From 38a8f95b036cd984acc6836e909e5b9223e879c9 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 13 Sep 2022 01:22:27 +0000 Subject: [PATCH 1/2] fix: integrate gapic-generator-python-1.4.1 and enable more py_test targets PiperOrigin-RevId: 473833416 Source-Link: https://github.com/googleapis/googleapis/commit/565a5508869557a3228b871101e4e4ebd8f93d11 Source-Link: https://github.com/googleapis/googleapis-gen/commit/1ee1a06c6de3ca8b843572c1fde0548f84236989 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMWVlMWEwNmM2ZGUzY2E4Yjg0MzU3MmMxZmRlMDU0OGY4NDIzNjk4OSJ9 --- owl-bot-staging/v1beta1/.coveragerc | 17 + owl-bot-staging/v1beta1/.flake8 | 33 + owl-bot-staging/v1beta1/MANIFEST.in | 2 + owl-bot-staging/v1beta1/README.rst | 49 + owl-bot-staging/v1beta1/docs/conf.py | 376 + .../docs/dataform_v1beta1/dataform.rst | 10 + .../docs/dataform_v1beta1/services.rst | 6 + .../v1beta1/docs/dataform_v1beta1/types.rst | 7 + owl-bot-staging/v1beta1/docs/index.rst | 7 + .../v1beta1/google/cloud/dataform/__init__.py | 147 + .../v1beta1/google/cloud/dataform/py.typed | 2 + .../google/cloud/dataform_v1beta1/__init__.py | 148 + .../dataform_v1beta1/gapic_metadata.json | 383 + .../google/cloud/dataform_v1beta1/py.typed | 2 + .../dataform_v1beta1/services/__init__.py | 15 + .../services/dataform/__init__.py | 22 + .../services/dataform/async_client.py | 3582 ++++++ .../services/dataform/client.py | 3833 +++++++ .../services/dataform/pagers.py | 865 ++ .../services/dataform/transports/__init__.py | 33 + .../services/dataform/transports/base.py | 664 ++ .../services/dataform/transports/grpc.py | 1231 +++ .../dataform/transports/grpc_asyncio.py | 1230 +++ .../cloud/dataform_v1beta1/types/__init__.py | 144 + .../cloud/dataform_v1beta1/types/dataform.py | 2309 ++++ owl-bot-staging/v1beta1/mypy.ini | 3 + owl-bot-staging/v1beta1/noxfile.py | 179 + ...taform_cancel_workflow_invocation_async.py | 50 + ...ataform_cancel_workflow_invocation_sync.py | 50 + ...dataform_commit_workspace_changes_async.py | 55 + ..._dataform_commit_workspace_changes_sync.py | 55 + ...ataform_create_compilation_result_async.py | 56 + ...dataform_create_compilation_result_sync.py | 56 + ...erated_dataform_create_repository_async.py | 53 + ...nerated_dataform_create_repository_sync.py | 53 + ...taform_create_workflow_invocation_async.py | 52 + ...ataform_create_workflow_invocation_sync.py | 52 + ...nerated_dataform_create_workspace_async.py | 53 + ...enerated_dataform_create_workspace_sync.py | 53 + ...erated_dataform_delete_repository_async.py | 50 + ...nerated_dataform_delete_repository_sync.py | 50 + ...taform_delete_workflow_invocation_async.py | 50 + ...ataform_delete_workflow_invocation_sync.py | 50 + ...nerated_dataform_delete_workspace_async.py | 50 + ...enerated_dataform_delete_workspace_sync.py | 50 + ...enerated_dataform_fetch_file_diff_async.py | 53 + ...generated_dataform_fetch_file_diff_sync.py | 53 + ..._dataform_fetch_file_git_statuses_async.py | 52 + ...d_dataform_fetch_file_git_statuses_sync.py | 52 + ...d_dataform_fetch_git_ahead_behind_async.py | 52 + ...ed_dataform_fetch_git_ahead_behind_sync.py | 52 + ...ed_dataform_fetch_remote_branches_async.py | 52 + ...ted_dataform_fetch_remote_branches_sync.py | 52 + ...d_dataform_get_compilation_result_async.py | 52 + ...ed_dataform_get_compilation_result_sync.py | 52 + ...generated_dataform_get_repository_async.py | 52 + ..._generated_dataform_get_repository_sync.py | 52 + ..._dataform_get_workflow_invocation_async.py | 52 + ...d_dataform_get_workflow_invocation_sync.py | 52 + ..._generated_dataform_get_workspace_async.py | 52 + ...1_generated_dataform_get_workspace_sync.py | 52 + ...ted_dataform_install_npm_packages_async.py | 52 + ...ated_dataform_install_npm_packages_sync.py | 52 + ...dataform_list_compilation_results_async.py | 53 + ..._dataform_list_compilation_results_sync.py | 53 + ...erated_dataform_list_repositories_async.py | 53 + ...nerated_dataform_list_repositories_sync.py | 53 + ...ataform_list_workflow_invocations_async.py | 53 + ...dataform_list_workflow_invocations_sync.py | 53 + ...enerated_dataform_list_workspaces_async.py | 53 + ...generated_dataform_list_workspaces_sync.py | 53 + ...generated_dataform_make_directory_async.py | 53 + ..._generated_dataform_make_directory_sync.py | 53 + ...generated_dataform_move_directory_async.py | 54 + ..._generated_dataform_move_directory_sync.py | 54 + ...eta1_generated_dataform_move_file_async.py | 54 + ...beta1_generated_dataform_move_file_sync.py | 54 + ...nerated_dataform_pull_git_commits_async.py | 55 + ...enerated_dataform_pull_git_commits_sync.py | 55 + ...nerated_dataform_push_git_commits_async.py | 50 + ...enerated_dataform_push_git_commits_sync.py | 50 + ..._query_compilation_result_actions_async.py | 53 + ...m_query_compilation_result_actions_sync.py | 53 + ...dataform_query_directory_contents_async.py | 53 + ..._dataform_query_directory_contents_sync.py | 53 + ...query_workflow_invocation_actions_async.py | 53 + ..._query_workflow_invocation_actions_sync.py | 53 + ...eta1_generated_dataform_read_file_async.py | 53 + ...beta1_generated_dataform_read_file_sync.py | 53 + ...nerated_dataform_remove_directory_async.py | 51 + ...enerated_dataform_remove_directory_sync.py | 51 + ...a1_generated_dataform_remove_file_async.py | 51 + ...ta1_generated_dataform_remove_file_sync.py | 51 + ..._dataform_reset_workspace_changes_async.py | 50 + ...d_dataform_reset_workspace_changes_sync.py | 50 + ...erated_dataform_update_repository_async.py | 51 + ...nerated_dataform_update_repository_sync.py | 51 + ...ta1_generated_dataform_write_file_async.py | 54 + ...eta1_generated_dataform_write_file_sync.py | 54 + .../snippet_metadata_dataform_v1beta1.json | 5646 ++++++++++ .../fixup_dataform_v1beta1_keywords.py | 211 + owl-bot-staging/v1beta1/setup.py | 59 + owl-bot-staging/v1beta1/tests/__init__.py | 16 + .../v1beta1/tests/unit/__init__.py | 16 + .../v1beta1/tests/unit/gapic/__init__.py | 16 + .../unit/gapic/dataform_v1beta1/__init__.py | 16 + .../gapic/dataform_v1beta1/test_dataform.py | 9611 +++++++++++++++++ 107 files changed, 34660 insertions(+) create mode 100644 owl-bot-staging/v1beta1/.coveragerc create mode 100644 owl-bot-staging/v1beta1/.flake8 create mode 100644 owl-bot-staging/v1beta1/MANIFEST.in create mode 100644 owl-bot-staging/v1beta1/README.rst create mode 100644 owl-bot-staging/v1beta1/docs/conf.py create mode 100644 owl-bot-staging/v1beta1/docs/dataform_v1beta1/dataform.rst create mode 100644 owl-bot-staging/v1beta1/docs/dataform_v1beta1/services.rst create mode 100644 owl-bot-staging/v1beta1/docs/dataform_v1beta1/types.rst create mode 100644 owl-bot-staging/v1beta1/docs/index.rst create mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform/__init__.py create mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform/py.typed create mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/__init__.py create mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/py.typed create mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/__init__.py create mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/__init__.py create mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/async_client.py create mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/client.py create mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/pagers.py create mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/__init__.py create mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/base.py create mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/grpc.py create mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/grpc_asyncio.py create mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/types/__init__.py create mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/types/dataform.py create mode 100644 owl-bot-staging/v1beta1/mypy.ini create mode 100644 owl-bot-staging/v1beta1/noxfile.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_cancel_workflow_invocation_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_cancel_workflow_invocation_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_commit_workspace_changes_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_commit_workspace_changes_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_compilation_result_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_compilation_result_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_repository_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_repository_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workflow_invocation_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workflow_invocation_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workspace_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workspace_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_repository_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_repository_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workflow_invocation_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workflow_invocation_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workspace_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workspace_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_diff_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_diff_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_git_statuses_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_git_statuses_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_remote_branches_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_remote_branches_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_compilation_result_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_compilation_result_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_repository_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_repository_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workflow_invocation_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workflow_invocation_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workspace_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workspace_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_install_npm_packages_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_install_npm_packages_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_compilation_results_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_compilation_results_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_repositories_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_repositories_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workflow_invocations_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workflow_invocations_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workspaces_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workspaces_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_make_directory_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_make_directory_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_directory_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_directory_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_file_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_file_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_pull_git_commits_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_pull_git_commits_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_push_git_commits_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_push_git_commits_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_compilation_result_actions_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_compilation_result_actions_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_directory_contents_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_directory_contents_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_read_file_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_read_file_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_directory_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_directory_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_file_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_file_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_reset_workspace_changes_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_reset_workspace_changes_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_update_repository_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_update_repository_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_write_file_async.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_write_file_sync.py create mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/snippet_metadata_dataform_v1beta1.json create mode 100644 owl-bot-staging/v1beta1/scripts/fixup_dataform_v1beta1_keywords.py create mode 100644 owl-bot-staging/v1beta1/setup.py create mode 100644 owl-bot-staging/v1beta1/tests/__init__.py create mode 100644 owl-bot-staging/v1beta1/tests/unit/__init__.py create mode 100644 owl-bot-staging/v1beta1/tests/unit/gapic/__init__.py create mode 100644 owl-bot-staging/v1beta1/tests/unit/gapic/dataform_v1beta1/__init__.py create mode 100644 owl-bot-staging/v1beta1/tests/unit/gapic/dataform_v1beta1/test_dataform.py diff --git a/owl-bot-staging/v1beta1/.coveragerc b/owl-bot-staging/v1beta1/.coveragerc new file mode 100644 index 0000000..e3c571a --- /dev/null +++ b/owl-bot-staging/v1beta1/.coveragerc @@ -0,0 +1,17 @@ +[run] +branch = True + +[report] +show_missing = True +omit = + google/cloud/dataform/__init__.py +exclude_lines = + # Re-enable the standard pragma + pragma: NO COVER + # Ignore debug-only repr + def __repr__ + # Ignore pkg_resources exceptions. + # This is added at the module level as a safeguard for if someone + # generates the code and tries to run it without pip installing. This + # makes it virtually impossible to test properly. + except pkg_resources.DistributionNotFound diff --git a/owl-bot-staging/v1beta1/.flake8 b/owl-bot-staging/v1beta1/.flake8 new file mode 100644 index 0000000..29227d4 --- /dev/null +++ b/owl-bot-staging/v1beta1/.flake8 @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 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. + +# Generated by synthtool. DO NOT EDIT! +[flake8] +ignore = E203, E266, E501, W503 +exclude = + # Exclude generated code. + **/proto/** + **/gapic/** + **/services/** + **/types/** + *_pb2.py + + # Standard linting exemptions. + **/.nox/** + __pycache__, + .git, + *.pyc, + conf.py diff --git a/owl-bot-staging/v1beta1/MANIFEST.in b/owl-bot-staging/v1beta1/MANIFEST.in new file mode 100644 index 0000000..781c0b0 --- /dev/null +++ b/owl-bot-staging/v1beta1/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include google/cloud/dataform *.py +recursive-include google/cloud/dataform_v1beta1 *.py diff --git a/owl-bot-staging/v1beta1/README.rst b/owl-bot-staging/v1beta1/README.rst new file mode 100644 index 0000000..1f42e73 --- /dev/null +++ b/owl-bot-staging/v1beta1/README.rst @@ -0,0 +1,49 @@ +Python Client for Google Cloud Dataform API +================================================= + +Quick Start +----------- + +In order to use this library, you first need to go through the following steps: + +1. `Select or create a Cloud Platform project.`_ +2. `Enable billing for your project.`_ +3. Enable the Google Cloud Dataform API. +4. `Setup Authentication.`_ + +.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project +.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project +.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html + +Installation +~~~~~~~~~~~~ + +Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to +create isolated Python environments. The basic problem it addresses is one of +dependencies and versions, and indirectly permissions. + +With `virtualenv`_, it's possible to install this library without needing system +install permissions, and without clashing with the installed system +dependencies. + +.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ + + +Mac/Linux +^^^^^^^^^ + +.. code-block:: console + + python3 -m venv + source /bin/activate + /bin/pip install /path/to/library + + +Windows +^^^^^^^ + +.. code-block:: console + + python3 -m venv + \Scripts\activate + \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/v1beta1/docs/conf.py b/owl-bot-staging/v1beta1/docs/conf.py new file mode 100644 index 0000000..c1af2db --- /dev/null +++ b/owl-bot-staging/v1beta1/docs/conf.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +# 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. +# +# +# google-cloud-dataform documentation build configuration file +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import shlex + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath("..")) + +__version__ = "0.1.0" + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +needs_sphinx = "4.0.1" + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", +] + +# autodoc/autosummary flags +autoclass_content = "both" +autodoc_default_flags = ["members"] +autosummary_generate = True + + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# Allow markdown includes (so releases.md can include CHANGLEOG.md) +# http://www.sphinx-doc.org/en/master/markdown.html +source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +source_suffix = [".rst", ".md"] + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The root toctree document. +root_doc = "index" + +# General information about the project. +project = u"google-cloud-dataform" +copyright = u"2022, Google, LLC" +author = u"Google APIs" # TODO: autogenerate this bit + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The full version, including alpha/beta/rc tags. +release = __version__ +# The short X.Y version. +version = ".".join(release.split(".")[0:2]) + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = "alabaster" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + "description": "Google Cloud Client Libraries for Python", + "github_user": "googleapis", + "github_repo": "google-cloud-python", + "github_banner": True, + "font_family": "'Roboto', Georgia, sans", + "head_font_family": "'Roboto', Georgia, serif", + "code_font_family": "'Roboto Mono', 'Consolas', monospace", +} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = "google-cloud-dataform-doc" + +# -- Options for warnings ------------------------------------------------------ + + +suppress_warnings = [ + # Temporarily suppress this to avoid "more than one target found for + # cross-reference" warning, which are intractable for us to avoid while in + # a mono-repo. + # See https://github.com/sphinx-doc/sphinx/blob + # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 + "ref.python" +] + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', + # Latex figure (float) alignment + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + root_doc, + "google-cloud-dataform.tex", + u"google-cloud-dataform Documentation", + author, + "manual", + ) +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ( + root_doc, + "google-cloud-dataform", + u"Google Cloud Dataform Documentation", + [author], + 1, + ) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + root_doc, + "google-cloud-dataform", + u"google-cloud-dataform Documentation", + author, + "google-cloud-dataform", + "GAPIC library for Google Cloud Dataform API", + "APIs", + ) +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("http://python.readthedocs.org/en/latest/", None), + "gax": ("https://gax-python.readthedocs.org/en/latest/", None), + "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), + "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), + "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), + "grpc": ("https://grpc.io/grpc/python/", None), + "requests": ("http://requests.kennethreitz.org/en/stable/", None), + "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), + "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), +} + + +# Napoleon settings +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True +napoleon_use_admonition_for_examples = False +napoleon_use_admonition_for_notes = False +napoleon_use_admonition_for_references = False +napoleon_use_ivar = False +napoleon_use_param = True +napoleon_use_rtype = True diff --git a/owl-bot-staging/v1beta1/docs/dataform_v1beta1/dataform.rst b/owl-bot-staging/v1beta1/docs/dataform_v1beta1/dataform.rst new file mode 100644 index 0000000..3d3fd90 --- /dev/null +++ b/owl-bot-staging/v1beta1/docs/dataform_v1beta1/dataform.rst @@ -0,0 +1,10 @@ +Dataform +-------------------------- + +.. automodule:: google.cloud.dataform_v1beta1.services.dataform + :members: + :inherited-members: + +.. automodule:: google.cloud.dataform_v1beta1.services.dataform.pagers + :members: + :inherited-members: diff --git a/owl-bot-staging/v1beta1/docs/dataform_v1beta1/services.rst b/owl-bot-staging/v1beta1/docs/dataform_v1beta1/services.rst new file mode 100644 index 0000000..f6e29bf --- /dev/null +++ b/owl-bot-staging/v1beta1/docs/dataform_v1beta1/services.rst @@ -0,0 +1,6 @@ +Services for Google Cloud Dataform v1beta1 API +============================================== +.. toctree:: + :maxdepth: 2 + + dataform diff --git a/owl-bot-staging/v1beta1/docs/dataform_v1beta1/types.rst b/owl-bot-staging/v1beta1/docs/dataform_v1beta1/types.rst new file mode 100644 index 0000000..7f1fe65 --- /dev/null +++ b/owl-bot-staging/v1beta1/docs/dataform_v1beta1/types.rst @@ -0,0 +1,7 @@ +Types for Google Cloud Dataform v1beta1 API +=========================================== + +.. automodule:: google.cloud.dataform_v1beta1.types + :members: + :undoc-members: + :show-inheritance: diff --git a/owl-bot-staging/v1beta1/docs/index.rst b/owl-bot-staging/v1beta1/docs/index.rst new file mode 100644 index 0000000..4cd285b --- /dev/null +++ b/owl-bot-staging/v1beta1/docs/index.rst @@ -0,0 +1,7 @@ +API Reference +------------- +.. toctree:: + :maxdepth: 2 + + dataform_v1beta1/services + dataform_v1beta1/types diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform/__init__.py b/owl-bot-staging/v1beta1/google/cloud/dataform/__init__.py new file mode 100644 index 0000000..a4191d0 --- /dev/null +++ b/owl-bot-staging/v1beta1/google/cloud/dataform/__init__.py @@ -0,0 +1,147 @@ +# -*- coding: utf-8 -*- +# 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. +# + +from google.cloud.dataform_v1beta1.services.dataform.client import DataformClient +from google.cloud.dataform_v1beta1.services.dataform.async_client import DataformAsyncClient + +from google.cloud.dataform_v1beta1.types.dataform import CancelWorkflowInvocationRequest +from google.cloud.dataform_v1beta1.types.dataform import CommitAuthor +from google.cloud.dataform_v1beta1.types.dataform import CommitWorkspaceChangesRequest +from google.cloud.dataform_v1beta1.types.dataform import CompilationResult +from google.cloud.dataform_v1beta1.types.dataform import CompilationResultAction +from google.cloud.dataform_v1beta1.types.dataform import CreateCompilationResultRequest +from google.cloud.dataform_v1beta1.types.dataform import CreateRepositoryRequest +from google.cloud.dataform_v1beta1.types.dataform import CreateWorkflowInvocationRequest +from google.cloud.dataform_v1beta1.types.dataform import CreateWorkspaceRequest +from google.cloud.dataform_v1beta1.types.dataform import DeleteRepositoryRequest +from google.cloud.dataform_v1beta1.types.dataform import DeleteWorkflowInvocationRequest +from google.cloud.dataform_v1beta1.types.dataform import DeleteWorkspaceRequest +from google.cloud.dataform_v1beta1.types.dataform import FetchFileDiffRequest +from google.cloud.dataform_v1beta1.types.dataform import FetchFileDiffResponse +from google.cloud.dataform_v1beta1.types.dataform import FetchFileGitStatusesRequest +from google.cloud.dataform_v1beta1.types.dataform import FetchFileGitStatusesResponse +from google.cloud.dataform_v1beta1.types.dataform import FetchGitAheadBehindRequest +from google.cloud.dataform_v1beta1.types.dataform import FetchGitAheadBehindResponse +from google.cloud.dataform_v1beta1.types.dataform import FetchRemoteBranchesRequest +from google.cloud.dataform_v1beta1.types.dataform import FetchRemoteBranchesResponse +from google.cloud.dataform_v1beta1.types.dataform import GetCompilationResultRequest +from google.cloud.dataform_v1beta1.types.dataform import GetRepositoryRequest +from google.cloud.dataform_v1beta1.types.dataform import GetWorkflowInvocationRequest +from google.cloud.dataform_v1beta1.types.dataform import GetWorkspaceRequest +from google.cloud.dataform_v1beta1.types.dataform import InstallNpmPackagesRequest +from google.cloud.dataform_v1beta1.types.dataform import InstallNpmPackagesResponse +from google.cloud.dataform_v1beta1.types.dataform import ListCompilationResultsRequest +from google.cloud.dataform_v1beta1.types.dataform import ListCompilationResultsResponse +from google.cloud.dataform_v1beta1.types.dataform import ListRepositoriesRequest +from google.cloud.dataform_v1beta1.types.dataform import ListRepositoriesResponse +from google.cloud.dataform_v1beta1.types.dataform import ListWorkflowInvocationsRequest +from google.cloud.dataform_v1beta1.types.dataform import ListWorkflowInvocationsResponse +from google.cloud.dataform_v1beta1.types.dataform import ListWorkspacesRequest +from google.cloud.dataform_v1beta1.types.dataform import ListWorkspacesResponse +from google.cloud.dataform_v1beta1.types.dataform import MakeDirectoryRequest +from google.cloud.dataform_v1beta1.types.dataform import MakeDirectoryResponse +from google.cloud.dataform_v1beta1.types.dataform import MoveDirectoryRequest +from google.cloud.dataform_v1beta1.types.dataform import MoveDirectoryResponse +from google.cloud.dataform_v1beta1.types.dataform import MoveFileRequest +from google.cloud.dataform_v1beta1.types.dataform import MoveFileResponse +from google.cloud.dataform_v1beta1.types.dataform import PullGitCommitsRequest +from google.cloud.dataform_v1beta1.types.dataform import PushGitCommitsRequest +from google.cloud.dataform_v1beta1.types.dataform import QueryCompilationResultActionsRequest +from google.cloud.dataform_v1beta1.types.dataform import QueryCompilationResultActionsResponse +from google.cloud.dataform_v1beta1.types.dataform import QueryDirectoryContentsRequest +from google.cloud.dataform_v1beta1.types.dataform import QueryDirectoryContentsResponse +from google.cloud.dataform_v1beta1.types.dataform import QueryWorkflowInvocationActionsRequest +from google.cloud.dataform_v1beta1.types.dataform import QueryWorkflowInvocationActionsResponse +from google.cloud.dataform_v1beta1.types.dataform import ReadFileRequest +from google.cloud.dataform_v1beta1.types.dataform import ReadFileResponse +from google.cloud.dataform_v1beta1.types.dataform import RelationDescriptor +from google.cloud.dataform_v1beta1.types.dataform import RemoveDirectoryRequest +from google.cloud.dataform_v1beta1.types.dataform import RemoveFileRequest +from google.cloud.dataform_v1beta1.types.dataform import Repository +from google.cloud.dataform_v1beta1.types.dataform import ResetWorkspaceChangesRequest +from google.cloud.dataform_v1beta1.types.dataform import Target +from google.cloud.dataform_v1beta1.types.dataform import UpdateRepositoryRequest +from google.cloud.dataform_v1beta1.types.dataform import WorkflowInvocation +from google.cloud.dataform_v1beta1.types.dataform import WorkflowInvocationAction +from google.cloud.dataform_v1beta1.types.dataform import Workspace +from google.cloud.dataform_v1beta1.types.dataform import WriteFileRequest +from google.cloud.dataform_v1beta1.types.dataform import WriteFileResponse + +__all__ = ('DataformClient', + 'DataformAsyncClient', + 'CancelWorkflowInvocationRequest', + 'CommitAuthor', + 'CommitWorkspaceChangesRequest', + 'CompilationResult', + 'CompilationResultAction', + 'CreateCompilationResultRequest', + 'CreateRepositoryRequest', + 'CreateWorkflowInvocationRequest', + 'CreateWorkspaceRequest', + 'DeleteRepositoryRequest', + 'DeleteWorkflowInvocationRequest', + 'DeleteWorkspaceRequest', + 'FetchFileDiffRequest', + 'FetchFileDiffResponse', + 'FetchFileGitStatusesRequest', + 'FetchFileGitStatusesResponse', + 'FetchGitAheadBehindRequest', + 'FetchGitAheadBehindResponse', + 'FetchRemoteBranchesRequest', + 'FetchRemoteBranchesResponse', + 'GetCompilationResultRequest', + 'GetRepositoryRequest', + 'GetWorkflowInvocationRequest', + 'GetWorkspaceRequest', + 'InstallNpmPackagesRequest', + 'InstallNpmPackagesResponse', + 'ListCompilationResultsRequest', + 'ListCompilationResultsResponse', + 'ListRepositoriesRequest', + 'ListRepositoriesResponse', + 'ListWorkflowInvocationsRequest', + 'ListWorkflowInvocationsResponse', + 'ListWorkspacesRequest', + 'ListWorkspacesResponse', + 'MakeDirectoryRequest', + 'MakeDirectoryResponse', + 'MoveDirectoryRequest', + 'MoveDirectoryResponse', + 'MoveFileRequest', + 'MoveFileResponse', + 'PullGitCommitsRequest', + 'PushGitCommitsRequest', + 'QueryCompilationResultActionsRequest', + 'QueryCompilationResultActionsResponse', + 'QueryDirectoryContentsRequest', + 'QueryDirectoryContentsResponse', + 'QueryWorkflowInvocationActionsRequest', + 'QueryWorkflowInvocationActionsResponse', + 'ReadFileRequest', + 'ReadFileResponse', + 'RelationDescriptor', + 'RemoveDirectoryRequest', + 'RemoveFileRequest', + 'Repository', + 'ResetWorkspaceChangesRequest', + 'Target', + 'UpdateRepositoryRequest', + 'WorkflowInvocation', + 'WorkflowInvocationAction', + 'Workspace', + 'WriteFileRequest', + 'WriteFileResponse', +) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform/py.typed b/owl-bot-staging/v1beta1/google/cloud/dataform/py.typed new file mode 100644 index 0000000..060113d --- /dev/null +++ b/owl-bot-staging/v1beta1/google/cloud/dataform/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-cloud-dataform package uses inline types. diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/__init__.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/__init__.py new file mode 100644 index 0000000..43c0350 --- /dev/null +++ b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/__init__.py @@ -0,0 +1,148 @@ +# -*- coding: utf-8 -*- +# 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. +# + +from .services.dataform import DataformClient +from .services.dataform import DataformAsyncClient + +from .types.dataform import CancelWorkflowInvocationRequest +from .types.dataform import CommitAuthor +from .types.dataform import CommitWorkspaceChangesRequest +from .types.dataform import CompilationResult +from .types.dataform import CompilationResultAction +from .types.dataform import CreateCompilationResultRequest +from .types.dataform import CreateRepositoryRequest +from .types.dataform import CreateWorkflowInvocationRequest +from .types.dataform import CreateWorkspaceRequest +from .types.dataform import DeleteRepositoryRequest +from .types.dataform import DeleteWorkflowInvocationRequest +from .types.dataform import DeleteWorkspaceRequest +from .types.dataform import FetchFileDiffRequest +from .types.dataform import FetchFileDiffResponse +from .types.dataform import FetchFileGitStatusesRequest +from .types.dataform import FetchFileGitStatusesResponse +from .types.dataform import FetchGitAheadBehindRequest +from .types.dataform import FetchGitAheadBehindResponse +from .types.dataform import FetchRemoteBranchesRequest +from .types.dataform import FetchRemoteBranchesResponse +from .types.dataform import GetCompilationResultRequest +from .types.dataform import GetRepositoryRequest +from .types.dataform import GetWorkflowInvocationRequest +from .types.dataform import GetWorkspaceRequest +from .types.dataform import InstallNpmPackagesRequest +from .types.dataform import InstallNpmPackagesResponse +from .types.dataform import ListCompilationResultsRequest +from .types.dataform import ListCompilationResultsResponse +from .types.dataform import ListRepositoriesRequest +from .types.dataform import ListRepositoriesResponse +from .types.dataform import ListWorkflowInvocationsRequest +from .types.dataform import ListWorkflowInvocationsResponse +from .types.dataform import ListWorkspacesRequest +from .types.dataform import ListWorkspacesResponse +from .types.dataform import MakeDirectoryRequest +from .types.dataform import MakeDirectoryResponse +from .types.dataform import MoveDirectoryRequest +from .types.dataform import MoveDirectoryResponse +from .types.dataform import MoveFileRequest +from .types.dataform import MoveFileResponse +from .types.dataform import PullGitCommitsRequest +from .types.dataform import PushGitCommitsRequest +from .types.dataform import QueryCompilationResultActionsRequest +from .types.dataform import QueryCompilationResultActionsResponse +from .types.dataform import QueryDirectoryContentsRequest +from .types.dataform import QueryDirectoryContentsResponse +from .types.dataform import QueryWorkflowInvocationActionsRequest +from .types.dataform import QueryWorkflowInvocationActionsResponse +from .types.dataform import ReadFileRequest +from .types.dataform import ReadFileResponse +from .types.dataform import RelationDescriptor +from .types.dataform import RemoveDirectoryRequest +from .types.dataform import RemoveFileRequest +from .types.dataform import Repository +from .types.dataform import ResetWorkspaceChangesRequest +from .types.dataform import Target +from .types.dataform import UpdateRepositoryRequest +from .types.dataform import WorkflowInvocation +from .types.dataform import WorkflowInvocationAction +from .types.dataform import Workspace +from .types.dataform import WriteFileRequest +from .types.dataform import WriteFileResponse + +__all__ = ( + 'DataformAsyncClient', +'CancelWorkflowInvocationRequest', +'CommitAuthor', +'CommitWorkspaceChangesRequest', +'CompilationResult', +'CompilationResultAction', +'CreateCompilationResultRequest', +'CreateRepositoryRequest', +'CreateWorkflowInvocationRequest', +'CreateWorkspaceRequest', +'DataformClient', +'DeleteRepositoryRequest', +'DeleteWorkflowInvocationRequest', +'DeleteWorkspaceRequest', +'FetchFileDiffRequest', +'FetchFileDiffResponse', +'FetchFileGitStatusesRequest', +'FetchFileGitStatusesResponse', +'FetchGitAheadBehindRequest', +'FetchGitAheadBehindResponse', +'FetchRemoteBranchesRequest', +'FetchRemoteBranchesResponse', +'GetCompilationResultRequest', +'GetRepositoryRequest', +'GetWorkflowInvocationRequest', +'GetWorkspaceRequest', +'InstallNpmPackagesRequest', +'InstallNpmPackagesResponse', +'ListCompilationResultsRequest', +'ListCompilationResultsResponse', +'ListRepositoriesRequest', +'ListRepositoriesResponse', +'ListWorkflowInvocationsRequest', +'ListWorkflowInvocationsResponse', +'ListWorkspacesRequest', +'ListWorkspacesResponse', +'MakeDirectoryRequest', +'MakeDirectoryResponse', +'MoveDirectoryRequest', +'MoveDirectoryResponse', +'MoveFileRequest', +'MoveFileResponse', +'PullGitCommitsRequest', +'PushGitCommitsRequest', +'QueryCompilationResultActionsRequest', +'QueryCompilationResultActionsResponse', +'QueryDirectoryContentsRequest', +'QueryDirectoryContentsResponse', +'QueryWorkflowInvocationActionsRequest', +'QueryWorkflowInvocationActionsResponse', +'ReadFileRequest', +'ReadFileResponse', +'RelationDescriptor', +'RemoveDirectoryRequest', +'RemoveFileRequest', +'Repository', +'ResetWorkspaceChangesRequest', +'Target', +'UpdateRepositoryRequest', +'WorkflowInvocation', +'WorkflowInvocationAction', +'Workspace', +'WriteFileRequest', +'WriteFileResponse', +) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/gapic_metadata.json b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/gapic_metadata.json new file mode 100644 index 0000000..312e0ba --- /dev/null +++ b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/gapic_metadata.json @@ -0,0 +1,383 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.cloud.dataform_v1beta1", + "protoPackage": "google.cloud.dataform.v1beta1", + "schema": "1.0", + "services": { + "Dataform": { + "clients": { + "grpc": { + "libraryClient": "DataformClient", + "rpcs": { + "CancelWorkflowInvocation": { + "methods": [ + "cancel_workflow_invocation" + ] + }, + "CommitWorkspaceChanges": { + "methods": [ + "commit_workspace_changes" + ] + }, + "CreateCompilationResult": { + "methods": [ + "create_compilation_result" + ] + }, + "CreateRepository": { + "methods": [ + "create_repository" + ] + }, + "CreateWorkflowInvocation": { + "methods": [ + "create_workflow_invocation" + ] + }, + "CreateWorkspace": { + "methods": [ + "create_workspace" + ] + }, + "DeleteRepository": { + "methods": [ + "delete_repository" + ] + }, + "DeleteWorkflowInvocation": { + "methods": [ + "delete_workflow_invocation" + ] + }, + "DeleteWorkspace": { + "methods": [ + "delete_workspace" + ] + }, + "FetchFileDiff": { + "methods": [ + "fetch_file_diff" + ] + }, + "FetchFileGitStatuses": { + "methods": [ + "fetch_file_git_statuses" + ] + }, + "FetchGitAheadBehind": { + "methods": [ + "fetch_git_ahead_behind" + ] + }, + "FetchRemoteBranches": { + "methods": [ + "fetch_remote_branches" + ] + }, + "GetCompilationResult": { + "methods": [ + "get_compilation_result" + ] + }, + "GetRepository": { + "methods": [ + "get_repository" + ] + }, + "GetWorkflowInvocation": { + "methods": [ + "get_workflow_invocation" + ] + }, + "GetWorkspace": { + "methods": [ + "get_workspace" + ] + }, + "InstallNpmPackages": { + "methods": [ + "install_npm_packages" + ] + }, + "ListCompilationResults": { + "methods": [ + "list_compilation_results" + ] + }, + "ListRepositories": { + "methods": [ + "list_repositories" + ] + }, + "ListWorkflowInvocations": { + "methods": [ + "list_workflow_invocations" + ] + }, + "ListWorkspaces": { + "methods": [ + "list_workspaces" + ] + }, + "MakeDirectory": { + "methods": [ + "make_directory" + ] + }, + "MoveDirectory": { + "methods": [ + "move_directory" + ] + }, + "MoveFile": { + "methods": [ + "move_file" + ] + }, + "PullGitCommits": { + "methods": [ + "pull_git_commits" + ] + }, + "PushGitCommits": { + "methods": [ + "push_git_commits" + ] + }, + "QueryCompilationResultActions": { + "methods": [ + "query_compilation_result_actions" + ] + }, + "QueryDirectoryContents": { + "methods": [ + "query_directory_contents" + ] + }, + "QueryWorkflowInvocationActions": { + "methods": [ + "query_workflow_invocation_actions" + ] + }, + "ReadFile": { + "methods": [ + "read_file" + ] + }, + "RemoveDirectory": { + "methods": [ + "remove_directory" + ] + }, + "RemoveFile": { + "methods": [ + "remove_file" + ] + }, + "ResetWorkspaceChanges": { + "methods": [ + "reset_workspace_changes" + ] + }, + "UpdateRepository": { + "methods": [ + "update_repository" + ] + }, + "WriteFile": { + "methods": [ + "write_file" + ] + } + } + }, + "grpc-async": { + "libraryClient": "DataformAsyncClient", + "rpcs": { + "CancelWorkflowInvocation": { + "methods": [ + "cancel_workflow_invocation" + ] + }, + "CommitWorkspaceChanges": { + "methods": [ + "commit_workspace_changes" + ] + }, + "CreateCompilationResult": { + "methods": [ + "create_compilation_result" + ] + }, + "CreateRepository": { + "methods": [ + "create_repository" + ] + }, + "CreateWorkflowInvocation": { + "methods": [ + "create_workflow_invocation" + ] + }, + "CreateWorkspace": { + "methods": [ + "create_workspace" + ] + }, + "DeleteRepository": { + "methods": [ + "delete_repository" + ] + }, + "DeleteWorkflowInvocation": { + "methods": [ + "delete_workflow_invocation" + ] + }, + "DeleteWorkspace": { + "methods": [ + "delete_workspace" + ] + }, + "FetchFileDiff": { + "methods": [ + "fetch_file_diff" + ] + }, + "FetchFileGitStatuses": { + "methods": [ + "fetch_file_git_statuses" + ] + }, + "FetchGitAheadBehind": { + "methods": [ + "fetch_git_ahead_behind" + ] + }, + "FetchRemoteBranches": { + "methods": [ + "fetch_remote_branches" + ] + }, + "GetCompilationResult": { + "methods": [ + "get_compilation_result" + ] + }, + "GetRepository": { + "methods": [ + "get_repository" + ] + }, + "GetWorkflowInvocation": { + "methods": [ + "get_workflow_invocation" + ] + }, + "GetWorkspace": { + "methods": [ + "get_workspace" + ] + }, + "InstallNpmPackages": { + "methods": [ + "install_npm_packages" + ] + }, + "ListCompilationResults": { + "methods": [ + "list_compilation_results" + ] + }, + "ListRepositories": { + "methods": [ + "list_repositories" + ] + }, + "ListWorkflowInvocations": { + "methods": [ + "list_workflow_invocations" + ] + }, + "ListWorkspaces": { + "methods": [ + "list_workspaces" + ] + }, + "MakeDirectory": { + "methods": [ + "make_directory" + ] + }, + "MoveDirectory": { + "methods": [ + "move_directory" + ] + }, + "MoveFile": { + "methods": [ + "move_file" + ] + }, + "PullGitCommits": { + "methods": [ + "pull_git_commits" + ] + }, + "PushGitCommits": { + "methods": [ + "push_git_commits" + ] + }, + "QueryCompilationResultActions": { + "methods": [ + "query_compilation_result_actions" + ] + }, + "QueryDirectoryContents": { + "methods": [ + "query_directory_contents" + ] + }, + "QueryWorkflowInvocationActions": { + "methods": [ + "query_workflow_invocation_actions" + ] + }, + "ReadFile": { + "methods": [ + "read_file" + ] + }, + "RemoveDirectory": { + "methods": [ + "remove_directory" + ] + }, + "RemoveFile": { + "methods": [ + "remove_file" + ] + }, + "ResetWorkspaceChanges": { + "methods": [ + "reset_workspace_changes" + ] + }, + "UpdateRepository": { + "methods": [ + "update_repository" + ] + }, + "WriteFile": { + "methods": [ + "write_file" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/py.typed b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/py.typed new file mode 100644 index 0000000..060113d --- /dev/null +++ b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-cloud-dataform package uses inline types. diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/__init__.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/__init__.py new file mode 100644 index 0000000..e8e1c38 --- /dev/null +++ b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# 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. +# diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/__init__.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/__init__.py new file mode 100644 index 0000000..008a1aa --- /dev/null +++ b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# 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. +# +from .client import DataformClient +from .async_client import DataformAsyncClient + +__all__ = ( + 'DataformClient', + 'DataformAsyncClient', +) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/async_client.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/async_client.py new file mode 100644 index 0000000..5d2b24a --- /dev/null +++ b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/async_client.py @@ -0,0 +1,3582 @@ +# -*- coding: utf-8 -*- +# 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. +# +from collections import OrderedDict +import functools +import re +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +import pkg_resources + +from google.api_core.client_options import ClientOptions +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries +from google.auth import credentials as ga_credentials # type: ignore +from google.oauth2 import service_account # type: ignore + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object] # type: ignore + +from google.cloud.dataform_v1beta1.services.dataform import pagers +from google.cloud.dataform_v1beta1.types import dataform +from google.cloud.location import locations_pb2 # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.protobuf import field_mask_pb2 # type: ignore +from google.type import interval_pb2 # type: ignore +from .transports.base import DataformTransport, DEFAULT_CLIENT_INFO +from .transports.grpc_asyncio import DataformGrpcAsyncIOTransport +from .client import DataformClient + + +class DataformAsyncClient: + """Dataform is a service to develop, create, document, test, and + update curated tables in BigQuery. + """ + + _client: DataformClient + + DEFAULT_ENDPOINT = DataformClient.DEFAULT_ENDPOINT + DEFAULT_MTLS_ENDPOINT = DataformClient.DEFAULT_MTLS_ENDPOINT + + compilation_result_path = staticmethod(DataformClient.compilation_result_path) + parse_compilation_result_path = staticmethod(DataformClient.parse_compilation_result_path) + repository_path = staticmethod(DataformClient.repository_path) + parse_repository_path = staticmethod(DataformClient.parse_repository_path) + secret_version_path = staticmethod(DataformClient.secret_version_path) + parse_secret_version_path = staticmethod(DataformClient.parse_secret_version_path) + workflow_invocation_path = staticmethod(DataformClient.workflow_invocation_path) + parse_workflow_invocation_path = staticmethod(DataformClient.parse_workflow_invocation_path) + workspace_path = staticmethod(DataformClient.workspace_path) + parse_workspace_path = staticmethod(DataformClient.parse_workspace_path) + common_billing_account_path = staticmethod(DataformClient.common_billing_account_path) + parse_common_billing_account_path = staticmethod(DataformClient.parse_common_billing_account_path) + common_folder_path = staticmethod(DataformClient.common_folder_path) + parse_common_folder_path = staticmethod(DataformClient.parse_common_folder_path) + common_organization_path = staticmethod(DataformClient.common_organization_path) + parse_common_organization_path = staticmethod(DataformClient.parse_common_organization_path) + common_project_path = staticmethod(DataformClient.common_project_path) + parse_common_project_path = staticmethod(DataformClient.parse_common_project_path) + common_location_path = staticmethod(DataformClient.common_location_path) + parse_common_location_path = staticmethod(DataformClient.parse_common_location_path) + + @classmethod + def from_service_account_info(cls, info: dict, *args, **kwargs): + """Creates an instance of this client using the provided credentials + info. + + Args: + info (dict): The service account private key info. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + DataformAsyncClient: The constructed client. + """ + return DataformClient.from_service_account_info.__func__(DataformAsyncClient, info, *args, **kwargs) # type: ignore + + @classmethod + def from_service_account_file(cls, filename: str, *args, **kwargs): + """Creates an instance of this client using the provided credentials + file. + + Args: + filename (str): The path to the service account private key json + file. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + DataformAsyncClient: The constructed client. + """ + return DataformClient.from_service_account_file.__func__(DataformAsyncClient, filename, *args, **kwargs) # type: ignore + + from_service_account_json = from_service_account_file + + @classmethod + def get_mtls_endpoint_and_cert_source(cls, client_options: Optional[ClientOptions] = None): + """Return the API endpoint and client cert source for mutual TLS. + + The client cert source is determined in the following order: + (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the + client cert source is None. + (2) if `client_options.client_cert_source` is provided, use the provided one; if the + default client cert source exists, use the default one; otherwise the client cert + source is None. + + The API endpoint is determined in the following order: + (1) if `client_options.api_endpoint` if provided, use the provided one. + (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the + default mTLS endpoint; if the environment variabel is "never", use the default API + endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise + use the default API endpoint. + + More details can be found at https://google.aip.dev/auth/4114. + + Args: + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. Only the `api_endpoint` and `client_cert_source` properties may be used + in this method. + + Returns: + Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the + client cert source to use. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If any errors happen. + """ + return DataformClient.get_mtls_endpoint_and_cert_source(client_options) # type: ignore + + @property + def transport(self) -> DataformTransport: + """Returns the transport used by the client instance. + + Returns: + DataformTransport: The transport used by the client instance. + """ + return self._client.transport + + get_transport_class = functools.partial(type(DataformClient).get_transport_class, type(DataformClient)) + + def __init__(self, *, + credentials: ga_credentials.Credentials = None, + transport: Union[str, DataformTransport] = "grpc_asyncio", + client_options: ClientOptions = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + ) -> None: + """Instantiates the dataform client. + + Args: + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + transport (Union[str, ~.DataformTransport]): The + transport to use. If set to None, a transport is chosen + automatically. + client_options (ClientOptions): Custom options for the client. It + won't take effect if a ``transport`` instance is provided. + (1) The ``api_endpoint`` property can be used to override the + default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT + environment variable can also be used to override the endpoint: + "always" (always use the default mTLS endpoint), "never" (always + use the default regular endpoint) and "auto" (auto switch to the + default mTLS endpoint if client certificate is present, this is + the default value). However, the ``api_endpoint`` property takes + precedence if provided. + (2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable + is "true", then the ``client_cert_source`` property can be used + to provide client certificate for mutual TLS transport. If + not provided, the default SSL client certificate will be used if + present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not + set, no client certificate will be used. + + Raises: + google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport + creation failed for any reason. + """ + self._client = DataformClient( + credentials=credentials, + transport=transport, + client_options=client_options, + client_info=client_info, + + ) + + async def list_repositories(self, + request: Union[dataform.ListRepositoriesRequest, dict] = None, + *, + parent: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.ListRepositoriesAsyncPager: + r"""Lists Repositories in a given project and location. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_list_repositories(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ListRepositoriesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_repositories(request=request) + + # Handle the response + async for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.ListRepositoriesRequest, dict]): + The request object. `ListRepositories` request message. + parent (:class:`str`): + Required. The location in which to list repositories. + Must be in the format ``projects/*/locations/*``. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.services.dataform.pagers.ListRepositoriesAsyncPager: + ListRepositories response message. + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent]) + if request is not None and has_flattened_params: + raise ValueError("If the `request` argument is set, then none of " + "the individual field arguments should be set.") + + request = dataform.ListRepositoriesRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.list_repositories, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("parent", request.parent), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # This method is paged; wrap the response in a pager, which provides + # an `__aiter__` convenience method. + response = pagers.ListRepositoriesAsyncPager( + method=rpc, + request=request, + response=response, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def get_repository(self, + request: Union[dataform.GetRepositoryRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.Repository: + r"""Fetches a single Repository. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_get_repository(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.GetRepositoryRequest( + name="name_value", + ) + + # Make the request + response = await client.get_repository(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.GetRepositoryRequest, dict]): + The request object. `GetRepository` request message. + name (:class:`str`): + Required. The repository's name. + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.Repository: + Represents a Dataform Git repository. + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError("If the `request` argument is set, then none of " + "the individual field arguments should be set.") + + request = dataform.GetRepositoryRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.get_repository, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def create_repository(self, + request: Union[dataform.CreateRepositoryRequest, dict] = None, + *, + parent: str = None, + repository: dataform.Repository = None, + repository_id: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.Repository: + r"""Creates a new Repository in a given project and + location. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_create_repository(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.CreateRepositoryRequest( + parent="parent_value", + repository_id="repository_id_value", + ) + + # Make the request + response = await client.create_repository(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.CreateRepositoryRequest, dict]): + The request object. `CreateRepository` request message. + parent (:class:`str`): + Required. The location in which to create the + repository. Must be in the format + ``projects/*/locations/*``. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + repository (:class:`google.cloud.dataform_v1beta1.types.Repository`): + Required. The repository to create. + This corresponds to the ``repository`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + repository_id (:class:`str`): + Required. The ID to use for the + repository, which will become the final + component of the repository's resource + name. + + This corresponds to the ``repository_id`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.Repository: + Represents a Dataform Git repository. + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent, repository, repository_id]) + if request is not None and has_flattened_params: + raise ValueError("If the `request` argument is set, then none of " + "the individual field arguments should be set.") + + request = dataform.CreateRepositoryRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + if repository is not None: + request.repository = repository + if repository_id is not None: + request.repository_id = repository_id + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.create_repository, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("parent", request.parent), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def update_repository(self, + request: Union[dataform.UpdateRepositoryRequest, dict] = None, + *, + repository: dataform.Repository = None, + update_mask: field_mask_pb2.FieldMask = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.Repository: + r"""Updates a single Repository. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_update_repository(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.UpdateRepositoryRequest( + ) + + # Make the request + response = await client.update_repository(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.UpdateRepositoryRequest, dict]): + The request object. `UpdateRepository` request message. + repository (:class:`google.cloud.dataform_v1beta1.types.Repository`): + Required. The repository to update. + This corresponds to the ``repository`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): + Optional. Specifies the fields to be + updated in the repository. If left + unset, all fields will be updated. + + This corresponds to the ``update_mask`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.Repository: + Represents a Dataform Git repository. + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([repository, update_mask]) + if request is not None and has_flattened_params: + raise ValueError("If the `request` argument is set, then none of " + "the individual field arguments should be set.") + + request = dataform.UpdateRepositoryRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if repository is not None: + request.repository = repository + if update_mask is not None: + request.update_mask = update_mask + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.update_repository, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("repository.name", request.repository.name), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def delete_repository(self, + request: Union[dataform.DeleteRepositoryRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Deletes a single Repository. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_delete_repository(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.DeleteRepositoryRequest( + name="name_value", + ) + + # Make the request + await client.delete_repository(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.DeleteRepositoryRequest, dict]): + The request object. `DeleteRepository` request message. + name (:class:`str`): + Required. The repository's name. + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError("If the `request` argument is set, then none of " + "the individual field arguments should be set.") + + request = dataform.DeleteRepositoryRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.delete_repository, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + async def fetch_remote_branches(self, + request: Union[dataform.FetchRemoteBranchesRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.FetchRemoteBranchesResponse: + r"""Fetches a Repository's remote branches. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_fetch_remote_branches(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.FetchRemoteBranchesRequest( + name="name_value", + ) + + # Make the request + response = await client.fetch_remote_branches(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.FetchRemoteBranchesRequest, dict]): + The request object. `FetchRemoteBranches` request + message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.FetchRemoteBranchesResponse: + FetchRemoteBranches response message. + """ + # Create or coerce a protobuf request object. + request = dataform.FetchRemoteBranchesRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.fetch_remote_branches, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def list_workspaces(self, + request: Union[dataform.ListWorkspacesRequest, dict] = None, + *, + parent: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.ListWorkspacesAsyncPager: + r"""Lists Workspaces in a given Repository. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_list_workspaces(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ListWorkspacesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_workspaces(request=request) + + # Handle the response + async for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.ListWorkspacesRequest, dict]): + The request object. `ListWorkspaces` request message. + parent (:class:`str`): + Required. The repository in which to list workspaces. + Must be in the format + ``projects/*/locations/*/repositories/*``. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.services.dataform.pagers.ListWorkspacesAsyncPager: + ListWorkspaces response message. + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent]) + if request is not None and has_flattened_params: + raise ValueError("If the `request` argument is set, then none of " + "the individual field arguments should be set.") + + request = dataform.ListWorkspacesRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.list_workspaces, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("parent", request.parent), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # This method is paged; wrap the response in a pager, which provides + # an `__aiter__` convenience method. + response = pagers.ListWorkspacesAsyncPager( + method=rpc, + request=request, + response=response, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def get_workspace(self, + request: Union[dataform.GetWorkspaceRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.Workspace: + r"""Fetches a single Workspace. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_get_workspace(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.GetWorkspaceRequest( + name="name_value", + ) + + # Make the request + response = await client.get_workspace(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.GetWorkspaceRequest, dict]): + The request object. `GetWorkspace` request message. + name (:class:`str`): + Required. The workspace's name. + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.Workspace: + Represents a Dataform Git workspace. + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError("If the `request` argument is set, then none of " + "the individual field arguments should be set.") + + request = dataform.GetWorkspaceRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.get_workspace, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def create_workspace(self, + request: Union[dataform.CreateWorkspaceRequest, dict] = None, + *, + parent: str = None, + workspace: dataform.Workspace = None, + workspace_id: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.Workspace: + r"""Creates a new Workspace in a given Repository. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_create_workspace(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.CreateWorkspaceRequest( + parent="parent_value", + workspace_id="workspace_id_value", + ) + + # Make the request + response = await client.create_workspace(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.CreateWorkspaceRequest, dict]): + The request object. `CreateWorkspace` request message. + parent (:class:`str`): + Required. The repository in which to create the + workspace. Must be in the format + ``projects/*/locations/*/repositories/*``. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + workspace (:class:`google.cloud.dataform_v1beta1.types.Workspace`): + Required. The workspace to create. + This corresponds to the ``workspace`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + workspace_id (:class:`str`): + Required. The ID to use for the + workspace, which will become the final + component of the workspace's resource + name. + + This corresponds to the ``workspace_id`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.Workspace: + Represents a Dataform Git workspace. + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent, workspace, workspace_id]) + if request is not None and has_flattened_params: + raise ValueError("If the `request` argument is set, then none of " + "the individual field arguments should be set.") + + request = dataform.CreateWorkspaceRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + if workspace is not None: + request.workspace = workspace + if workspace_id is not None: + request.workspace_id = workspace_id + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.create_workspace, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("parent", request.parent), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def delete_workspace(self, + request: Union[dataform.DeleteWorkspaceRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Deletes a single Workspace. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_delete_workspace(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.DeleteWorkspaceRequest( + name="name_value", + ) + + # Make the request + await client.delete_workspace(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.DeleteWorkspaceRequest, dict]): + The request object. `DeleteWorkspace` request message. + name (:class:`str`): + Required. The workspace resource's + name. + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError("If the `request` argument is set, then none of " + "the individual field arguments should be set.") + + request = dataform.DeleteWorkspaceRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.delete_workspace, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + async def install_npm_packages(self, + request: Union[dataform.InstallNpmPackagesRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.InstallNpmPackagesResponse: + r"""Installs dependency NPM packages (inside a + Workspace). + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_install_npm_packages(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.InstallNpmPackagesRequest( + workspace="workspace_value", + ) + + # Make the request + response = await client.install_npm_packages(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.InstallNpmPackagesRequest, dict]): + The request object. `InstallNpmPackages` request + message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.InstallNpmPackagesResponse: + InstallNpmPackages response message. + """ + # Create or coerce a protobuf request object. + request = dataform.InstallNpmPackagesRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.install_npm_packages, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def pull_git_commits(self, + request: Union[dataform.PullGitCommitsRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Pulls Git commits from the Repository's remote into a + Workspace. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_pull_git_commits(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + author = dataform_v1beta1.CommitAuthor() + author.name = "name_value" + author.email_address = "email_address_value" + + request = dataform_v1beta1.PullGitCommitsRequest( + name="name_value", + author=author, + ) + + # Make the request + await client.pull_git_commits(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.PullGitCommitsRequest, dict]): + The request object. `PullGitCommits` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + request = dataform.PullGitCommitsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.pull_git_commits, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + async def push_git_commits(self, + request: Union[dataform.PushGitCommitsRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Pushes Git commits from a Workspace to the + Repository's remote. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_push_git_commits(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.PushGitCommitsRequest( + name="name_value", + ) + + # Make the request + await client.push_git_commits(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.PushGitCommitsRequest, dict]): + The request object. `PushGitCommits` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + request = dataform.PushGitCommitsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.push_git_commits, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + async def fetch_file_git_statuses(self, + request: Union[dataform.FetchFileGitStatusesRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.FetchFileGitStatusesResponse: + r"""Fetches Git statuses for the files in a Workspace. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_fetch_file_git_statuses(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.FetchFileGitStatusesRequest( + name="name_value", + ) + + # Make the request + response = await client.fetch_file_git_statuses(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.FetchFileGitStatusesRequest, dict]): + The request object. `FetchFileGitStatuses` request + message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.FetchFileGitStatusesResponse: + FetchFileGitStatuses response message. + """ + # Create or coerce a protobuf request object. + request = dataform.FetchFileGitStatusesRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.fetch_file_git_statuses, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def fetch_git_ahead_behind(self, + request: Union[dataform.FetchGitAheadBehindRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.FetchGitAheadBehindResponse: + r"""Fetches Git ahead/behind against a remote branch. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_fetch_git_ahead_behind(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.FetchGitAheadBehindRequest( + name="name_value", + ) + + # Make the request + response = await client.fetch_git_ahead_behind(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.FetchGitAheadBehindRequest, dict]): + The request object. `FetchGitAheadBehind` request + message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.FetchGitAheadBehindResponse: + FetchGitAheadBehind response message. + """ + # Create or coerce a protobuf request object. + request = dataform.FetchGitAheadBehindRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.fetch_git_ahead_behind, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def commit_workspace_changes(self, + request: Union[dataform.CommitWorkspaceChangesRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Applies a Git commit for uncommitted files in a + Workspace. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_commit_workspace_changes(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + author = dataform_v1beta1.CommitAuthor() + author.name = "name_value" + author.email_address = "email_address_value" + + request = dataform_v1beta1.CommitWorkspaceChangesRequest( + name="name_value", + author=author, + ) + + # Make the request + await client.commit_workspace_changes(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.CommitWorkspaceChangesRequest, dict]): + The request object. `CommitWorkspaceChanges` request + message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + request = dataform.CommitWorkspaceChangesRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.commit_workspace_changes, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + async def reset_workspace_changes(self, + request: Union[dataform.ResetWorkspaceChangesRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Performs a Git reset for uncommitted files in a + Workspace. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_reset_workspace_changes(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ResetWorkspaceChangesRequest( + name="name_value", + ) + + # Make the request + await client.reset_workspace_changes(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.ResetWorkspaceChangesRequest, dict]): + The request object. `ResetWorkspaceChanges` request + message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + request = dataform.ResetWorkspaceChangesRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.reset_workspace_changes, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + async def fetch_file_diff(self, + request: Union[dataform.FetchFileDiffRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.FetchFileDiffResponse: + r"""Fetches Git diff for an uncommitted file in a + Workspace. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_fetch_file_diff(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.FetchFileDiffRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + response = await client.fetch_file_diff(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.FetchFileDiffRequest, dict]): + The request object. `FetchFileDiff` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.FetchFileDiffResponse: + FetchFileDiff response message. + """ + # Create or coerce a protobuf request object. + request = dataform.FetchFileDiffRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.fetch_file_diff, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def query_directory_contents(self, + request: Union[dataform.QueryDirectoryContentsRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.QueryDirectoryContentsAsyncPager: + r"""Returns the contents of a given Workspace directory. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_query_directory_contents(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.QueryDirectoryContentsRequest( + workspace="workspace_value", + ) + + # Make the request + page_result = client.query_directory_contents(request=request) + + # Handle the response + async for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.QueryDirectoryContentsRequest, dict]): + The request object. `QueryDirectoryContents` request + message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.services.dataform.pagers.QueryDirectoryContentsAsyncPager: + QueryDirectoryContents response message. + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + request = dataform.QueryDirectoryContentsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.query_directory_contents, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # This method is paged; wrap the response in a pager, which provides + # an `__aiter__` convenience method. + response = pagers.QueryDirectoryContentsAsyncPager( + method=rpc, + request=request, + response=response, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def make_directory(self, + request: Union[dataform.MakeDirectoryRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.MakeDirectoryResponse: + r"""Creates a directory inside a Workspace. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_make_directory(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.MakeDirectoryRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + response = await client.make_directory(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.MakeDirectoryRequest, dict]): + The request object. `MakeDirectory` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.MakeDirectoryResponse: + MakeDirectory response message. + """ + # Create or coerce a protobuf request object. + request = dataform.MakeDirectoryRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.make_directory, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def remove_directory(self, + request: Union[dataform.RemoveDirectoryRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Deletes a directory (inside a Workspace) and all of + its contents. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_remove_directory(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.RemoveDirectoryRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + await client.remove_directory(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.RemoveDirectoryRequest, dict]): + The request object. `RemoveDirectory` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + request = dataform.RemoveDirectoryRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.remove_directory, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + async def move_directory(self, + request: Union[dataform.MoveDirectoryRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.MoveDirectoryResponse: + r"""Moves a directory (inside a Workspace), and all of + its contents, to a new location. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_move_directory(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.MoveDirectoryRequest( + workspace="workspace_value", + path="path_value", + new_path="new_path_value", + ) + + # Make the request + response = await client.move_directory(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.MoveDirectoryRequest, dict]): + The request object. `MoveDirectory` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.MoveDirectoryResponse: + MoveDirectory response message. + """ + # Create or coerce a protobuf request object. + request = dataform.MoveDirectoryRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.move_directory, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def read_file(self, + request: Union[dataform.ReadFileRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.ReadFileResponse: + r"""Returns the contents of a file (inside a Workspace). + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_read_file(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ReadFileRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + response = await client.read_file(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.ReadFileRequest, dict]): + The request object. `ReadFile` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.ReadFileResponse: + ReadFile response message. + """ + # Create or coerce a protobuf request object. + request = dataform.ReadFileRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.read_file, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def remove_file(self, + request: Union[dataform.RemoveFileRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Deletes a file (inside a Workspace). + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_remove_file(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.RemoveFileRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + await client.remove_file(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.RemoveFileRequest, dict]): + The request object. `RemoveFile` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + request = dataform.RemoveFileRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.remove_file, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + async def move_file(self, + request: Union[dataform.MoveFileRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.MoveFileResponse: + r"""Moves a file (inside a Workspace) to a new location. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_move_file(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.MoveFileRequest( + workspace="workspace_value", + path="path_value", + new_path="new_path_value", + ) + + # Make the request + response = await client.move_file(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.MoveFileRequest, dict]): + The request object. `MoveFile` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.MoveFileResponse: + MoveFile response message. + """ + # Create or coerce a protobuf request object. + request = dataform.MoveFileRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.move_file, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def write_file(self, + request: Union[dataform.WriteFileRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.WriteFileResponse: + r"""Writes to a file (inside a Workspace). + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_write_file(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.WriteFileRequest( + workspace="workspace_value", + path="path_value", + contents=b'contents_blob', + ) + + # Make the request + response = await client.write_file(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.WriteFileRequest, dict]): + The request object. `WriteFile` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.WriteFileResponse: + WriteFile response message. + """ + # Create or coerce a protobuf request object. + request = dataform.WriteFileRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.write_file, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def list_compilation_results(self, + request: Union[dataform.ListCompilationResultsRequest, dict] = None, + *, + parent: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.ListCompilationResultsAsyncPager: + r"""Lists CompilationResults in a given Repository. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_list_compilation_results(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ListCompilationResultsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_compilation_results(request=request) + + # Handle the response + async for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.ListCompilationResultsRequest, dict]): + The request object. `ListCompilationResults` request + message. + parent (:class:`str`): + Required. The repository in which to list compilation + results. Must be in the format + ``projects/*/locations/*/repositories/*``. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.services.dataform.pagers.ListCompilationResultsAsyncPager: + ListCompilationResults response message. + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent]) + if request is not None and has_flattened_params: + raise ValueError("If the `request` argument is set, then none of " + "the individual field arguments should be set.") + + request = dataform.ListCompilationResultsRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.list_compilation_results, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("parent", request.parent), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # This method is paged; wrap the response in a pager, which provides + # an `__aiter__` convenience method. + response = pagers.ListCompilationResultsAsyncPager( + method=rpc, + request=request, + response=response, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def get_compilation_result(self, + request: Union[dataform.GetCompilationResultRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.CompilationResult: + r"""Fetches a single CompilationResult. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_get_compilation_result(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.GetCompilationResultRequest( + name="name_value", + ) + + # Make the request + response = await client.get_compilation_result(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.GetCompilationResultRequest, dict]): + The request object. `GetCompilationResult` request + message. + name (:class:`str`): + Required. The compilation result's + name. + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.CompilationResult: + Represents the result of compiling a + Dataform project. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError("If the `request` argument is set, then none of " + "the individual field arguments should be set.") + + request = dataform.GetCompilationResultRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.get_compilation_result, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def create_compilation_result(self, + request: Union[dataform.CreateCompilationResultRequest, dict] = None, + *, + parent: str = None, + compilation_result: dataform.CompilationResult = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.CompilationResult: + r"""Creates a new CompilationResult in a given project + and location. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_create_compilation_result(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + compilation_result = dataform_v1beta1.CompilationResult() + compilation_result.git_commitish = "git_commitish_value" + + request = dataform_v1beta1.CreateCompilationResultRequest( + parent="parent_value", + compilation_result=compilation_result, + ) + + # Make the request + response = await client.create_compilation_result(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.CreateCompilationResultRequest, dict]): + The request object. `CreateCompilationResult` request + message. + parent (:class:`str`): + Required. The repository in which to create the + compilation result. Must be in the format + ``projects/*/locations/*/repositories/*``. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + compilation_result (:class:`google.cloud.dataform_v1beta1.types.CompilationResult`): + Required. The compilation result to + create. + + This corresponds to the ``compilation_result`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.CompilationResult: + Represents the result of compiling a + Dataform project. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent, compilation_result]) + if request is not None and has_flattened_params: + raise ValueError("If the `request` argument is set, then none of " + "the individual field arguments should be set.") + + request = dataform.CreateCompilationResultRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + if compilation_result is not None: + request.compilation_result = compilation_result + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.create_compilation_result, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("parent", request.parent), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def query_compilation_result_actions(self, + request: Union[dataform.QueryCompilationResultActionsRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.QueryCompilationResultActionsAsyncPager: + r"""Returns CompilationResultActions in a given + CompilationResult. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_query_compilation_result_actions(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.QueryCompilationResultActionsRequest( + name="name_value", + ) + + # Make the request + page_result = client.query_compilation_result_actions(request=request) + + # Handle the response + async for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsRequest, dict]): + The request object. `QueryCompilationResultActions` + request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.services.dataform.pagers.QueryCompilationResultActionsAsyncPager: + QueryCompilationResultActions response message. + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + request = dataform.QueryCompilationResultActionsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.query_compilation_result_actions, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # This method is paged; wrap the response in a pager, which provides + # an `__aiter__` convenience method. + response = pagers.QueryCompilationResultActionsAsyncPager( + method=rpc, + request=request, + response=response, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def list_workflow_invocations(self, + request: Union[dataform.ListWorkflowInvocationsRequest, dict] = None, + *, + parent: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.ListWorkflowInvocationsAsyncPager: + r"""Lists WorkflowInvocations in a given Repository. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_list_workflow_invocations(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ListWorkflowInvocationsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_workflow_invocations(request=request) + + # Handle the response + async for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsRequest, dict]): + The request object. `ListWorkflowInvocations` request + message. + parent (:class:`str`): + Required. The parent resource of the WorkflowInvocation + type. Must be in the format + ``projects/*/locations/*/repositories/*``. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.services.dataform.pagers.ListWorkflowInvocationsAsyncPager: + ListWorkflowInvocations response message. + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent]) + if request is not None and has_flattened_params: + raise ValueError("If the `request` argument is set, then none of " + "the individual field arguments should be set.") + + request = dataform.ListWorkflowInvocationsRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.list_workflow_invocations, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("parent", request.parent), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # This method is paged; wrap the response in a pager, which provides + # an `__aiter__` convenience method. + response = pagers.ListWorkflowInvocationsAsyncPager( + method=rpc, + request=request, + response=response, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def get_workflow_invocation(self, + request: Union[dataform.GetWorkflowInvocationRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.WorkflowInvocation: + r"""Fetches a single WorkflowInvocation. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_get_workflow_invocation(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.GetWorkflowInvocationRequest( + name="name_value", + ) + + # Make the request + response = await client.get_workflow_invocation(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.GetWorkflowInvocationRequest, dict]): + The request object. `GetWorkflowInvocation` request + message. + name (:class:`str`): + Required. The workflow invocation + resource's name. + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.WorkflowInvocation: + Represents a single invocation of a + compilation result. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError("If the `request` argument is set, then none of " + "the individual field arguments should be set.") + + request = dataform.GetWorkflowInvocationRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.get_workflow_invocation, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def create_workflow_invocation(self, + request: Union[dataform.CreateWorkflowInvocationRequest, dict] = None, + *, + parent: str = None, + workflow_invocation: dataform.WorkflowInvocation = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.WorkflowInvocation: + r"""Creates a new WorkflowInvocation in a given + Repository. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_create_workflow_invocation(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.CreateWorkflowInvocationRequest( + parent="parent_value", + ) + + # Make the request + response = await client.create_workflow_invocation(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.CreateWorkflowInvocationRequest, dict]): + The request object. `CreateWorkflowInvocation` request + message. + parent (:class:`str`): + Required. The repository in which to create the workflow + invocation. Must be in the format + ``projects/*/locations/*/repositories/*``. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + workflow_invocation (:class:`google.cloud.dataform_v1beta1.types.WorkflowInvocation`): + Required. The workflow invocation + resource to create. + + This corresponds to the ``workflow_invocation`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.WorkflowInvocation: + Represents a single invocation of a + compilation result. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent, workflow_invocation]) + if request is not None and has_flattened_params: + raise ValueError("If the `request` argument is set, then none of " + "the individual field arguments should be set.") + + request = dataform.CreateWorkflowInvocationRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + if workflow_invocation is not None: + request.workflow_invocation = workflow_invocation + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.create_workflow_invocation, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("parent", request.parent), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def delete_workflow_invocation(self, + request: Union[dataform.DeleteWorkflowInvocationRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Deletes a single WorkflowInvocation. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_delete_workflow_invocation(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.DeleteWorkflowInvocationRequest( + name="name_value", + ) + + # Make the request + await client.delete_workflow_invocation(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.DeleteWorkflowInvocationRequest, dict]): + The request object. `DeleteWorkflowInvocation` request + message. + name (:class:`str`): + Required. The workflow invocation + resource's name. + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError("If the `request` argument is set, then none of " + "the individual field arguments should be set.") + + request = dataform.DeleteWorkflowInvocationRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.delete_workflow_invocation, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + async def cancel_workflow_invocation(self, + request: Union[dataform.CancelWorkflowInvocationRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Requests cancellation of a running + WorkflowInvocation. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_cancel_workflow_invocation(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.CancelWorkflowInvocationRequest( + name="name_value", + ) + + # Make the request + await client.cancel_workflow_invocation(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.CancelWorkflowInvocationRequest, dict]): + The request object. `CancelWorkflowInvocation` request + message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + request = dataform.CancelWorkflowInvocationRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.cancel_workflow_invocation, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + async def query_workflow_invocation_actions(self, + request: Union[dataform.QueryWorkflowInvocationActionsRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.QueryWorkflowInvocationActionsAsyncPager: + r"""Returns WorkflowInvocationActions in a given + WorkflowInvocation. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + async def sample_query_workflow_invocation_actions(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.QueryWorkflowInvocationActionsRequest( + name="name_value", + ) + + # Make the request + page_result = client.query_workflow_invocation_actions(request=request) + + # Handle the response + async for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsRequest, dict]): + The request object. `QueryWorkflowInvocationActions` + request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.services.dataform.pagers.QueryWorkflowInvocationActionsAsyncPager: + QueryWorkflowInvocationActions response message. + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + request = dataform.QueryWorkflowInvocationActionsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.query_workflow_invocation_actions, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # This method is paged; wrap the response in a pager, which provides + # an `__aiter__` convenience method. + response = pagers.QueryWorkflowInvocationActionsAsyncPager( + method=rpc, + request=request, + response=response, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def get_location( + self, + request: locations_pb2.GetLocationRequest = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> locations_pb2.Location: + r"""Gets information about a location. + + Args: + request (:class:`~.location_pb2.GetLocationRequest`): + The request object. Request message for + `GetLocation` method. + retry (google.api_core.retry.Retry): Designation of what errors, + if any, should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + Returns: + ~.location_pb2.Location: + Location object. + """ + # Create or coerce a protobuf request object. + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = locations_pb2.GetLocationRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method.wrap_method( + self._client._transport.get_location, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + (("name", request.name),)), + ) + + # Send the request. + response = await rpc( + request, retry=retry, timeout=timeout, metadata=metadata,) + + # Done; return the response. + return response + + async def list_locations( + self, + request: locations_pb2.ListLocationsRequest = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> locations_pb2.ListLocationsResponse: + r"""Lists information about the supported locations for this service. + + Args: + request (:class:`~.location_pb2.ListLocationsRequest`): + The request object. Request message for + `ListLocations` method. + retry (google.api_core.retry.Retry): Designation of what errors, + if any, should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + Returns: + ~.location_pb2.ListLocationsResponse: + Response message for ``ListLocations`` method. + """ + # Create or coerce a protobuf request object. + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = locations_pb2.ListLocationsRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method.wrap_method( + self._client._transport.list_locations, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + (("name", request.name),)), + ) + + # Send the request. + response = await rpc( + request, retry=retry, timeout=timeout, metadata=metadata,) + + # Done; return the response. + return response + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc, tb): + await self.transport.close() + +try: + DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=pkg_resources.get_distribution( + "google-cloud-dataform", + ).version, + ) +except pkg_resources.DistributionNotFound: + DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() + + +__all__ = ( + "DataformAsyncClient", +) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/client.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/client.py new file mode 100644 index 0000000..ed5204d --- /dev/null +++ b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/client.py @@ -0,0 +1,3833 @@ +# -*- coding: utf-8 -*- +# 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. +# +from collections import OrderedDict +import os +import re +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +import pkg_resources + +from google.api_core import client_options as client_options_lib +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries +from google.auth import credentials as ga_credentials # type: ignore +from google.auth.transport import mtls # type: ignore +from google.auth.transport.grpc import SslCredentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore +from google.oauth2 import service_account # type: ignore + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object] # type: ignore + +from google.cloud.dataform_v1beta1.services.dataform import pagers +from google.cloud.dataform_v1beta1.types import dataform +from google.cloud.location import locations_pb2 # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.protobuf import field_mask_pb2 # type: ignore +from google.type import interval_pb2 # type: ignore +from .transports.base import DataformTransport, DEFAULT_CLIENT_INFO +from .transports.grpc import DataformGrpcTransport +from .transports.grpc_asyncio import DataformGrpcAsyncIOTransport + + +class DataformClientMeta(type): + """Metaclass for the Dataform client. + + This provides class-level methods for building and retrieving + support objects (e.g. transport) without polluting the client instance + objects. + """ + _transport_registry = OrderedDict() # type: Dict[str, Type[DataformTransport]] + _transport_registry["grpc"] = DataformGrpcTransport + _transport_registry["grpc_asyncio"] = DataformGrpcAsyncIOTransport + + def get_transport_class(cls, + label: str = None, + ) -> Type[DataformTransport]: + """Returns an appropriate transport class. + + Args: + label: The name of the desired transport. If none is + provided, then the first transport in the registry is used. + + Returns: + The transport class to use. + """ + # If a specific transport is requested, return that one. + if label: + return cls._transport_registry[label] + + # No transport is requested; return the default (that is, the first one + # in the dictionary). + return next(iter(cls._transport_registry.values())) + + +class DataformClient(metaclass=DataformClientMeta): + """Dataform is a service to develop, create, document, test, and + update curated tables in BigQuery. + """ + + @staticmethod + def _get_default_mtls_endpoint(api_endpoint): + """Converts api endpoint to mTLS endpoint. + + Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to + "*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively. + Args: + api_endpoint (Optional[str]): the api endpoint to convert. + Returns: + str: converted mTLS api endpoint. + """ + if not api_endpoint: + return api_endpoint + + mtls_endpoint_re = re.compile( + r"(?P[^.]+)(?P\.mtls)?(?P\.sandbox)?(?P\.googleapis\.com)?" + ) + + m = mtls_endpoint_re.match(api_endpoint) + name, mtls, sandbox, googledomain = m.groups() + if mtls or not googledomain: + return api_endpoint + + if sandbox: + return api_endpoint.replace( + "sandbox.googleapis.com", "mtls.sandbox.googleapis.com" + ) + + return api_endpoint.replace(".googleapis.com", ".mtls.googleapis.com") + + DEFAULT_ENDPOINT = "dataform.googleapis.com" + DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore + DEFAULT_ENDPOINT + ) + + @classmethod + def from_service_account_info(cls, info: dict, *args, **kwargs): + """Creates an instance of this client using the provided credentials + info. + + Args: + info (dict): The service account private key info. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + DataformClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_info(info) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + @classmethod + def from_service_account_file(cls, filename: str, *args, **kwargs): + """Creates an instance of this client using the provided credentials + file. + + Args: + filename (str): The path to the service account private key json + file. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + DataformClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_file( + filename) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + from_service_account_json = from_service_account_file + + @property + def transport(self) -> DataformTransport: + """Returns the transport used by the client instance. + + Returns: + DataformTransport: The transport used by the client + instance. + """ + return self._transport + + @staticmethod + def compilation_result_path(project: str,location: str,repository: str,compilation_result: str,) -> str: + """Returns a fully-qualified compilation_result string.""" + return "projects/{project}/locations/{location}/repositories/{repository}/compilationResults/{compilation_result}".format(project=project, location=location, repository=repository, compilation_result=compilation_result, ) + + @staticmethod + def parse_compilation_result_path(path: str) -> Dict[str,str]: + """Parses a compilation_result path into its component segments.""" + m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)/repositories/(?P.+?)/compilationResults/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def repository_path(project: str,location: str,repository: str,) -> str: + """Returns a fully-qualified repository string.""" + return "projects/{project}/locations/{location}/repositories/{repository}".format(project=project, location=location, repository=repository, ) + + @staticmethod + def parse_repository_path(path: str) -> Dict[str,str]: + """Parses a repository path into its component segments.""" + m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)/repositories/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def secret_version_path(project: str,secret: str,version: str,) -> str: + """Returns a fully-qualified secret_version string.""" + return "projects/{project}/secrets/{secret}/versions/{version}".format(project=project, secret=secret, version=version, ) + + @staticmethod + def parse_secret_version_path(path: str) -> Dict[str,str]: + """Parses a secret_version path into its component segments.""" + m = re.match(r"^projects/(?P.+?)/secrets/(?P.+?)/versions/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def workflow_invocation_path(project: str,location: str,repository: str,workflow_invocation: str,) -> str: + """Returns a fully-qualified workflow_invocation string.""" + return "projects/{project}/locations/{location}/repositories/{repository}/workflowInvocations/{workflow_invocation}".format(project=project, location=location, repository=repository, workflow_invocation=workflow_invocation, ) + + @staticmethod + def parse_workflow_invocation_path(path: str) -> Dict[str,str]: + """Parses a workflow_invocation path into its component segments.""" + m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)/repositories/(?P.+?)/workflowInvocations/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def workspace_path(project: str,location: str,repository: str,workspace: str,) -> str: + """Returns a fully-qualified workspace string.""" + return "projects/{project}/locations/{location}/repositories/{repository}/workspaces/{workspace}".format(project=project, location=location, repository=repository, workspace=workspace, ) + + @staticmethod + def parse_workspace_path(path: str) -> Dict[str,str]: + """Parses a workspace path into its component segments.""" + m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)/repositories/(?P.+?)/workspaces/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_billing_account_path(billing_account: str, ) -> str: + """Returns a fully-qualified billing_account string.""" + return "billingAccounts/{billing_account}".format(billing_account=billing_account, ) + + @staticmethod + def parse_common_billing_account_path(path: str) -> Dict[str,str]: + """Parse a billing_account path into its component segments.""" + m = re.match(r"^billingAccounts/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_folder_path(folder: str, ) -> str: + """Returns a fully-qualified folder string.""" + return "folders/{folder}".format(folder=folder, ) + + @staticmethod + def parse_common_folder_path(path: str) -> Dict[str,str]: + """Parse a folder path into its component segments.""" + m = re.match(r"^folders/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_organization_path(organization: str, ) -> str: + """Returns a fully-qualified organization string.""" + return "organizations/{organization}".format(organization=organization, ) + + @staticmethod + def parse_common_organization_path(path: str) -> Dict[str,str]: + """Parse a organization path into its component segments.""" + m = re.match(r"^organizations/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_project_path(project: str, ) -> str: + """Returns a fully-qualified project string.""" + return "projects/{project}".format(project=project, ) + + @staticmethod + def parse_common_project_path(path: str) -> Dict[str,str]: + """Parse a project path into its component segments.""" + m = re.match(r"^projects/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_location_path(project: str, location: str, ) -> str: + """Returns a fully-qualified location string.""" + return "projects/{project}/locations/{location}".format(project=project, location=location, ) + + @staticmethod + def parse_common_location_path(path: str) -> Dict[str,str]: + """Parse a location path into its component segments.""" + m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)$", path) + return m.groupdict() if m else {} + + @classmethod + def get_mtls_endpoint_and_cert_source(cls, client_options: Optional[client_options_lib.ClientOptions] = None): + """Return the API endpoint and client cert source for mutual TLS. + + The client cert source is determined in the following order: + (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the + client cert source is None. + (2) if `client_options.client_cert_source` is provided, use the provided one; if the + default client cert source exists, use the default one; otherwise the client cert + source is None. + + The API endpoint is determined in the following order: + (1) if `client_options.api_endpoint` if provided, use the provided one. + (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the + default mTLS endpoint; if the environment variabel is "never", use the default API + endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise + use the default API endpoint. + + More details can be found at https://google.aip.dev/auth/4114. + + Args: + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. Only the `api_endpoint` and `client_cert_source` properties may be used + in this method. + + Returns: + Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the + client cert source to use. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If any errors happen. + """ + if client_options is None: + client_options = client_options_lib.ClientOptions() + use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") + use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto") + if use_client_cert not in ("true", "false"): + raise ValueError("Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`") + if use_mtls_endpoint not in ("auto", "never", "always"): + raise MutualTLSChannelError("Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`") + + # Figure out the client cert source to use. + client_cert_source = None + if use_client_cert == "true": + if client_options.client_cert_source: + client_cert_source = client_options.client_cert_source + elif mtls.has_default_client_cert_source(): + client_cert_source = mtls.default_client_cert_source() + + # Figure out which api endpoint to use. + if client_options.api_endpoint is not None: + api_endpoint = client_options.api_endpoint + elif use_mtls_endpoint == "always" or (use_mtls_endpoint == "auto" and client_cert_source): + api_endpoint = cls.DEFAULT_MTLS_ENDPOINT + else: + api_endpoint = cls.DEFAULT_ENDPOINT + + return api_endpoint, client_cert_source + + def __init__(self, *, + credentials: Optional[ga_credentials.Credentials] = None, + transport: Union[str, DataformTransport, None] = None, + client_options: Optional[client_options_lib.ClientOptions] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + ) -> None: + """Instantiates the dataform client. + + Args: + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + transport (Union[str, DataformTransport]): The + transport to use. If set to None, a transport is chosen + automatically. + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. It won't take effect if a ``transport`` instance is provided. + (1) The ``api_endpoint`` property can be used to override the + default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT + environment variable can also be used to override the endpoint: + "always" (always use the default mTLS endpoint), "never" (always + use the default regular endpoint) and "auto" (auto switch to the + default mTLS endpoint if client certificate is present, this is + the default value). However, the ``api_endpoint`` property takes + precedence if provided. + (2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable + is "true", then the ``client_cert_source`` property can be used + to provide client certificate for mutual TLS transport. If + not provided, the default SSL client certificate will be used if + present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not + set, no client certificate will be used. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport + creation failed for any reason. + """ + if isinstance(client_options, dict): + client_options = client_options_lib.from_dict(client_options) + if client_options is None: + client_options = client_options_lib.ClientOptions() + + api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source(client_options) + + api_key_value = getattr(client_options, "api_key", None) + if api_key_value and credentials: + raise ValueError("client_options.api_key and credentials are mutually exclusive") + + # Save or instantiate the transport. + # Ordinarily, we provide the transport, but allowing a custom transport + # instance provides an extensibility point for unusual situations. + if isinstance(transport, DataformTransport): + # transport is a DataformTransport instance. + if credentials or client_options.credentials_file or api_key_value: + raise ValueError("When providing a transport instance, " + "provide its credentials directly.") + if client_options.scopes: + raise ValueError( + "When providing a transport instance, provide its scopes " + "directly." + ) + self._transport = transport + else: + import google.auth._default # type: ignore + + if api_key_value and hasattr(google.auth._default, "get_api_key_credentials"): + credentials = google.auth._default.get_api_key_credentials(api_key_value) + + Transport = type(self).get_transport_class(transport) + self._transport = Transport( + credentials=credentials, + credentials_file=client_options.credentials_file, + host=api_endpoint, + scopes=client_options.scopes, + client_cert_source_for_mtls=client_cert_source_func, + quota_project_id=client_options.quota_project_id, + client_info=client_info, + always_use_jwt_access=True, + api_audience=client_options.api_audience, + ) + + def list_repositories(self, + request: Union[dataform.ListRepositoriesRequest, dict] = None, + *, + parent: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.ListRepositoriesPager: + r"""Lists Repositories in a given project and location. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_list_repositories(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ListRepositoriesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_repositories(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.ListRepositoriesRequest, dict]): + The request object. `ListRepositories` request message. + parent (str): + Required. The location in which to list repositories. + Must be in the format ``projects/*/locations/*``. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.services.dataform.pagers.ListRepositoriesPager: + ListRepositories response message. + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent]) + if request is not None and has_flattened_params: + raise ValueError('If the `request` argument is set, then none of ' + 'the individual field arguments should be set.') + + # Minor optimization to avoid making a copy if the user passes + # in a dataform.ListRepositoriesRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.ListRepositoriesRequest): + request = dataform.ListRepositoriesRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.list_repositories] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("parent", request.parent), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # This method is paged; wrap the response in a pager, which provides + # an `__iter__` convenience method. + response = pagers.ListRepositoriesPager( + method=rpc, + request=request, + response=response, + metadata=metadata, + ) + + # Done; return the response. + return response + + def get_repository(self, + request: Union[dataform.GetRepositoryRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.Repository: + r"""Fetches a single Repository. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_get_repository(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.GetRepositoryRequest( + name="name_value", + ) + + # Make the request + response = client.get_repository(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.GetRepositoryRequest, dict]): + The request object. `GetRepository` request message. + name (str): + Required. The repository's name. + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.Repository: + Represents a Dataform Git repository. + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError('If the `request` argument is set, then none of ' + 'the individual field arguments should be set.') + + # Minor optimization to avoid making a copy if the user passes + # in a dataform.GetRepositoryRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.GetRepositoryRequest): + request = dataform.GetRepositoryRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.get_repository] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def create_repository(self, + request: Union[dataform.CreateRepositoryRequest, dict] = None, + *, + parent: str = None, + repository: dataform.Repository = None, + repository_id: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.Repository: + r"""Creates a new Repository in a given project and + location. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_create_repository(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.CreateRepositoryRequest( + parent="parent_value", + repository_id="repository_id_value", + ) + + # Make the request + response = client.create_repository(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.CreateRepositoryRequest, dict]): + The request object. `CreateRepository` request message. + parent (str): + Required. The location in which to create the + repository. Must be in the format + ``projects/*/locations/*``. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + repository (google.cloud.dataform_v1beta1.types.Repository): + Required. The repository to create. + This corresponds to the ``repository`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + repository_id (str): + Required. The ID to use for the + repository, which will become the final + component of the repository's resource + name. + + This corresponds to the ``repository_id`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.Repository: + Represents a Dataform Git repository. + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent, repository, repository_id]) + if request is not None and has_flattened_params: + raise ValueError('If the `request` argument is set, then none of ' + 'the individual field arguments should be set.') + + # Minor optimization to avoid making a copy if the user passes + # in a dataform.CreateRepositoryRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.CreateRepositoryRequest): + request = dataform.CreateRepositoryRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + if repository is not None: + request.repository = repository + if repository_id is not None: + request.repository_id = repository_id + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.create_repository] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("parent", request.parent), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def update_repository(self, + request: Union[dataform.UpdateRepositoryRequest, dict] = None, + *, + repository: dataform.Repository = None, + update_mask: field_mask_pb2.FieldMask = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.Repository: + r"""Updates a single Repository. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_update_repository(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.UpdateRepositoryRequest( + ) + + # Make the request + response = client.update_repository(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.UpdateRepositoryRequest, dict]): + The request object. `UpdateRepository` request message. + repository (google.cloud.dataform_v1beta1.types.Repository): + Required. The repository to update. + This corresponds to the ``repository`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + update_mask (google.protobuf.field_mask_pb2.FieldMask): + Optional. Specifies the fields to be + updated in the repository. If left + unset, all fields will be updated. + + This corresponds to the ``update_mask`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.Repository: + Represents a Dataform Git repository. + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([repository, update_mask]) + if request is not None and has_flattened_params: + raise ValueError('If the `request` argument is set, then none of ' + 'the individual field arguments should be set.') + + # Minor optimization to avoid making a copy if the user passes + # in a dataform.UpdateRepositoryRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.UpdateRepositoryRequest): + request = dataform.UpdateRepositoryRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if repository is not None: + request.repository = repository + if update_mask is not None: + request.update_mask = update_mask + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.update_repository] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("repository.name", request.repository.name), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def delete_repository(self, + request: Union[dataform.DeleteRepositoryRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Deletes a single Repository. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_delete_repository(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.DeleteRepositoryRequest( + name="name_value", + ) + + # Make the request + client.delete_repository(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.DeleteRepositoryRequest, dict]): + The request object. `DeleteRepository` request message. + name (str): + Required. The repository's name. + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError('If the `request` argument is set, then none of ' + 'the individual field arguments should be set.') + + # Minor optimization to avoid making a copy if the user passes + # in a dataform.DeleteRepositoryRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.DeleteRepositoryRequest): + request = dataform.DeleteRepositoryRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.delete_repository] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + def fetch_remote_branches(self, + request: Union[dataform.FetchRemoteBranchesRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.FetchRemoteBranchesResponse: + r"""Fetches a Repository's remote branches. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_fetch_remote_branches(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.FetchRemoteBranchesRequest( + name="name_value", + ) + + # Make the request + response = client.fetch_remote_branches(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.FetchRemoteBranchesRequest, dict]): + The request object. `FetchRemoteBranches` request + message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.FetchRemoteBranchesResponse: + FetchRemoteBranches response message. + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.FetchRemoteBranchesRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.FetchRemoteBranchesRequest): + request = dataform.FetchRemoteBranchesRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.fetch_remote_branches] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def list_workspaces(self, + request: Union[dataform.ListWorkspacesRequest, dict] = None, + *, + parent: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.ListWorkspacesPager: + r"""Lists Workspaces in a given Repository. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_list_workspaces(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ListWorkspacesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_workspaces(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.ListWorkspacesRequest, dict]): + The request object. `ListWorkspaces` request message. + parent (str): + Required. The repository in which to list workspaces. + Must be in the format + ``projects/*/locations/*/repositories/*``. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.services.dataform.pagers.ListWorkspacesPager: + ListWorkspaces response message. + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent]) + if request is not None and has_flattened_params: + raise ValueError('If the `request` argument is set, then none of ' + 'the individual field arguments should be set.') + + # Minor optimization to avoid making a copy if the user passes + # in a dataform.ListWorkspacesRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.ListWorkspacesRequest): + request = dataform.ListWorkspacesRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.list_workspaces] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("parent", request.parent), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # This method is paged; wrap the response in a pager, which provides + # an `__iter__` convenience method. + response = pagers.ListWorkspacesPager( + method=rpc, + request=request, + response=response, + metadata=metadata, + ) + + # Done; return the response. + return response + + def get_workspace(self, + request: Union[dataform.GetWorkspaceRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.Workspace: + r"""Fetches a single Workspace. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_get_workspace(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.GetWorkspaceRequest( + name="name_value", + ) + + # Make the request + response = client.get_workspace(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.GetWorkspaceRequest, dict]): + The request object. `GetWorkspace` request message. + name (str): + Required. The workspace's name. + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.Workspace: + Represents a Dataform Git workspace. + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError('If the `request` argument is set, then none of ' + 'the individual field arguments should be set.') + + # Minor optimization to avoid making a copy if the user passes + # in a dataform.GetWorkspaceRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.GetWorkspaceRequest): + request = dataform.GetWorkspaceRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.get_workspace] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def create_workspace(self, + request: Union[dataform.CreateWorkspaceRequest, dict] = None, + *, + parent: str = None, + workspace: dataform.Workspace = None, + workspace_id: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.Workspace: + r"""Creates a new Workspace in a given Repository. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_create_workspace(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.CreateWorkspaceRequest( + parent="parent_value", + workspace_id="workspace_id_value", + ) + + # Make the request + response = client.create_workspace(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.CreateWorkspaceRequest, dict]): + The request object. `CreateWorkspace` request message. + parent (str): + Required. The repository in which to create the + workspace. Must be in the format + ``projects/*/locations/*/repositories/*``. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + workspace (google.cloud.dataform_v1beta1.types.Workspace): + Required. The workspace to create. + This corresponds to the ``workspace`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + workspace_id (str): + Required. The ID to use for the + workspace, which will become the final + component of the workspace's resource + name. + + This corresponds to the ``workspace_id`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.Workspace: + Represents a Dataform Git workspace. + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent, workspace, workspace_id]) + if request is not None and has_flattened_params: + raise ValueError('If the `request` argument is set, then none of ' + 'the individual field arguments should be set.') + + # Minor optimization to avoid making a copy if the user passes + # in a dataform.CreateWorkspaceRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.CreateWorkspaceRequest): + request = dataform.CreateWorkspaceRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + if workspace is not None: + request.workspace = workspace + if workspace_id is not None: + request.workspace_id = workspace_id + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.create_workspace] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("parent", request.parent), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def delete_workspace(self, + request: Union[dataform.DeleteWorkspaceRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Deletes a single Workspace. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_delete_workspace(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.DeleteWorkspaceRequest( + name="name_value", + ) + + # Make the request + client.delete_workspace(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.DeleteWorkspaceRequest, dict]): + The request object. `DeleteWorkspace` request message. + name (str): + Required. The workspace resource's + name. + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError('If the `request` argument is set, then none of ' + 'the individual field arguments should be set.') + + # Minor optimization to avoid making a copy if the user passes + # in a dataform.DeleteWorkspaceRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.DeleteWorkspaceRequest): + request = dataform.DeleteWorkspaceRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.delete_workspace] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + def install_npm_packages(self, + request: Union[dataform.InstallNpmPackagesRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.InstallNpmPackagesResponse: + r"""Installs dependency NPM packages (inside a + Workspace). + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_install_npm_packages(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.InstallNpmPackagesRequest( + workspace="workspace_value", + ) + + # Make the request + response = client.install_npm_packages(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.InstallNpmPackagesRequest, dict]): + The request object. `InstallNpmPackages` request + message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.InstallNpmPackagesResponse: + InstallNpmPackages response message. + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.InstallNpmPackagesRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.InstallNpmPackagesRequest): + request = dataform.InstallNpmPackagesRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.install_npm_packages] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def pull_git_commits(self, + request: Union[dataform.PullGitCommitsRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Pulls Git commits from the Repository's remote into a + Workspace. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_pull_git_commits(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + author = dataform_v1beta1.CommitAuthor() + author.name = "name_value" + author.email_address = "email_address_value" + + request = dataform_v1beta1.PullGitCommitsRequest( + name="name_value", + author=author, + ) + + # Make the request + client.pull_git_commits(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.PullGitCommitsRequest, dict]): + The request object. `PullGitCommits` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.PullGitCommitsRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.PullGitCommitsRequest): + request = dataform.PullGitCommitsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.pull_git_commits] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + def push_git_commits(self, + request: Union[dataform.PushGitCommitsRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Pushes Git commits from a Workspace to the + Repository's remote. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_push_git_commits(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.PushGitCommitsRequest( + name="name_value", + ) + + # Make the request + client.push_git_commits(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.PushGitCommitsRequest, dict]): + The request object. `PushGitCommits` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.PushGitCommitsRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.PushGitCommitsRequest): + request = dataform.PushGitCommitsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.push_git_commits] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + def fetch_file_git_statuses(self, + request: Union[dataform.FetchFileGitStatusesRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.FetchFileGitStatusesResponse: + r"""Fetches Git statuses for the files in a Workspace. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_fetch_file_git_statuses(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.FetchFileGitStatusesRequest( + name="name_value", + ) + + # Make the request + response = client.fetch_file_git_statuses(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.FetchFileGitStatusesRequest, dict]): + The request object. `FetchFileGitStatuses` request + message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.FetchFileGitStatusesResponse: + FetchFileGitStatuses response message. + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.FetchFileGitStatusesRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.FetchFileGitStatusesRequest): + request = dataform.FetchFileGitStatusesRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.fetch_file_git_statuses] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def fetch_git_ahead_behind(self, + request: Union[dataform.FetchGitAheadBehindRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.FetchGitAheadBehindResponse: + r"""Fetches Git ahead/behind against a remote branch. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_fetch_git_ahead_behind(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.FetchGitAheadBehindRequest( + name="name_value", + ) + + # Make the request + response = client.fetch_git_ahead_behind(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.FetchGitAheadBehindRequest, dict]): + The request object. `FetchGitAheadBehind` request + message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.FetchGitAheadBehindResponse: + FetchGitAheadBehind response message. + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.FetchGitAheadBehindRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.FetchGitAheadBehindRequest): + request = dataform.FetchGitAheadBehindRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.fetch_git_ahead_behind] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def commit_workspace_changes(self, + request: Union[dataform.CommitWorkspaceChangesRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Applies a Git commit for uncommitted files in a + Workspace. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_commit_workspace_changes(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + author = dataform_v1beta1.CommitAuthor() + author.name = "name_value" + author.email_address = "email_address_value" + + request = dataform_v1beta1.CommitWorkspaceChangesRequest( + name="name_value", + author=author, + ) + + # Make the request + client.commit_workspace_changes(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.CommitWorkspaceChangesRequest, dict]): + The request object. `CommitWorkspaceChanges` request + message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.CommitWorkspaceChangesRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.CommitWorkspaceChangesRequest): + request = dataform.CommitWorkspaceChangesRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.commit_workspace_changes] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + def reset_workspace_changes(self, + request: Union[dataform.ResetWorkspaceChangesRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Performs a Git reset for uncommitted files in a + Workspace. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_reset_workspace_changes(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ResetWorkspaceChangesRequest( + name="name_value", + ) + + # Make the request + client.reset_workspace_changes(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.ResetWorkspaceChangesRequest, dict]): + The request object. `ResetWorkspaceChanges` request + message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.ResetWorkspaceChangesRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.ResetWorkspaceChangesRequest): + request = dataform.ResetWorkspaceChangesRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.reset_workspace_changes] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + def fetch_file_diff(self, + request: Union[dataform.FetchFileDiffRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.FetchFileDiffResponse: + r"""Fetches Git diff for an uncommitted file in a + Workspace. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_fetch_file_diff(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.FetchFileDiffRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + response = client.fetch_file_diff(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.FetchFileDiffRequest, dict]): + The request object. `FetchFileDiff` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.FetchFileDiffResponse: + FetchFileDiff response message. + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.FetchFileDiffRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.FetchFileDiffRequest): + request = dataform.FetchFileDiffRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.fetch_file_diff] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def query_directory_contents(self, + request: Union[dataform.QueryDirectoryContentsRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.QueryDirectoryContentsPager: + r"""Returns the contents of a given Workspace directory. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_query_directory_contents(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.QueryDirectoryContentsRequest( + workspace="workspace_value", + ) + + # Make the request + page_result = client.query_directory_contents(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.QueryDirectoryContentsRequest, dict]): + The request object. `QueryDirectoryContents` request + message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.services.dataform.pagers.QueryDirectoryContentsPager: + QueryDirectoryContents response message. + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.QueryDirectoryContentsRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.QueryDirectoryContentsRequest): + request = dataform.QueryDirectoryContentsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.query_directory_contents] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # This method is paged; wrap the response in a pager, which provides + # an `__iter__` convenience method. + response = pagers.QueryDirectoryContentsPager( + method=rpc, + request=request, + response=response, + metadata=metadata, + ) + + # Done; return the response. + return response + + def make_directory(self, + request: Union[dataform.MakeDirectoryRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.MakeDirectoryResponse: + r"""Creates a directory inside a Workspace. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_make_directory(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.MakeDirectoryRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + response = client.make_directory(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.MakeDirectoryRequest, dict]): + The request object. `MakeDirectory` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.MakeDirectoryResponse: + MakeDirectory response message. + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.MakeDirectoryRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.MakeDirectoryRequest): + request = dataform.MakeDirectoryRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.make_directory] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def remove_directory(self, + request: Union[dataform.RemoveDirectoryRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Deletes a directory (inside a Workspace) and all of + its contents. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_remove_directory(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.RemoveDirectoryRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + client.remove_directory(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.RemoveDirectoryRequest, dict]): + The request object. `RemoveDirectory` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.RemoveDirectoryRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.RemoveDirectoryRequest): + request = dataform.RemoveDirectoryRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.remove_directory] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + def move_directory(self, + request: Union[dataform.MoveDirectoryRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.MoveDirectoryResponse: + r"""Moves a directory (inside a Workspace), and all of + its contents, to a new location. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_move_directory(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.MoveDirectoryRequest( + workspace="workspace_value", + path="path_value", + new_path="new_path_value", + ) + + # Make the request + response = client.move_directory(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.MoveDirectoryRequest, dict]): + The request object. `MoveDirectory` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.MoveDirectoryResponse: + MoveDirectory response message. + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.MoveDirectoryRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.MoveDirectoryRequest): + request = dataform.MoveDirectoryRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.move_directory] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def read_file(self, + request: Union[dataform.ReadFileRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.ReadFileResponse: + r"""Returns the contents of a file (inside a Workspace). + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_read_file(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ReadFileRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + response = client.read_file(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.ReadFileRequest, dict]): + The request object. `ReadFile` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.ReadFileResponse: + ReadFile response message. + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.ReadFileRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.ReadFileRequest): + request = dataform.ReadFileRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.read_file] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def remove_file(self, + request: Union[dataform.RemoveFileRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Deletes a file (inside a Workspace). + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_remove_file(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.RemoveFileRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + client.remove_file(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.RemoveFileRequest, dict]): + The request object. `RemoveFile` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.RemoveFileRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.RemoveFileRequest): + request = dataform.RemoveFileRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.remove_file] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + def move_file(self, + request: Union[dataform.MoveFileRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.MoveFileResponse: + r"""Moves a file (inside a Workspace) to a new location. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_move_file(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.MoveFileRequest( + workspace="workspace_value", + path="path_value", + new_path="new_path_value", + ) + + # Make the request + response = client.move_file(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.MoveFileRequest, dict]): + The request object. `MoveFile` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.MoveFileResponse: + MoveFile response message. + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.MoveFileRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.MoveFileRequest): + request = dataform.MoveFileRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.move_file] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def write_file(self, + request: Union[dataform.WriteFileRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.WriteFileResponse: + r"""Writes to a file (inside a Workspace). + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_write_file(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.WriteFileRequest( + workspace="workspace_value", + path="path_value", + contents=b'contents_blob', + ) + + # Make the request + response = client.write_file(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.WriteFileRequest, dict]): + The request object. `WriteFile` request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.WriteFileResponse: + WriteFile response message. + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.WriteFileRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.WriteFileRequest): + request = dataform.WriteFileRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.write_file] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("workspace", request.workspace), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def list_compilation_results(self, + request: Union[dataform.ListCompilationResultsRequest, dict] = None, + *, + parent: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.ListCompilationResultsPager: + r"""Lists CompilationResults in a given Repository. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_list_compilation_results(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ListCompilationResultsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_compilation_results(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.ListCompilationResultsRequest, dict]): + The request object. `ListCompilationResults` request + message. + parent (str): + Required. The repository in which to list compilation + results. Must be in the format + ``projects/*/locations/*/repositories/*``. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.services.dataform.pagers.ListCompilationResultsPager: + ListCompilationResults response message. + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent]) + if request is not None and has_flattened_params: + raise ValueError('If the `request` argument is set, then none of ' + 'the individual field arguments should be set.') + + # Minor optimization to avoid making a copy if the user passes + # in a dataform.ListCompilationResultsRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.ListCompilationResultsRequest): + request = dataform.ListCompilationResultsRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.list_compilation_results] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("parent", request.parent), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # This method is paged; wrap the response in a pager, which provides + # an `__iter__` convenience method. + response = pagers.ListCompilationResultsPager( + method=rpc, + request=request, + response=response, + metadata=metadata, + ) + + # Done; return the response. + return response + + def get_compilation_result(self, + request: Union[dataform.GetCompilationResultRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.CompilationResult: + r"""Fetches a single CompilationResult. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_get_compilation_result(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.GetCompilationResultRequest( + name="name_value", + ) + + # Make the request + response = client.get_compilation_result(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.GetCompilationResultRequest, dict]): + The request object. `GetCompilationResult` request + message. + name (str): + Required. The compilation result's + name. + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.CompilationResult: + Represents the result of compiling a + Dataform project. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError('If the `request` argument is set, then none of ' + 'the individual field arguments should be set.') + + # Minor optimization to avoid making a copy if the user passes + # in a dataform.GetCompilationResultRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.GetCompilationResultRequest): + request = dataform.GetCompilationResultRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.get_compilation_result] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def create_compilation_result(self, + request: Union[dataform.CreateCompilationResultRequest, dict] = None, + *, + parent: str = None, + compilation_result: dataform.CompilationResult = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.CompilationResult: + r"""Creates a new CompilationResult in a given project + and location. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_create_compilation_result(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + compilation_result = dataform_v1beta1.CompilationResult() + compilation_result.git_commitish = "git_commitish_value" + + request = dataform_v1beta1.CreateCompilationResultRequest( + parent="parent_value", + compilation_result=compilation_result, + ) + + # Make the request + response = client.create_compilation_result(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.CreateCompilationResultRequest, dict]): + The request object. `CreateCompilationResult` request + message. + parent (str): + Required. The repository in which to create the + compilation result. Must be in the format + ``projects/*/locations/*/repositories/*``. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + compilation_result (google.cloud.dataform_v1beta1.types.CompilationResult): + Required. The compilation result to + create. + + This corresponds to the ``compilation_result`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.CompilationResult: + Represents the result of compiling a + Dataform project. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent, compilation_result]) + if request is not None and has_flattened_params: + raise ValueError('If the `request` argument is set, then none of ' + 'the individual field arguments should be set.') + + # Minor optimization to avoid making a copy if the user passes + # in a dataform.CreateCompilationResultRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.CreateCompilationResultRequest): + request = dataform.CreateCompilationResultRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + if compilation_result is not None: + request.compilation_result = compilation_result + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.create_compilation_result] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("parent", request.parent), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def query_compilation_result_actions(self, + request: Union[dataform.QueryCompilationResultActionsRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.QueryCompilationResultActionsPager: + r"""Returns CompilationResultActions in a given + CompilationResult. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_query_compilation_result_actions(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.QueryCompilationResultActionsRequest( + name="name_value", + ) + + # Make the request + page_result = client.query_compilation_result_actions(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsRequest, dict]): + The request object. `QueryCompilationResultActions` + request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.services.dataform.pagers.QueryCompilationResultActionsPager: + QueryCompilationResultActions response message. + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.QueryCompilationResultActionsRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.QueryCompilationResultActionsRequest): + request = dataform.QueryCompilationResultActionsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.query_compilation_result_actions] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # This method is paged; wrap the response in a pager, which provides + # an `__iter__` convenience method. + response = pagers.QueryCompilationResultActionsPager( + method=rpc, + request=request, + response=response, + metadata=metadata, + ) + + # Done; return the response. + return response + + def list_workflow_invocations(self, + request: Union[dataform.ListWorkflowInvocationsRequest, dict] = None, + *, + parent: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.ListWorkflowInvocationsPager: + r"""Lists WorkflowInvocations in a given Repository. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_list_workflow_invocations(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ListWorkflowInvocationsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_workflow_invocations(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsRequest, dict]): + The request object. `ListWorkflowInvocations` request + message. + parent (str): + Required. The parent resource of the WorkflowInvocation + type. Must be in the format + ``projects/*/locations/*/repositories/*``. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.services.dataform.pagers.ListWorkflowInvocationsPager: + ListWorkflowInvocations response message. + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent]) + if request is not None and has_flattened_params: + raise ValueError('If the `request` argument is set, then none of ' + 'the individual field arguments should be set.') + + # Minor optimization to avoid making a copy if the user passes + # in a dataform.ListWorkflowInvocationsRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.ListWorkflowInvocationsRequest): + request = dataform.ListWorkflowInvocationsRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.list_workflow_invocations] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("parent", request.parent), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # This method is paged; wrap the response in a pager, which provides + # an `__iter__` convenience method. + response = pagers.ListWorkflowInvocationsPager( + method=rpc, + request=request, + response=response, + metadata=metadata, + ) + + # Done; return the response. + return response + + def get_workflow_invocation(self, + request: Union[dataform.GetWorkflowInvocationRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.WorkflowInvocation: + r"""Fetches a single WorkflowInvocation. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_get_workflow_invocation(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.GetWorkflowInvocationRequest( + name="name_value", + ) + + # Make the request + response = client.get_workflow_invocation(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.GetWorkflowInvocationRequest, dict]): + The request object. `GetWorkflowInvocation` request + message. + name (str): + Required. The workflow invocation + resource's name. + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.WorkflowInvocation: + Represents a single invocation of a + compilation result. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError('If the `request` argument is set, then none of ' + 'the individual field arguments should be set.') + + # Minor optimization to avoid making a copy if the user passes + # in a dataform.GetWorkflowInvocationRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.GetWorkflowInvocationRequest): + request = dataform.GetWorkflowInvocationRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.get_workflow_invocation] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def create_workflow_invocation(self, + request: Union[dataform.CreateWorkflowInvocationRequest, dict] = None, + *, + parent: str = None, + workflow_invocation: dataform.WorkflowInvocation = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> dataform.WorkflowInvocation: + r"""Creates a new WorkflowInvocation in a given + Repository. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_create_workflow_invocation(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.CreateWorkflowInvocationRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_workflow_invocation(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.CreateWorkflowInvocationRequest, dict]): + The request object. `CreateWorkflowInvocation` request + message. + parent (str): + Required. The repository in which to create the workflow + invocation. Must be in the format + ``projects/*/locations/*/repositories/*``. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + workflow_invocation (google.cloud.dataform_v1beta1.types.WorkflowInvocation): + Required. The workflow invocation + resource to create. + + This corresponds to the ``workflow_invocation`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.types.WorkflowInvocation: + Represents a single invocation of a + compilation result. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent, workflow_invocation]) + if request is not None and has_flattened_params: + raise ValueError('If the `request` argument is set, then none of ' + 'the individual field arguments should be set.') + + # Minor optimization to avoid making a copy if the user passes + # in a dataform.CreateWorkflowInvocationRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.CreateWorkflowInvocationRequest): + request = dataform.CreateWorkflowInvocationRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + if workflow_invocation is not None: + request.workflow_invocation = workflow_invocation + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.create_workflow_invocation] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("parent", request.parent), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def delete_workflow_invocation(self, + request: Union[dataform.DeleteWorkflowInvocationRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Deletes a single WorkflowInvocation. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_delete_workflow_invocation(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.DeleteWorkflowInvocationRequest( + name="name_value", + ) + + # Make the request + client.delete_workflow_invocation(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.DeleteWorkflowInvocationRequest, dict]): + The request object. `DeleteWorkflowInvocation` request + message. + name (str): + Required. The workflow invocation + resource's name. + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError('If the `request` argument is set, then none of ' + 'the individual field arguments should be set.') + + # Minor optimization to avoid making a copy if the user passes + # in a dataform.DeleteWorkflowInvocationRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.DeleteWorkflowInvocationRequest): + request = dataform.DeleteWorkflowInvocationRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.delete_workflow_invocation] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + def cancel_workflow_invocation(self, + request: Union[dataform.CancelWorkflowInvocationRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> None: + r"""Requests cancellation of a running + WorkflowInvocation. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_cancel_workflow_invocation(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.CancelWorkflowInvocationRequest( + name="name_value", + ) + + # Make the request + client.cancel_workflow_invocation(request=request) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.CancelWorkflowInvocationRequest, dict]): + The request object. `CancelWorkflowInvocation` request + message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.CancelWorkflowInvocationRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.CancelWorkflowInvocationRequest): + request = dataform.CancelWorkflowInvocationRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.cancel_workflow_invocation] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + def query_workflow_invocation_actions(self, + request: Union[dataform.QueryWorkflowInvocationActionsRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.QueryWorkflowInvocationActionsPager: + r"""Returns WorkflowInvocationActions in a given + WorkflowInvocation. + + .. code-block:: python + + # 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. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import dataform_v1beta1 + + def sample_query_workflow_invocation_actions(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.QueryWorkflowInvocationActionsRequest( + name="name_value", + ) + + # Make the request + page_result = client.query_workflow_invocation_actions(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsRequest, dict]): + The request object. `QueryWorkflowInvocationActions` + request message. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dataform_v1beta1.services.dataform.pagers.QueryWorkflowInvocationActionsPager: + QueryWorkflowInvocationActions response message. + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a dataform.QueryWorkflowInvocationActionsRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, dataform.QueryWorkflowInvocationActionsRequest): + request = dataform.QueryWorkflowInvocationActionsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.query_workflow_invocation_actions] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ("name", request.name), + )), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # This method is paged; wrap the response in a pager, which provides + # an `__iter__` convenience method. + response = pagers.QueryWorkflowInvocationActionsPager( + method=rpc, + request=request, + response=response, + metadata=metadata, + ) + + # Done; return the response. + return response + + def __enter__(self): + return self + + def __exit__(self, type, value, traceback): + """Releases underlying transport's resources. + + .. warning:: + ONLY use as a context manager if the transport is NOT shared + with other clients! Exiting the with block will CLOSE the transport + and may cause errors in other clients! + """ + self.transport.close() + + def get_location( + self, + request: locations_pb2.GetLocationRequest = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> locations_pb2.Location: + r"""Gets information about a location. + + Args: + request (:class:`~.location_pb2.GetLocationRequest`): + The request object. Request message for + `GetLocation` method. + retry (google.api_core.retry.Retry): Designation of what errors, + if any, should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + Returns: + ~.location_pb2.Location: + Location object. + """ + # Create or coerce a protobuf request object. + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = locations_pb2.GetLocationRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method.wrap_method( + self._transport.get_location, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + (("name", request.name),)), + ) + + # Send the request. + response = rpc( + request, retry=retry, timeout=timeout, metadata=metadata,) + + # Done; return the response. + return response + + def list_locations( + self, + request: locations_pb2.ListLocationsRequest = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> locations_pb2.ListLocationsResponse: + r"""Lists information about the supported locations for this service. + + Args: + request (:class:`~.location_pb2.ListLocationsRequest`): + The request object. Request message for + `ListLocations` method. + retry (google.api_core.retry.Retry): Designation of what errors, + if any, should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + Returns: + ~.location_pb2.ListLocationsResponse: + Response message for ``ListLocations`` method. + """ + # Create or coerce a protobuf request object. + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = locations_pb2.ListLocationsRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method.wrap_method( + self._transport.list_locations, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + (("name", request.name),)), + ) + + # Send the request. + response = rpc( + request, retry=retry, timeout=timeout, metadata=metadata,) + + # Done; return the response. + return response + +try: + DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=pkg_resources.get_distribution( + "google-cloud-dataform", + ).version, + ) +except pkg_resources.DistributionNotFound: + DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() + + +__all__ = ( + "DataformClient", +) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/pagers.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/pagers.py new file mode 100644 index 0000000..35cf1eb --- /dev/null +++ b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/pagers.py @@ -0,0 +1,865 @@ +# -*- coding: utf-8 -*- +# 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. +# +from typing import Any, AsyncIterator, Awaitable, Callable, Sequence, Tuple, Optional, Iterator + +from google.cloud.dataform_v1beta1.types import dataform + + +class ListRepositoriesPager: + """A pager for iterating through ``list_repositories`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dataform_v1beta1.types.ListRepositoriesResponse` object, and + provides an ``__iter__`` method to iterate through its + ``repositories`` field. + + If there are more pages, the ``__iter__`` method will make additional + ``ListRepositories`` requests and continue to iterate + through the ``repositories`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dataform_v1beta1.types.ListRepositoriesResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + def __init__(self, + method: Callable[..., dataform.ListRepositoriesResponse], + request: dataform.ListRepositoriesRequest, + response: dataform.ListRepositoriesResponse, + *, + metadata: Sequence[Tuple[str, str]] = ()): + """Instantiate the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dataform_v1beta1.types.ListRepositoriesRequest): + The initial request object. + response (google.cloud.dataform_v1beta1.types.ListRepositoriesResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = dataform.ListRepositoriesRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + def pages(self) -> Iterator[dataform.ListRepositoriesResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = self._method(self._request, metadata=self._metadata) + yield self._response + + def __iter__(self) -> Iterator[dataform.Repository]: + for page in self.pages: + yield from page.repositories + + def __repr__(self) -> str: + return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) + + +class ListRepositoriesAsyncPager: + """A pager for iterating through ``list_repositories`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dataform_v1beta1.types.ListRepositoriesResponse` object, and + provides an ``__aiter__`` method to iterate through its + ``repositories`` field. + + If there are more pages, the ``__aiter__`` method will make additional + ``ListRepositories`` requests and continue to iterate + through the ``repositories`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dataform_v1beta1.types.ListRepositoriesResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + def __init__(self, + method: Callable[..., Awaitable[dataform.ListRepositoriesResponse]], + request: dataform.ListRepositoriesRequest, + response: dataform.ListRepositoriesResponse, + *, + metadata: Sequence[Tuple[str, str]] = ()): + """Instantiates the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dataform_v1beta1.types.ListRepositoriesRequest): + The initial request object. + response (google.cloud.dataform_v1beta1.types.ListRepositoriesResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = dataform.ListRepositoriesRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + async def pages(self) -> AsyncIterator[dataform.ListRepositoriesResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = await self._method(self._request, metadata=self._metadata) + yield self._response + def __aiter__(self) -> AsyncIterator[dataform.Repository]: + async def async_generator(): + async for page in self.pages: + for response in page.repositories: + yield response + + return async_generator() + + def __repr__(self) -> str: + return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) + + +class ListWorkspacesPager: + """A pager for iterating through ``list_workspaces`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dataform_v1beta1.types.ListWorkspacesResponse` object, and + provides an ``__iter__`` method to iterate through its + ``workspaces`` field. + + If there are more pages, the ``__iter__`` method will make additional + ``ListWorkspaces`` requests and continue to iterate + through the ``workspaces`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dataform_v1beta1.types.ListWorkspacesResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + def __init__(self, + method: Callable[..., dataform.ListWorkspacesResponse], + request: dataform.ListWorkspacesRequest, + response: dataform.ListWorkspacesResponse, + *, + metadata: Sequence[Tuple[str, str]] = ()): + """Instantiate the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dataform_v1beta1.types.ListWorkspacesRequest): + The initial request object. + response (google.cloud.dataform_v1beta1.types.ListWorkspacesResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = dataform.ListWorkspacesRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + def pages(self) -> Iterator[dataform.ListWorkspacesResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = self._method(self._request, metadata=self._metadata) + yield self._response + + def __iter__(self) -> Iterator[dataform.Workspace]: + for page in self.pages: + yield from page.workspaces + + def __repr__(self) -> str: + return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) + + +class ListWorkspacesAsyncPager: + """A pager for iterating through ``list_workspaces`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dataform_v1beta1.types.ListWorkspacesResponse` object, and + provides an ``__aiter__`` method to iterate through its + ``workspaces`` field. + + If there are more pages, the ``__aiter__`` method will make additional + ``ListWorkspaces`` requests and continue to iterate + through the ``workspaces`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dataform_v1beta1.types.ListWorkspacesResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + def __init__(self, + method: Callable[..., Awaitable[dataform.ListWorkspacesResponse]], + request: dataform.ListWorkspacesRequest, + response: dataform.ListWorkspacesResponse, + *, + metadata: Sequence[Tuple[str, str]] = ()): + """Instantiates the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dataform_v1beta1.types.ListWorkspacesRequest): + The initial request object. + response (google.cloud.dataform_v1beta1.types.ListWorkspacesResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = dataform.ListWorkspacesRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + async def pages(self) -> AsyncIterator[dataform.ListWorkspacesResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = await self._method(self._request, metadata=self._metadata) + yield self._response + def __aiter__(self) -> AsyncIterator[dataform.Workspace]: + async def async_generator(): + async for page in self.pages: + for response in page.workspaces: + yield response + + return async_generator() + + def __repr__(self) -> str: + return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) + + +class QueryDirectoryContentsPager: + """A pager for iterating through ``query_directory_contents`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dataform_v1beta1.types.QueryDirectoryContentsResponse` object, and + provides an ``__iter__`` method to iterate through its + ``directory_entries`` field. + + If there are more pages, the ``__iter__`` method will make additional + ``QueryDirectoryContents`` requests and continue to iterate + through the ``directory_entries`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dataform_v1beta1.types.QueryDirectoryContentsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + def __init__(self, + method: Callable[..., dataform.QueryDirectoryContentsResponse], + request: dataform.QueryDirectoryContentsRequest, + response: dataform.QueryDirectoryContentsResponse, + *, + metadata: Sequence[Tuple[str, str]] = ()): + """Instantiate the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dataform_v1beta1.types.QueryDirectoryContentsRequest): + The initial request object. + response (google.cloud.dataform_v1beta1.types.QueryDirectoryContentsResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = dataform.QueryDirectoryContentsRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + def pages(self) -> Iterator[dataform.QueryDirectoryContentsResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = self._method(self._request, metadata=self._metadata) + yield self._response + + def __iter__(self) -> Iterator[dataform.QueryDirectoryContentsResponse.DirectoryEntry]: + for page in self.pages: + yield from page.directory_entries + + def __repr__(self) -> str: + return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) + + +class QueryDirectoryContentsAsyncPager: + """A pager for iterating through ``query_directory_contents`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dataform_v1beta1.types.QueryDirectoryContentsResponse` object, and + provides an ``__aiter__`` method to iterate through its + ``directory_entries`` field. + + If there are more pages, the ``__aiter__`` method will make additional + ``QueryDirectoryContents`` requests and continue to iterate + through the ``directory_entries`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dataform_v1beta1.types.QueryDirectoryContentsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + def __init__(self, + method: Callable[..., Awaitable[dataform.QueryDirectoryContentsResponse]], + request: dataform.QueryDirectoryContentsRequest, + response: dataform.QueryDirectoryContentsResponse, + *, + metadata: Sequence[Tuple[str, str]] = ()): + """Instantiates the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dataform_v1beta1.types.QueryDirectoryContentsRequest): + The initial request object. + response (google.cloud.dataform_v1beta1.types.QueryDirectoryContentsResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = dataform.QueryDirectoryContentsRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + async def pages(self) -> AsyncIterator[dataform.QueryDirectoryContentsResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = await self._method(self._request, metadata=self._metadata) + yield self._response + def __aiter__(self) -> AsyncIterator[dataform.QueryDirectoryContentsResponse.DirectoryEntry]: + async def async_generator(): + async for page in self.pages: + for response in page.directory_entries: + yield response + + return async_generator() + + def __repr__(self) -> str: + return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) + + +class ListCompilationResultsPager: + """A pager for iterating through ``list_compilation_results`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dataform_v1beta1.types.ListCompilationResultsResponse` object, and + provides an ``__iter__`` method to iterate through its + ``compilation_results`` field. + + If there are more pages, the ``__iter__`` method will make additional + ``ListCompilationResults`` requests and continue to iterate + through the ``compilation_results`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dataform_v1beta1.types.ListCompilationResultsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + def __init__(self, + method: Callable[..., dataform.ListCompilationResultsResponse], + request: dataform.ListCompilationResultsRequest, + response: dataform.ListCompilationResultsResponse, + *, + metadata: Sequence[Tuple[str, str]] = ()): + """Instantiate the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dataform_v1beta1.types.ListCompilationResultsRequest): + The initial request object. + response (google.cloud.dataform_v1beta1.types.ListCompilationResultsResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = dataform.ListCompilationResultsRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + def pages(self) -> Iterator[dataform.ListCompilationResultsResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = self._method(self._request, metadata=self._metadata) + yield self._response + + def __iter__(self) -> Iterator[dataform.CompilationResult]: + for page in self.pages: + yield from page.compilation_results + + def __repr__(self) -> str: + return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) + + +class ListCompilationResultsAsyncPager: + """A pager for iterating through ``list_compilation_results`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dataform_v1beta1.types.ListCompilationResultsResponse` object, and + provides an ``__aiter__`` method to iterate through its + ``compilation_results`` field. + + If there are more pages, the ``__aiter__`` method will make additional + ``ListCompilationResults`` requests and continue to iterate + through the ``compilation_results`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dataform_v1beta1.types.ListCompilationResultsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + def __init__(self, + method: Callable[..., Awaitable[dataform.ListCompilationResultsResponse]], + request: dataform.ListCompilationResultsRequest, + response: dataform.ListCompilationResultsResponse, + *, + metadata: Sequence[Tuple[str, str]] = ()): + """Instantiates the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dataform_v1beta1.types.ListCompilationResultsRequest): + The initial request object. + response (google.cloud.dataform_v1beta1.types.ListCompilationResultsResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = dataform.ListCompilationResultsRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + async def pages(self) -> AsyncIterator[dataform.ListCompilationResultsResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = await self._method(self._request, metadata=self._metadata) + yield self._response + def __aiter__(self) -> AsyncIterator[dataform.CompilationResult]: + async def async_generator(): + async for page in self.pages: + for response in page.compilation_results: + yield response + + return async_generator() + + def __repr__(self) -> str: + return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) + + +class QueryCompilationResultActionsPager: + """A pager for iterating through ``query_compilation_result_actions`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsResponse` object, and + provides an ``__iter__`` method to iterate through its + ``compilation_result_actions`` field. + + If there are more pages, the ``__iter__`` method will make additional + ``QueryCompilationResultActions`` requests and continue to iterate + through the ``compilation_result_actions`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + def __init__(self, + method: Callable[..., dataform.QueryCompilationResultActionsResponse], + request: dataform.QueryCompilationResultActionsRequest, + response: dataform.QueryCompilationResultActionsResponse, + *, + metadata: Sequence[Tuple[str, str]] = ()): + """Instantiate the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsRequest): + The initial request object. + response (google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = dataform.QueryCompilationResultActionsRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + def pages(self) -> Iterator[dataform.QueryCompilationResultActionsResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = self._method(self._request, metadata=self._metadata) + yield self._response + + def __iter__(self) -> Iterator[dataform.CompilationResultAction]: + for page in self.pages: + yield from page.compilation_result_actions + + def __repr__(self) -> str: + return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) + + +class QueryCompilationResultActionsAsyncPager: + """A pager for iterating through ``query_compilation_result_actions`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsResponse` object, and + provides an ``__aiter__`` method to iterate through its + ``compilation_result_actions`` field. + + If there are more pages, the ``__aiter__`` method will make additional + ``QueryCompilationResultActions`` requests and continue to iterate + through the ``compilation_result_actions`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + def __init__(self, + method: Callable[..., Awaitable[dataform.QueryCompilationResultActionsResponse]], + request: dataform.QueryCompilationResultActionsRequest, + response: dataform.QueryCompilationResultActionsResponse, + *, + metadata: Sequence[Tuple[str, str]] = ()): + """Instantiates the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsRequest): + The initial request object. + response (google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = dataform.QueryCompilationResultActionsRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + async def pages(self) -> AsyncIterator[dataform.QueryCompilationResultActionsResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = await self._method(self._request, metadata=self._metadata) + yield self._response + def __aiter__(self) -> AsyncIterator[dataform.CompilationResultAction]: + async def async_generator(): + async for page in self.pages: + for response in page.compilation_result_actions: + yield response + + return async_generator() + + def __repr__(self) -> str: + return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) + + +class ListWorkflowInvocationsPager: + """A pager for iterating through ``list_workflow_invocations`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsResponse` object, and + provides an ``__iter__`` method to iterate through its + ``workflow_invocations`` field. + + If there are more pages, the ``__iter__`` method will make additional + ``ListWorkflowInvocations`` requests and continue to iterate + through the ``workflow_invocations`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + def __init__(self, + method: Callable[..., dataform.ListWorkflowInvocationsResponse], + request: dataform.ListWorkflowInvocationsRequest, + response: dataform.ListWorkflowInvocationsResponse, + *, + metadata: Sequence[Tuple[str, str]] = ()): + """Instantiate the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsRequest): + The initial request object. + response (google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = dataform.ListWorkflowInvocationsRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + def pages(self) -> Iterator[dataform.ListWorkflowInvocationsResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = self._method(self._request, metadata=self._metadata) + yield self._response + + def __iter__(self) -> Iterator[dataform.WorkflowInvocation]: + for page in self.pages: + yield from page.workflow_invocations + + def __repr__(self) -> str: + return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) + + +class ListWorkflowInvocationsAsyncPager: + """A pager for iterating through ``list_workflow_invocations`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsResponse` object, and + provides an ``__aiter__`` method to iterate through its + ``workflow_invocations`` field. + + If there are more pages, the ``__aiter__`` method will make additional + ``ListWorkflowInvocations`` requests and continue to iterate + through the ``workflow_invocations`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + def __init__(self, + method: Callable[..., Awaitable[dataform.ListWorkflowInvocationsResponse]], + request: dataform.ListWorkflowInvocationsRequest, + response: dataform.ListWorkflowInvocationsResponse, + *, + metadata: Sequence[Tuple[str, str]] = ()): + """Instantiates the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsRequest): + The initial request object. + response (google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = dataform.ListWorkflowInvocationsRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + async def pages(self) -> AsyncIterator[dataform.ListWorkflowInvocationsResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = await self._method(self._request, metadata=self._metadata) + yield self._response + def __aiter__(self) -> AsyncIterator[dataform.WorkflowInvocation]: + async def async_generator(): + async for page in self.pages: + for response in page.workflow_invocations: + yield response + + return async_generator() + + def __repr__(self) -> str: + return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) + + +class QueryWorkflowInvocationActionsPager: + """A pager for iterating through ``query_workflow_invocation_actions`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsResponse` object, and + provides an ``__iter__`` method to iterate through its + ``workflow_invocation_actions`` field. + + If there are more pages, the ``__iter__`` method will make additional + ``QueryWorkflowInvocationActions`` requests and continue to iterate + through the ``workflow_invocation_actions`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + def __init__(self, + method: Callable[..., dataform.QueryWorkflowInvocationActionsResponse], + request: dataform.QueryWorkflowInvocationActionsRequest, + response: dataform.QueryWorkflowInvocationActionsResponse, + *, + metadata: Sequence[Tuple[str, str]] = ()): + """Instantiate the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsRequest): + The initial request object. + response (google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = dataform.QueryWorkflowInvocationActionsRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + def pages(self) -> Iterator[dataform.QueryWorkflowInvocationActionsResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = self._method(self._request, metadata=self._metadata) + yield self._response + + def __iter__(self) -> Iterator[dataform.WorkflowInvocationAction]: + for page in self.pages: + yield from page.workflow_invocation_actions + + def __repr__(self) -> str: + return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) + + +class QueryWorkflowInvocationActionsAsyncPager: + """A pager for iterating through ``query_workflow_invocation_actions`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsResponse` object, and + provides an ``__aiter__`` method to iterate through its + ``workflow_invocation_actions`` field. + + If there are more pages, the ``__aiter__`` method will make additional + ``QueryWorkflowInvocationActions`` requests and continue to iterate + through the ``workflow_invocation_actions`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + def __init__(self, + method: Callable[..., Awaitable[dataform.QueryWorkflowInvocationActionsResponse]], + request: dataform.QueryWorkflowInvocationActionsRequest, + response: dataform.QueryWorkflowInvocationActionsResponse, + *, + metadata: Sequence[Tuple[str, str]] = ()): + """Instantiates the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsRequest): + The initial request object. + response (google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = dataform.QueryWorkflowInvocationActionsRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + async def pages(self) -> AsyncIterator[dataform.QueryWorkflowInvocationActionsResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = await self._method(self._request, metadata=self._metadata) + yield self._response + def __aiter__(self) -> AsyncIterator[dataform.WorkflowInvocationAction]: + async def async_generator(): + async for page in self.pages: + for response in page.workflow_invocation_actions: + yield response + + return async_generator() + + def __repr__(self) -> str: + return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/__init__.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/__init__.py new file mode 100644 index 0000000..c4201d8 --- /dev/null +++ b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/__init__.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# 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. +# +from collections import OrderedDict +from typing import Dict, Type + +from .base import DataformTransport +from .grpc import DataformGrpcTransport +from .grpc_asyncio import DataformGrpcAsyncIOTransport + + +# Compile a registry of transports. +_transport_registry = OrderedDict() # type: Dict[str, Type[DataformTransport]] +_transport_registry['grpc'] = DataformGrpcTransport +_transport_registry['grpc_asyncio'] = DataformGrpcAsyncIOTransport + +__all__ = ( + 'DataformTransport', + 'DataformGrpcTransport', + 'DataformGrpcAsyncIOTransport', +) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/base.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/base.py new file mode 100644 index 0000000..a9b8db2 --- /dev/null +++ b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/base.py @@ -0,0 +1,664 @@ +# -*- coding: utf-8 -*- +# 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. +# +import abc +from typing import Awaitable, Callable, Dict, Optional, Sequence, Union +import pkg_resources + +import google.auth # type: ignore +import google.api_core +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries +from google.auth import credentials as ga_credentials # type: ignore +from google.oauth2 import service_account # type: ignore + +from google.cloud.dataform_v1beta1.types import dataform +from google.cloud.location import locations_pb2 # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.protobuf import empty_pb2 # type: ignore + +try: + DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=pkg_resources.get_distribution( + 'google-cloud-dataform', + ).version, + ) +except pkg_resources.DistributionNotFound: + DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() + + +class DataformTransport(abc.ABC): + """Abstract transport class for Dataform.""" + + AUTH_SCOPES = ( + 'https://www.googleapis.com/auth/cloud-platform', + ) + + DEFAULT_HOST: str = 'dataform.googleapis.com' + def __init__( + self, *, + host: str = DEFAULT_HOST, + credentials: ga_credentials.Credentials = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + quota_project_id: Optional[str] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, + **kwargs, + ) -> None: + """Instantiate the transport. + + Args: + host (Optional[str]): + The hostname to connect to. + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is mutually exclusive with credentials. + scopes (Optional[Sequence[str]]): A list of scopes. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + """ + + scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} + + # Save the scopes. + self._scopes = scopes + + # If no credentials are provided, then determine the appropriate + # defaults. + if credentials and credentials_file: + raise core_exceptions.DuplicateCredentialArgs("'credentials_file' and 'credentials' are mutually exclusive") + + if credentials_file is not None: + credentials, _ = google.auth.load_credentials_from_file( + credentials_file, + **scopes_kwargs, + quota_project_id=quota_project_id + ) + elif credentials is None: + credentials, _ = google.auth.default(**scopes_kwargs, quota_project_id=quota_project_id) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience(api_audience if api_audience else host) + + # If the credentials are service account credentials, then always try to use self signed JWT. + if always_use_jwt_access and isinstance(credentials, service_account.Credentials) and hasattr(service_account.Credentials, "with_always_use_jwt_access"): + credentials = credentials.with_always_use_jwt_access(True) + + # Save the credentials. + self._credentials = credentials + + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ':' not in host: + host += ':443' + self._host = host + + def _prep_wrapped_messages(self, client_info): + # Precompute the wrapped methods. + self._wrapped_methods = { + self.list_repositories: gapic_v1.method.wrap_method( + self.list_repositories, + default_timeout=None, + client_info=client_info, + ), + self.get_repository: gapic_v1.method.wrap_method( + self.get_repository, + default_timeout=None, + client_info=client_info, + ), + self.create_repository: gapic_v1.method.wrap_method( + self.create_repository, + default_timeout=None, + client_info=client_info, + ), + self.update_repository: gapic_v1.method.wrap_method( + self.update_repository, + default_timeout=None, + client_info=client_info, + ), + self.delete_repository: gapic_v1.method.wrap_method( + self.delete_repository, + default_timeout=None, + client_info=client_info, + ), + self.fetch_remote_branches: gapic_v1.method.wrap_method( + self.fetch_remote_branches, + default_timeout=None, + client_info=client_info, + ), + self.list_workspaces: gapic_v1.method.wrap_method( + self.list_workspaces, + default_timeout=None, + client_info=client_info, + ), + self.get_workspace: gapic_v1.method.wrap_method( + self.get_workspace, + default_timeout=None, + client_info=client_info, + ), + self.create_workspace: gapic_v1.method.wrap_method( + self.create_workspace, + default_timeout=None, + client_info=client_info, + ), + self.delete_workspace: gapic_v1.method.wrap_method( + self.delete_workspace, + default_timeout=None, + client_info=client_info, + ), + self.install_npm_packages: gapic_v1.method.wrap_method( + self.install_npm_packages, + default_timeout=None, + client_info=client_info, + ), + self.pull_git_commits: gapic_v1.method.wrap_method( + self.pull_git_commits, + default_timeout=None, + client_info=client_info, + ), + self.push_git_commits: gapic_v1.method.wrap_method( + self.push_git_commits, + default_timeout=None, + client_info=client_info, + ), + self.fetch_file_git_statuses: gapic_v1.method.wrap_method( + self.fetch_file_git_statuses, + default_timeout=None, + client_info=client_info, + ), + self.fetch_git_ahead_behind: gapic_v1.method.wrap_method( + self.fetch_git_ahead_behind, + default_timeout=None, + client_info=client_info, + ), + self.commit_workspace_changes: gapic_v1.method.wrap_method( + self.commit_workspace_changes, + default_timeout=None, + client_info=client_info, + ), + self.reset_workspace_changes: gapic_v1.method.wrap_method( + self.reset_workspace_changes, + default_timeout=None, + client_info=client_info, + ), + self.fetch_file_diff: gapic_v1.method.wrap_method( + self.fetch_file_diff, + default_timeout=None, + client_info=client_info, + ), + self.query_directory_contents: gapic_v1.method.wrap_method( + self.query_directory_contents, + default_timeout=None, + client_info=client_info, + ), + self.make_directory: gapic_v1.method.wrap_method( + self.make_directory, + default_timeout=None, + client_info=client_info, + ), + self.remove_directory: gapic_v1.method.wrap_method( + self.remove_directory, + default_timeout=None, + client_info=client_info, + ), + self.move_directory: gapic_v1.method.wrap_method( + self.move_directory, + default_timeout=None, + client_info=client_info, + ), + self.read_file: gapic_v1.method.wrap_method( + self.read_file, + default_timeout=None, + client_info=client_info, + ), + self.remove_file: gapic_v1.method.wrap_method( + self.remove_file, + default_timeout=None, + client_info=client_info, + ), + self.move_file: gapic_v1.method.wrap_method( + self.move_file, + default_timeout=None, + client_info=client_info, + ), + self.write_file: gapic_v1.method.wrap_method( + self.write_file, + default_timeout=None, + client_info=client_info, + ), + self.list_compilation_results: gapic_v1.method.wrap_method( + self.list_compilation_results, + default_timeout=None, + client_info=client_info, + ), + self.get_compilation_result: gapic_v1.method.wrap_method( + self.get_compilation_result, + default_timeout=None, + client_info=client_info, + ), + self.create_compilation_result: gapic_v1.method.wrap_method( + self.create_compilation_result, + default_timeout=None, + client_info=client_info, + ), + self.query_compilation_result_actions: gapic_v1.method.wrap_method( + self.query_compilation_result_actions, + default_timeout=None, + client_info=client_info, + ), + self.list_workflow_invocations: gapic_v1.method.wrap_method( + self.list_workflow_invocations, + default_timeout=None, + client_info=client_info, + ), + self.get_workflow_invocation: gapic_v1.method.wrap_method( + self.get_workflow_invocation, + default_timeout=None, + client_info=client_info, + ), + self.create_workflow_invocation: gapic_v1.method.wrap_method( + self.create_workflow_invocation, + default_timeout=None, + client_info=client_info, + ), + self.delete_workflow_invocation: gapic_v1.method.wrap_method( + self.delete_workflow_invocation, + default_timeout=None, + client_info=client_info, + ), + self.cancel_workflow_invocation: gapic_v1.method.wrap_method( + self.cancel_workflow_invocation, + default_timeout=None, + client_info=client_info, + ), + self.query_workflow_invocation_actions: gapic_v1.method.wrap_method( + self.query_workflow_invocation_actions, + default_timeout=None, + client_info=client_info, + ), + } + + def close(self): + """Closes resources associated with the transport. + + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! + """ + raise NotImplementedError() + + @property + def list_repositories(self) -> Callable[ + [dataform.ListRepositoriesRequest], + Union[ + dataform.ListRepositoriesResponse, + Awaitable[dataform.ListRepositoriesResponse] + ]]: + raise NotImplementedError() + + @property + def get_repository(self) -> Callable[ + [dataform.GetRepositoryRequest], + Union[ + dataform.Repository, + Awaitable[dataform.Repository] + ]]: + raise NotImplementedError() + + @property + def create_repository(self) -> Callable[ + [dataform.CreateRepositoryRequest], + Union[ + dataform.Repository, + Awaitable[dataform.Repository] + ]]: + raise NotImplementedError() + + @property + def update_repository(self) -> Callable[ + [dataform.UpdateRepositoryRequest], + Union[ + dataform.Repository, + Awaitable[dataform.Repository] + ]]: + raise NotImplementedError() + + @property + def delete_repository(self) -> Callable[ + [dataform.DeleteRepositoryRequest], + Union[ + empty_pb2.Empty, + Awaitable[empty_pb2.Empty] + ]]: + raise NotImplementedError() + + @property + def fetch_remote_branches(self) -> Callable[ + [dataform.FetchRemoteBranchesRequest], + Union[ + dataform.FetchRemoteBranchesResponse, + Awaitable[dataform.FetchRemoteBranchesResponse] + ]]: + raise NotImplementedError() + + @property + def list_workspaces(self) -> Callable[ + [dataform.ListWorkspacesRequest], + Union[ + dataform.ListWorkspacesResponse, + Awaitable[dataform.ListWorkspacesResponse] + ]]: + raise NotImplementedError() + + @property + def get_workspace(self) -> Callable[ + [dataform.GetWorkspaceRequest], + Union[ + dataform.Workspace, + Awaitable[dataform.Workspace] + ]]: + raise NotImplementedError() + + @property + def create_workspace(self) -> Callable[ + [dataform.CreateWorkspaceRequest], + Union[ + dataform.Workspace, + Awaitable[dataform.Workspace] + ]]: + raise NotImplementedError() + + @property + def delete_workspace(self) -> Callable[ + [dataform.DeleteWorkspaceRequest], + Union[ + empty_pb2.Empty, + Awaitable[empty_pb2.Empty] + ]]: + raise NotImplementedError() + + @property + def install_npm_packages(self) -> Callable[ + [dataform.InstallNpmPackagesRequest], + Union[ + dataform.InstallNpmPackagesResponse, + Awaitable[dataform.InstallNpmPackagesResponse] + ]]: + raise NotImplementedError() + + @property + def pull_git_commits(self) -> Callable[ + [dataform.PullGitCommitsRequest], + Union[ + empty_pb2.Empty, + Awaitable[empty_pb2.Empty] + ]]: + raise NotImplementedError() + + @property + def push_git_commits(self) -> Callable[ + [dataform.PushGitCommitsRequest], + Union[ + empty_pb2.Empty, + Awaitable[empty_pb2.Empty] + ]]: + raise NotImplementedError() + + @property + def fetch_file_git_statuses(self) -> Callable[ + [dataform.FetchFileGitStatusesRequest], + Union[ + dataform.FetchFileGitStatusesResponse, + Awaitable[dataform.FetchFileGitStatusesResponse] + ]]: + raise NotImplementedError() + + @property + def fetch_git_ahead_behind(self) -> Callable[ + [dataform.FetchGitAheadBehindRequest], + Union[ + dataform.FetchGitAheadBehindResponse, + Awaitable[dataform.FetchGitAheadBehindResponse] + ]]: + raise NotImplementedError() + + @property + def commit_workspace_changes(self) -> Callable[ + [dataform.CommitWorkspaceChangesRequest], + Union[ + empty_pb2.Empty, + Awaitable[empty_pb2.Empty] + ]]: + raise NotImplementedError() + + @property + def reset_workspace_changes(self) -> Callable[ + [dataform.ResetWorkspaceChangesRequest], + Union[ + empty_pb2.Empty, + Awaitable[empty_pb2.Empty] + ]]: + raise NotImplementedError() + + @property + def fetch_file_diff(self) -> Callable[ + [dataform.FetchFileDiffRequest], + Union[ + dataform.FetchFileDiffResponse, + Awaitable[dataform.FetchFileDiffResponse] + ]]: + raise NotImplementedError() + + @property + def query_directory_contents(self) -> Callable[ + [dataform.QueryDirectoryContentsRequest], + Union[ + dataform.QueryDirectoryContentsResponse, + Awaitable[dataform.QueryDirectoryContentsResponse] + ]]: + raise NotImplementedError() + + @property + def make_directory(self) -> Callable[ + [dataform.MakeDirectoryRequest], + Union[ + dataform.MakeDirectoryResponse, + Awaitable[dataform.MakeDirectoryResponse] + ]]: + raise NotImplementedError() + + @property + def remove_directory(self) -> Callable[ + [dataform.RemoveDirectoryRequest], + Union[ + empty_pb2.Empty, + Awaitable[empty_pb2.Empty] + ]]: + raise NotImplementedError() + + @property + def move_directory(self) -> Callable[ + [dataform.MoveDirectoryRequest], + Union[ + dataform.MoveDirectoryResponse, + Awaitable[dataform.MoveDirectoryResponse] + ]]: + raise NotImplementedError() + + @property + def read_file(self) -> Callable[ + [dataform.ReadFileRequest], + Union[ + dataform.ReadFileResponse, + Awaitable[dataform.ReadFileResponse] + ]]: + raise NotImplementedError() + + @property + def remove_file(self) -> Callable[ + [dataform.RemoveFileRequest], + Union[ + empty_pb2.Empty, + Awaitable[empty_pb2.Empty] + ]]: + raise NotImplementedError() + + @property + def move_file(self) -> Callable[ + [dataform.MoveFileRequest], + Union[ + dataform.MoveFileResponse, + Awaitable[dataform.MoveFileResponse] + ]]: + raise NotImplementedError() + + @property + def write_file(self) -> Callable[ + [dataform.WriteFileRequest], + Union[ + dataform.WriteFileResponse, + Awaitable[dataform.WriteFileResponse] + ]]: + raise NotImplementedError() + + @property + def list_compilation_results(self) -> Callable[ + [dataform.ListCompilationResultsRequest], + Union[ + dataform.ListCompilationResultsResponse, + Awaitable[dataform.ListCompilationResultsResponse] + ]]: + raise NotImplementedError() + + @property + def get_compilation_result(self) -> Callable[ + [dataform.GetCompilationResultRequest], + Union[ + dataform.CompilationResult, + Awaitable[dataform.CompilationResult] + ]]: + raise NotImplementedError() + + @property + def create_compilation_result(self) -> Callable[ + [dataform.CreateCompilationResultRequest], + Union[ + dataform.CompilationResult, + Awaitable[dataform.CompilationResult] + ]]: + raise NotImplementedError() + + @property + def query_compilation_result_actions(self) -> Callable[ + [dataform.QueryCompilationResultActionsRequest], + Union[ + dataform.QueryCompilationResultActionsResponse, + Awaitable[dataform.QueryCompilationResultActionsResponse] + ]]: + raise NotImplementedError() + + @property + def list_workflow_invocations(self) -> Callable[ + [dataform.ListWorkflowInvocationsRequest], + Union[ + dataform.ListWorkflowInvocationsResponse, + Awaitable[dataform.ListWorkflowInvocationsResponse] + ]]: + raise NotImplementedError() + + @property + def get_workflow_invocation(self) -> Callable[ + [dataform.GetWorkflowInvocationRequest], + Union[ + dataform.WorkflowInvocation, + Awaitable[dataform.WorkflowInvocation] + ]]: + raise NotImplementedError() + + @property + def create_workflow_invocation(self) -> Callable[ + [dataform.CreateWorkflowInvocationRequest], + Union[ + dataform.WorkflowInvocation, + Awaitable[dataform.WorkflowInvocation] + ]]: + raise NotImplementedError() + + @property + def delete_workflow_invocation(self) -> Callable[ + [dataform.DeleteWorkflowInvocationRequest], + Union[ + empty_pb2.Empty, + Awaitable[empty_pb2.Empty] + ]]: + raise NotImplementedError() + + @property + def cancel_workflow_invocation(self) -> Callable[ + [dataform.CancelWorkflowInvocationRequest], + Union[ + empty_pb2.Empty, + Awaitable[empty_pb2.Empty] + ]]: + raise NotImplementedError() + + @property + def query_workflow_invocation_actions(self) -> Callable[ + [dataform.QueryWorkflowInvocationActionsRequest], + Union[ + dataform.QueryWorkflowInvocationActionsResponse, + Awaitable[dataform.QueryWorkflowInvocationActionsResponse] + ]]: + raise NotImplementedError() + + @property + def get_location(self, + ) -> Callable[ + [locations_pb2.GetLocationRequest], + Union[locations_pb2.Location, Awaitable[locations_pb2.Location]], + ]: + raise NotImplementedError() + + @property + def list_locations(self, + ) -> Callable[ + [locations_pb2.ListLocationsRequest], + Union[locations_pb2.ListLocationsResponse, Awaitable[locations_pb2.ListLocationsResponse]], + ]: + raise NotImplementedError() + + @property + def kind(self) -> str: + raise NotImplementedError() + + +__all__ = ( + 'DataformTransport', +) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/grpc.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/grpc.py new file mode 100644 index 0000000..1ca9e02 --- /dev/null +++ b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/grpc.py @@ -0,0 +1,1231 @@ +# -*- coding: utf-8 -*- +# 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. +# +import warnings +from typing import Callable, Dict, Optional, Sequence, Tuple, Union + +from google.api_core import grpc_helpers +from google.api_core import gapic_v1 +import google.auth # type: ignore +from google.auth import credentials as ga_credentials # type: ignore +from google.auth.transport.grpc import SslCredentials # type: ignore + +import grpc # type: ignore + +from google.cloud.dataform_v1beta1.types import dataform +from google.cloud.location import locations_pb2 # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.protobuf import empty_pb2 # type: ignore +from .base import DataformTransport, DEFAULT_CLIENT_INFO + + +class DataformGrpcTransport(DataformTransport): + """gRPC backend transport for Dataform. + + Dataform is a service to develop, create, document, test, and + update curated tables in BigQuery. + + This class defines the same methods as the primary client, so the + primary client can load the underlying transport implementation + and call it. + + It sends protocol buffers over the wire using gRPC (which is built on + top of HTTP/2); the ``grpcio`` package must be installed. + """ + _stubs: Dict[str, Callable] + + def __init__(self, *, + host: str = 'dataform.googleapis.com', + credentials: ga_credentials.Credentials = None, + credentials_file: str = None, + scopes: Sequence[str] = None, + channel: grpc.Channel = None, + api_mtls_endpoint: str = None, + client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, + ssl_channel_credentials: grpc.ChannelCredentials = None, + client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + quota_project_id: Optional[str] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, + ) -> None: + """Instantiate the transport. + + Args: + host (Optional[str]): + The hostname to connect to. + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + This argument is ignored if ``channel`` is provided. + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is ignored if ``channel`` is provided. + scopes (Optional(Sequence[str])): A list of scopes. This argument is + ignored if ``channel`` is provided. + channel (Optional[grpc.Channel]): A ``Channel`` instance through + which to make calls. + api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. + If provided, it overrides the ``host`` argument and tries to create + a mutual TLS channel with client SSL credentials from + ``client_cert_source`` or application default SSL credentials. + client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): + Deprecated. A callback to provide client SSL certificate bytes and + private key bytes, both in PEM format. It is ignored if + ``api_mtls_endpoint`` is None. + ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials + for the grpc channel. It is ignored if ``channel`` is provided. + client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): + A callback to provide client certificate bytes and private key bytes, + both in PEM format. It is used to configure a mutual TLS channel. It is + ignored if ``channel`` or ``ssl_channel_credentials`` is provided. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport + creation failed for any reason. + google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` + and ``credentials_file`` are passed. + """ + self._grpc_channel = None + self._ssl_channel_credentials = ssl_channel_credentials + self._stubs: Dict[str, Callable] = {} + + if api_mtls_endpoint: + warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) + if client_cert_source: + warnings.warn("client_cert_source is deprecated", DeprecationWarning) + + if channel: + # Ignore credentials if a channel was passed. + credentials = False + # If a channel was explicitly provided, set it. + self._grpc_channel = channel + self._ssl_channel_credentials = None + + else: + if api_mtls_endpoint: + host = api_mtls_endpoint + + # Create SSL credentials with client_cert_source or application + # default SSL credentials. + if client_cert_source: + cert, key = client_cert_source() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + else: + self._ssl_channel_credentials = SslCredentials().ssl_credentials + + else: + if client_cert_source_for_mtls and not ssl_channel_credentials: + cert, key = client_cert_source_for_mtls() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + + # The base transport sets the host, credentials and scopes + super().__init__( + host=host, + credentials=credentials, + credentials_file=credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + client_info=client_info, + always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, + ) + + if not self._grpc_channel: + self._grpc_channel = type(self).create_channel( + self._host, + # use the credentials which are saved + credentials=self._credentials, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, + scopes=self._scopes, + ssl_credentials=self._ssl_channel_credentials, + quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + # Wrap messages. This must be done after self._grpc_channel exists + self._prep_wrapped_messages(client_info) + + @classmethod + def create_channel(cls, + host: str = 'dataform.googleapis.com', + credentials: ga_credentials.Credentials = None, + credentials_file: str = None, + scopes: Optional[Sequence[str]] = None, + quota_project_id: Optional[str] = None, + **kwargs) -> grpc.Channel: + """Create and return a gRPC channel object. + Args: + host (Optional[str]): The host for the channel to use. + credentials (Optional[~.Credentials]): The + authorization credentials to attach to requests. These + credentials identify this application to the service. If + none are specified, the client will attempt to ascertain + the credentials from the environment. + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is mutually exclusive with credentials. + scopes (Optional[Sequence[str]]): A optional list of scopes needed for this + service. These are only used when credentials are not specified and + are passed to :func:`google.auth.default`. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + kwargs (Optional[dict]): Keyword arguments, which are passed to the + channel creation. + Returns: + grpc.Channel: A gRPC channel object. + + Raises: + google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` + and ``credentials_file`` are passed. + """ + + return grpc_helpers.create_channel( + host, + credentials=credentials, + credentials_file=credentials_file, + quota_project_id=quota_project_id, + default_scopes=cls.AUTH_SCOPES, + scopes=scopes, + default_host=cls.DEFAULT_HOST, + **kwargs + ) + + @property + def grpc_channel(self) -> grpc.Channel: + """Return the channel designed to connect to this service. + """ + return self._grpc_channel + + @property + def list_repositories(self) -> Callable[ + [dataform.ListRepositoriesRequest], + dataform.ListRepositoriesResponse]: + r"""Return a callable for the list repositories method over gRPC. + + Lists Repositories in a given project and location. + + Returns: + Callable[[~.ListRepositoriesRequest], + ~.ListRepositoriesResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'list_repositories' not in self._stubs: + self._stubs['list_repositories'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/ListRepositories', + request_serializer=dataform.ListRepositoriesRequest.serialize, + response_deserializer=dataform.ListRepositoriesResponse.deserialize, + ) + return self._stubs['list_repositories'] + + @property + def get_repository(self) -> Callable[ + [dataform.GetRepositoryRequest], + dataform.Repository]: + r"""Return a callable for the get repository method over gRPC. + + Fetches a single Repository. + + Returns: + Callable[[~.GetRepositoryRequest], + ~.Repository]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'get_repository' not in self._stubs: + self._stubs['get_repository'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/GetRepository', + request_serializer=dataform.GetRepositoryRequest.serialize, + response_deserializer=dataform.Repository.deserialize, + ) + return self._stubs['get_repository'] + + @property + def create_repository(self) -> Callable[ + [dataform.CreateRepositoryRequest], + dataform.Repository]: + r"""Return a callable for the create repository method over gRPC. + + Creates a new Repository in a given project and + location. + + Returns: + Callable[[~.CreateRepositoryRequest], + ~.Repository]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'create_repository' not in self._stubs: + self._stubs['create_repository'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/CreateRepository', + request_serializer=dataform.CreateRepositoryRequest.serialize, + response_deserializer=dataform.Repository.deserialize, + ) + return self._stubs['create_repository'] + + @property + def update_repository(self) -> Callable[ + [dataform.UpdateRepositoryRequest], + dataform.Repository]: + r"""Return a callable for the update repository method over gRPC. + + Updates a single Repository. + + Returns: + Callable[[~.UpdateRepositoryRequest], + ~.Repository]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'update_repository' not in self._stubs: + self._stubs['update_repository'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/UpdateRepository', + request_serializer=dataform.UpdateRepositoryRequest.serialize, + response_deserializer=dataform.Repository.deserialize, + ) + return self._stubs['update_repository'] + + @property + def delete_repository(self) -> Callable[ + [dataform.DeleteRepositoryRequest], + empty_pb2.Empty]: + r"""Return a callable for the delete repository method over gRPC. + + Deletes a single Repository. + + Returns: + Callable[[~.DeleteRepositoryRequest], + ~.Empty]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'delete_repository' not in self._stubs: + self._stubs['delete_repository'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/DeleteRepository', + request_serializer=dataform.DeleteRepositoryRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['delete_repository'] + + @property + def fetch_remote_branches(self) -> Callable[ + [dataform.FetchRemoteBranchesRequest], + dataform.FetchRemoteBranchesResponse]: + r"""Return a callable for the fetch remote branches method over gRPC. + + Fetches a Repository's remote branches. + + Returns: + Callable[[~.FetchRemoteBranchesRequest], + ~.FetchRemoteBranchesResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'fetch_remote_branches' not in self._stubs: + self._stubs['fetch_remote_branches'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/FetchRemoteBranches', + request_serializer=dataform.FetchRemoteBranchesRequest.serialize, + response_deserializer=dataform.FetchRemoteBranchesResponse.deserialize, + ) + return self._stubs['fetch_remote_branches'] + + @property + def list_workspaces(self) -> Callable[ + [dataform.ListWorkspacesRequest], + dataform.ListWorkspacesResponse]: + r"""Return a callable for the list workspaces method over gRPC. + + Lists Workspaces in a given Repository. + + Returns: + Callable[[~.ListWorkspacesRequest], + ~.ListWorkspacesResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'list_workspaces' not in self._stubs: + self._stubs['list_workspaces'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/ListWorkspaces', + request_serializer=dataform.ListWorkspacesRequest.serialize, + response_deserializer=dataform.ListWorkspacesResponse.deserialize, + ) + return self._stubs['list_workspaces'] + + @property + def get_workspace(self) -> Callable[ + [dataform.GetWorkspaceRequest], + dataform.Workspace]: + r"""Return a callable for the get workspace method over gRPC. + + Fetches a single Workspace. + + Returns: + Callable[[~.GetWorkspaceRequest], + ~.Workspace]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'get_workspace' not in self._stubs: + self._stubs['get_workspace'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/GetWorkspace', + request_serializer=dataform.GetWorkspaceRequest.serialize, + response_deserializer=dataform.Workspace.deserialize, + ) + return self._stubs['get_workspace'] + + @property + def create_workspace(self) -> Callable[ + [dataform.CreateWorkspaceRequest], + dataform.Workspace]: + r"""Return a callable for the create workspace method over gRPC. + + Creates a new Workspace in a given Repository. + + Returns: + Callable[[~.CreateWorkspaceRequest], + ~.Workspace]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'create_workspace' not in self._stubs: + self._stubs['create_workspace'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/CreateWorkspace', + request_serializer=dataform.CreateWorkspaceRequest.serialize, + response_deserializer=dataform.Workspace.deserialize, + ) + return self._stubs['create_workspace'] + + @property + def delete_workspace(self) -> Callable[ + [dataform.DeleteWorkspaceRequest], + empty_pb2.Empty]: + r"""Return a callable for the delete workspace method over gRPC. + + Deletes a single Workspace. + + Returns: + Callable[[~.DeleteWorkspaceRequest], + ~.Empty]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'delete_workspace' not in self._stubs: + self._stubs['delete_workspace'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/DeleteWorkspace', + request_serializer=dataform.DeleteWorkspaceRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['delete_workspace'] + + @property + def install_npm_packages(self) -> Callable[ + [dataform.InstallNpmPackagesRequest], + dataform.InstallNpmPackagesResponse]: + r"""Return a callable for the install npm packages method over gRPC. + + Installs dependency NPM packages (inside a + Workspace). + + Returns: + Callable[[~.InstallNpmPackagesRequest], + ~.InstallNpmPackagesResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'install_npm_packages' not in self._stubs: + self._stubs['install_npm_packages'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/InstallNpmPackages', + request_serializer=dataform.InstallNpmPackagesRequest.serialize, + response_deserializer=dataform.InstallNpmPackagesResponse.deserialize, + ) + return self._stubs['install_npm_packages'] + + @property + def pull_git_commits(self) -> Callable[ + [dataform.PullGitCommitsRequest], + empty_pb2.Empty]: + r"""Return a callable for the pull git commits method over gRPC. + + Pulls Git commits from the Repository's remote into a + Workspace. + + Returns: + Callable[[~.PullGitCommitsRequest], + ~.Empty]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'pull_git_commits' not in self._stubs: + self._stubs['pull_git_commits'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/PullGitCommits', + request_serializer=dataform.PullGitCommitsRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['pull_git_commits'] + + @property + def push_git_commits(self) -> Callable[ + [dataform.PushGitCommitsRequest], + empty_pb2.Empty]: + r"""Return a callable for the push git commits method over gRPC. + + Pushes Git commits from a Workspace to the + Repository's remote. + + Returns: + Callable[[~.PushGitCommitsRequest], + ~.Empty]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'push_git_commits' not in self._stubs: + self._stubs['push_git_commits'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/PushGitCommits', + request_serializer=dataform.PushGitCommitsRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['push_git_commits'] + + @property + def fetch_file_git_statuses(self) -> Callable[ + [dataform.FetchFileGitStatusesRequest], + dataform.FetchFileGitStatusesResponse]: + r"""Return a callable for the fetch file git statuses method over gRPC. + + Fetches Git statuses for the files in a Workspace. + + Returns: + Callable[[~.FetchFileGitStatusesRequest], + ~.FetchFileGitStatusesResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'fetch_file_git_statuses' not in self._stubs: + self._stubs['fetch_file_git_statuses'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/FetchFileGitStatuses', + request_serializer=dataform.FetchFileGitStatusesRequest.serialize, + response_deserializer=dataform.FetchFileGitStatusesResponse.deserialize, + ) + return self._stubs['fetch_file_git_statuses'] + + @property + def fetch_git_ahead_behind(self) -> Callable[ + [dataform.FetchGitAheadBehindRequest], + dataform.FetchGitAheadBehindResponse]: + r"""Return a callable for the fetch git ahead behind method over gRPC. + + Fetches Git ahead/behind against a remote branch. + + Returns: + Callable[[~.FetchGitAheadBehindRequest], + ~.FetchGitAheadBehindResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'fetch_git_ahead_behind' not in self._stubs: + self._stubs['fetch_git_ahead_behind'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/FetchGitAheadBehind', + request_serializer=dataform.FetchGitAheadBehindRequest.serialize, + response_deserializer=dataform.FetchGitAheadBehindResponse.deserialize, + ) + return self._stubs['fetch_git_ahead_behind'] + + @property + def commit_workspace_changes(self) -> Callable[ + [dataform.CommitWorkspaceChangesRequest], + empty_pb2.Empty]: + r"""Return a callable for the commit workspace changes method over gRPC. + + Applies a Git commit for uncommitted files in a + Workspace. + + Returns: + Callable[[~.CommitWorkspaceChangesRequest], + ~.Empty]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'commit_workspace_changes' not in self._stubs: + self._stubs['commit_workspace_changes'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/CommitWorkspaceChanges', + request_serializer=dataform.CommitWorkspaceChangesRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['commit_workspace_changes'] + + @property + def reset_workspace_changes(self) -> Callable[ + [dataform.ResetWorkspaceChangesRequest], + empty_pb2.Empty]: + r"""Return a callable for the reset workspace changes method over gRPC. + + Performs a Git reset for uncommitted files in a + Workspace. + + Returns: + Callable[[~.ResetWorkspaceChangesRequest], + ~.Empty]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'reset_workspace_changes' not in self._stubs: + self._stubs['reset_workspace_changes'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/ResetWorkspaceChanges', + request_serializer=dataform.ResetWorkspaceChangesRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['reset_workspace_changes'] + + @property + def fetch_file_diff(self) -> Callable[ + [dataform.FetchFileDiffRequest], + dataform.FetchFileDiffResponse]: + r"""Return a callable for the fetch file diff method over gRPC. + + Fetches Git diff for an uncommitted file in a + Workspace. + + Returns: + Callable[[~.FetchFileDiffRequest], + ~.FetchFileDiffResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'fetch_file_diff' not in self._stubs: + self._stubs['fetch_file_diff'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/FetchFileDiff', + request_serializer=dataform.FetchFileDiffRequest.serialize, + response_deserializer=dataform.FetchFileDiffResponse.deserialize, + ) + return self._stubs['fetch_file_diff'] + + @property + def query_directory_contents(self) -> Callable[ + [dataform.QueryDirectoryContentsRequest], + dataform.QueryDirectoryContentsResponse]: + r"""Return a callable for the query directory contents method over gRPC. + + Returns the contents of a given Workspace directory. + + Returns: + Callable[[~.QueryDirectoryContentsRequest], + ~.QueryDirectoryContentsResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'query_directory_contents' not in self._stubs: + self._stubs['query_directory_contents'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/QueryDirectoryContents', + request_serializer=dataform.QueryDirectoryContentsRequest.serialize, + response_deserializer=dataform.QueryDirectoryContentsResponse.deserialize, + ) + return self._stubs['query_directory_contents'] + + @property + def make_directory(self) -> Callable[ + [dataform.MakeDirectoryRequest], + dataform.MakeDirectoryResponse]: + r"""Return a callable for the make directory method over gRPC. + + Creates a directory inside a Workspace. + + Returns: + Callable[[~.MakeDirectoryRequest], + ~.MakeDirectoryResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'make_directory' not in self._stubs: + self._stubs['make_directory'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/MakeDirectory', + request_serializer=dataform.MakeDirectoryRequest.serialize, + response_deserializer=dataform.MakeDirectoryResponse.deserialize, + ) + return self._stubs['make_directory'] + + @property + def remove_directory(self) -> Callable[ + [dataform.RemoveDirectoryRequest], + empty_pb2.Empty]: + r"""Return a callable for the remove directory method over gRPC. + + Deletes a directory (inside a Workspace) and all of + its contents. + + Returns: + Callable[[~.RemoveDirectoryRequest], + ~.Empty]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'remove_directory' not in self._stubs: + self._stubs['remove_directory'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/RemoveDirectory', + request_serializer=dataform.RemoveDirectoryRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['remove_directory'] + + @property + def move_directory(self) -> Callable[ + [dataform.MoveDirectoryRequest], + dataform.MoveDirectoryResponse]: + r"""Return a callable for the move directory method over gRPC. + + Moves a directory (inside a Workspace), and all of + its contents, to a new location. + + Returns: + Callable[[~.MoveDirectoryRequest], + ~.MoveDirectoryResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'move_directory' not in self._stubs: + self._stubs['move_directory'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/MoveDirectory', + request_serializer=dataform.MoveDirectoryRequest.serialize, + response_deserializer=dataform.MoveDirectoryResponse.deserialize, + ) + return self._stubs['move_directory'] + + @property + def read_file(self) -> Callable[ + [dataform.ReadFileRequest], + dataform.ReadFileResponse]: + r"""Return a callable for the read file method over gRPC. + + Returns the contents of a file (inside a Workspace). + + Returns: + Callable[[~.ReadFileRequest], + ~.ReadFileResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'read_file' not in self._stubs: + self._stubs['read_file'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/ReadFile', + request_serializer=dataform.ReadFileRequest.serialize, + response_deserializer=dataform.ReadFileResponse.deserialize, + ) + return self._stubs['read_file'] + + @property + def remove_file(self) -> Callable[ + [dataform.RemoveFileRequest], + empty_pb2.Empty]: + r"""Return a callable for the remove file method over gRPC. + + Deletes a file (inside a Workspace). + + Returns: + Callable[[~.RemoveFileRequest], + ~.Empty]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'remove_file' not in self._stubs: + self._stubs['remove_file'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/RemoveFile', + request_serializer=dataform.RemoveFileRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['remove_file'] + + @property + def move_file(self) -> Callable[ + [dataform.MoveFileRequest], + dataform.MoveFileResponse]: + r"""Return a callable for the move file method over gRPC. + + Moves a file (inside a Workspace) to a new location. + + Returns: + Callable[[~.MoveFileRequest], + ~.MoveFileResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'move_file' not in self._stubs: + self._stubs['move_file'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/MoveFile', + request_serializer=dataform.MoveFileRequest.serialize, + response_deserializer=dataform.MoveFileResponse.deserialize, + ) + return self._stubs['move_file'] + + @property + def write_file(self) -> Callable[ + [dataform.WriteFileRequest], + dataform.WriteFileResponse]: + r"""Return a callable for the write file method over gRPC. + + Writes to a file (inside a Workspace). + + Returns: + Callable[[~.WriteFileRequest], + ~.WriteFileResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'write_file' not in self._stubs: + self._stubs['write_file'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/WriteFile', + request_serializer=dataform.WriteFileRequest.serialize, + response_deserializer=dataform.WriteFileResponse.deserialize, + ) + return self._stubs['write_file'] + + @property + def list_compilation_results(self) -> Callable[ + [dataform.ListCompilationResultsRequest], + dataform.ListCompilationResultsResponse]: + r"""Return a callable for the list compilation results method over gRPC. + + Lists CompilationResults in a given Repository. + + Returns: + Callable[[~.ListCompilationResultsRequest], + ~.ListCompilationResultsResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'list_compilation_results' not in self._stubs: + self._stubs['list_compilation_results'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/ListCompilationResults', + request_serializer=dataform.ListCompilationResultsRequest.serialize, + response_deserializer=dataform.ListCompilationResultsResponse.deserialize, + ) + return self._stubs['list_compilation_results'] + + @property + def get_compilation_result(self) -> Callable[ + [dataform.GetCompilationResultRequest], + dataform.CompilationResult]: + r"""Return a callable for the get compilation result method over gRPC. + + Fetches a single CompilationResult. + + Returns: + Callable[[~.GetCompilationResultRequest], + ~.CompilationResult]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'get_compilation_result' not in self._stubs: + self._stubs['get_compilation_result'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/GetCompilationResult', + request_serializer=dataform.GetCompilationResultRequest.serialize, + response_deserializer=dataform.CompilationResult.deserialize, + ) + return self._stubs['get_compilation_result'] + + @property + def create_compilation_result(self) -> Callable[ + [dataform.CreateCompilationResultRequest], + dataform.CompilationResult]: + r"""Return a callable for the create compilation result method over gRPC. + + Creates a new CompilationResult in a given project + and location. + + Returns: + Callable[[~.CreateCompilationResultRequest], + ~.CompilationResult]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'create_compilation_result' not in self._stubs: + self._stubs['create_compilation_result'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/CreateCompilationResult', + request_serializer=dataform.CreateCompilationResultRequest.serialize, + response_deserializer=dataform.CompilationResult.deserialize, + ) + return self._stubs['create_compilation_result'] + + @property + def query_compilation_result_actions(self) -> Callable[ + [dataform.QueryCompilationResultActionsRequest], + dataform.QueryCompilationResultActionsResponse]: + r"""Return a callable for the query compilation result + actions method over gRPC. + + Returns CompilationResultActions in a given + CompilationResult. + + Returns: + Callable[[~.QueryCompilationResultActionsRequest], + ~.QueryCompilationResultActionsResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'query_compilation_result_actions' not in self._stubs: + self._stubs['query_compilation_result_actions'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/QueryCompilationResultActions', + request_serializer=dataform.QueryCompilationResultActionsRequest.serialize, + response_deserializer=dataform.QueryCompilationResultActionsResponse.deserialize, + ) + return self._stubs['query_compilation_result_actions'] + + @property + def list_workflow_invocations(self) -> Callable[ + [dataform.ListWorkflowInvocationsRequest], + dataform.ListWorkflowInvocationsResponse]: + r"""Return a callable for the list workflow invocations method over gRPC. + + Lists WorkflowInvocations in a given Repository. + + Returns: + Callable[[~.ListWorkflowInvocationsRequest], + ~.ListWorkflowInvocationsResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'list_workflow_invocations' not in self._stubs: + self._stubs['list_workflow_invocations'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/ListWorkflowInvocations', + request_serializer=dataform.ListWorkflowInvocationsRequest.serialize, + response_deserializer=dataform.ListWorkflowInvocationsResponse.deserialize, + ) + return self._stubs['list_workflow_invocations'] + + @property + def get_workflow_invocation(self) -> Callable[ + [dataform.GetWorkflowInvocationRequest], + dataform.WorkflowInvocation]: + r"""Return a callable for the get workflow invocation method over gRPC. + + Fetches a single WorkflowInvocation. + + Returns: + Callable[[~.GetWorkflowInvocationRequest], + ~.WorkflowInvocation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'get_workflow_invocation' not in self._stubs: + self._stubs['get_workflow_invocation'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/GetWorkflowInvocation', + request_serializer=dataform.GetWorkflowInvocationRequest.serialize, + response_deserializer=dataform.WorkflowInvocation.deserialize, + ) + return self._stubs['get_workflow_invocation'] + + @property + def create_workflow_invocation(self) -> Callable[ + [dataform.CreateWorkflowInvocationRequest], + dataform.WorkflowInvocation]: + r"""Return a callable for the create workflow invocation method over gRPC. + + Creates a new WorkflowInvocation in a given + Repository. + + Returns: + Callable[[~.CreateWorkflowInvocationRequest], + ~.WorkflowInvocation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'create_workflow_invocation' not in self._stubs: + self._stubs['create_workflow_invocation'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/CreateWorkflowInvocation', + request_serializer=dataform.CreateWorkflowInvocationRequest.serialize, + response_deserializer=dataform.WorkflowInvocation.deserialize, + ) + return self._stubs['create_workflow_invocation'] + + @property + def delete_workflow_invocation(self) -> Callable[ + [dataform.DeleteWorkflowInvocationRequest], + empty_pb2.Empty]: + r"""Return a callable for the delete workflow invocation method over gRPC. + + Deletes a single WorkflowInvocation. + + Returns: + Callable[[~.DeleteWorkflowInvocationRequest], + ~.Empty]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'delete_workflow_invocation' not in self._stubs: + self._stubs['delete_workflow_invocation'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/DeleteWorkflowInvocation', + request_serializer=dataform.DeleteWorkflowInvocationRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['delete_workflow_invocation'] + + @property + def cancel_workflow_invocation(self) -> Callable[ + [dataform.CancelWorkflowInvocationRequest], + empty_pb2.Empty]: + r"""Return a callable for the cancel workflow invocation method over gRPC. + + Requests cancellation of a running + WorkflowInvocation. + + Returns: + Callable[[~.CancelWorkflowInvocationRequest], + ~.Empty]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'cancel_workflow_invocation' not in self._stubs: + self._stubs['cancel_workflow_invocation'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/CancelWorkflowInvocation', + request_serializer=dataform.CancelWorkflowInvocationRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['cancel_workflow_invocation'] + + @property + def query_workflow_invocation_actions(self) -> Callable[ + [dataform.QueryWorkflowInvocationActionsRequest], + dataform.QueryWorkflowInvocationActionsResponse]: + r"""Return a callable for the query workflow invocation + actions method over gRPC. + + Returns WorkflowInvocationActions in a given + WorkflowInvocation. + + Returns: + Callable[[~.QueryWorkflowInvocationActionsRequest], + ~.QueryWorkflowInvocationActionsResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'query_workflow_invocation_actions' not in self._stubs: + self._stubs['query_workflow_invocation_actions'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/QueryWorkflowInvocationActions', + request_serializer=dataform.QueryWorkflowInvocationActionsRequest.serialize, + response_deserializer=dataform.QueryWorkflowInvocationActionsResponse.deserialize, + ) + return self._stubs['query_workflow_invocation_actions'] + + def close(self): + self.grpc_channel.close() + + @property + def list_locations( + self, + ) -> Callable[[locations_pb2.ListLocationsRequest], locations_pb2.ListLocationsResponse]: + r"""Return a callable for the list locations method over gRPC. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "list_locations" not in self._stubs: + self._stubs["list_locations"] = self.grpc_channel.unary_unary( + "/google.cloud.location.Locations/ListLocations", + request_serializer=locations_pb2.ListLocationsRequest.SerializeToString, + response_deserializer=locations_pb2.ListLocationsResponse.FromString, + ) + return self._stubs["list_locations"] + + @property + def get_location( + self, + ) -> Callable[[locations_pb2.GetLocationRequest], locations_pb2.Location]: + r"""Return a callable for the list locations method over gRPC. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "get_location" not in self._stubs: + self._stubs["get_location"] = self.grpc_channel.unary_unary( + "/google.cloud.location.Locations/GetLocation", + request_serializer=locations_pb2.GetLocationRequest.SerializeToString, + response_deserializer=locations_pb2.Location.FromString, + ) + return self._stubs["get_location"] + + @property + def kind(self) -> str: + return "grpc" + + +__all__ = ( + 'DataformGrpcTransport', +) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/grpc_asyncio.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/grpc_asyncio.py new file mode 100644 index 0000000..31672b4 --- /dev/null +++ b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/grpc_asyncio.py @@ -0,0 +1,1230 @@ +# -*- coding: utf-8 -*- +# 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. +# +import warnings +from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union + +from google.api_core import gapic_v1 +from google.api_core import grpc_helpers_async +from google.auth import credentials as ga_credentials # type: ignore +from google.auth.transport.grpc import SslCredentials # type: ignore + +import grpc # type: ignore +from grpc.experimental import aio # type: ignore + +from google.cloud.dataform_v1beta1.types import dataform +from google.cloud.location import locations_pb2 # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.protobuf import empty_pb2 # type: ignore +from .base import DataformTransport, DEFAULT_CLIENT_INFO +from .grpc import DataformGrpcTransport + + +class DataformGrpcAsyncIOTransport(DataformTransport): + """gRPC AsyncIO backend transport for Dataform. + + Dataform is a service to develop, create, document, test, and + update curated tables in BigQuery. + + This class defines the same methods as the primary client, so the + primary client can load the underlying transport implementation + and call it. + + It sends protocol buffers over the wire using gRPC (which is built on + top of HTTP/2); the ``grpcio`` package must be installed. + """ + + _grpc_channel: aio.Channel + _stubs: Dict[str, Callable] = {} + + @classmethod + def create_channel(cls, + host: str = 'dataform.googleapis.com', + credentials: ga_credentials.Credentials = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + quota_project_id: Optional[str] = None, + **kwargs) -> aio.Channel: + """Create and return a gRPC AsyncIO channel object. + Args: + host (Optional[str]): The host for the channel to use. + credentials (Optional[~.Credentials]): The + authorization credentials to attach to requests. These + credentials identify this application to the service. If + none are specified, the client will attempt to ascertain + the credentials from the environment. + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is ignored if ``channel`` is provided. + scopes (Optional[Sequence[str]]): A optional list of scopes needed for this + service. These are only used when credentials are not specified and + are passed to :func:`google.auth.default`. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + kwargs (Optional[dict]): Keyword arguments, which are passed to the + channel creation. + Returns: + aio.Channel: A gRPC AsyncIO channel object. + """ + + return grpc_helpers_async.create_channel( + host, + credentials=credentials, + credentials_file=credentials_file, + quota_project_id=quota_project_id, + default_scopes=cls.AUTH_SCOPES, + scopes=scopes, + default_host=cls.DEFAULT_HOST, + **kwargs + ) + + def __init__(self, *, + host: str = 'dataform.googleapis.com', + credentials: ga_credentials.Credentials = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: aio.Channel = None, + api_mtls_endpoint: str = None, + client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, + ssl_channel_credentials: grpc.ChannelCredentials = None, + client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + quota_project_id=None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, + ) -> None: + """Instantiate the transport. + + Args: + host (Optional[str]): + The hostname to connect to. + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + This argument is ignored if ``channel`` is provided. + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is ignored if ``channel`` is provided. + scopes (Optional[Sequence[str]]): A optional list of scopes needed for this + service. These are only used when credentials are not specified and + are passed to :func:`google.auth.default`. + channel (Optional[aio.Channel]): A ``Channel`` instance through + which to make calls. + api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. + If provided, it overrides the ``host`` argument and tries to create + a mutual TLS channel with client SSL credentials from + ``client_cert_source`` or application default SSL credentials. + client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): + Deprecated. A callback to provide client SSL certificate bytes and + private key bytes, both in PEM format. It is ignored if + ``api_mtls_endpoint`` is None. + ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials + for the grpc channel. It is ignored if ``channel`` is provided. + client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): + A callback to provide client certificate bytes and private key bytes, + both in PEM format. It is used to configure a mutual TLS channel. It is + ignored if ``channel`` or ``ssl_channel_credentials`` is provided. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + + Raises: + google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport + creation failed for any reason. + google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` + and ``credentials_file`` are passed. + """ + self._grpc_channel = None + self._ssl_channel_credentials = ssl_channel_credentials + self._stubs: Dict[str, Callable] = {} + + if api_mtls_endpoint: + warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) + if client_cert_source: + warnings.warn("client_cert_source is deprecated", DeprecationWarning) + + if channel: + # Ignore credentials if a channel was passed. + credentials = False + # If a channel was explicitly provided, set it. + self._grpc_channel = channel + self._ssl_channel_credentials = None + else: + if api_mtls_endpoint: + host = api_mtls_endpoint + + # Create SSL credentials with client_cert_source or application + # default SSL credentials. + if client_cert_source: + cert, key = client_cert_source() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + else: + self._ssl_channel_credentials = SslCredentials().ssl_credentials + + else: + if client_cert_source_for_mtls and not ssl_channel_credentials: + cert, key = client_cert_source_for_mtls() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + + # The base transport sets the host, credentials and scopes + super().__init__( + host=host, + credentials=credentials, + credentials_file=credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + client_info=client_info, + always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, + ) + + if not self._grpc_channel: + self._grpc_channel = type(self).create_channel( + self._host, + # use the credentials which are saved + credentials=self._credentials, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, + scopes=self._scopes, + ssl_credentials=self._ssl_channel_credentials, + quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + # Wrap messages. This must be done after self._grpc_channel exists + self._prep_wrapped_messages(client_info) + + @property + def grpc_channel(self) -> aio.Channel: + """Create the channel designed to connect to this service. + + This property caches on the instance; repeated calls return + the same channel. + """ + # Return the channel from cache. + return self._grpc_channel + + @property + def list_repositories(self) -> Callable[ + [dataform.ListRepositoriesRequest], + Awaitable[dataform.ListRepositoriesResponse]]: + r"""Return a callable for the list repositories method over gRPC. + + Lists Repositories in a given project and location. + + Returns: + Callable[[~.ListRepositoriesRequest], + Awaitable[~.ListRepositoriesResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'list_repositories' not in self._stubs: + self._stubs['list_repositories'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/ListRepositories', + request_serializer=dataform.ListRepositoriesRequest.serialize, + response_deserializer=dataform.ListRepositoriesResponse.deserialize, + ) + return self._stubs['list_repositories'] + + @property + def get_repository(self) -> Callable[ + [dataform.GetRepositoryRequest], + Awaitable[dataform.Repository]]: + r"""Return a callable for the get repository method over gRPC. + + Fetches a single Repository. + + Returns: + Callable[[~.GetRepositoryRequest], + Awaitable[~.Repository]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'get_repository' not in self._stubs: + self._stubs['get_repository'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/GetRepository', + request_serializer=dataform.GetRepositoryRequest.serialize, + response_deserializer=dataform.Repository.deserialize, + ) + return self._stubs['get_repository'] + + @property + def create_repository(self) -> Callable[ + [dataform.CreateRepositoryRequest], + Awaitable[dataform.Repository]]: + r"""Return a callable for the create repository method over gRPC. + + Creates a new Repository in a given project and + location. + + Returns: + Callable[[~.CreateRepositoryRequest], + Awaitable[~.Repository]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'create_repository' not in self._stubs: + self._stubs['create_repository'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/CreateRepository', + request_serializer=dataform.CreateRepositoryRequest.serialize, + response_deserializer=dataform.Repository.deserialize, + ) + return self._stubs['create_repository'] + + @property + def update_repository(self) -> Callable[ + [dataform.UpdateRepositoryRequest], + Awaitable[dataform.Repository]]: + r"""Return a callable for the update repository method over gRPC. + + Updates a single Repository. + + Returns: + Callable[[~.UpdateRepositoryRequest], + Awaitable[~.Repository]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'update_repository' not in self._stubs: + self._stubs['update_repository'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/UpdateRepository', + request_serializer=dataform.UpdateRepositoryRequest.serialize, + response_deserializer=dataform.Repository.deserialize, + ) + return self._stubs['update_repository'] + + @property + def delete_repository(self) -> Callable[ + [dataform.DeleteRepositoryRequest], + Awaitable[empty_pb2.Empty]]: + r"""Return a callable for the delete repository method over gRPC. + + Deletes a single Repository. + + Returns: + Callable[[~.DeleteRepositoryRequest], + Awaitable[~.Empty]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'delete_repository' not in self._stubs: + self._stubs['delete_repository'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/DeleteRepository', + request_serializer=dataform.DeleteRepositoryRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['delete_repository'] + + @property + def fetch_remote_branches(self) -> Callable[ + [dataform.FetchRemoteBranchesRequest], + Awaitable[dataform.FetchRemoteBranchesResponse]]: + r"""Return a callable for the fetch remote branches method over gRPC. + + Fetches a Repository's remote branches. + + Returns: + Callable[[~.FetchRemoteBranchesRequest], + Awaitable[~.FetchRemoteBranchesResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'fetch_remote_branches' not in self._stubs: + self._stubs['fetch_remote_branches'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/FetchRemoteBranches', + request_serializer=dataform.FetchRemoteBranchesRequest.serialize, + response_deserializer=dataform.FetchRemoteBranchesResponse.deserialize, + ) + return self._stubs['fetch_remote_branches'] + + @property + def list_workspaces(self) -> Callable[ + [dataform.ListWorkspacesRequest], + Awaitable[dataform.ListWorkspacesResponse]]: + r"""Return a callable for the list workspaces method over gRPC. + + Lists Workspaces in a given Repository. + + Returns: + Callable[[~.ListWorkspacesRequest], + Awaitable[~.ListWorkspacesResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'list_workspaces' not in self._stubs: + self._stubs['list_workspaces'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/ListWorkspaces', + request_serializer=dataform.ListWorkspacesRequest.serialize, + response_deserializer=dataform.ListWorkspacesResponse.deserialize, + ) + return self._stubs['list_workspaces'] + + @property + def get_workspace(self) -> Callable[ + [dataform.GetWorkspaceRequest], + Awaitable[dataform.Workspace]]: + r"""Return a callable for the get workspace method over gRPC. + + Fetches a single Workspace. + + Returns: + Callable[[~.GetWorkspaceRequest], + Awaitable[~.Workspace]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'get_workspace' not in self._stubs: + self._stubs['get_workspace'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/GetWorkspace', + request_serializer=dataform.GetWorkspaceRequest.serialize, + response_deserializer=dataform.Workspace.deserialize, + ) + return self._stubs['get_workspace'] + + @property + def create_workspace(self) -> Callable[ + [dataform.CreateWorkspaceRequest], + Awaitable[dataform.Workspace]]: + r"""Return a callable for the create workspace method over gRPC. + + Creates a new Workspace in a given Repository. + + Returns: + Callable[[~.CreateWorkspaceRequest], + Awaitable[~.Workspace]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'create_workspace' not in self._stubs: + self._stubs['create_workspace'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/CreateWorkspace', + request_serializer=dataform.CreateWorkspaceRequest.serialize, + response_deserializer=dataform.Workspace.deserialize, + ) + return self._stubs['create_workspace'] + + @property + def delete_workspace(self) -> Callable[ + [dataform.DeleteWorkspaceRequest], + Awaitable[empty_pb2.Empty]]: + r"""Return a callable for the delete workspace method over gRPC. + + Deletes a single Workspace. + + Returns: + Callable[[~.DeleteWorkspaceRequest], + Awaitable[~.Empty]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'delete_workspace' not in self._stubs: + self._stubs['delete_workspace'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/DeleteWorkspace', + request_serializer=dataform.DeleteWorkspaceRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['delete_workspace'] + + @property + def install_npm_packages(self) -> Callable[ + [dataform.InstallNpmPackagesRequest], + Awaitable[dataform.InstallNpmPackagesResponse]]: + r"""Return a callable for the install npm packages method over gRPC. + + Installs dependency NPM packages (inside a + Workspace). + + Returns: + Callable[[~.InstallNpmPackagesRequest], + Awaitable[~.InstallNpmPackagesResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'install_npm_packages' not in self._stubs: + self._stubs['install_npm_packages'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/InstallNpmPackages', + request_serializer=dataform.InstallNpmPackagesRequest.serialize, + response_deserializer=dataform.InstallNpmPackagesResponse.deserialize, + ) + return self._stubs['install_npm_packages'] + + @property + def pull_git_commits(self) -> Callable[ + [dataform.PullGitCommitsRequest], + Awaitable[empty_pb2.Empty]]: + r"""Return a callable for the pull git commits method over gRPC. + + Pulls Git commits from the Repository's remote into a + Workspace. + + Returns: + Callable[[~.PullGitCommitsRequest], + Awaitable[~.Empty]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'pull_git_commits' not in self._stubs: + self._stubs['pull_git_commits'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/PullGitCommits', + request_serializer=dataform.PullGitCommitsRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['pull_git_commits'] + + @property + def push_git_commits(self) -> Callable[ + [dataform.PushGitCommitsRequest], + Awaitable[empty_pb2.Empty]]: + r"""Return a callable for the push git commits method over gRPC. + + Pushes Git commits from a Workspace to the + Repository's remote. + + Returns: + Callable[[~.PushGitCommitsRequest], + Awaitable[~.Empty]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'push_git_commits' not in self._stubs: + self._stubs['push_git_commits'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/PushGitCommits', + request_serializer=dataform.PushGitCommitsRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['push_git_commits'] + + @property + def fetch_file_git_statuses(self) -> Callable[ + [dataform.FetchFileGitStatusesRequest], + Awaitable[dataform.FetchFileGitStatusesResponse]]: + r"""Return a callable for the fetch file git statuses method over gRPC. + + Fetches Git statuses for the files in a Workspace. + + Returns: + Callable[[~.FetchFileGitStatusesRequest], + Awaitable[~.FetchFileGitStatusesResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'fetch_file_git_statuses' not in self._stubs: + self._stubs['fetch_file_git_statuses'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/FetchFileGitStatuses', + request_serializer=dataform.FetchFileGitStatusesRequest.serialize, + response_deserializer=dataform.FetchFileGitStatusesResponse.deserialize, + ) + return self._stubs['fetch_file_git_statuses'] + + @property + def fetch_git_ahead_behind(self) -> Callable[ + [dataform.FetchGitAheadBehindRequest], + Awaitable[dataform.FetchGitAheadBehindResponse]]: + r"""Return a callable for the fetch git ahead behind method over gRPC. + + Fetches Git ahead/behind against a remote branch. + + Returns: + Callable[[~.FetchGitAheadBehindRequest], + Awaitable[~.FetchGitAheadBehindResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'fetch_git_ahead_behind' not in self._stubs: + self._stubs['fetch_git_ahead_behind'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/FetchGitAheadBehind', + request_serializer=dataform.FetchGitAheadBehindRequest.serialize, + response_deserializer=dataform.FetchGitAheadBehindResponse.deserialize, + ) + return self._stubs['fetch_git_ahead_behind'] + + @property + def commit_workspace_changes(self) -> Callable[ + [dataform.CommitWorkspaceChangesRequest], + Awaitable[empty_pb2.Empty]]: + r"""Return a callable for the commit workspace changes method over gRPC. + + Applies a Git commit for uncommitted files in a + Workspace. + + Returns: + Callable[[~.CommitWorkspaceChangesRequest], + Awaitable[~.Empty]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'commit_workspace_changes' not in self._stubs: + self._stubs['commit_workspace_changes'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/CommitWorkspaceChanges', + request_serializer=dataform.CommitWorkspaceChangesRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['commit_workspace_changes'] + + @property + def reset_workspace_changes(self) -> Callable[ + [dataform.ResetWorkspaceChangesRequest], + Awaitable[empty_pb2.Empty]]: + r"""Return a callable for the reset workspace changes method over gRPC. + + Performs a Git reset for uncommitted files in a + Workspace. + + Returns: + Callable[[~.ResetWorkspaceChangesRequest], + Awaitable[~.Empty]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'reset_workspace_changes' not in self._stubs: + self._stubs['reset_workspace_changes'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/ResetWorkspaceChanges', + request_serializer=dataform.ResetWorkspaceChangesRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['reset_workspace_changes'] + + @property + def fetch_file_diff(self) -> Callable[ + [dataform.FetchFileDiffRequest], + Awaitable[dataform.FetchFileDiffResponse]]: + r"""Return a callable for the fetch file diff method over gRPC. + + Fetches Git diff for an uncommitted file in a + Workspace. + + Returns: + Callable[[~.FetchFileDiffRequest], + Awaitable[~.FetchFileDiffResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'fetch_file_diff' not in self._stubs: + self._stubs['fetch_file_diff'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/FetchFileDiff', + request_serializer=dataform.FetchFileDiffRequest.serialize, + response_deserializer=dataform.FetchFileDiffResponse.deserialize, + ) + return self._stubs['fetch_file_diff'] + + @property + def query_directory_contents(self) -> Callable[ + [dataform.QueryDirectoryContentsRequest], + Awaitable[dataform.QueryDirectoryContentsResponse]]: + r"""Return a callable for the query directory contents method over gRPC. + + Returns the contents of a given Workspace directory. + + Returns: + Callable[[~.QueryDirectoryContentsRequest], + Awaitable[~.QueryDirectoryContentsResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'query_directory_contents' not in self._stubs: + self._stubs['query_directory_contents'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/QueryDirectoryContents', + request_serializer=dataform.QueryDirectoryContentsRequest.serialize, + response_deserializer=dataform.QueryDirectoryContentsResponse.deserialize, + ) + return self._stubs['query_directory_contents'] + + @property + def make_directory(self) -> Callable[ + [dataform.MakeDirectoryRequest], + Awaitable[dataform.MakeDirectoryResponse]]: + r"""Return a callable for the make directory method over gRPC. + + Creates a directory inside a Workspace. + + Returns: + Callable[[~.MakeDirectoryRequest], + Awaitable[~.MakeDirectoryResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'make_directory' not in self._stubs: + self._stubs['make_directory'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/MakeDirectory', + request_serializer=dataform.MakeDirectoryRequest.serialize, + response_deserializer=dataform.MakeDirectoryResponse.deserialize, + ) + return self._stubs['make_directory'] + + @property + def remove_directory(self) -> Callable[ + [dataform.RemoveDirectoryRequest], + Awaitable[empty_pb2.Empty]]: + r"""Return a callable for the remove directory method over gRPC. + + Deletes a directory (inside a Workspace) and all of + its contents. + + Returns: + Callable[[~.RemoveDirectoryRequest], + Awaitable[~.Empty]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'remove_directory' not in self._stubs: + self._stubs['remove_directory'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/RemoveDirectory', + request_serializer=dataform.RemoveDirectoryRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['remove_directory'] + + @property + def move_directory(self) -> Callable[ + [dataform.MoveDirectoryRequest], + Awaitable[dataform.MoveDirectoryResponse]]: + r"""Return a callable for the move directory method over gRPC. + + Moves a directory (inside a Workspace), and all of + its contents, to a new location. + + Returns: + Callable[[~.MoveDirectoryRequest], + Awaitable[~.MoveDirectoryResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'move_directory' not in self._stubs: + self._stubs['move_directory'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/MoveDirectory', + request_serializer=dataform.MoveDirectoryRequest.serialize, + response_deserializer=dataform.MoveDirectoryResponse.deserialize, + ) + return self._stubs['move_directory'] + + @property + def read_file(self) -> Callable[ + [dataform.ReadFileRequest], + Awaitable[dataform.ReadFileResponse]]: + r"""Return a callable for the read file method over gRPC. + + Returns the contents of a file (inside a Workspace). + + Returns: + Callable[[~.ReadFileRequest], + Awaitable[~.ReadFileResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'read_file' not in self._stubs: + self._stubs['read_file'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/ReadFile', + request_serializer=dataform.ReadFileRequest.serialize, + response_deserializer=dataform.ReadFileResponse.deserialize, + ) + return self._stubs['read_file'] + + @property + def remove_file(self) -> Callable[ + [dataform.RemoveFileRequest], + Awaitable[empty_pb2.Empty]]: + r"""Return a callable for the remove file method over gRPC. + + Deletes a file (inside a Workspace). + + Returns: + Callable[[~.RemoveFileRequest], + Awaitable[~.Empty]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'remove_file' not in self._stubs: + self._stubs['remove_file'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/RemoveFile', + request_serializer=dataform.RemoveFileRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['remove_file'] + + @property + def move_file(self) -> Callable[ + [dataform.MoveFileRequest], + Awaitable[dataform.MoveFileResponse]]: + r"""Return a callable for the move file method over gRPC. + + Moves a file (inside a Workspace) to a new location. + + Returns: + Callable[[~.MoveFileRequest], + Awaitable[~.MoveFileResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'move_file' not in self._stubs: + self._stubs['move_file'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/MoveFile', + request_serializer=dataform.MoveFileRequest.serialize, + response_deserializer=dataform.MoveFileResponse.deserialize, + ) + return self._stubs['move_file'] + + @property + def write_file(self) -> Callable[ + [dataform.WriteFileRequest], + Awaitable[dataform.WriteFileResponse]]: + r"""Return a callable for the write file method over gRPC. + + Writes to a file (inside a Workspace). + + Returns: + Callable[[~.WriteFileRequest], + Awaitable[~.WriteFileResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'write_file' not in self._stubs: + self._stubs['write_file'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/WriteFile', + request_serializer=dataform.WriteFileRequest.serialize, + response_deserializer=dataform.WriteFileResponse.deserialize, + ) + return self._stubs['write_file'] + + @property + def list_compilation_results(self) -> Callable[ + [dataform.ListCompilationResultsRequest], + Awaitable[dataform.ListCompilationResultsResponse]]: + r"""Return a callable for the list compilation results method over gRPC. + + Lists CompilationResults in a given Repository. + + Returns: + Callable[[~.ListCompilationResultsRequest], + Awaitable[~.ListCompilationResultsResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'list_compilation_results' not in self._stubs: + self._stubs['list_compilation_results'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/ListCompilationResults', + request_serializer=dataform.ListCompilationResultsRequest.serialize, + response_deserializer=dataform.ListCompilationResultsResponse.deserialize, + ) + return self._stubs['list_compilation_results'] + + @property + def get_compilation_result(self) -> Callable[ + [dataform.GetCompilationResultRequest], + Awaitable[dataform.CompilationResult]]: + r"""Return a callable for the get compilation result method over gRPC. + + Fetches a single CompilationResult. + + Returns: + Callable[[~.GetCompilationResultRequest], + Awaitable[~.CompilationResult]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'get_compilation_result' not in self._stubs: + self._stubs['get_compilation_result'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/GetCompilationResult', + request_serializer=dataform.GetCompilationResultRequest.serialize, + response_deserializer=dataform.CompilationResult.deserialize, + ) + return self._stubs['get_compilation_result'] + + @property + def create_compilation_result(self) -> Callable[ + [dataform.CreateCompilationResultRequest], + Awaitable[dataform.CompilationResult]]: + r"""Return a callable for the create compilation result method over gRPC. + + Creates a new CompilationResult in a given project + and location. + + Returns: + Callable[[~.CreateCompilationResultRequest], + Awaitable[~.CompilationResult]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'create_compilation_result' not in self._stubs: + self._stubs['create_compilation_result'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/CreateCompilationResult', + request_serializer=dataform.CreateCompilationResultRequest.serialize, + response_deserializer=dataform.CompilationResult.deserialize, + ) + return self._stubs['create_compilation_result'] + + @property + def query_compilation_result_actions(self) -> Callable[ + [dataform.QueryCompilationResultActionsRequest], + Awaitable[dataform.QueryCompilationResultActionsResponse]]: + r"""Return a callable for the query compilation result + actions method over gRPC. + + Returns CompilationResultActions in a given + CompilationResult. + + Returns: + Callable[[~.QueryCompilationResultActionsRequest], + Awaitable[~.QueryCompilationResultActionsResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'query_compilation_result_actions' not in self._stubs: + self._stubs['query_compilation_result_actions'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/QueryCompilationResultActions', + request_serializer=dataform.QueryCompilationResultActionsRequest.serialize, + response_deserializer=dataform.QueryCompilationResultActionsResponse.deserialize, + ) + return self._stubs['query_compilation_result_actions'] + + @property + def list_workflow_invocations(self) -> Callable[ + [dataform.ListWorkflowInvocationsRequest], + Awaitable[dataform.ListWorkflowInvocationsResponse]]: + r"""Return a callable for the list workflow invocations method over gRPC. + + Lists WorkflowInvocations in a given Repository. + + Returns: + Callable[[~.ListWorkflowInvocationsRequest], + Awaitable[~.ListWorkflowInvocationsResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'list_workflow_invocations' not in self._stubs: + self._stubs['list_workflow_invocations'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/ListWorkflowInvocations', + request_serializer=dataform.ListWorkflowInvocationsRequest.serialize, + response_deserializer=dataform.ListWorkflowInvocationsResponse.deserialize, + ) + return self._stubs['list_workflow_invocations'] + + @property + def get_workflow_invocation(self) -> Callable[ + [dataform.GetWorkflowInvocationRequest], + Awaitable[dataform.WorkflowInvocation]]: + r"""Return a callable for the get workflow invocation method over gRPC. + + Fetches a single WorkflowInvocation. + + Returns: + Callable[[~.GetWorkflowInvocationRequest], + Awaitable[~.WorkflowInvocation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'get_workflow_invocation' not in self._stubs: + self._stubs['get_workflow_invocation'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/GetWorkflowInvocation', + request_serializer=dataform.GetWorkflowInvocationRequest.serialize, + response_deserializer=dataform.WorkflowInvocation.deserialize, + ) + return self._stubs['get_workflow_invocation'] + + @property + def create_workflow_invocation(self) -> Callable[ + [dataform.CreateWorkflowInvocationRequest], + Awaitable[dataform.WorkflowInvocation]]: + r"""Return a callable for the create workflow invocation method over gRPC. + + Creates a new WorkflowInvocation in a given + Repository. + + Returns: + Callable[[~.CreateWorkflowInvocationRequest], + Awaitable[~.WorkflowInvocation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'create_workflow_invocation' not in self._stubs: + self._stubs['create_workflow_invocation'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/CreateWorkflowInvocation', + request_serializer=dataform.CreateWorkflowInvocationRequest.serialize, + response_deserializer=dataform.WorkflowInvocation.deserialize, + ) + return self._stubs['create_workflow_invocation'] + + @property + def delete_workflow_invocation(self) -> Callable[ + [dataform.DeleteWorkflowInvocationRequest], + Awaitable[empty_pb2.Empty]]: + r"""Return a callable for the delete workflow invocation method over gRPC. + + Deletes a single WorkflowInvocation. + + Returns: + Callable[[~.DeleteWorkflowInvocationRequest], + Awaitable[~.Empty]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'delete_workflow_invocation' not in self._stubs: + self._stubs['delete_workflow_invocation'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/DeleteWorkflowInvocation', + request_serializer=dataform.DeleteWorkflowInvocationRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['delete_workflow_invocation'] + + @property + def cancel_workflow_invocation(self) -> Callable[ + [dataform.CancelWorkflowInvocationRequest], + Awaitable[empty_pb2.Empty]]: + r"""Return a callable for the cancel workflow invocation method over gRPC. + + Requests cancellation of a running + WorkflowInvocation. + + Returns: + Callable[[~.CancelWorkflowInvocationRequest], + Awaitable[~.Empty]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'cancel_workflow_invocation' not in self._stubs: + self._stubs['cancel_workflow_invocation'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/CancelWorkflowInvocation', + request_serializer=dataform.CancelWorkflowInvocationRequest.serialize, + response_deserializer=empty_pb2.Empty.FromString, + ) + return self._stubs['cancel_workflow_invocation'] + + @property + def query_workflow_invocation_actions(self) -> Callable[ + [dataform.QueryWorkflowInvocationActionsRequest], + Awaitable[dataform.QueryWorkflowInvocationActionsResponse]]: + r"""Return a callable for the query workflow invocation + actions method over gRPC. + + Returns WorkflowInvocationActions in a given + WorkflowInvocation. + + Returns: + Callable[[~.QueryWorkflowInvocationActionsRequest], + Awaitable[~.QueryWorkflowInvocationActionsResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if 'query_workflow_invocation_actions' not in self._stubs: + self._stubs['query_workflow_invocation_actions'] = self.grpc_channel.unary_unary( + '/google.cloud.dataform.v1beta1.Dataform/QueryWorkflowInvocationActions', + request_serializer=dataform.QueryWorkflowInvocationActionsRequest.serialize, + response_deserializer=dataform.QueryWorkflowInvocationActionsResponse.deserialize, + ) + return self._stubs['query_workflow_invocation_actions'] + + def close(self): + return self.grpc_channel.close() + + @property + def list_locations( + self, + ) -> Callable[[locations_pb2.ListLocationsRequest], locations_pb2.ListLocationsResponse]: + r"""Return a callable for the list locations method over gRPC. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "list_locations" not in self._stubs: + self._stubs["list_locations"] = self.grpc_channel.unary_unary( + "/google.cloud.location.Locations/ListLocations", + request_serializer=locations_pb2.ListLocationsRequest.SerializeToString, + response_deserializer=locations_pb2.ListLocationsResponse.FromString, + ) + return self._stubs["list_locations"] + + @property + def get_location( + self, + ) -> Callable[[locations_pb2.GetLocationRequest], locations_pb2.Location]: + r"""Return a callable for the list locations method over gRPC. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "get_location" not in self._stubs: + self._stubs["get_location"] = self.grpc_channel.unary_unary( + "/google.cloud.location.Locations/GetLocation", + request_serializer=locations_pb2.GetLocationRequest.SerializeToString, + response_deserializer=locations_pb2.Location.FromString, + ) + return self._stubs["get_location"] + + +__all__ = ( + 'DataformGrpcAsyncIOTransport', +) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/types/__init__.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/types/__init__.py new file mode 100644 index 0000000..37a0679 --- /dev/null +++ b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/types/__init__.py @@ -0,0 +1,144 @@ +# -*- coding: utf-8 -*- +# 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. +# +from .dataform import ( + CancelWorkflowInvocationRequest, + CommitAuthor, + CommitWorkspaceChangesRequest, + CompilationResult, + CompilationResultAction, + CreateCompilationResultRequest, + CreateRepositoryRequest, + CreateWorkflowInvocationRequest, + CreateWorkspaceRequest, + DeleteRepositoryRequest, + DeleteWorkflowInvocationRequest, + DeleteWorkspaceRequest, + FetchFileDiffRequest, + FetchFileDiffResponse, + FetchFileGitStatusesRequest, + FetchFileGitStatusesResponse, + FetchGitAheadBehindRequest, + FetchGitAheadBehindResponse, + FetchRemoteBranchesRequest, + FetchRemoteBranchesResponse, + GetCompilationResultRequest, + GetRepositoryRequest, + GetWorkflowInvocationRequest, + GetWorkspaceRequest, + InstallNpmPackagesRequest, + InstallNpmPackagesResponse, + ListCompilationResultsRequest, + ListCompilationResultsResponse, + ListRepositoriesRequest, + ListRepositoriesResponse, + ListWorkflowInvocationsRequest, + ListWorkflowInvocationsResponse, + ListWorkspacesRequest, + ListWorkspacesResponse, + MakeDirectoryRequest, + MakeDirectoryResponse, + MoveDirectoryRequest, + MoveDirectoryResponse, + MoveFileRequest, + MoveFileResponse, + PullGitCommitsRequest, + PushGitCommitsRequest, + QueryCompilationResultActionsRequest, + QueryCompilationResultActionsResponse, + QueryDirectoryContentsRequest, + QueryDirectoryContentsResponse, + QueryWorkflowInvocationActionsRequest, + QueryWorkflowInvocationActionsResponse, + ReadFileRequest, + ReadFileResponse, + RelationDescriptor, + RemoveDirectoryRequest, + RemoveFileRequest, + Repository, + ResetWorkspaceChangesRequest, + Target, + UpdateRepositoryRequest, + WorkflowInvocation, + WorkflowInvocationAction, + Workspace, + WriteFileRequest, + WriteFileResponse, +) + +__all__ = ( + 'CancelWorkflowInvocationRequest', + 'CommitAuthor', + 'CommitWorkspaceChangesRequest', + 'CompilationResult', + 'CompilationResultAction', + 'CreateCompilationResultRequest', + 'CreateRepositoryRequest', + 'CreateWorkflowInvocationRequest', + 'CreateWorkspaceRequest', + 'DeleteRepositoryRequest', + 'DeleteWorkflowInvocationRequest', + 'DeleteWorkspaceRequest', + 'FetchFileDiffRequest', + 'FetchFileDiffResponse', + 'FetchFileGitStatusesRequest', + 'FetchFileGitStatusesResponse', + 'FetchGitAheadBehindRequest', + 'FetchGitAheadBehindResponse', + 'FetchRemoteBranchesRequest', + 'FetchRemoteBranchesResponse', + 'GetCompilationResultRequest', + 'GetRepositoryRequest', + 'GetWorkflowInvocationRequest', + 'GetWorkspaceRequest', + 'InstallNpmPackagesRequest', + 'InstallNpmPackagesResponse', + 'ListCompilationResultsRequest', + 'ListCompilationResultsResponse', + 'ListRepositoriesRequest', + 'ListRepositoriesResponse', + 'ListWorkflowInvocationsRequest', + 'ListWorkflowInvocationsResponse', + 'ListWorkspacesRequest', + 'ListWorkspacesResponse', + 'MakeDirectoryRequest', + 'MakeDirectoryResponse', + 'MoveDirectoryRequest', + 'MoveDirectoryResponse', + 'MoveFileRequest', + 'MoveFileResponse', + 'PullGitCommitsRequest', + 'PushGitCommitsRequest', + 'QueryCompilationResultActionsRequest', + 'QueryCompilationResultActionsResponse', + 'QueryDirectoryContentsRequest', + 'QueryDirectoryContentsResponse', + 'QueryWorkflowInvocationActionsRequest', + 'QueryWorkflowInvocationActionsResponse', + 'ReadFileRequest', + 'ReadFileResponse', + 'RelationDescriptor', + 'RemoveDirectoryRequest', + 'RemoveFileRequest', + 'Repository', + 'ResetWorkspaceChangesRequest', + 'Target', + 'UpdateRepositoryRequest', + 'WorkflowInvocation', + 'WorkflowInvocationAction', + 'Workspace', + 'WriteFileRequest', + 'WriteFileResponse', +) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/types/dataform.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/types/dataform.py new file mode 100644 index 0000000..85a8311 --- /dev/null +++ b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/types/dataform.py @@ -0,0 +1,2309 @@ +# -*- coding: utf-8 -*- +# 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. +# +import proto # type: ignore + +from google.protobuf import field_mask_pb2 # type: ignore +from google.type import interval_pb2 # type: ignore + + +__protobuf__ = proto.module( + package='google.cloud.dataform.v1beta1', + manifest={ + 'Repository', + 'ListRepositoriesRequest', + 'ListRepositoriesResponse', + 'GetRepositoryRequest', + 'CreateRepositoryRequest', + 'UpdateRepositoryRequest', + 'DeleteRepositoryRequest', + 'FetchRemoteBranchesRequest', + 'FetchRemoteBranchesResponse', + 'Workspace', + 'ListWorkspacesRequest', + 'ListWorkspacesResponse', + 'GetWorkspaceRequest', + 'CreateWorkspaceRequest', + 'DeleteWorkspaceRequest', + 'CommitAuthor', + 'PullGitCommitsRequest', + 'PushGitCommitsRequest', + 'FetchFileGitStatusesRequest', + 'FetchFileGitStatusesResponse', + 'FetchGitAheadBehindRequest', + 'FetchGitAheadBehindResponse', + 'CommitWorkspaceChangesRequest', + 'ResetWorkspaceChangesRequest', + 'FetchFileDiffRequest', + 'FetchFileDiffResponse', + 'QueryDirectoryContentsRequest', + 'QueryDirectoryContentsResponse', + 'MakeDirectoryRequest', + 'MakeDirectoryResponse', + 'RemoveDirectoryRequest', + 'MoveDirectoryRequest', + 'MoveDirectoryResponse', + 'ReadFileRequest', + 'ReadFileResponse', + 'RemoveFileRequest', + 'MoveFileRequest', + 'MoveFileResponse', + 'WriteFileRequest', + 'WriteFileResponse', + 'InstallNpmPackagesRequest', + 'InstallNpmPackagesResponse', + 'CompilationResult', + 'ListCompilationResultsRequest', + 'ListCompilationResultsResponse', + 'GetCompilationResultRequest', + 'CreateCompilationResultRequest', + 'Target', + 'RelationDescriptor', + 'CompilationResultAction', + 'QueryCompilationResultActionsRequest', + 'QueryCompilationResultActionsResponse', + 'WorkflowInvocation', + 'ListWorkflowInvocationsRequest', + 'ListWorkflowInvocationsResponse', + 'GetWorkflowInvocationRequest', + 'CreateWorkflowInvocationRequest', + 'DeleteWorkflowInvocationRequest', + 'CancelWorkflowInvocationRequest', + 'WorkflowInvocationAction', + 'QueryWorkflowInvocationActionsRequest', + 'QueryWorkflowInvocationActionsResponse', + }, +) + + +class Repository(proto.Message): + r"""Represents a Dataform Git repository. + + Attributes: + name (str): + Output only. The repository's name. + git_remote_settings (google.cloud.dataform_v1beta1.types.Repository.GitRemoteSettings): + Optional. If set, configures this repository + to be linked to a Git remote. + """ + + class GitRemoteSettings(proto.Message): + r"""Controls Git remote configuration for a repository. + + Attributes: + url (str): + Required. The Git remote's URL. + default_branch (str): + Required. The Git remote's default branch + name. + authentication_token_secret_version (str): + 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/*``. + token_status (google.cloud.dataform_v1beta1.types.Repository.GitRemoteSettings.TokenStatus): + Output only. Indicates the status of the Git + access token. + """ + class TokenStatus(proto.Enum): + r"""Indicates the status of a Git authentication token.""" + TOKEN_STATUS_UNSPECIFIED = 0 + NOT_FOUND = 1 + INVALID = 2 + VALID = 3 + + url = proto.Field( + proto.STRING, + number=1, + ) + default_branch = proto.Field( + proto.STRING, + number=2, + ) + authentication_token_secret_version = proto.Field( + proto.STRING, + number=3, + ) + token_status = proto.Field( + proto.ENUM, + number=4, + enum='Repository.GitRemoteSettings.TokenStatus', + ) + + name = proto.Field( + proto.STRING, + number=1, + ) + git_remote_settings = proto.Field( + proto.MESSAGE, + number=2, + message=GitRemoteSettings, + ) + + +class ListRepositoriesRequest(proto.Message): + r"""``ListRepositories`` request message. + + Attributes: + parent (str): + Required. The location in which to list repositories. Must + be in the format ``projects/*/locations/*``. + page_size (int): + Optional. Maximum number of repositories to + return. The server may return fewer items than + requested. If unspecified, the server will pick + an appropriate default. + page_token (str): + 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. + order_by (str): + 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. + filter (str): + Optional. Filter for the returned list. + """ + + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) + order_by = proto.Field( + proto.STRING, + number=4, + ) + filter = proto.Field( + proto.STRING, + number=5, + ) + + +class ListRepositoriesResponse(proto.Message): + r"""``ListRepositories`` response message. + + Attributes: + repositories (Sequence[google.cloud.dataform_v1beta1.types.Repository]): + List of repositories. + next_page_token (str): + A token which can be sent as ``page_token`` to retrieve the + next page. If this field is omitted, there are no subsequent + pages. + unreachable (Sequence[str]): + Locations which could not be reached. + """ + + @property + def raw_page(self): + return self + + repositories = proto.RepeatedField( + proto.MESSAGE, + number=1, + message='Repository', + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + unreachable = proto.RepeatedField( + proto.STRING, + number=3, + ) + + +class GetRepositoryRequest(proto.Message): + r"""``GetRepository`` request message. + + Attributes: + name (str): + Required. The repository's name. + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + + +class CreateRepositoryRequest(proto.Message): + r"""``CreateRepository`` request message. + + Attributes: + parent (str): + Required. The location in which to create the repository. + Must be in the format ``projects/*/locations/*``. + repository (google.cloud.dataform_v1beta1.types.Repository): + Required. The repository to create. + repository_id (str): + Required. The ID to use for the repository, + which will become the final component of the + repository's resource name. + """ + + parent = proto.Field( + proto.STRING, + number=1, + ) + repository = proto.Field( + proto.MESSAGE, + number=2, + message='Repository', + ) + repository_id = proto.Field( + proto.STRING, + number=3, + ) + + +class UpdateRepositoryRequest(proto.Message): + r"""``UpdateRepository`` request message. + + Attributes: + update_mask (google.protobuf.field_mask_pb2.FieldMask): + Optional. Specifies the fields to be updated + in the repository. If left unset, all fields + will be updated. + repository (google.cloud.dataform_v1beta1.types.Repository): + Required. The repository to update. + """ + + update_mask = proto.Field( + proto.MESSAGE, + number=1, + message=field_mask_pb2.FieldMask, + ) + repository = proto.Field( + proto.MESSAGE, + number=2, + message='Repository', + ) + + +class DeleteRepositoryRequest(proto.Message): + r"""``DeleteRepository`` request message. + + Attributes: + name (str): + Required. The repository's name. + force (bool): + 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.) + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + force = proto.Field( + proto.BOOL, + number=2, + ) + + +class FetchRemoteBranchesRequest(proto.Message): + r"""``FetchRemoteBranches`` request message. + + Attributes: + name (str): + Required. The repository's name. + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + + +class FetchRemoteBranchesResponse(proto.Message): + r"""``FetchRemoteBranches`` response message. + + Attributes: + branches (Sequence[str]): + The remote repository's branch names. + """ + + branches = proto.RepeatedField( + proto.STRING, + number=1, + ) + + +class Workspace(proto.Message): + r"""Represents a Dataform Git workspace. + + Attributes: + name (str): + Output only. The workspace's name. + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + + +class ListWorkspacesRequest(proto.Message): + r"""``ListWorkspaces`` request message. + + Attributes: + parent (str): + Required. The repository in which to list workspaces. Must + be in the format ``projects/*/locations/*/repositories/*``. + page_size (int): + Optional. Maximum number of workspaces to + return. The server may return fewer items than + requested. If unspecified, the server will pick + an appropriate default. + page_token (str): + 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. + order_by (str): + 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. + filter (str): + Optional. Filter for the returned list. + """ + + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) + order_by = proto.Field( + proto.STRING, + number=4, + ) + filter = proto.Field( + proto.STRING, + number=5, + ) + + +class ListWorkspacesResponse(proto.Message): + r"""``ListWorkspaces`` response message. + + Attributes: + workspaces (Sequence[google.cloud.dataform_v1beta1.types.Workspace]): + List of workspaces. + next_page_token (str): + A token, which can be sent as ``page_token`` to retrieve the + next page. If this field is omitted, there are no subsequent + pages. + unreachable (Sequence[str]): + Locations which could not be reached. + """ + + @property + def raw_page(self): + return self + + workspaces = proto.RepeatedField( + proto.MESSAGE, + number=1, + message='Workspace', + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + unreachable = proto.RepeatedField( + proto.STRING, + number=3, + ) + + +class GetWorkspaceRequest(proto.Message): + r"""``GetWorkspace`` request message. + + Attributes: + name (str): + Required. The workspace's name. + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + + +class CreateWorkspaceRequest(proto.Message): + r"""``CreateWorkspace`` request message. + + Attributes: + parent (str): + Required. The repository in which to create the workspace. + Must be in the format + ``projects/*/locations/*/repositories/*``. + workspace (google.cloud.dataform_v1beta1.types.Workspace): + Required. The workspace to create. + workspace_id (str): + Required. The ID to use for the workspace, + which will become the final component of the + workspace's resource name. + """ + + parent = proto.Field( + proto.STRING, + number=1, + ) + workspace = proto.Field( + proto.MESSAGE, + number=2, + message='Workspace', + ) + workspace_id = proto.Field( + proto.STRING, + number=3, + ) + + +class DeleteWorkspaceRequest(proto.Message): + r"""``DeleteWorkspace`` request message. + + Attributes: + name (str): + Required. The workspace resource's name. + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + + +class CommitAuthor(proto.Message): + r"""Represents the author of a Git commit. + + Attributes: + name (str): + Required. The commit author's name. + email_address (str): + Required. The commit author's email address. + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + email_address = proto.Field( + proto.STRING, + number=2, + ) + + +class PullGitCommitsRequest(proto.Message): + r"""``PullGitCommits`` request message. + + Attributes: + name (str): + Required. The workspace's name. + remote_branch (str): + 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. + author (google.cloud.dataform_v1beta1.types.CommitAuthor): + Required. The author of any merge commit + which may be created as a result of merging + fetched Git commits into this workspace. + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + remote_branch = proto.Field( + proto.STRING, + number=2, + ) + author = proto.Field( + proto.MESSAGE, + number=3, + message='CommitAuthor', + ) + + +class PushGitCommitsRequest(proto.Message): + r"""``PushGitCommits`` request message. + + Attributes: + name (str): + Required. The workspace's name. + remote_branch (str): + 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. + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + remote_branch = proto.Field( + proto.STRING, + number=2, + ) + + +class FetchFileGitStatusesRequest(proto.Message): + r"""``FetchFileGitStatuses`` request message. + + Attributes: + name (str): + Required. The workspace's name. + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + + +class FetchFileGitStatusesResponse(proto.Message): + r"""``FetchFileGitStatuses`` response message. + + Attributes: + uncommitted_file_changes (Sequence[google.cloud.dataform_v1beta1.types.FetchFileGitStatusesResponse.UncommittedFileChange]): + A list of all files which have uncommitted + Git changes. There will only be a single entry + for any given file. + """ + + class UncommittedFileChange(proto.Message): + r"""Represents the Git state of a file with uncommitted changes. + + Attributes: + path (str): + The file's full path including filename, + relative to the workspace root. + state (google.cloud.dataform_v1beta1.types.FetchFileGitStatusesResponse.UncommittedFileChange.State): + Indicates the status of the file. + """ + class State(proto.Enum): + r"""Indicates the status of an uncommitted file change.""" + STATE_UNSPECIFIED = 0 + ADDED = 1 + DELETED = 2 + MODIFIED = 3 + HAS_CONFLICTS = 4 + + path = proto.Field( + proto.STRING, + number=1, + ) + state = proto.Field( + proto.ENUM, + number=2, + enum='FetchFileGitStatusesResponse.UncommittedFileChange.State', + ) + + uncommitted_file_changes = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=UncommittedFileChange, + ) + + +class FetchGitAheadBehindRequest(proto.Message): + r"""``FetchGitAheadBehind`` request message. + + Attributes: + name (str): + Required. The workspace's name. + remote_branch (str): + 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. + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + remote_branch = proto.Field( + proto.STRING, + number=2, + ) + + +class FetchGitAheadBehindResponse(proto.Message): + r"""``FetchGitAheadBehind`` response message. + + Attributes: + commits_ahead (int): + The number of commits in the remote branch + that are not in the workspace. + commits_behind (int): + The number of commits in the workspace that + are not in the remote branch. + """ + + commits_ahead = proto.Field( + proto.INT32, + number=1, + ) + commits_behind = proto.Field( + proto.INT32, + number=2, + ) + + +class CommitWorkspaceChangesRequest(proto.Message): + r"""``CommitWorkspaceChanges`` request message. + + Attributes: + name (str): + Required. The workspace's name. + author (google.cloud.dataform_v1beta1.types.CommitAuthor): + Required. The commit's author. + commit_message (str): + Optional. The commit's message. + paths (Sequence[str]): + Optional. Full file paths to commit including + filename, rooted at workspace root. If left + empty, all files will be committed. + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + author = proto.Field( + proto.MESSAGE, + number=4, + message='CommitAuthor', + ) + commit_message = proto.Field( + proto.STRING, + number=2, + ) + paths = proto.RepeatedField( + proto.STRING, + number=3, + ) + + +class ResetWorkspaceChangesRequest(proto.Message): + r"""``ResetWorkspaceChanges`` request message. + + Attributes: + name (str): + Required. The workspace's name. + paths (Sequence[str]): + 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. + clean (bool): + Optional. If set to true, untracked files + will be deleted. + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + paths = proto.RepeatedField( + proto.STRING, + number=2, + ) + clean = proto.Field( + proto.BOOL, + number=3, + ) + + +class FetchFileDiffRequest(proto.Message): + r"""``FetchFileDiff`` request message. + + Attributes: + workspace (str): + Required. The workspace's name. + path (str): + Required. The file's full path including + filename, relative to the workspace root. + """ + + workspace = proto.Field( + proto.STRING, + number=1, + ) + path = proto.Field( + proto.STRING, + number=2, + ) + + +class FetchFileDiffResponse(proto.Message): + r"""``FetchFileDiff`` response message. + + Attributes: + formatted_diff (str): + The raw formatted Git diff for the file. + """ + + formatted_diff = proto.Field( + proto.STRING, + number=1, + ) + + +class QueryDirectoryContentsRequest(proto.Message): + r"""``QueryDirectoryContents`` request message. + + Attributes: + workspace (str): + Required. The workspace's name. + path (str): + Optional. The directory's full path including + directory name, relative to the workspace root. + If left unset, the workspace root is used. + page_size (int): + Optional. Maximum number of paths to return. + The server may return fewer items than + requested. If unspecified, the server will pick + an appropriate default. + page_token (str): + 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. + """ + + workspace = proto.Field( + proto.STRING, + number=1, + ) + path = proto.Field( + proto.STRING, + number=2, + ) + page_size = proto.Field( + proto.INT32, + number=3, + ) + page_token = proto.Field( + proto.STRING, + number=4, + ) + + +class QueryDirectoryContentsResponse(proto.Message): + r"""``QueryDirectoryContents`` response message. + + Attributes: + directory_entries (Sequence[google.cloud.dataform_v1beta1.types.QueryDirectoryContentsResponse.DirectoryEntry]): + List of entries in the directory. + next_page_token (str): + A token, which can be sent as ``page_token`` to retrieve the + next page. If this field is omitted, there are no subsequent + pages. + """ + + class DirectoryEntry(proto.Message): + r"""Represents a single entry in a workspace directory. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + file (str): + A file in the directory. + + This field is a member of `oneof`_ ``entry``. + directory (str): + A child directory in the directory. + + This field is a member of `oneof`_ ``entry``. + """ + + file = proto.Field( + proto.STRING, + number=1, + oneof='entry', + ) + directory = proto.Field( + proto.STRING, + number=2, + oneof='entry', + ) + + @property + def raw_page(self): + return self + + directory_entries = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=DirectoryEntry, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + + +class MakeDirectoryRequest(proto.Message): + r"""``MakeDirectory`` request message. + + Attributes: + workspace (str): + Required. The workspace's name. + path (str): + Required. The directory's full path including + directory name, relative to the workspace root. + """ + + workspace = proto.Field( + proto.STRING, + number=1, + ) + path = proto.Field( + proto.STRING, + number=2, + ) + + +class MakeDirectoryResponse(proto.Message): + r"""``MakeDirectory`` response message. + """ + + +class RemoveDirectoryRequest(proto.Message): + r"""``RemoveDirectory`` request message. + + Attributes: + workspace (str): + Required. The workspace's name. + path (str): + Required. The directory's full path including + directory name, relative to the workspace root. + """ + + workspace = proto.Field( + proto.STRING, + number=1, + ) + path = proto.Field( + proto.STRING, + number=2, + ) + + +class MoveDirectoryRequest(proto.Message): + r"""``MoveDirectory`` request message. + + Attributes: + workspace (str): + Required. The workspace's name. + path (str): + Required. The directory's full path including + directory name, relative to the workspace root. + new_path (str): + Required. The new path for the directory + including directory name, rooted at workspace + root. + """ + + workspace = proto.Field( + proto.STRING, + number=1, + ) + path = proto.Field( + proto.STRING, + number=2, + ) + new_path = proto.Field( + proto.STRING, + number=3, + ) + + +class MoveDirectoryResponse(proto.Message): + r"""``MoveDirectory`` response message. + """ + + +class ReadFileRequest(proto.Message): + r"""``ReadFile`` request message. + + Attributes: + workspace (str): + Required. The workspace's name. + path (str): + Required. The file's full path including + filename, relative to the workspace root. + """ + + workspace = proto.Field( + proto.STRING, + number=1, + ) + path = proto.Field( + proto.STRING, + number=2, + ) + + +class ReadFileResponse(proto.Message): + r"""``ReadFile`` response message. + + Attributes: + file_contents (bytes): + The file's contents. + """ + + file_contents = proto.Field( + proto.BYTES, + number=1, + ) + + +class RemoveFileRequest(proto.Message): + r"""``RemoveFile`` request message. + + Attributes: + workspace (str): + Required. The workspace's name. + path (str): + Required. The file's full path including + filename, relative to the workspace root. + """ + + workspace = proto.Field( + proto.STRING, + number=1, + ) + path = proto.Field( + proto.STRING, + number=2, + ) + + +class MoveFileRequest(proto.Message): + r"""``MoveFile`` request message. + + Attributes: + workspace (str): + Required. The workspace's name. + path (str): + Required. The file's full path including + filename, relative to the workspace root. + new_path (str): + Required. The file's new path including + filename, relative to the workspace root. + """ + + workspace = proto.Field( + proto.STRING, + number=1, + ) + path = proto.Field( + proto.STRING, + number=2, + ) + new_path = proto.Field( + proto.STRING, + number=3, + ) + + +class MoveFileResponse(proto.Message): + r"""``MoveFile`` response message. + """ + + +class WriteFileRequest(proto.Message): + r"""``WriteFile`` request message. + + Attributes: + workspace (str): + Required. The workspace's name. + path (str): + Required. The file. + contents (bytes): + Required. The file's contents. + """ + + workspace = proto.Field( + proto.STRING, + number=1, + ) + path = proto.Field( + proto.STRING, + number=2, + ) + contents = proto.Field( + proto.BYTES, + number=3, + ) + + +class WriteFileResponse(proto.Message): + r"""``WriteFile`` response message. + """ + + +class InstallNpmPackagesRequest(proto.Message): + r"""``InstallNpmPackages`` request message. + + Attributes: + workspace (str): + Required. The workspace's name. + """ + + workspace = proto.Field( + proto.STRING, + number=1, + ) + + +class InstallNpmPackagesResponse(proto.Message): + r"""``InstallNpmPackages`` response message. + """ + + +class CompilationResult(proto.Message): + r"""Represents the result of compiling a Dataform project. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + name (str): + Output only. The compilation result's name. + git_commitish (str): + 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`` + + This field is a member of `oneof`_ ``source``. + workspace (str): + Immutable. The name of the workspace to compile. Must be in + the format + ``projects/*/locations/*/repositories/*/workspaces/*``. + + This field is a member of `oneof`_ ``source``. + code_compilation_config (google.cloud.dataform_v1beta1.types.CompilationResult.CodeCompilationConfig): + Immutable. If set, fields of ``code_compilation_overrides`` + override the default compilation settings that are specified + in dataform.json. + dataform_core_version (str): + Output only. The version of ``@dataform/core`` that was used + for compilation. + compilation_errors (Sequence[google.cloud.dataform_v1beta1.types.CompilationResult.CompilationError]): + Output only. Errors encountered during + project compilation. + """ + + class CodeCompilationConfig(proto.Message): + r"""Configures various aspects of Dataform code compilation. + + Attributes: + default_database (str): + Optional. The default database (Google Cloud + project ID). + default_schema (str): + Optional. The default schema (BigQuery + dataset ID). + default_location (str): + 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. + assertion_schema (str): + Optional. The default schema (BigQuery + dataset ID) for assertions. + vars_ (Mapping[str, str]): + Optional. User-defined variables that are + made available to project code during + compilation. + database_suffix (str): + Optional. The suffix that should be appended + to all database (Google Cloud project ID) names. + schema_suffix (str): + Optional. The suffix that should be appended + to all schema (BigQuery dataset ID) names. + table_prefix (str): + Optional. The prefix that should be prepended + to all table names. + """ + + default_database = proto.Field( + proto.STRING, + number=1, + ) + default_schema = proto.Field( + proto.STRING, + number=2, + ) + default_location = proto.Field( + proto.STRING, + number=8, + ) + assertion_schema = proto.Field( + proto.STRING, + number=3, + ) + vars_ = proto.MapField( + proto.STRING, + proto.STRING, + number=4, + ) + database_suffix = proto.Field( + proto.STRING, + number=5, + ) + schema_suffix = proto.Field( + proto.STRING, + number=6, + ) + table_prefix = proto.Field( + proto.STRING, + number=7, + ) + + class CompilationError(proto.Message): + r"""An error encountered when attempting to compile a Dataform + project. + + Attributes: + message (str): + Output only. The error's top level message. + stack (str): + Output only. The error's full stack trace. + path (str): + Output only. The path of the file where this + error occurred, if available, relative to the + project root. + action_target (google.cloud.dataform_v1beta1.types.Target): + Output only. The identifier of the action + where this error occurred, if available. + """ + + message = proto.Field( + proto.STRING, + number=1, + ) + stack = proto.Field( + proto.STRING, + number=2, + ) + path = proto.Field( + proto.STRING, + number=3, + ) + action_target = proto.Field( + proto.MESSAGE, + number=4, + message='Target', + ) + + name = proto.Field( + proto.STRING, + number=1, + ) + git_commitish = proto.Field( + proto.STRING, + number=2, + oneof='source', + ) + workspace = proto.Field( + proto.STRING, + number=3, + oneof='source', + ) + code_compilation_config = proto.Field( + proto.MESSAGE, + number=4, + message=CodeCompilationConfig, + ) + dataform_core_version = proto.Field( + proto.STRING, + number=5, + ) + compilation_errors = proto.RepeatedField( + proto.MESSAGE, + number=6, + message=CompilationError, + ) + + +class ListCompilationResultsRequest(proto.Message): + r"""``ListCompilationResults`` request message. + + Attributes: + parent (str): + Required. The repository in which to list compilation + results. Must be in the format + ``projects/*/locations/*/repositories/*``. + page_size (int): + 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. + page_token (str): + 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. + """ + + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) + + +class ListCompilationResultsResponse(proto.Message): + r"""``ListCompilationResults`` response message. + + Attributes: + compilation_results (Sequence[google.cloud.dataform_v1beta1.types.CompilationResult]): + List of compilation results. + next_page_token (str): + A token, which can be sent as ``page_token`` to retrieve the + next page. If this field is omitted, there are no subsequent + pages. + unreachable (Sequence[str]): + Locations which could not be reached. + """ + + @property + def raw_page(self): + return self + + compilation_results = proto.RepeatedField( + proto.MESSAGE, + number=1, + message='CompilationResult', + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + unreachable = proto.RepeatedField( + proto.STRING, + number=3, + ) + + +class GetCompilationResultRequest(proto.Message): + r"""``GetCompilationResult`` request message. + + Attributes: + name (str): + Required. The compilation result's name. + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + + +class CreateCompilationResultRequest(proto.Message): + r"""``CreateCompilationResult`` request message. + + Attributes: + parent (str): + Required. The repository in which to create the compilation + result. Must be in the format + ``projects/*/locations/*/repositories/*``. + compilation_result (google.cloud.dataform_v1beta1.types.CompilationResult): + Required. The compilation result to create. + """ + + parent = proto.Field( + proto.STRING, + number=1, + ) + compilation_result = proto.Field( + proto.MESSAGE, + number=2, + message='CompilationResult', + ) + + +class Target(proto.Message): + r"""Represents an action identifier. If the action writes output, + the output will be written to the referenced database object. + + Attributes: + database (str): + The action's database (Google Cloud project + ID) . + schema (str): + The action's schema (BigQuery dataset ID), within + ``database``. + name (str): + The action's name, within ``database`` and ``schema``. + """ + + database = proto.Field( + proto.STRING, + number=1, + ) + schema = proto.Field( + proto.STRING, + number=2, + ) + name = proto.Field( + proto.STRING, + number=3, + ) + + +class RelationDescriptor(proto.Message): + r"""Describes a relation and its columns. + + Attributes: + description (str): + A text description of the relation. + columns (Sequence[google.cloud.dataform_v1beta1.types.RelationDescriptor.ColumnDescriptor]): + A list of descriptions of columns within the + relation. + bigquery_labels (Mapping[str, str]): + A set of BigQuery labels that should be + applied to the relation. + """ + + class ColumnDescriptor(proto.Message): + r"""Describes a column. + + Attributes: + path (Sequence[str]): + The identifier for the column. Each entry in ``path`` + represents one level of nesting. + description (str): + A textual description of the column. + bigquery_policy_tags (Sequence[str]): + A list of BigQuery policy tags that will be + applied to the column. + """ + + path = proto.RepeatedField( + proto.STRING, + number=1, + ) + description = proto.Field( + proto.STRING, + number=2, + ) + bigquery_policy_tags = proto.RepeatedField( + proto.STRING, + number=3, + ) + + description = proto.Field( + proto.STRING, + number=1, + ) + columns = proto.RepeatedField( + proto.MESSAGE, + number=2, + message=ColumnDescriptor, + ) + bigquery_labels = proto.MapField( + proto.STRING, + proto.STRING, + number=3, + ) + + +class CompilationResultAction(proto.Message): + r"""Represents a single Dataform action in a compilation result. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + target (google.cloud.dataform_v1beta1.types.Target): + This action's identifier. Unique within the + compilation result. + canonical_target (google.cloud.dataform_v1beta1.types.Target): + The action's identifier if the project had + been compiled without any overrides configured. + Unique within the compilation result. + file_path (str): + The full path including filename in which + this action is located, relative to the + workspace root. + relation (google.cloud.dataform_v1beta1.types.CompilationResultAction.Relation): + The database relation created/updated by this + action. + + This field is a member of `oneof`_ ``compiled_object``. + operations (google.cloud.dataform_v1beta1.types.CompilationResultAction.Operations): + The database operations executed by this + action. + + This field is a member of `oneof`_ ``compiled_object``. + assertion (google.cloud.dataform_v1beta1.types.CompilationResultAction.Assertion): + The assertion executed by this action. + + This field is a member of `oneof`_ ``compiled_object``. + declaration (google.cloud.dataform_v1beta1.types.CompilationResultAction.Declaration): + The declaration declared by this action. + + This field is a member of `oneof`_ ``compiled_object``. + """ + + class Relation(proto.Message): + r"""Represents a database relation. + + Attributes: + dependency_targets (Sequence[google.cloud.dataform_v1beta1.types.Target]): + A list of actions that this action depends + on. + disabled (bool): + Whether this action is disabled (i.e. should + not be run). + tags (Sequence[str]): + Arbitrary, user-defined tags on this action. + relation_descriptor (google.cloud.dataform_v1beta1.types.RelationDescriptor): + Descriptor for the relation and its columns. + relation_type (google.cloud.dataform_v1beta1.types.CompilationResultAction.Relation.RelationType): + The type of this relation. + select_query (str): + The SELECT query which returns rows which + this relation should contain. + pre_operations (Sequence[str]): + SQL statements to be executed before creating + the relation. + post_operations (Sequence[str]): + SQL statements to be executed after creating + the relation. + incremental_table_config (google.cloud.dataform_v1beta1.types.CompilationResultAction.Relation.IncrementalTableConfig): + Configures ``INCREMENTAL_TABLE`` settings for this relation. + Only set if ``relation_type`` is ``INCREMENTAL_TABLE``. + partition_expression (str): + The SQL expression used to partition the + relation. + cluster_expressions (Sequence[str]): + A list of columns or SQL expressions used to + cluster the table. + partition_expiration_days (int): + Sets the partition expiration in days. + require_partition_filter (bool): + Specifies whether queries on this table must + include a predicate filter that filters on the + partitioning column. + additional_options (Mapping[str, str]): + 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. + """ + class RelationType(proto.Enum): + r"""Indicates the type of this relation.""" + RELATION_TYPE_UNSPECIFIED = 0 + TABLE = 1 + VIEW = 2 + INCREMENTAL_TABLE = 3 + MATERIALIZED_VIEW = 4 + + class IncrementalTableConfig(proto.Message): + r"""Contains settings for relations of type ``INCREMENTAL_TABLE``. + + Attributes: + incremental_select_query (str): + The SELECT query which returns rows which + should be inserted into the relation if it + already exists and is not being refreshed. + refresh_disabled (bool): + Whether this table should be protected from + being refreshed. + unique_key_parts (Sequence[str]): + 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. + update_partition_filter (str): + A SQL expression conditional used to limit the set of + existing rows considered for a merge operation (see + ``unique_key_parts`` for more information). + incremental_pre_operations (Sequence[str]): + SQL statements to be executed before + inserting new rows into the relation. + incremental_post_operations (Sequence[str]): + SQL statements to be executed after inserting + new rows into the relation. + """ + + incremental_select_query = proto.Field( + proto.STRING, + number=1, + ) + refresh_disabled = proto.Field( + proto.BOOL, + number=2, + ) + unique_key_parts = proto.RepeatedField( + proto.STRING, + number=3, + ) + update_partition_filter = proto.Field( + proto.STRING, + number=4, + ) + incremental_pre_operations = proto.RepeatedField( + proto.STRING, + number=5, + ) + incremental_post_operations = proto.RepeatedField( + proto.STRING, + number=6, + ) + + dependency_targets = proto.RepeatedField( + proto.MESSAGE, + number=1, + message='Target', + ) + disabled = proto.Field( + proto.BOOL, + number=2, + ) + tags = proto.RepeatedField( + proto.STRING, + number=3, + ) + relation_descriptor = proto.Field( + proto.MESSAGE, + number=4, + message='RelationDescriptor', + ) + relation_type = proto.Field( + proto.ENUM, + number=5, + enum='CompilationResultAction.Relation.RelationType', + ) + select_query = proto.Field( + proto.STRING, + number=6, + ) + pre_operations = proto.RepeatedField( + proto.STRING, + number=7, + ) + post_operations = proto.RepeatedField( + proto.STRING, + number=8, + ) + incremental_table_config = proto.Field( + proto.MESSAGE, + number=9, + message='CompilationResultAction.Relation.IncrementalTableConfig', + ) + partition_expression = proto.Field( + proto.STRING, + number=10, + ) + cluster_expressions = proto.RepeatedField( + proto.STRING, + number=11, + ) + partition_expiration_days = proto.Field( + proto.INT32, + number=12, + ) + require_partition_filter = proto.Field( + proto.BOOL, + number=13, + ) + additional_options = proto.MapField( + proto.STRING, + proto.STRING, + number=14, + ) + + class Operations(proto.Message): + r"""Represents a list of arbitrary database operations. + + Attributes: + dependency_targets (Sequence[google.cloud.dataform_v1beta1.types.Target]): + A list of actions that this action depends + on. + disabled (bool): + Whether this action is disabled (i.e. should + not be run). + tags (Sequence[str]): + Arbitrary, user-defined tags on this action. + relation_descriptor (google.cloud.dataform_v1beta1.types.RelationDescriptor): + Descriptor for any output relation and its columns. Only set + if ``has_output`` is true. + queries (Sequence[str]): + A list of arbitrary SQL statements that will + be executed without alteration. + has_output (bool): + Whether these operations produce an output + relation. + """ + + dependency_targets = proto.RepeatedField( + proto.MESSAGE, + number=1, + message='Target', + ) + disabled = proto.Field( + proto.BOOL, + number=2, + ) + tags = proto.RepeatedField( + proto.STRING, + number=3, + ) + relation_descriptor = proto.Field( + proto.MESSAGE, + number=6, + message='RelationDescriptor', + ) + queries = proto.RepeatedField( + proto.STRING, + number=4, + ) + has_output = proto.Field( + proto.BOOL, + number=5, + ) + + class Assertion(proto.Message): + r"""Represents an assertion upon a SQL query which is required + return zero rows. + + Attributes: + dependency_targets (Sequence[google.cloud.dataform_v1beta1.types.Target]): + A list of actions that this action depends + on. + parent_action (google.cloud.dataform_v1beta1.types.Target): + The parent action of this assertion. Only set + if this assertion was automatically generated. + disabled (bool): + Whether this action is disabled (i.e. should + not be run). + tags (Sequence[str]): + Arbitrary, user-defined tags on this action. + select_query (str): + The SELECT query which must return zero rows + in order for this assertion to succeed. + relation_descriptor (google.cloud.dataform_v1beta1.types.RelationDescriptor): + Descriptor for the assertion's + automatically-generated view and its columns. + """ + + dependency_targets = proto.RepeatedField( + proto.MESSAGE, + number=1, + message='Target', + ) + parent_action = proto.Field( + proto.MESSAGE, + number=5, + message='Target', + ) + disabled = proto.Field( + proto.BOOL, + number=2, + ) + tags = proto.RepeatedField( + proto.STRING, + number=3, + ) + select_query = proto.Field( + proto.STRING, + number=4, + ) + relation_descriptor = proto.Field( + proto.MESSAGE, + number=6, + message='RelationDescriptor', + ) + + class Declaration(proto.Message): + r"""Represents a relation which is not managed by Dataform but + which may be referenced by Dataform actions. + + Attributes: + relation_descriptor (google.cloud.dataform_v1beta1.types.RelationDescriptor): + 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. + """ + + relation_descriptor = proto.Field( + proto.MESSAGE, + number=1, + message='RelationDescriptor', + ) + + target = proto.Field( + proto.MESSAGE, + number=1, + message='Target', + ) + canonical_target = proto.Field( + proto.MESSAGE, + number=2, + message='Target', + ) + file_path = proto.Field( + proto.STRING, + number=3, + ) + relation = proto.Field( + proto.MESSAGE, + number=4, + oneof='compiled_object', + message=Relation, + ) + operations = proto.Field( + proto.MESSAGE, + number=5, + oneof='compiled_object', + message=Operations, + ) + assertion = proto.Field( + proto.MESSAGE, + number=6, + oneof='compiled_object', + message=Assertion, + ) + declaration = proto.Field( + proto.MESSAGE, + number=7, + oneof='compiled_object', + message=Declaration, + ) + + +class QueryCompilationResultActionsRequest(proto.Message): + r"""``QueryCompilationResultActions`` request message. + + Attributes: + name (str): + Required. The compilation result's name. + page_size (int): + 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. + page_token (str): + 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. + filter (str): + Optional. Optional filter for the returned list. Filtering + is only currently supported on the ``file_path`` field. + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) + filter = proto.Field( + proto.STRING, + number=4, + ) + + +class QueryCompilationResultActionsResponse(proto.Message): + r"""``QueryCompilationResultActions`` response message. + + Attributes: + compilation_result_actions (Sequence[google.cloud.dataform_v1beta1.types.CompilationResultAction]): + List of compilation result actions. + next_page_token (str): + A token, which can be sent as ``page_token`` to retrieve the + next page. If this field is omitted, there are no subsequent + pages. + """ + + @property + def raw_page(self): + return self + + compilation_result_actions = proto.RepeatedField( + proto.MESSAGE, + number=1, + message='CompilationResultAction', + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + + +class WorkflowInvocation(proto.Message): + r"""Represents a single invocation of a compilation result. + + Attributes: + name (str): + Output only. The workflow invocation's name. + compilation_result (str): + Immutable. The name of the compilation result to compile. + Must be in the format + ``projects/*/locations/*/repositories/*/compilationResults/*``. + invocation_config (google.cloud.dataform_v1beta1.types.WorkflowInvocation.InvocationConfig): + Immutable. If left unset, a default + InvocationConfig will be used. + state (google.cloud.dataform_v1beta1.types.WorkflowInvocation.State): + Output only. This workflow invocation's + current state. + invocation_timing (google.type.interval_pb2.Interval): + Output only. This workflow invocation's + timing details. + """ + class State(proto.Enum): + r"""Represents the current state of a workflow invocation.""" + STATE_UNSPECIFIED = 0 + RUNNING = 1 + SUCCEEDED = 2 + CANCELLED = 3 + FAILED = 4 + CANCELING = 5 + + class InvocationConfig(proto.Message): + r"""Includes various configuration options for this workflow invocation. + If both ``included_targets`` and ``included_tags`` are unset, all + actions will be included. + + Attributes: + included_targets (Sequence[google.cloud.dataform_v1beta1.types.Target]): + Immutable. The set of action identifiers to + include. + included_tags (Sequence[str]): + Immutable. The set of tags to include. + transitive_dependencies_included (bool): + Immutable. When set to true, transitive + dependencies of included actions will be + executed. + transitive_dependents_included (bool): + Immutable. When set to true, transitive + dependents of included actions will be executed. + fully_refresh_incremental_tables_enabled (bool): + Immutable. When set to true, any incremental + tables will be fully refreshed. + """ + + included_targets = proto.RepeatedField( + proto.MESSAGE, + number=1, + message='Target', + ) + included_tags = proto.RepeatedField( + proto.STRING, + number=2, + ) + transitive_dependencies_included = proto.Field( + proto.BOOL, + number=3, + ) + transitive_dependents_included = proto.Field( + proto.BOOL, + number=4, + ) + fully_refresh_incremental_tables_enabled = proto.Field( + proto.BOOL, + number=5, + ) + + name = proto.Field( + proto.STRING, + number=1, + ) + compilation_result = proto.Field( + proto.STRING, + number=2, + ) + invocation_config = proto.Field( + proto.MESSAGE, + number=3, + message=InvocationConfig, + ) + state = proto.Field( + proto.ENUM, + number=4, + enum=State, + ) + invocation_timing = proto.Field( + proto.MESSAGE, + number=5, + message=interval_pb2.Interval, + ) + + +class ListWorkflowInvocationsRequest(proto.Message): + r"""``ListWorkflowInvocations`` request message. + + Attributes: + parent (str): + Required. The parent resource of the WorkflowInvocation + type. Must be in the format + ``projects/*/locations/*/repositories/*``. + page_size (int): + 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. + page_token (str): + 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. + """ + + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) + + +class ListWorkflowInvocationsResponse(proto.Message): + r"""``ListWorkflowInvocations`` response message. + + Attributes: + workflow_invocations (Sequence[google.cloud.dataform_v1beta1.types.WorkflowInvocation]): + List of workflow invocations. + next_page_token (str): + A token, which can be sent as ``page_token`` to retrieve the + next page. If this field is omitted, there are no subsequent + pages. + unreachable (Sequence[str]): + Locations which could not be reached. + """ + + @property + def raw_page(self): + return self + + workflow_invocations = proto.RepeatedField( + proto.MESSAGE, + number=1, + message='WorkflowInvocation', + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + unreachable = proto.RepeatedField( + proto.STRING, + number=3, + ) + + +class GetWorkflowInvocationRequest(proto.Message): + r"""``GetWorkflowInvocation`` request message. + + Attributes: + name (str): + Required. The workflow invocation resource's + name. + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + + +class CreateWorkflowInvocationRequest(proto.Message): + r"""``CreateWorkflowInvocation`` request message. + + Attributes: + parent (str): + Required. The repository in which to create the workflow + invocation. Must be in the format + ``projects/*/locations/*/repositories/*``. + workflow_invocation (google.cloud.dataform_v1beta1.types.WorkflowInvocation): + Required. The workflow invocation resource to + create. + """ + + parent = proto.Field( + proto.STRING, + number=1, + ) + workflow_invocation = proto.Field( + proto.MESSAGE, + number=2, + message='WorkflowInvocation', + ) + + +class DeleteWorkflowInvocationRequest(proto.Message): + r"""``DeleteWorkflowInvocation`` request message. + + Attributes: + name (str): + Required. The workflow invocation resource's + name. + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + + +class CancelWorkflowInvocationRequest(proto.Message): + r"""``CancelWorkflowInvocation`` request message. + + Attributes: + name (str): + Required. The workflow invocation resource's + name. + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + + +class WorkflowInvocationAction(proto.Message): + r"""Represents a single action in a workflow invocation. + + Attributes: + target (google.cloud.dataform_v1beta1.types.Target): + Output only. This action's identifier. Unique + within the workflow invocation. + canonical_target (google.cloud.dataform_v1beta1.types.Target): + Output only. The action's identifier if the + project had been compiled without any overrides + configured. Unique within the compilation + result. + state (google.cloud.dataform_v1beta1.types.WorkflowInvocationAction.State): + Output only. This action's current state. + failure_reason (str): + Output only. If and only if action's state is + FAILED a failure reason is set. + invocation_timing (google.type.interval_pb2.Interval): + 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. + bigquery_action (google.cloud.dataform_v1beta1.types.WorkflowInvocationAction.BigQueryAction): + Output only. The workflow action's bigquery + action details. + """ + class State(proto.Enum): + r"""Represents the current state of an workflow invocation + action. + """ + PENDING = 0 + RUNNING = 1 + SKIPPED = 2 + DISABLED = 3 + SUCCEEDED = 4 + CANCELLED = 5 + FAILED = 6 + + class BigQueryAction(proto.Message): + r"""Represents a workflow action that will run against BigQuery. + + Attributes: + sql_script (str): + Output only. The generated BigQuery SQL + script that will be executed. + """ + + sql_script = proto.Field( + proto.STRING, + number=1, + ) + + target = proto.Field( + proto.MESSAGE, + number=1, + message='Target', + ) + canonical_target = proto.Field( + proto.MESSAGE, + number=2, + message='Target', + ) + state = proto.Field( + proto.ENUM, + number=4, + enum=State, + ) + failure_reason = proto.Field( + proto.STRING, + number=7, + ) + invocation_timing = proto.Field( + proto.MESSAGE, + number=5, + message=interval_pb2.Interval, + ) + bigquery_action = proto.Field( + proto.MESSAGE, + number=6, + message=BigQueryAction, + ) + + +class QueryWorkflowInvocationActionsRequest(proto.Message): + r"""``QueryWorkflowInvocationActions`` request message. + + Attributes: + name (str): + Required. The workflow invocation's name. + page_size (int): + 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. + page_token (str): + 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. + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) + + +class QueryWorkflowInvocationActionsResponse(proto.Message): + r"""``QueryWorkflowInvocationActions`` response message. + + Attributes: + workflow_invocation_actions (Sequence[google.cloud.dataform_v1beta1.types.WorkflowInvocationAction]): + List of workflow invocation actions. + next_page_token (str): + A token, which can be sent as ``page_token`` to retrieve the + next page. If this field is omitted, there are no subsequent + pages. + """ + + @property + def raw_page(self): + return self + + workflow_invocation_actions = proto.RepeatedField( + proto.MESSAGE, + number=1, + message='WorkflowInvocationAction', + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/v1beta1/mypy.ini b/owl-bot-staging/v1beta1/mypy.ini new file mode 100644 index 0000000..574c5ae --- /dev/null +++ b/owl-bot-staging/v1beta1/mypy.ini @@ -0,0 +1,3 @@ +[mypy] +python_version = 3.7 +namespace_packages = True diff --git a/owl-bot-staging/v1beta1/noxfile.py b/owl-bot-staging/v1beta1/noxfile.py new file mode 100644 index 0000000..965629c --- /dev/null +++ b/owl-bot-staging/v1beta1/noxfile.py @@ -0,0 +1,179 @@ +# -*- coding: utf-8 -*- +# 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. +# +import os +import pathlib +import shutil +import subprocess +import sys + + +import nox # type: ignore + +ALL_PYTHON = [ + "3.7", + "3.8", + "3.9", + "3.10", +] + +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() + +LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" +PACKAGE_NAME = subprocess.check_output([sys.executable, "setup.py", "--name"], encoding="utf-8") + +BLACK_VERSION = "black==22.3.0" +BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] +DEFAULT_PYTHON_VERSION = "3.10" + +nox.sessions = [ + "unit", + "cover", + "mypy", + "check_lower_bounds" + # exclude update_lower_bounds from default + "docs", + "blacken", + "lint", + "lint_setup_py", +] + +@nox.session(python=ALL_PYTHON) +def unit(session): + """Run the unit test suite.""" + + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + session.install('-e', '.') + + session.run( + 'py.test', + '--quiet', + '--cov=google/cloud/dataform_v1beta1/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)) + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def cover(session): + """Run the final coverage report. + This outputs the coverage report aggregating coverage from the unit + test runs (not system test runs), and then erases coverage data. + """ + session.install("coverage", "pytest-cov") + session.run("coverage", "report", "--show-missing", "--fail-under=100") + + session.run("coverage", "erase") + + +@nox.session(python=ALL_PYTHON) +def mypy(session): + """Run the type checker.""" + session.install('mypy', 'types-pkg_resources') + session.install('.') + session.run( + 'mypy', + '--explicit-package-bases', + 'google', + ) + + +@nox.session +def update_lower_bounds(session): + """Update lower bounds in constraints.txt to match setup.py""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'update', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + + +@nox.session +def check_lower_bounds(session): + """Check lower bounds in setup.py are reflected in constraints file""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'check', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def docs(session): + """Build the docs for this library.""" + + session.install("-e", ".") + session.install("sphinx==4.0.1", "alabaster", "recommonmark") + + shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) + session.run( + "sphinx-build", + "-W", # warnings as errors + "-T", # show full traceback on exception + "-N", # no colors + "-b", + "html", + "-d", + os.path.join("docs", "_build", "doctrees", ""), + os.path.join("docs", ""), + os.path.join("docs", "_build", "html", ""), + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint(session): + """Run linters. + + Returns a failure if the linters find linting errors or sufficiently + serious code quality issues. + """ + session.install("flake8", BLACK_VERSION) + session.run( + "black", + "--check", + *BLACK_PATHS, + ) + session.run("flake8", "google", "tests", "samples") + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def blacken(session): + """Run black. Format code to uniform standard.""" + session.install(BLACK_VERSION) + session.run( + "black", + *BLACK_PATHS, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint_setup_py(session): + """Verify that setup.py is valid (including RST check).""" + session.install("docutils", "pygments") + session.run("python", "setup.py", "check", "--restructuredtext", "--strict") diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_cancel_workflow_invocation_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_cancel_workflow_invocation_async.py new file mode 100644 index 0000000..b837244 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_cancel_workflow_invocation_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CancelWorkflowInvocation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_cancel_workflow_invocation(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.CancelWorkflowInvocationRequest( + name="name_value", + ) + + # Make the request + await client.cancel_workflow_invocation(request=request) + + +# [END dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_cancel_workflow_invocation_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_cancel_workflow_invocation_sync.py new file mode 100644 index 0000000..566f192 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_cancel_workflow_invocation_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CancelWorkflowInvocation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_cancel_workflow_invocation(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.CancelWorkflowInvocationRequest( + name="name_value", + ) + + # Make the request + client.cancel_workflow_invocation(request=request) + + +# [END dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_commit_workspace_changes_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_commit_workspace_changes_async.py new file mode 100644 index 0000000..ef053ba --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_commit_workspace_changes_async.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CommitWorkspaceChanges +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_commit_workspace_changes(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + author = dataform_v1beta1.CommitAuthor() + author.name = "name_value" + author.email_address = "email_address_value" + + request = dataform_v1beta1.CommitWorkspaceChangesRequest( + name="name_value", + author=author, + ) + + # Make the request + await client.commit_workspace_changes(request=request) + + +# [END dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_commit_workspace_changes_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_commit_workspace_changes_sync.py new file mode 100644 index 0000000..2a2baad --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_commit_workspace_changes_sync.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CommitWorkspaceChanges +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_commit_workspace_changes(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + author = dataform_v1beta1.CommitAuthor() + author.name = "name_value" + author.email_address = "email_address_value" + + request = dataform_v1beta1.CommitWorkspaceChangesRequest( + name="name_value", + author=author, + ) + + # Make the request + client.commit_workspace_changes(request=request) + + +# [END dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_compilation_result_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_compilation_result_async.py new file mode 100644 index 0000000..6cec1c3 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_compilation_result_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateCompilationResult +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_create_compilation_result(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + compilation_result = dataform_v1beta1.CompilationResult() + compilation_result.git_commitish = "git_commitish_value" + + request = dataform_v1beta1.CreateCompilationResultRequest( + parent="parent_value", + compilation_result=compilation_result, + ) + + # Make the request + response = await client.create_compilation_result(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_CreateCompilationResult_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_compilation_result_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_compilation_result_sync.py new file mode 100644 index 0000000..d44ccee --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_compilation_result_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateCompilationResult +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_CreateCompilationResult_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_create_compilation_result(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + compilation_result = dataform_v1beta1.CompilationResult() + compilation_result.git_commitish = "git_commitish_value" + + request = dataform_v1beta1.CreateCompilationResultRequest( + parent="parent_value", + compilation_result=compilation_result, + ) + + # Make the request + response = client.create_compilation_result(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_CreateCompilationResult_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_repository_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_repository_async.py new file mode 100644 index 0000000..9cb6d7d --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_repository_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateRepository +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_create_repository(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.CreateRepositoryRequest( + parent="parent_value", + repository_id="repository_id_value", + ) + + # Make the request + response = await client.create_repository(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_CreateRepository_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_repository_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_repository_sync.py new file mode 100644 index 0000000..0f0719e --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_repository_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateRepository +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_CreateRepository_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_create_repository(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.CreateRepositoryRequest( + parent="parent_value", + repository_id="repository_id_value", + ) + + # Make the request + response = client.create_repository(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_CreateRepository_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workflow_invocation_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workflow_invocation_async.py new file mode 100644 index 0000000..80ae5d3 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workflow_invocation_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateWorkflowInvocation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_create_workflow_invocation(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.CreateWorkflowInvocationRequest( + parent="parent_value", + ) + + # Make the request + response = await client.create_workflow_invocation(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workflow_invocation_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workflow_invocation_sync.py new file mode 100644 index 0000000..65974f1 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workflow_invocation_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateWorkflowInvocation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_create_workflow_invocation(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.CreateWorkflowInvocationRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_workflow_invocation(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workspace_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workspace_async.py new file mode 100644 index 0000000..e521029 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workspace_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateWorkspace +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_create_workspace(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.CreateWorkspaceRequest( + parent="parent_value", + workspace_id="workspace_id_value", + ) + + # Make the request + response = await client.create_workspace(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_CreateWorkspace_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workspace_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workspace_sync.py new file mode 100644 index 0000000..0005a29 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workspace_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateWorkspace +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_CreateWorkspace_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_create_workspace(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.CreateWorkspaceRequest( + parent="parent_value", + workspace_id="workspace_id_value", + ) + + # Make the request + response = client.create_workspace(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_CreateWorkspace_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_repository_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_repository_async.py new file mode 100644 index 0000000..211bab3 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_repository_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteRepository +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_delete_repository(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.DeleteRepositoryRequest( + name="name_value", + ) + + # Make the request + await client.delete_repository(request=request) + + +# [END dataform_v1beta1_generated_Dataform_DeleteRepository_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_repository_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_repository_sync.py new file mode 100644 index 0000000..4ba2349 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_repository_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteRepository +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_DeleteRepository_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_delete_repository(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.DeleteRepositoryRequest( + name="name_value", + ) + + # Make the request + client.delete_repository(request=request) + + +# [END dataform_v1beta1_generated_Dataform_DeleteRepository_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workflow_invocation_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workflow_invocation_async.py new file mode 100644 index 0000000..0773958 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workflow_invocation_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteWorkflowInvocation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_delete_workflow_invocation(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.DeleteWorkflowInvocationRequest( + name="name_value", + ) + + # Make the request + await client.delete_workflow_invocation(request=request) + + +# [END dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workflow_invocation_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workflow_invocation_sync.py new file mode 100644 index 0000000..184ffd8 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workflow_invocation_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteWorkflowInvocation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_delete_workflow_invocation(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.DeleteWorkflowInvocationRequest( + name="name_value", + ) + + # Make the request + client.delete_workflow_invocation(request=request) + + +# [END dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workspace_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workspace_async.py new file mode 100644 index 0000000..a5f76d9 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workspace_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteWorkspace +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_delete_workspace(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.DeleteWorkspaceRequest( + name="name_value", + ) + + # Make the request + await client.delete_workspace(request=request) + + +# [END dataform_v1beta1_generated_Dataform_DeleteWorkspace_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workspace_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workspace_sync.py new file mode 100644 index 0000000..1458c0b --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workspace_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteWorkspace +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_DeleteWorkspace_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_delete_workspace(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.DeleteWorkspaceRequest( + name="name_value", + ) + + # Make the request + client.delete_workspace(request=request) + + +# [END dataform_v1beta1_generated_Dataform_DeleteWorkspace_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_diff_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_diff_async.py new file mode 100644 index 0000000..e99cc5f --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_diff_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for FetchFileDiff +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_fetch_file_diff(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.FetchFileDiffRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + response = await client.fetch_file_diff(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_FetchFileDiff_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_diff_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_diff_sync.py new file mode 100644 index 0000000..a26b604 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_diff_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for FetchFileDiff +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_FetchFileDiff_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_fetch_file_diff(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.FetchFileDiffRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + response = client.fetch_file_diff(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_FetchFileDiff_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_git_statuses_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_git_statuses_async.py new file mode 100644 index 0000000..289dd0e --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_git_statuses_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for FetchFileGitStatuses +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_fetch_file_git_statuses(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.FetchFileGitStatusesRequest( + name="name_value", + ) + + # Make the request + response = await client.fetch_file_git_statuses(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_git_statuses_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_git_statuses_sync.py new file mode 100644 index 0000000..6cdd072 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_git_statuses_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for FetchFileGitStatuses +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_fetch_file_git_statuses(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.FetchFileGitStatusesRequest( + name="name_value", + ) + + # Make the request + response = client.fetch_file_git_statuses(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_async.py new file mode 100644 index 0000000..aa31603 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for FetchGitAheadBehind +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_fetch_git_ahead_behind(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.FetchGitAheadBehindRequest( + name="name_value", + ) + + # Make the request + response = await client.fetch_git_ahead_behind(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_sync.py new file mode 100644 index 0000000..6088b62 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for FetchGitAheadBehind +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_fetch_git_ahead_behind(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.FetchGitAheadBehindRequest( + name="name_value", + ) + + # Make the request + response = client.fetch_git_ahead_behind(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_remote_branches_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_remote_branches_async.py new file mode 100644 index 0000000..d6a2eb7 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_remote_branches_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for FetchRemoteBranches +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_fetch_remote_branches(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.FetchRemoteBranchesRequest( + name="name_value", + ) + + # Make the request + response = await client.fetch_remote_branches(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_FetchRemoteBranches_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_remote_branches_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_remote_branches_sync.py new file mode 100644 index 0000000..74c7bb1 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_remote_branches_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for FetchRemoteBranches +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_FetchRemoteBranches_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_fetch_remote_branches(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.FetchRemoteBranchesRequest( + name="name_value", + ) + + # Make the request + response = client.fetch_remote_branches(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_FetchRemoteBranches_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_compilation_result_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_compilation_result_async.py new file mode 100644 index 0000000..6e42896 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_compilation_result_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetCompilationResult +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_get_compilation_result(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.GetCompilationResultRequest( + name="name_value", + ) + + # Make the request + response = await client.get_compilation_result(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_GetCompilationResult_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_compilation_result_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_compilation_result_sync.py new file mode 100644 index 0000000..4b37ab2 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_compilation_result_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetCompilationResult +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_GetCompilationResult_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_get_compilation_result(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.GetCompilationResultRequest( + name="name_value", + ) + + # Make the request + response = client.get_compilation_result(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_GetCompilationResult_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_repository_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_repository_async.py new file mode 100644 index 0000000..b90fd17 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_repository_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetRepository +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_get_repository(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.GetRepositoryRequest( + name="name_value", + ) + + # Make the request + response = await client.get_repository(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_GetRepository_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_repository_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_repository_sync.py new file mode 100644 index 0000000..499bfc5 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_repository_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetRepository +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_GetRepository_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_get_repository(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.GetRepositoryRequest( + name="name_value", + ) + + # Make the request + response = client.get_repository(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_GetRepository_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workflow_invocation_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workflow_invocation_async.py new file mode 100644 index 0000000..3e28ad6 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workflow_invocation_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetWorkflowInvocation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_get_workflow_invocation(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.GetWorkflowInvocationRequest( + name="name_value", + ) + + # Make the request + response = await client.get_workflow_invocation(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workflow_invocation_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workflow_invocation_sync.py new file mode 100644 index 0000000..e3d2eaa --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workflow_invocation_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetWorkflowInvocation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_get_workflow_invocation(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.GetWorkflowInvocationRequest( + name="name_value", + ) + + # Make the request + response = client.get_workflow_invocation(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workspace_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workspace_async.py new file mode 100644 index 0000000..8f4cb60 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workspace_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetWorkspace +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_get_workspace(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.GetWorkspaceRequest( + name="name_value", + ) + + # Make the request + response = await client.get_workspace(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_GetWorkspace_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workspace_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workspace_sync.py new file mode 100644 index 0000000..1704f66 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workspace_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetWorkspace +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_GetWorkspace_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_get_workspace(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.GetWorkspaceRequest( + name="name_value", + ) + + # Make the request + response = client.get_workspace(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_GetWorkspace_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_install_npm_packages_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_install_npm_packages_async.py new file mode 100644 index 0000000..ea40b65 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_install_npm_packages_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for InstallNpmPackages +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_install_npm_packages(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.InstallNpmPackagesRequest( + workspace="workspace_value", + ) + + # Make the request + response = await client.install_npm_packages(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_InstallNpmPackages_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_install_npm_packages_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_install_npm_packages_sync.py new file mode 100644 index 0000000..f63ffe0 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_install_npm_packages_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for InstallNpmPackages +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_InstallNpmPackages_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_install_npm_packages(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.InstallNpmPackagesRequest( + workspace="workspace_value", + ) + + # Make the request + response = client.install_npm_packages(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_InstallNpmPackages_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_compilation_results_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_compilation_results_async.py new file mode 100644 index 0000000..06cb733 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_compilation_results_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListCompilationResults +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_list_compilation_results(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ListCompilationResultsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_compilation_results(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dataform_v1beta1_generated_Dataform_ListCompilationResults_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_compilation_results_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_compilation_results_sync.py new file mode 100644 index 0000000..9726782 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_compilation_results_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListCompilationResults +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_ListCompilationResults_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_list_compilation_results(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ListCompilationResultsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_compilation_results(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dataform_v1beta1_generated_Dataform_ListCompilationResults_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_repositories_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_repositories_async.py new file mode 100644 index 0000000..5302adc --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_repositories_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListRepositories +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_list_repositories(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ListRepositoriesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_repositories(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dataform_v1beta1_generated_Dataform_ListRepositories_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_repositories_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_repositories_sync.py new file mode 100644 index 0000000..5210900 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_repositories_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListRepositories +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_ListRepositories_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_list_repositories(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ListRepositoriesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_repositories(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dataform_v1beta1_generated_Dataform_ListRepositories_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workflow_invocations_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workflow_invocations_async.py new file mode 100644 index 0000000..41b6e4d --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workflow_invocations_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListWorkflowInvocations +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_list_workflow_invocations(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ListWorkflowInvocationsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_workflow_invocations(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workflow_invocations_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workflow_invocations_sync.py new file mode 100644 index 0000000..e19c771 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workflow_invocations_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListWorkflowInvocations +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_list_workflow_invocations(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ListWorkflowInvocationsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_workflow_invocations(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workspaces_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workspaces_async.py new file mode 100644 index 0000000..ab69fca --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workspaces_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListWorkspaces +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_list_workspaces(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ListWorkspacesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_workspaces(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dataform_v1beta1_generated_Dataform_ListWorkspaces_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workspaces_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workspaces_sync.py new file mode 100644 index 0000000..6b2cdab --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workspaces_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListWorkspaces +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_ListWorkspaces_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_list_workspaces(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ListWorkspacesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_workspaces(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dataform_v1beta1_generated_Dataform_ListWorkspaces_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_make_directory_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_make_directory_async.py new file mode 100644 index 0000000..b6b2110 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_make_directory_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for MakeDirectory +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_make_directory(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.MakeDirectoryRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + response = await client.make_directory(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_MakeDirectory_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_make_directory_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_make_directory_sync.py new file mode 100644 index 0000000..511e194 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_make_directory_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for MakeDirectory +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_MakeDirectory_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_make_directory(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.MakeDirectoryRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + response = client.make_directory(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_MakeDirectory_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_directory_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_directory_async.py new file mode 100644 index 0000000..54f69cd --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_directory_async.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for MoveDirectory +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_move_directory(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.MoveDirectoryRequest( + workspace="workspace_value", + path="path_value", + new_path="new_path_value", + ) + + # Make the request + response = await client.move_directory(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_MoveDirectory_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_directory_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_directory_sync.py new file mode 100644 index 0000000..15a8f58 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_directory_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for MoveDirectory +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_MoveDirectory_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_move_directory(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.MoveDirectoryRequest( + workspace="workspace_value", + path="path_value", + new_path="new_path_value", + ) + + # Make the request + response = client.move_directory(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_MoveDirectory_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_file_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_file_async.py new file mode 100644 index 0000000..4266481 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_file_async.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for MoveFile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_move_file(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.MoveFileRequest( + workspace="workspace_value", + path="path_value", + new_path="new_path_value", + ) + + # Make the request + response = await client.move_file(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_MoveFile_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_file_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_file_sync.py new file mode 100644 index 0000000..7e2c7c3 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_file_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for MoveFile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_MoveFile_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_move_file(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.MoveFileRequest( + workspace="workspace_value", + path="path_value", + new_path="new_path_value", + ) + + # Make the request + response = client.move_file(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_MoveFile_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_pull_git_commits_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_pull_git_commits_async.py new file mode 100644 index 0000000..d89788e --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_pull_git_commits_async.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PullGitCommits +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_pull_git_commits(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + author = dataform_v1beta1.CommitAuthor() + author.name = "name_value" + author.email_address = "email_address_value" + + request = dataform_v1beta1.PullGitCommitsRequest( + name="name_value", + author=author, + ) + + # Make the request + await client.pull_git_commits(request=request) + + +# [END dataform_v1beta1_generated_Dataform_PullGitCommits_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_pull_git_commits_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_pull_git_commits_sync.py new file mode 100644 index 0000000..5327931 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_pull_git_commits_sync.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PullGitCommits +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_PullGitCommits_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_pull_git_commits(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + author = dataform_v1beta1.CommitAuthor() + author.name = "name_value" + author.email_address = "email_address_value" + + request = dataform_v1beta1.PullGitCommitsRequest( + name="name_value", + author=author, + ) + + # Make the request + client.pull_git_commits(request=request) + + +# [END dataform_v1beta1_generated_Dataform_PullGitCommits_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_push_git_commits_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_push_git_commits_async.py new file mode 100644 index 0000000..4d83316 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_push_git_commits_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PushGitCommits +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_push_git_commits(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.PushGitCommitsRequest( + name="name_value", + ) + + # Make the request + await client.push_git_commits(request=request) + + +# [END dataform_v1beta1_generated_Dataform_PushGitCommits_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_push_git_commits_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_push_git_commits_sync.py new file mode 100644 index 0000000..73fdf41 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_push_git_commits_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PushGitCommits +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_PushGitCommits_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_push_git_commits(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.PushGitCommitsRequest( + name="name_value", + ) + + # Make the request + client.push_git_commits(request=request) + + +# [END dataform_v1beta1_generated_Dataform_PushGitCommits_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_compilation_result_actions_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_compilation_result_actions_async.py new file mode 100644 index 0000000..52f444b --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_compilation_result_actions_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for QueryCompilationResultActions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_query_compilation_result_actions(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.QueryCompilationResultActionsRequest( + name="name_value", + ) + + # Make the request + page_result = client.query_compilation_result_actions(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_compilation_result_actions_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_compilation_result_actions_sync.py new file mode 100644 index 0000000..ce85bda --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_compilation_result_actions_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for QueryCompilationResultActions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_query_compilation_result_actions(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.QueryCompilationResultActionsRequest( + name="name_value", + ) + + # Make the request + page_result = client.query_compilation_result_actions(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_directory_contents_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_directory_contents_async.py new file mode 100644 index 0000000..a2874e2 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_directory_contents_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for QueryDirectoryContents +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_query_directory_contents(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.QueryDirectoryContentsRequest( + workspace="workspace_value", + ) + + # Make the request + page_result = client.query_directory_contents(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dataform_v1beta1_generated_Dataform_QueryDirectoryContents_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_directory_contents_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_directory_contents_sync.py new file mode 100644 index 0000000..6758fdf --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_directory_contents_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for QueryDirectoryContents +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_QueryDirectoryContents_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_query_directory_contents(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.QueryDirectoryContentsRequest( + workspace="workspace_value", + ) + + # Make the request + page_result = client.query_directory_contents(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dataform_v1beta1_generated_Dataform_QueryDirectoryContents_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_async.py new file mode 100644 index 0000000..27cfaaf --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for QueryWorkflowInvocationActions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_query_workflow_invocation_actions(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.QueryWorkflowInvocationActionsRequest( + name="name_value", + ) + + # Make the request + page_result = client.query_workflow_invocation_actions(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_sync.py new file mode 100644 index 0000000..9858402 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for QueryWorkflowInvocationActions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_query_workflow_invocation_actions(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.QueryWorkflowInvocationActionsRequest( + name="name_value", + ) + + # Make the request + page_result = client.query_workflow_invocation_actions(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_read_file_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_read_file_async.py new file mode 100644 index 0000000..b5d8fc0 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_read_file_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ReadFile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_read_file(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ReadFileRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + response = await client.read_file(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_ReadFile_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_read_file_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_read_file_sync.py new file mode 100644 index 0000000..d39b4ba --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_read_file_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ReadFile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_ReadFile_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_read_file(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ReadFileRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + response = client.read_file(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_ReadFile_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_directory_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_directory_async.py new file mode 100644 index 0000000..e5af286 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_directory_async.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RemoveDirectory +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_remove_directory(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.RemoveDirectoryRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + await client.remove_directory(request=request) + + +# [END dataform_v1beta1_generated_Dataform_RemoveDirectory_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_directory_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_directory_sync.py new file mode 100644 index 0000000..8c7c1d1 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_directory_sync.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RemoveDirectory +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_RemoveDirectory_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_remove_directory(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.RemoveDirectoryRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + client.remove_directory(request=request) + + +# [END dataform_v1beta1_generated_Dataform_RemoveDirectory_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_file_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_file_async.py new file mode 100644 index 0000000..8882913 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_file_async.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RemoveFile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_remove_file(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.RemoveFileRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + await client.remove_file(request=request) + + +# [END dataform_v1beta1_generated_Dataform_RemoveFile_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_file_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_file_sync.py new file mode 100644 index 0000000..e16511f --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_file_sync.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RemoveFile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_RemoveFile_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_remove_file(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.RemoveFileRequest( + workspace="workspace_value", + path="path_value", + ) + + # Make the request + client.remove_file(request=request) + + +# [END dataform_v1beta1_generated_Dataform_RemoveFile_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_reset_workspace_changes_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_reset_workspace_changes_async.py new file mode 100644 index 0000000..35ea778 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_reset_workspace_changes_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ResetWorkspaceChanges +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_reset_workspace_changes(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ResetWorkspaceChangesRequest( + name="name_value", + ) + + # Make the request + await client.reset_workspace_changes(request=request) + + +# [END dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_reset_workspace_changes_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_reset_workspace_changes_sync.py new file mode 100644 index 0000000..be8a247 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_reset_workspace_changes_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ResetWorkspaceChanges +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_reset_workspace_changes(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.ResetWorkspaceChangesRequest( + name="name_value", + ) + + # Make the request + client.reset_workspace_changes(request=request) + + +# [END dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_update_repository_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_update_repository_async.py new file mode 100644 index 0000000..678711d --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_update_repository_async.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateRepository +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_update_repository(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.UpdateRepositoryRequest( + ) + + # Make the request + response = await client.update_repository(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_UpdateRepository_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_update_repository_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_update_repository_sync.py new file mode 100644 index 0000000..761dbd4 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_update_repository_sync.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateRepository +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_UpdateRepository_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_update_repository(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.UpdateRepositoryRequest( + ) + + # Make the request + response = client.update_repository(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_UpdateRepository_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_write_file_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_write_file_async.py new file mode 100644 index 0000000..4a07b88 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_write_file_async.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for WriteFile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +async def sample_write_file(): + # Create a client + client = dataform_v1beta1.DataformAsyncClient() + + # Initialize request argument(s) + request = dataform_v1beta1.WriteFileRequest( + workspace="workspace_value", + path="path_value", + contents=b'contents_blob', + ) + + # Make the request + response = await client.write_file(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_WriteFile_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_write_file_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_write_file_sync.py new file mode 100644 index 0000000..3b7f5d4 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_write_file_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for WriteFile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dataform + + +# [START dataform_v1beta1_generated_Dataform_WriteFile_sync] +# 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. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import dataform_v1beta1 + + +def sample_write_file(): + # Create a client + client = dataform_v1beta1.DataformClient() + + # Initialize request argument(s) + request = dataform_v1beta1.WriteFileRequest( + workspace="workspace_value", + path="path_value", + contents=b'contents_blob', + ) + + # Make the request + response = client.write_file(request=request) + + # Handle the response + print(response) + +# [END dataform_v1beta1_generated_Dataform_WriteFile_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/snippet_metadata_dataform_v1beta1.json b/owl-bot-staging/v1beta1/samples/generated_samples/snippet_metadata_dataform_v1beta1.json new file mode 100644 index 0000000..9a32187 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated_samples/snippet_metadata_dataform_v1beta1.json @@ -0,0 +1,5646 @@ +{ + "clientLibrary": { + "apis": [ + { + "id": "google.cloud.dataform.v1beta1", + "version": "v1beta1" + } + ], + "language": "PYTHON", + "name": "google-cloud-dataform" + }, + "snippets": [ + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.cancel_workflow_invocation", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.CancelWorkflowInvocation", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "CancelWorkflowInvocation" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.CancelWorkflowInvocationRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "cancel_workflow_invocation" + }, + "description": "Sample for CancelWorkflowInvocation", + "file": "dataform_v1beta1_generated_dataform_cancel_workflow_invocation_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_cancel_workflow_invocation_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.cancel_workflow_invocation", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.CancelWorkflowInvocation", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "CancelWorkflowInvocation" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.CancelWorkflowInvocationRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "cancel_workflow_invocation" + }, + "description": "Sample for CancelWorkflowInvocation", + "file": "dataform_v1beta1_generated_dataform_cancel_workflow_invocation_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_cancel_workflow_invocation_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.commit_workspace_changes", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.CommitWorkspaceChanges", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "CommitWorkspaceChanges" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.CommitWorkspaceChangesRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "commit_workspace_changes" + }, + "description": "Sample for CommitWorkspaceChanges", + "file": "dataform_v1beta1_generated_dataform_commit_workspace_changes_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_async", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 50, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 51, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_commit_workspace_changes_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.commit_workspace_changes", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.CommitWorkspaceChanges", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "CommitWorkspaceChanges" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.CommitWorkspaceChangesRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "commit_workspace_changes" + }, + "description": "Sample for CommitWorkspaceChanges", + "file": "dataform_v1beta1_generated_dataform_commit_workspace_changes_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_sync", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 50, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 51, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_commit_workspace_changes_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.create_compilation_result", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateCompilationResult", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "CreateCompilationResult" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.CreateCompilationResultRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "compilation_result", + "type": "google.cloud.dataform_v1beta1.types.CompilationResult" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.CompilationResult", + "shortName": "create_compilation_result" + }, + "description": "Sample for CreateCompilationResult", + "file": "dataform_v1beta1_generated_dataform_create_compilation_result_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_CreateCompilationResult_async", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 49, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 50, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_create_compilation_result_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.create_compilation_result", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateCompilationResult", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "CreateCompilationResult" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.CreateCompilationResultRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "compilation_result", + "type": "google.cloud.dataform_v1beta1.types.CompilationResult" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.CompilationResult", + "shortName": "create_compilation_result" + }, + "description": "Sample for CreateCompilationResult", + "file": "dataform_v1beta1_generated_dataform_create_compilation_result_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_CreateCompilationResult_sync", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 49, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 50, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_create_compilation_result_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.create_repository", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateRepository", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "CreateRepository" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.CreateRepositoryRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "repository", + "type": "google.cloud.dataform_v1beta1.types.Repository" + }, + { + "name": "repository_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.Repository", + "shortName": "create_repository" + }, + "description": "Sample for CreateRepository", + "file": "dataform_v1beta1_generated_dataform_create_repository_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_CreateRepository_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_create_repository_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.create_repository", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateRepository", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "CreateRepository" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.CreateRepositoryRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "repository", + "type": "google.cloud.dataform_v1beta1.types.Repository" + }, + { + "name": "repository_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.Repository", + "shortName": "create_repository" + }, + "description": "Sample for CreateRepository", + "file": "dataform_v1beta1_generated_dataform_create_repository_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_CreateRepository_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_create_repository_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.create_workflow_invocation", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateWorkflowInvocation", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "CreateWorkflowInvocation" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.CreateWorkflowInvocationRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "workflow_invocation", + "type": "google.cloud.dataform_v1beta1.types.WorkflowInvocation" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.WorkflowInvocation", + "shortName": "create_workflow_invocation" + }, + "description": "Sample for CreateWorkflowInvocation", + "file": "dataform_v1beta1_generated_dataform_create_workflow_invocation_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_create_workflow_invocation_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.create_workflow_invocation", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateWorkflowInvocation", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "CreateWorkflowInvocation" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.CreateWorkflowInvocationRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "workflow_invocation", + "type": "google.cloud.dataform_v1beta1.types.WorkflowInvocation" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.WorkflowInvocation", + "shortName": "create_workflow_invocation" + }, + "description": "Sample for CreateWorkflowInvocation", + "file": "dataform_v1beta1_generated_dataform_create_workflow_invocation_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_create_workflow_invocation_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.create_workspace", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateWorkspace", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "CreateWorkspace" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.CreateWorkspaceRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "workspace", + "type": "google.cloud.dataform_v1beta1.types.Workspace" + }, + { + "name": "workspace_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.Workspace", + "shortName": "create_workspace" + }, + "description": "Sample for CreateWorkspace", + "file": "dataform_v1beta1_generated_dataform_create_workspace_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_CreateWorkspace_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_create_workspace_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.create_workspace", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateWorkspace", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "CreateWorkspace" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.CreateWorkspaceRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "workspace", + "type": "google.cloud.dataform_v1beta1.types.Workspace" + }, + { + "name": "workspace_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.Workspace", + "shortName": "create_workspace" + }, + "description": "Sample for CreateWorkspace", + "file": "dataform_v1beta1_generated_dataform_create_workspace_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_CreateWorkspace_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_create_workspace_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.delete_repository", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteRepository", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "DeleteRepository" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.DeleteRepositoryRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_repository" + }, + "description": "Sample for DeleteRepository", + "file": "dataform_v1beta1_generated_dataform_delete_repository_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_DeleteRepository_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_delete_repository_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.delete_repository", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteRepository", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "DeleteRepository" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.DeleteRepositoryRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_repository" + }, + "description": "Sample for DeleteRepository", + "file": "dataform_v1beta1_generated_dataform_delete_repository_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_DeleteRepository_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_delete_repository_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.delete_workflow_invocation", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteWorkflowInvocation", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "DeleteWorkflowInvocation" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.DeleteWorkflowInvocationRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_workflow_invocation" + }, + "description": "Sample for DeleteWorkflowInvocation", + "file": "dataform_v1beta1_generated_dataform_delete_workflow_invocation_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_delete_workflow_invocation_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.delete_workflow_invocation", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteWorkflowInvocation", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "DeleteWorkflowInvocation" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.DeleteWorkflowInvocationRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_workflow_invocation" + }, + "description": "Sample for DeleteWorkflowInvocation", + "file": "dataform_v1beta1_generated_dataform_delete_workflow_invocation_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_delete_workflow_invocation_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.delete_workspace", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteWorkspace", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "DeleteWorkspace" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.DeleteWorkspaceRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_workspace" + }, + "description": "Sample for DeleteWorkspace", + "file": "dataform_v1beta1_generated_dataform_delete_workspace_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_DeleteWorkspace_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_delete_workspace_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.delete_workspace", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteWorkspace", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "DeleteWorkspace" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.DeleteWorkspaceRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_workspace" + }, + "description": "Sample for DeleteWorkspace", + "file": "dataform_v1beta1_generated_dataform_delete_workspace_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_DeleteWorkspace_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_delete_workspace_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.fetch_file_diff", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchFileDiff", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "FetchFileDiff" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.FetchFileDiffRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.FetchFileDiffResponse", + "shortName": "fetch_file_diff" + }, + "description": "Sample for FetchFileDiff", + "file": "dataform_v1beta1_generated_dataform_fetch_file_diff_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_FetchFileDiff_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_fetch_file_diff_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.fetch_file_diff", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchFileDiff", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "FetchFileDiff" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.FetchFileDiffRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.FetchFileDiffResponse", + "shortName": "fetch_file_diff" + }, + "description": "Sample for FetchFileDiff", + "file": "dataform_v1beta1_generated_dataform_fetch_file_diff_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_FetchFileDiff_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_fetch_file_diff_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.fetch_file_git_statuses", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchFileGitStatuses", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "FetchFileGitStatuses" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.FetchFileGitStatusesRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.FetchFileGitStatusesResponse", + "shortName": "fetch_file_git_statuses" + }, + "description": "Sample for FetchFileGitStatuses", + "file": "dataform_v1beta1_generated_dataform_fetch_file_git_statuses_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_fetch_file_git_statuses_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.fetch_file_git_statuses", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchFileGitStatuses", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "FetchFileGitStatuses" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.FetchFileGitStatusesRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.FetchFileGitStatusesResponse", + "shortName": "fetch_file_git_statuses" + }, + "description": "Sample for FetchFileGitStatuses", + "file": "dataform_v1beta1_generated_dataform_fetch_file_git_statuses_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_fetch_file_git_statuses_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.fetch_git_ahead_behind", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchGitAheadBehind", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "FetchGitAheadBehind" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.FetchGitAheadBehindRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.FetchGitAheadBehindResponse", + "shortName": "fetch_git_ahead_behind" + }, + "description": "Sample for FetchGitAheadBehind", + "file": "dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.fetch_git_ahead_behind", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchGitAheadBehind", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "FetchGitAheadBehind" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.FetchGitAheadBehindRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.FetchGitAheadBehindResponse", + "shortName": "fetch_git_ahead_behind" + }, + "description": "Sample for FetchGitAheadBehind", + "file": "dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.fetch_remote_branches", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchRemoteBranches", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "FetchRemoteBranches" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.FetchRemoteBranchesRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.FetchRemoteBranchesResponse", + "shortName": "fetch_remote_branches" + }, + "description": "Sample for FetchRemoteBranches", + "file": "dataform_v1beta1_generated_dataform_fetch_remote_branches_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_FetchRemoteBranches_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_fetch_remote_branches_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.fetch_remote_branches", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchRemoteBranches", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "FetchRemoteBranches" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.FetchRemoteBranchesRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.FetchRemoteBranchesResponse", + "shortName": "fetch_remote_branches" + }, + "description": "Sample for FetchRemoteBranches", + "file": "dataform_v1beta1_generated_dataform_fetch_remote_branches_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_FetchRemoteBranches_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_fetch_remote_branches_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.get_compilation_result", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.GetCompilationResult", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "GetCompilationResult" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.GetCompilationResultRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.CompilationResult", + "shortName": "get_compilation_result" + }, + "description": "Sample for GetCompilationResult", + "file": "dataform_v1beta1_generated_dataform_get_compilation_result_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_GetCompilationResult_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_get_compilation_result_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.get_compilation_result", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.GetCompilationResult", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "GetCompilationResult" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.GetCompilationResultRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.CompilationResult", + "shortName": "get_compilation_result" + }, + "description": "Sample for GetCompilationResult", + "file": "dataform_v1beta1_generated_dataform_get_compilation_result_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_GetCompilationResult_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_get_compilation_result_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.get_repository", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.GetRepository", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "GetRepository" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.GetRepositoryRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.Repository", + "shortName": "get_repository" + }, + "description": "Sample for GetRepository", + "file": "dataform_v1beta1_generated_dataform_get_repository_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_GetRepository_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_get_repository_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.get_repository", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.GetRepository", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "GetRepository" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.GetRepositoryRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.Repository", + "shortName": "get_repository" + }, + "description": "Sample for GetRepository", + "file": "dataform_v1beta1_generated_dataform_get_repository_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_GetRepository_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_get_repository_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.get_workflow_invocation", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.GetWorkflowInvocation", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "GetWorkflowInvocation" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.GetWorkflowInvocationRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.WorkflowInvocation", + "shortName": "get_workflow_invocation" + }, + "description": "Sample for GetWorkflowInvocation", + "file": "dataform_v1beta1_generated_dataform_get_workflow_invocation_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_get_workflow_invocation_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.get_workflow_invocation", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.GetWorkflowInvocation", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "GetWorkflowInvocation" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.GetWorkflowInvocationRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.WorkflowInvocation", + "shortName": "get_workflow_invocation" + }, + "description": "Sample for GetWorkflowInvocation", + "file": "dataform_v1beta1_generated_dataform_get_workflow_invocation_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_get_workflow_invocation_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.get_workspace", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.GetWorkspace", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "GetWorkspace" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.GetWorkspaceRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.Workspace", + "shortName": "get_workspace" + }, + "description": "Sample for GetWorkspace", + "file": "dataform_v1beta1_generated_dataform_get_workspace_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_GetWorkspace_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_get_workspace_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.get_workspace", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.GetWorkspace", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "GetWorkspace" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.GetWorkspaceRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.Workspace", + "shortName": "get_workspace" + }, + "description": "Sample for GetWorkspace", + "file": "dataform_v1beta1_generated_dataform_get_workspace_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_GetWorkspace_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_get_workspace_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.install_npm_packages", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.InstallNpmPackages", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "InstallNpmPackages" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.InstallNpmPackagesRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.InstallNpmPackagesResponse", + "shortName": "install_npm_packages" + }, + "description": "Sample for InstallNpmPackages", + "file": "dataform_v1beta1_generated_dataform_install_npm_packages_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_InstallNpmPackages_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_install_npm_packages_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.install_npm_packages", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.InstallNpmPackages", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "InstallNpmPackages" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.InstallNpmPackagesRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.InstallNpmPackagesResponse", + "shortName": "install_npm_packages" + }, + "description": "Sample for InstallNpmPackages", + "file": "dataform_v1beta1_generated_dataform_install_npm_packages_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_InstallNpmPackages_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_install_npm_packages_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.list_compilation_results", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.ListCompilationResults", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "ListCompilationResults" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.ListCompilationResultsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.ListCompilationResultsAsyncPager", + "shortName": "list_compilation_results" + }, + "description": "Sample for ListCompilationResults", + "file": "dataform_v1beta1_generated_dataform_list_compilation_results_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_ListCompilationResults_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_list_compilation_results_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.list_compilation_results", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.ListCompilationResults", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "ListCompilationResults" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.ListCompilationResultsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.ListCompilationResultsPager", + "shortName": "list_compilation_results" + }, + "description": "Sample for ListCompilationResults", + "file": "dataform_v1beta1_generated_dataform_list_compilation_results_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_ListCompilationResults_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_list_compilation_results_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.list_repositories", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.ListRepositories", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "ListRepositories" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.ListRepositoriesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.ListRepositoriesAsyncPager", + "shortName": "list_repositories" + }, + "description": "Sample for ListRepositories", + "file": "dataform_v1beta1_generated_dataform_list_repositories_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_ListRepositories_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_list_repositories_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.list_repositories", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.ListRepositories", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "ListRepositories" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.ListRepositoriesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.ListRepositoriesPager", + "shortName": "list_repositories" + }, + "description": "Sample for ListRepositories", + "file": "dataform_v1beta1_generated_dataform_list_repositories_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_ListRepositories_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_list_repositories_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.list_workflow_invocations", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.ListWorkflowInvocations", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "ListWorkflowInvocations" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.ListWorkflowInvocationsAsyncPager", + "shortName": "list_workflow_invocations" + }, + "description": "Sample for ListWorkflowInvocations", + "file": "dataform_v1beta1_generated_dataform_list_workflow_invocations_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_list_workflow_invocations_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.list_workflow_invocations", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.ListWorkflowInvocations", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "ListWorkflowInvocations" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.ListWorkflowInvocationsPager", + "shortName": "list_workflow_invocations" + }, + "description": "Sample for ListWorkflowInvocations", + "file": "dataform_v1beta1_generated_dataform_list_workflow_invocations_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_list_workflow_invocations_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.list_workspaces", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.ListWorkspaces", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "ListWorkspaces" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.ListWorkspacesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.ListWorkspacesAsyncPager", + "shortName": "list_workspaces" + }, + "description": "Sample for ListWorkspaces", + "file": "dataform_v1beta1_generated_dataform_list_workspaces_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_ListWorkspaces_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_list_workspaces_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.list_workspaces", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.ListWorkspaces", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "ListWorkspaces" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.ListWorkspacesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.ListWorkspacesPager", + "shortName": "list_workspaces" + }, + "description": "Sample for ListWorkspaces", + "file": "dataform_v1beta1_generated_dataform_list_workspaces_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_ListWorkspaces_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_list_workspaces_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.make_directory", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.MakeDirectory", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "MakeDirectory" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.MakeDirectoryRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.MakeDirectoryResponse", + "shortName": "make_directory" + }, + "description": "Sample for MakeDirectory", + "file": "dataform_v1beta1_generated_dataform_make_directory_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_MakeDirectory_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_make_directory_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.make_directory", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.MakeDirectory", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "MakeDirectory" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.MakeDirectoryRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.MakeDirectoryResponse", + "shortName": "make_directory" + }, + "description": "Sample for MakeDirectory", + "file": "dataform_v1beta1_generated_dataform_make_directory_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_MakeDirectory_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_make_directory_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.move_directory", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.MoveDirectory", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "MoveDirectory" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.MoveDirectoryRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.MoveDirectoryResponse", + "shortName": "move_directory" + }, + "description": "Sample for MoveDirectory", + "file": "dataform_v1beta1_generated_dataform_move_directory_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_MoveDirectory_async", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 50, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "start": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_move_directory_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.move_directory", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.MoveDirectory", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "MoveDirectory" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.MoveDirectoryRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.MoveDirectoryResponse", + "shortName": "move_directory" + }, + "description": "Sample for MoveDirectory", + "file": "dataform_v1beta1_generated_dataform_move_directory_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_MoveDirectory_sync", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 50, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "start": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_move_directory_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.move_file", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.MoveFile", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "MoveFile" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.MoveFileRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.MoveFileResponse", + "shortName": "move_file" + }, + "description": "Sample for MoveFile", + "file": "dataform_v1beta1_generated_dataform_move_file_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_MoveFile_async", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 50, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "start": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_move_file_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.move_file", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.MoveFile", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "MoveFile" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.MoveFileRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.MoveFileResponse", + "shortName": "move_file" + }, + "description": "Sample for MoveFile", + "file": "dataform_v1beta1_generated_dataform_move_file_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_MoveFile_sync", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 50, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "start": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_move_file_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.pull_git_commits", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.PullGitCommits", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "PullGitCommits" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.PullGitCommitsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "pull_git_commits" + }, + "description": "Sample for PullGitCommits", + "file": "dataform_v1beta1_generated_dataform_pull_git_commits_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_PullGitCommits_async", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 50, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 51, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_pull_git_commits_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.pull_git_commits", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.PullGitCommits", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "PullGitCommits" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.PullGitCommitsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "pull_git_commits" + }, + "description": "Sample for PullGitCommits", + "file": "dataform_v1beta1_generated_dataform_pull_git_commits_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_PullGitCommits_sync", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 50, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 51, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_pull_git_commits_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.push_git_commits", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.PushGitCommits", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "PushGitCommits" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.PushGitCommitsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "push_git_commits" + }, + "description": "Sample for PushGitCommits", + "file": "dataform_v1beta1_generated_dataform_push_git_commits_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_PushGitCommits_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_push_git_commits_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.push_git_commits", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.PushGitCommits", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "PushGitCommits" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.PushGitCommitsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "push_git_commits" + }, + "description": "Sample for PushGitCommits", + "file": "dataform_v1beta1_generated_dataform_push_git_commits_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_PushGitCommits_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_push_git_commits_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.query_compilation_result_actions", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryCompilationResultActions", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "QueryCompilationResultActions" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.QueryCompilationResultActionsAsyncPager", + "shortName": "query_compilation_result_actions" + }, + "description": "Sample for QueryCompilationResultActions", + "file": "dataform_v1beta1_generated_dataform_query_compilation_result_actions_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_query_compilation_result_actions_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.query_compilation_result_actions", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryCompilationResultActions", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "QueryCompilationResultActions" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.QueryCompilationResultActionsPager", + "shortName": "query_compilation_result_actions" + }, + "description": "Sample for QueryCompilationResultActions", + "file": "dataform_v1beta1_generated_dataform_query_compilation_result_actions_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_query_compilation_result_actions_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.query_directory_contents", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryDirectoryContents", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "QueryDirectoryContents" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.QueryDirectoryContentsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.QueryDirectoryContentsAsyncPager", + "shortName": "query_directory_contents" + }, + "description": "Sample for QueryDirectoryContents", + "file": "dataform_v1beta1_generated_dataform_query_directory_contents_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_QueryDirectoryContents_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_query_directory_contents_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.query_directory_contents", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryDirectoryContents", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "QueryDirectoryContents" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.QueryDirectoryContentsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.QueryDirectoryContentsPager", + "shortName": "query_directory_contents" + }, + "description": "Sample for QueryDirectoryContents", + "file": "dataform_v1beta1_generated_dataform_query_directory_contents_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_QueryDirectoryContents_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_query_directory_contents_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.query_workflow_invocation_actions", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryWorkflowInvocationActions", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "QueryWorkflowInvocationActions" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.QueryWorkflowInvocationActionsAsyncPager", + "shortName": "query_workflow_invocation_actions" + }, + "description": "Sample for QueryWorkflowInvocationActions", + "file": "dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.query_workflow_invocation_actions", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryWorkflowInvocationActions", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "QueryWorkflowInvocationActions" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.QueryWorkflowInvocationActionsPager", + "shortName": "query_workflow_invocation_actions" + }, + "description": "Sample for QueryWorkflowInvocationActions", + "file": "dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.read_file", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.ReadFile", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "ReadFile" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.ReadFileRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.ReadFileResponse", + "shortName": "read_file" + }, + "description": "Sample for ReadFile", + "file": "dataform_v1beta1_generated_dataform_read_file_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_ReadFile_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_read_file_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.read_file", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.ReadFile", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "ReadFile" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.ReadFileRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.ReadFileResponse", + "shortName": "read_file" + }, + "description": "Sample for ReadFile", + "file": "dataform_v1beta1_generated_dataform_read_file_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_ReadFile_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_read_file_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.remove_directory", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.RemoveDirectory", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "RemoveDirectory" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.RemoveDirectoryRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "remove_directory" + }, + "description": "Sample for RemoveDirectory", + "file": "dataform_v1beta1_generated_dataform_remove_directory_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_RemoveDirectory_async", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_remove_directory_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.remove_directory", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.RemoveDirectory", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "RemoveDirectory" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.RemoveDirectoryRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "remove_directory" + }, + "description": "Sample for RemoveDirectory", + "file": "dataform_v1beta1_generated_dataform_remove_directory_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_RemoveDirectory_sync", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_remove_directory_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.remove_file", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.RemoveFile", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "RemoveFile" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.RemoveFileRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "remove_file" + }, + "description": "Sample for RemoveFile", + "file": "dataform_v1beta1_generated_dataform_remove_file_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_RemoveFile_async", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_remove_file_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.remove_file", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.RemoveFile", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "RemoveFile" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.RemoveFileRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "remove_file" + }, + "description": "Sample for RemoveFile", + "file": "dataform_v1beta1_generated_dataform_remove_file_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_RemoveFile_sync", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_remove_file_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.reset_workspace_changes", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.ResetWorkspaceChanges", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "ResetWorkspaceChanges" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.ResetWorkspaceChangesRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "reset_workspace_changes" + }, + "description": "Sample for ResetWorkspaceChanges", + "file": "dataform_v1beta1_generated_dataform_reset_workspace_changes_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_reset_workspace_changes_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.reset_workspace_changes", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.ResetWorkspaceChanges", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "ResetWorkspaceChanges" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.ResetWorkspaceChangesRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "reset_workspace_changes" + }, + "description": "Sample for ResetWorkspaceChanges", + "file": "dataform_v1beta1_generated_dataform_reset_workspace_changes_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_reset_workspace_changes_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.update_repository", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.UpdateRepository", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "UpdateRepository" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.UpdateRepositoryRequest" + }, + { + "name": "repository", + "type": "google.cloud.dataform_v1beta1.types.Repository" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.Repository", + "shortName": "update_repository" + }, + "description": "Sample for UpdateRepository", + "file": "dataform_v1beta1_generated_dataform_update_repository_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_UpdateRepository_async", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_update_repository_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.update_repository", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.UpdateRepository", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "UpdateRepository" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.UpdateRepositoryRequest" + }, + { + "name": "repository", + "type": "google.cloud.dataform_v1beta1.types.Repository" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.Repository", + "shortName": "update_repository" + }, + "description": "Sample for UpdateRepository", + "file": "dataform_v1beta1_generated_dataform_update_repository_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_UpdateRepository_sync", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_update_repository_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", + "shortName": "DataformAsyncClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.write_file", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.WriteFile", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "WriteFile" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.WriteFileRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.WriteFileResponse", + "shortName": "write_file" + }, + "description": "Sample for WriteFile", + "file": "dataform_v1beta1_generated_dataform_write_file_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_WriteFile_async", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 50, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "start": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_write_file_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.dataform_v1beta1.DataformClient", + "shortName": "DataformClient" + }, + "fullName": "google.cloud.dataform_v1beta1.DataformClient.write_file", + "method": { + "fullName": "google.cloud.dataform.v1beta1.Dataform.WriteFile", + "service": { + "fullName": "google.cloud.dataform.v1beta1.Dataform", + "shortName": "Dataform" + }, + "shortName": "WriteFile" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.dataform_v1beta1.types.WriteFileRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.dataform_v1beta1.types.WriteFileResponse", + "shortName": "write_file" + }, + "description": "Sample for WriteFile", + "file": "dataform_v1beta1_generated_dataform_write_file_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "dataform_v1beta1_generated_Dataform_WriteFile_sync", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 50, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "start": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "dataform_v1beta1_generated_dataform_write_file_sync.py" + } + ] +} diff --git a/owl-bot-staging/v1beta1/scripts/fixup_dataform_v1beta1_keywords.py b/owl-bot-staging/v1beta1/scripts/fixup_dataform_v1beta1_keywords.py new file mode 100644 index 0000000..4e14973 --- /dev/null +++ b/owl-bot-staging/v1beta1/scripts/fixup_dataform_v1beta1_keywords.py @@ -0,0 +1,211 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# 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. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class dataformCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + 'cancel_workflow_invocation': ('name', ), + 'commit_workspace_changes': ('name', 'author', 'commit_message', 'paths', ), + 'create_compilation_result': ('parent', 'compilation_result', ), + 'create_repository': ('parent', 'repository', 'repository_id', ), + 'create_workflow_invocation': ('parent', 'workflow_invocation', ), + 'create_workspace': ('parent', 'workspace', 'workspace_id', ), + 'delete_repository': ('name', 'force', ), + 'delete_workflow_invocation': ('name', ), + 'delete_workspace': ('name', ), + 'fetch_file_diff': ('workspace', 'path', ), + 'fetch_file_git_statuses': ('name', ), + 'fetch_git_ahead_behind': ('name', 'remote_branch', ), + 'fetch_remote_branches': ('name', ), + 'get_compilation_result': ('name', ), + 'get_repository': ('name', ), + 'get_workflow_invocation': ('name', ), + 'get_workspace': ('name', ), + 'install_npm_packages': ('workspace', ), + 'list_compilation_results': ('parent', 'page_size', 'page_token', ), + 'list_repositories': ('parent', 'page_size', 'page_token', 'order_by', 'filter', ), + 'list_workflow_invocations': ('parent', 'page_size', 'page_token', ), + 'list_workspaces': ('parent', 'page_size', 'page_token', 'order_by', 'filter', ), + 'make_directory': ('workspace', 'path', ), + 'move_directory': ('workspace', 'path', 'new_path', ), + 'move_file': ('workspace', 'path', 'new_path', ), + 'pull_git_commits': ('name', 'author', 'remote_branch', ), + 'push_git_commits': ('name', 'remote_branch', ), + 'query_compilation_result_actions': ('name', 'page_size', 'page_token', 'filter', ), + 'query_directory_contents': ('workspace', 'path', 'page_size', 'page_token', ), + 'query_workflow_invocation_actions': ('name', 'page_size', 'page_token', ), + 'read_file': ('workspace', 'path', ), + 'remove_directory': ('workspace', 'path', ), + 'remove_file': ('workspace', 'path', ), + 'reset_workspace_changes': ('name', 'paths', 'clean', ), + 'update_repository': ('repository', 'update_mask', ), + 'write_file': ('workspace', 'path', 'contents', ), + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=dataformCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the dataform client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/v1beta1/setup.py b/owl-bot-staging/v1beta1/setup.py new file mode 100644 index 0000000..cd0952f --- /dev/null +++ b/owl-bot-staging/v1beta1/setup.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# 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. +# +import io +import os +import setuptools # type: ignore + +version = '0.1.0' + +package_root = os.path.abspath(os.path.dirname(__file__)) + +readme_filename = os.path.join(package_root, 'README.rst') +with io.open(readme_filename, encoding='utf-8') as readme_file: + readme = readme_file.read() + +setuptools.setup( + name='google-cloud-dataform', + author="Google LLC", + author_email="googleapis-packages@google.com", + url="https://github.com/googleapis/python-google-cloud-dataform", + version=version, + long_description=readme, + packages=setuptools.PEP420PackageFinder.find(), + namespace_packages=('google', 'google.cloud'), + platforms='Posix; MacOS X; Windows', + include_package_data=True, + install_requires=( + 'google-api-core[grpc] >= 2.10.0, < 3.0.0dev', + 'libcst >= 0.2.5', + 'googleapis-common-protos >= 1.55.0, <2.0.0dev', + 'proto-plus >= 1.19.7', + 'grpc-google-iam-v1 >= 0.12.4, < 0.13dev', + ), + python_requires='>=3.7', + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Intended Audience :: Developers', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Topic :: Internet', + 'Topic :: Software Development :: Libraries :: Python Modules', + ], + zip_safe=False, +) diff --git a/owl-bot-staging/v1beta1/tests/__init__.py b/owl-bot-staging/v1beta1/tests/__init__.py new file mode 100644 index 0000000..231bc12 --- /dev/null +++ b/owl-bot-staging/v1beta1/tests/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# 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. +# diff --git a/owl-bot-staging/v1beta1/tests/unit/__init__.py b/owl-bot-staging/v1beta1/tests/unit/__init__.py new file mode 100644 index 0000000..231bc12 --- /dev/null +++ b/owl-bot-staging/v1beta1/tests/unit/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# 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. +# diff --git a/owl-bot-staging/v1beta1/tests/unit/gapic/__init__.py b/owl-bot-staging/v1beta1/tests/unit/gapic/__init__.py new file mode 100644 index 0000000..231bc12 --- /dev/null +++ b/owl-bot-staging/v1beta1/tests/unit/gapic/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# 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. +# diff --git a/owl-bot-staging/v1beta1/tests/unit/gapic/dataform_v1beta1/__init__.py b/owl-bot-staging/v1beta1/tests/unit/gapic/dataform_v1beta1/__init__.py new file mode 100644 index 0000000..231bc12 --- /dev/null +++ b/owl-bot-staging/v1beta1/tests/unit/gapic/dataform_v1beta1/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# 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. +# diff --git a/owl-bot-staging/v1beta1/tests/unit/gapic/dataform_v1beta1/test_dataform.py b/owl-bot-staging/v1beta1/tests/unit/gapic/dataform_v1beta1/test_dataform.py new file mode 100644 index 0000000..05c0f9c --- /dev/null +++ b/owl-bot-staging/v1beta1/tests/unit/gapic/dataform_v1beta1/test_dataform.py @@ -0,0 +1,9611 @@ +# -*- coding: utf-8 -*- +# 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. +# +import os +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock # pragma: NO COVER +except ImportError: # pragma: NO COVER + import mock + +import grpc +from grpc.experimental import aio +import math +import pytest +from proto.marshal.rules.dates import DurationRule, TimestampRule +from proto.marshal.rules import wrappers + +from google.api_core import client_options +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import grpc_helpers +from google.api_core import grpc_helpers_async +from google.api_core import path_template +from google.auth import credentials as ga_credentials +from google.auth.exceptions import MutualTLSChannelError +from google.cloud.dataform_v1beta1.services.dataform import DataformAsyncClient +from google.cloud.dataform_v1beta1.services.dataform import DataformClient +from google.cloud.dataform_v1beta1.services.dataform import pagers +from google.cloud.dataform_v1beta1.services.dataform import transports +from google.cloud.dataform_v1beta1.types import dataform +from google.cloud.location import locations_pb2 +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import options_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.oauth2 import service_account +from google.protobuf import field_mask_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore +from google.type import interval_pb2 # type: ignore +import google.auth + + +def client_cert_source_callback(): + return b"cert bytes", b"key bytes" + + +# If default endpoint is localhost, then default mtls endpoint will be the same. +# This method modifies the default endpoint so the client can produce a different +# mtls endpoint for endpoint testing purposes. +def modify_default_endpoint(client): + return "foo.googleapis.com" if ("localhost" in client.DEFAULT_ENDPOINT) else client.DEFAULT_ENDPOINT + + +def test__get_default_mtls_endpoint(): + api_endpoint = "example.googleapis.com" + api_mtls_endpoint = "example.mtls.googleapis.com" + sandbox_endpoint = "example.sandbox.googleapis.com" + sandbox_mtls_endpoint = "example.mtls.sandbox.googleapis.com" + non_googleapi = "api.example.com" + + assert DataformClient._get_default_mtls_endpoint(None) is None + assert DataformClient._get_default_mtls_endpoint(api_endpoint) == api_mtls_endpoint + assert DataformClient._get_default_mtls_endpoint(api_mtls_endpoint) == api_mtls_endpoint + assert DataformClient._get_default_mtls_endpoint(sandbox_endpoint) == sandbox_mtls_endpoint + assert DataformClient._get_default_mtls_endpoint(sandbox_mtls_endpoint) == sandbox_mtls_endpoint + assert DataformClient._get_default_mtls_endpoint(non_googleapi) == non_googleapi + + +@pytest.mark.parametrize("client_class,transport_name", [ + (DataformClient, "grpc"), + (DataformAsyncClient, "grpc_asyncio"), +]) +def test_dataform_client_from_service_account_info(client_class, transport_name): + creds = ga_credentials.AnonymousCredentials() + with mock.patch.object(service_account.Credentials, 'from_service_account_info') as factory: + factory.return_value = creds + info = {"valid": True} + client = client_class.from_service_account_info(info, transport=transport_name) + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + assert client.transport._host == ( + 'dataform.googleapis.com:443' + ) + + +@pytest.mark.parametrize("transport_class,transport_name", [ + (transports.DataformGrpcTransport, "grpc"), + (transports.DataformGrpcAsyncIOTransport, "grpc_asyncio"), +]) +def test_dataform_client_service_account_always_use_jwt(transport_class, transport_name): + with mock.patch.object(service_account.Credentials, 'with_always_use_jwt_access', create=True) as use_jwt: + creds = service_account.Credentials(None, None, None) + transport = transport_class(credentials=creds, always_use_jwt_access=True) + use_jwt.assert_called_once_with(True) + + with mock.patch.object(service_account.Credentials, 'with_always_use_jwt_access', create=True) as use_jwt: + creds = service_account.Credentials(None, None, None) + transport = transport_class(credentials=creds, always_use_jwt_access=False) + use_jwt.assert_not_called() + + +@pytest.mark.parametrize("client_class,transport_name", [ + (DataformClient, "grpc"), + (DataformAsyncClient, "grpc_asyncio"), +]) +def test_dataform_client_from_service_account_file(client_class, transport_name): + creds = ga_credentials.AnonymousCredentials() + with mock.patch.object(service_account.Credentials, 'from_service_account_file') as factory: + factory.return_value = creds + client = client_class.from_service_account_file("dummy/file/path.json", transport=transport_name) + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + client = client_class.from_service_account_json("dummy/file/path.json", transport=transport_name) + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + assert client.transport._host == ( + 'dataform.googleapis.com:443' + ) + + +def test_dataform_client_get_transport_class(): + transport = DataformClient.get_transport_class() + available_transports = [ + transports.DataformGrpcTransport, + ] + assert transport in available_transports + + transport = DataformClient.get_transport_class("grpc") + assert transport == transports.DataformGrpcTransport + + +@pytest.mark.parametrize("client_class,transport_class,transport_name", [ + (DataformClient, transports.DataformGrpcTransport, "grpc"), + (DataformAsyncClient, transports.DataformGrpcAsyncIOTransport, "grpc_asyncio"), +]) +@mock.patch.object(DataformClient, "DEFAULT_ENDPOINT", modify_default_endpoint(DataformClient)) +@mock.patch.object(DataformAsyncClient, "DEFAULT_ENDPOINT", modify_default_endpoint(DataformAsyncClient)) +def test_dataform_client_client_options(client_class, transport_class, transport_name): + # Check that if channel is provided we won't create a new one. + with mock.patch.object(DataformClient, 'get_transport_class') as gtc: + transport = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ) + client = client_class(transport=transport) + gtc.assert_not_called() + + # Check that if channel is provided via str we will create a new one. + with mock.patch.object(DataformClient, 'get_transport_class') as gtc: + client = client_class(transport=transport_name) + gtc.assert_called() + + # Check the case api_endpoint is provided. + options = client_options.ClientOptions(api_endpoint="squid.clam.whelk") + with mock.patch.object(transport_class, '__init__') as patched: + patched.return_value = None + client = client_class(transport=transport_name, client_options=options) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host="squid.clam.whelk", + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is + # "never". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + with mock.patch.object(transport_class, '__init__') as patched: + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is + # "always". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + with mock.patch.object(transport_class, '__init__') as patched: + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_MTLS_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has + # unsupported value. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): + with pytest.raises(MutualTLSChannelError): + client = client_class(transport=transport_name) + + # Check the case GOOGLE_API_USE_CLIENT_CERTIFICATE has unsupported value. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"}): + with pytest.raises(ValueError): + client = client_class(transport=transport_name) + + # Check the case quota_project_id is provided + options = client_options.ClientOptions(quota_project_id="octopus") + with mock.patch.object(transport_class, '__init__') as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id="octopus", + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions(api_audience="https://language.googleapis.com") + with mock.patch.object(transport_class, '__init__') as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience="https://language.googleapis.com" + ) + +@pytest.mark.parametrize("client_class,transport_class,transport_name,use_client_cert_env", [ + (DataformClient, transports.DataformGrpcTransport, "grpc", "true"), + (DataformAsyncClient, transports.DataformGrpcAsyncIOTransport, "grpc_asyncio", "true"), + (DataformClient, transports.DataformGrpcTransport, "grpc", "false"), + (DataformAsyncClient, transports.DataformGrpcAsyncIOTransport, "grpc_asyncio", "false"), +]) +@mock.patch.object(DataformClient, "DEFAULT_ENDPOINT", modify_default_endpoint(DataformClient)) +@mock.patch.object(DataformAsyncClient, "DEFAULT_ENDPOINT", modify_default_endpoint(DataformAsyncClient)) +@mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}) +def test_dataform_client_mtls_env_auto(client_class, transport_class, transport_name, use_client_cert_env): + # This tests the endpoint autoswitch behavior. Endpoint is autoswitched to the default + # mtls endpoint, if GOOGLE_API_USE_CLIENT_CERTIFICATE is "true" and client cert exists. + + # Check the case client_cert_source is provided. Whether client cert is used depends on + # GOOGLE_API_USE_CLIENT_CERTIFICATE value. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env}): + options = client_options.ClientOptions(client_cert_source=client_cert_source_callback) + with mock.patch.object(transport_class, '__init__') as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + + if use_client_cert_env == "false": + expected_client_cert_source = None + expected_host = client.DEFAULT_ENDPOINT + else: + expected_client_cert_source = client_cert_source_callback + expected_host = client.DEFAULT_MTLS_ENDPOINT + + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=expected_host, + scopes=None, + client_cert_source_for_mtls=expected_client_cert_source, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case ADC client cert is provided. Whether client cert is used depends on + # GOOGLE_API_USE_CLIENT_CERTIFICATE value. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env}): + with mock.patch.object(transport_class, '__init__') as patched: + with mock.patch('google.auth.transport.mtls.has_default_client_cert_source', return_value=True): + with mock.patch('google.auth.transport.mtls.default_client_cert_source', return_value=client_cert_source_callback): + if use_client_cert_env == "false": + expected_host = client.DEFAULT_ENDPOINT + expected_client_cert_source = None + else: + expected_host = client.DEFAULT_MTLS_ENDPOINT + expected_client_cert_source = client_cert_source_callback + + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=expected_host, + scopes=None, + client_cert_source_for_mtls=expected_client_cert_source, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case client_cert_source and ADC client cert are not provided. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env}): + with mock.patch.object(transport_class, '__init__') as patched: + with mock.patch("google.auth.transport.mtls.has_default_client_cert_source", return_value=False): + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + +@pytest.mark.parametrize("client_class", [ + DataformClient, DataformAsyncClient +]) +@mock.patch.object(DataformClient, "DEFAULT_ENDPOINT", modify_default_endpoint(DataformClient)) +@mock.patch.object(DataformAsyncClient, "DEFAULT_ENDPOINT", modify_default_endpoint(DataformAsyncClient)) +def test_dataform_client_get_mtls_endpoint_and_cert_source(client_class): + mock_client_cert_source = mock.Mock() + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "true". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + mock_api_endpoint = "foo" + options = client_options.ClientOptions(client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source(options) + assert api_endpoint == mock_api_endpoint + assert cert_source == mock_client_cert_source + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "false". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}): + mock_client_cert_source = mock.Mock() + mock_api_endpoint = "foo" + options = client_options.ClientOptions(client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source(options) + assert api_endpoint == mock_api_endpoint + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "never". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "always". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert doesn't exist. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch('google.auth.transport.mtls.has_default_client_cert_source', return_value=False): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert exists. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch('google.auth.transport.mtls.has_default_client_cert_source', return_value=True): + with mock.patch('google.auth.transport.mtls.default_client_cert_source', return_value=mock_client_cert_source): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source == mock_client_cert_source + + +@pytest.mark.parametrize("client_class,transport_class,transport_name", [ + (DataformClient, transports.DataformGrpcTransport, "grpc"), + (DataformAsyncClient, transports.DataformGrpcAsyncIOTransport, "grpc_asyncio"), +]) +def test_dataform_client_client_options_scopes(client_class, transport_class, transport_name): + # Check the case scopes are provided. + options = client_options.ClientOptions( + scopes=["1", "2"], + ) + with mock.patch.object(transport_class, '__init__') as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=["1", "2"], + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + +@pytest.mark.parametrize("client_class,transport_class,transport_name,grpc_helpers", [ + (DataformClient, transports.DataformGrpcTransport, "grpc", grpc_helpers), + (DataformAsyncClient, transports.DataformGrpcAsyncIOTransport, "grpc_asyncio", grpc_helpers_async), +]) +def test_dataform_client_client_options_credentials_file(client_class, transport_class, transport_name, grpc_helpers): + # Check the case credentials file is provided. + options = client_options.ClientOptions( + credentials_file="credentials.json" + ) + + with mock.patch.object(transport_class, '__init__') as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + +def test_dataform_client_client_options_from_dict(): + with mock.patch('google.cloud.dataform_v1beta1.services.dataform.transports.DataformGrpcTransport.__init__') as grpc_transport: + grpc_transport.return_value = None + client = DataformClient( + client_options={'api_endpoint': 'squid.clam.whelk'} + ) + grpc_transport.assert_called_once_with( + credentials=None, + credentials_file=None, + host="squid.clam.whelk", + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + +@pytest.mark.parametrize("client_class,transport_class,transport_name,grpc_helpers", [ + (DataformClient, transports.DataformGrpcTransport, "grpc", grpc_helpers), + (DataformAsyncClient, transports.DataformGrpcAsyncIOTransport, "grpc_asyncio", grpc_helpers_async), +]) +def test_dataform_client_create_channel_credentials_file(client_class, transport_class, transport_name, grpc_helpers): + # Check the case credentials file is provided. + options = client_options.ClientOptions( + credentials_file="credentials.json" + ) + + with mock.patch.object(transport_class, '__init__') as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # test that the credentials from file are saved and used as the credentials. + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel" + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() + load_creds.return_value = (file_creds, None) + adc.return_value = (creds, None) + client = client_class(client_options=options, transport=transport_name) + create_channel.assert_called_with( + "dataform.googleapis.com:443", + credentials=file_creds, + credentials_file=None, + quota_project_id=None, + default_scopes=( + 'https://www.googleapis.com/auth/cloud-platform', +), + scopes=None, + default_host="dataform.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + +@pytest.mark.parametrize("request_type", [ + dataform.ListRepositoriesRequest, + dict, +]) +def test_list_repositories(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_repositories), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.ListRepositoriesResponse( + next_page_token='next_page_token_value', + unreachable=['unreachable_value'], + ) + response = client.list_repositories(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.ListRepositoriesRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListRepositoriesPager) + assert response.next_page_token == 'next_page_token_value' + assert response.unreachable == ['unreachable_value'] + + +def test_list_repositories_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_repositories), + '__call__') as call: + client.list_repositories() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.ListRepositoriesRequest() + +@pytest.mark.asyncio +async def test_list_repositories_async(transport: str = 'grpc_asyncio', request_type=dataform.ListRepositoriesRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_repositories), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListRepositoriesResponse( + next_page_token='next_page_token_value', + unreachable=['unreachable_value'], + )) + response = await client.list_repositories(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.ListRepositoriesRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListRepositoriesAsyncPager) + assert response.next_page_token == 'next_page_token_value' + assert response.unreachable == ['unreachable_value'] + + +@pytest.mark.asyncio +async def test_list_repositories_async_from_dict(): + await test_list_repositories_async(request_type=dict) + + +def test_list_repositories_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.ListRepositoriesRequest() + + request.parent = 'parent_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_repositories), + '__call__') as call: + call.return_value = dataform.ListRepositoriesResponse() + client.list_repositories(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'parent=parent_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_list_repositories_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.ListRepositoriesRequest() + + request.parent = 'parent_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_repositories), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListRepositoriesResponse()) + await client.list_repositories(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'parent=parent_value', + ) in kw['metadata'] + + +def test_list_repositories_flattened(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_repositories), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.ListRepositoriesResponse() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.list_repositories( + parent='parent_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = 'parent_value' + assert arg == mock_val + + +def test_list_repositories_flattened_error(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.list_repositories( + dataform.ListRepositoriesRequest(), + parent='parent_value', + ) + +@pytest.mark.asyncio +async def test_list_repositories_flattened_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_repositories), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.ListRepositoriesResponse() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListRepositoriesResponse()) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.list_repositories( + parent='parent_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = 'parent_value' + assert arg == mock_val + +@pytest.mark.asyncio +async def test_list_repositories_flattened_error_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.list_repositories( + dataform.ListRepositoriesRequest(), + parent='parent_value', + ) + + +def test_list_repositories_pager(transport_name: str = "grpc"): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_repositories), + '__call__') as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.ListRepositoriesResponse( + repositories=[ + dataform.Repository(), + dataform.Repository(), + dataform.Repository(), + ], + next_page_token='abc', + ), + dataform.ListRepositoriesResponse( + repositories=[], + next_page_token='def', + ), + dataform.ListRepositoriesResponse( + repositories=[ + dataform.Repository(), + ], + next_page_token='ghi', + ), + dataform.ListRepositoriesResponse( + repositories=[ + dataform.Repository(), + dataform.Repository(), + ], + ), + RuntimeError, + ) + + metadata = () + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ('parent', ''), + )), + ) + pager = client.list_repositories(request={}) + + assert pager._metadata == metadata + + results = list(pager) + assert len(results) == 6 + assert all(isinstance(i, dataform.Repository) + for i in results) +def test_list_repositories_pages(transport_name: str = "grpc"): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_repositories), + '__call__') as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.ListRepositoriesResponse( + repositories=[ + dataform.Repository(), + dataform.Repository(), + dataform.Repository(), + ], + next_page_token='abc', + ), + dataform.ListRepositoriesResponse( + repositories=[], + next_page_token='def', + ), + dataform.ListRepositoriesResponse( + repositories=[ + dataform.Repository(), + ], + next_page_token='ghi', + ), + dataform.ListRepositoriesResponse( + repositories=[ + dataform.Repository(), + dataform.Repository(), + ], + ), + RuntimeError, + ) + pages = list(client.list_repositories(request={}).pages) + for page_, token in zip(pages, ['abc','def','ghi', '']): + assert page_.raw_page.next_page_token == token + +@pytest.mark.asyncio +async def test_list_repositories_async_pager(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_repositories), + '__call__', new_callable=mock.AsyncMock) as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.ListRepositoriesResponse( + repositories=[ + dataform.Repository(), + dataform.Repository(), + dataform.Repository(), + ], + next_page_token='abc', + ), + dataform.ListRepositoriesResponse( + repositories=[], + next_page_token='def', + ), + dataform.ListRepositoriesResponse( + repositories=[ + dataform.Repository(), + ], + next_page_token='ghi', + ), + dataform.ListRepositoriesResponse( + repositories=[ + dataform.Repository(), + dataform.Repository(), + ], + ), + RuntimeError, + ) + async_pager = await client.list_repositories(request={},) + assert async_pager.next_page_token == 'abc' + responses = [] + async for response in async_pager: # pragma: no branch + responses.append(response) + + assert len(responses) == 6 + assert all(isinstance(i, dataform.Repository) + for i in responses) + + +@pytest.mark.asyncio +async def test_list_repositories_async_pages(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_repositories), + '__call__', new_callable=mock.AsyncMock) as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.ListRepositoriesResponse( + repositories=[ + dataform.Repository(), + dataform.Repository(), + dataform.Repository(), + ], + next_page_token='abc', + ), + dataform.ListRepositoriesResponse( + repositories=[], + next_page_token='def', + ), + dataform.ListRepositoriesResponse( + repositories=[ + dataform.Repository(), + ], + next_page_token='ghi', + ), + dataform.ListRepositoriesResponse( + repositories=[ + dataform.Repository(), + dataform.Repository(), + ], + ), + RuntimeError, + ) + pages = [] + async for page_ in (await client.list_repositories(request={})).pages: # pragma: no branch + pages.append(page_) + for page_, token in zip(pages, ['abc','def','ghi', '']): + assert page_.raw_page.next_page_token == token + +@pytest.mark.parametrize("request_type", [ + dataform.GetRepositoryRequest, + dict, +]) +def test_get_repository(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_repository), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.Repository( + name='name_value', + ) + response = client.get_repository(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.GetRepositoryRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.Repository) + assert response.name == 'name_value' + + +def test_get_repository_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_repository), + '__call__') as call: + client.get_repository() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.GetRepositoryRequest() + +@pytest.mark.asyncio +async def test_get_repository_async(transport: str = 'grpc_asyncio', request_type=dataform.GetRepositoryRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_repository), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.Repository( + name='name_value', + )) + response = await client.get_repository(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.GetRepositoryRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.Repository) + assert response.name == 'name_value' + + +@pytest.mark.asyncio +async def test_get_repository_async_from_dict(): + await test_get_repository_async(request_type=dict) + + +def test_get_repository_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.GetRepositoryRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_repository), + '__call__') as call: + call.return_value = dataform.Repository() + client.get_repository(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_get_repository_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.GetRepositoryRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_repository), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Repository()) + await client.get_repository(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +def test_get_repository_flattened(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_repository), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.Repository() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.get_repository( + name='name_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = 'name_value' + assert arg == mock_val + + +def test_get_repository_flattened_error(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.get_repository( + dataform.GetRepositoryRequest(), + name='name_value', + ) + +@pytest.mark.asyncio +async def test_get_repository_flattened_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_repository), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.Repository() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Repository()) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.get_repository( + name='name_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = 'name_value' + assert arg == mock_val + +@pytest.mark.asyncio +async def test_get_repository_flattened_error_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.get_repository( + dataform.GetRepositoryRequest(), + name='name_value', + ) + + +@pytest.mark.parametrize("request_type", [ + dataform.CreateRepositoryRequest, + dict, +]) +def test_create_repository(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_repository), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.Repository( + name='name_value', + ) + response = client.create_repository(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.CreateRepositoryRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.Repository) + assert response.name == 'name_value' + + +def test_create_repository_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_repository), + '__call__') as call: + client.create_repository() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.CreateRepositoryRequest() + +@pytest.mark.asyncio +async def test_create_repository_async(transport: str = 'grpc_asyncio', request_type=dataform.CreateRepositoryRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_repository), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.Repository( + name='name_value', + )) + response = await client.create_repository(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.CreateRepositoryRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.Repository) + assert response.name == 'name_value' + + +@pytest.mark.asyncio +async def test_create_repository_async_from_dict(): + await test_create_repository_async(request_type=dict) + + +def test_create_repository_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.CreateRepositoryRequest() + + request.parent = 'parent_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_repository), + '__call__') as call: + call.return_value = dataform.Repository() + client.create_repository(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'parent=parent_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_create_repository_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.CreateRepositoryRequest() + + request.parent = 'parent_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_repository), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Repository()) + await client.create_repository(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'parent=parent_value', + ) in kw['metadata'] + + +def test_create_repository_flattened(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_repository), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.Repository() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.create_repository( + parent='parent_value', + repository=dataform.Repository(name='name_value'), + repository_id='repository_id_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = 'parent_value' + assert arg == mock_val + arg = args[0].repository + mock_val = dataform.Repository(name='name_value') + assert arg == mock_val + arg = args[0].repository_id + mock_val = 'repository_id_value' + assert arg == mock_val + + +def test_create_repository_flattened_error(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.create_repository( + dataform.CreateRepositoryRequest(), + parent='parent_value', + repository=dataform.Repository(name='name_value'), + repository_id='repository_id_value', + ) + +@pytest.mark.asyncio +async def test_create_repository_flattened_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_repository), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.Repository() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Repository()) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.create_repository( + parent='parent_value', + repository=dataform.Repository(name='name_value'), + repository_id='repository_id_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = 'parent_value' + assert arg == mock_val + arg = args[0].repository + mock_val = dataform.Repository(name='name_value') + assert arg == mock_val + arg = args[0].repository_id + mock_val = 'repository_id_value' + assert arg == mock_val + +@pytest.mark.asyncio +async def test_create_repository_flattened_error_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.create_repository( + dataform.CreateRepositoryRequest(), + parent='parent_value', + repository=dataform.Repository(name='name_value'), + repository_id='repository_id_value', + ) + + +@pytest.mark.parametrize("request_type", [ + dataform.UpdateRepositoryRequest, + dict, +]) +def test_update_repository(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_repository), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.Repository( + name='name_value', + ) + response = client.update_repository(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.UpdateRepositoryRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.Repository) + assert response.name == 'name_value' + + +def test_update_repository_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_repository), + '__call__') as call: + client.update_repository() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.UpdateRepositoryRequest() + +@pytest.mark.asyncio +async def test_update_repository_async(transport: str = 'grpc_asyncio', request_type=dataform.UpdateRepositoryRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_repository), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.Repository( + name='name_value', + )) + response = await client.update_repository(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.UpdateRepositoryRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.Repository) + assert response.name == 'name_value' + + +@pytest.mark.asyncio +async def test_update_repository_async_from_dict(): + await test_update_repository_async(request_type=dict) + + +def test_update_repository_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.UpdateRepositoryRequest() + + request.repository.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_repository), + '__call__') as call: + call.return_value = dataform.Repository() + client.update_repository(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'repository.name=name_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_update_repository_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.UpdateRepositoryRequest() + + request.repository.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_repository), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Repository()) + await client.update_repository(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'repository.name=name_value', + ) in kw['metadata'] + + +def test_update_repository_flattened(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_repository), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.Repository() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.update_repository( + repository=dataform.Repository(name='name_value'), + update_mask=field_mask_pb2.FieldMask(paths=['paths_value']), + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].repository + mock_val = dataform.Repository(name='name_value') + assert arg == mock_val + arg = args[0].update_mask + mock_val = field_mask_pb2.FieldMask(paths=['paths_value']) + assert arg == mock_val + + +def test_update_repository_flattened_error(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.update_repository( + dataform.UpdateRepositoryRequest(), + repository=dataform.Repository(name='name_value'), + update_mask=field_mask_pb2.FieldMask(paths=['paths_value']), + ) + +@pytest.mark.asyncio +async def test_update_repository_flattened_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_repository), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.Repository() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Repository()) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.update_repository( + repository=dataform.Repository(name='name_value'), + update_mask=field_mask_pb2.FieldMask(paths=['paths_value']), + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].repository + mock_val = dataform.Repository(name='name_value') + assert arg == mock_val + arg = args[0].update_mask + mock_val = field_mask_pb2.FieldMask(paths=['paths_value']) + assert arg == mock_val + +@pytest.mark.asyncio +async def test_update_repository_flattened_error_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.update_repository( + dataform.UpdateRepositoryRequest(), + repository=dataform.Repository(name='name_value'), + update_mask=field_mask_pb2.FieldMask(paths=['paths_value']), + ) + + +@pytest.mark.parametrize("request_type", [ + dataform.DeleteRepositoryRequest, + dict, +]) +def test_delete_repository(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_repository), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = None + response = client.delete_repository(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.DeleteRepositoryRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +def test_delete_repository_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_repository), + '__call__') as call: + client.delete_repository() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.DeleteRepositoryRequest() + +@pytest.mark.asyncio +async def test_delete_repository_async(transport: str = 'grpc_asyncio', request_type=dataform.DeleteRepositoryRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_repository), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + response = await client.delete_repository(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.DeleteRepositoryRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +@pytest.mark.asyncio +async def test_delete_repository_async_from_dict(): + await test_delete_repository_async(request_type=dict) + + +def test_delete_repository_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.DeleteRepositoryRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_repository), + '__call__') as call: + call.return_value = None + client.delete_repository(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_delete_repository_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.DeleteRepositoryRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_repository), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.delete_repository(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +def test_delete_repository_flattened(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_repository), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = None + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.delete_repository( + name='name_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = 'name_value' + assert arg == mock_val + + +def test_delete_repository_flattened_error(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.delete_repository( + dataform.DeleteRepositoryRequest(), + name='name_value', + ) + +@pytest.mark.asyncio +async def test_delete_repository_flattened_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_repository), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = None + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.delete_repository( + name='name_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = 'name_value' + assert arg == mock_val + +@pytest.mark.asyncio +async def test_delete_repository_flattened_error_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.delete_repository( + dataform.DeleteRepositoryRequest(), + name='name_value', + ) + + +@pytest.mark.parametrize("request_type", [ + dataform.FetchRemoteBranchesRequest, + dict, +]) +def test_fetch_remote_branches(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_remote_branches), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.FetchRemoteBranchesResponse( + branches=['branches_value'], + ) + response = client.fetch_remote_branches(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.FetchRemoteBranchesRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.FetchRemoteBranchesResponse) + assert response.branches == ['branches_value'] + + +def test_fetch_remote_branches_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_remote_branches), + '__call__') as call: + client.fetch_remote_branches() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.FetchRemoteBranchesRequest() + +@pytest.mark.asyncio +async def test_fetch_remote_branches_async(transport: str = 'grpc_asyncio', request_type=dataform.FetchRemoteBranchesRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_remote_branches), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.FetchRemoteBranchesResponse( + branches=['branches_value'], + )) + response = await client.fetch_remote_branches(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.FetchRemoteBranchesRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.FetchRemoteBranchesResponse) + assert response.branches == ['branches_value'] + + +@pytest.mark.asyncio +async def test_fetch_remote_branches_async_from_dict(): + await test_fetch_remote_branches_async(request_type=dict) + + +def test_fetch_remote_branches_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.FetchRemoteBranchesRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_remote_branches), + '__call__') as call: + call.return_value = dataform.FetchRemoteBranchesResponse() + client.fetch_remote_branches(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_fetch_remote_branches_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.FetchRemoteBranchesRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_remote_branches), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.FetchRemoteBranchesResponse()) + await client.fetch_remote_branches(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.parametrize("request_type", [ + dataform.ListWorkspacesRequest, + dict, +]) +def test_list_workspaces(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workspaces), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.ListWorkspacesResponse( + next_page_token='next_page_token_value', + unreachable=['unreachable_value'], + ) + response = client.list_workspaces(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.ListWorkspacesRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListWorkspacesPager) + assert response.next_page_token == 'next_page_token_value' + assert response.unreachable == ['unreachable_value'] + + +def test_list_workspaces_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workspaces), + '__call__') as call: + client.list_workspaces() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.ListWorkspacesRequest() + +@pytest.mark.asyncio +async def test_list_workspaces_async(transport: str = 'grpc_asyncio', request_type=dataform.ListWorkspacesRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workspaces), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListWorkspacesResponse( + next_page_token='next_page_token_value', + unreachable=['unreachable_value'], + )) + response = await client.list_workspaces(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.ListWorkspacesRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListWorkspacesAsyncPager) + assert response.next_page_token == 'next_page_token_value' + assert response.unreachable == ['unreachable_value'] + + +@pytest.mark.asyncio +async def test_list_workspaces_async_from_dict(): + await test_list_workspaces_async(request_type=dict) + + +def test_list_workspaces_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.ListWorkspacesRequest() + + request.parent = 'parent_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workspaces), + '__call__') as call: + call.return_value = dataform.ListWorkspacesResponse() + client.list_workspaces(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'parent=parent_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_list_workspaces_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.ListWorkspacesRequest() + + request.parent = 'parent_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workspaces), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListWorkspacesResponse()) + await client.list_workspaces(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'parent=parent_value', + ) in kw['metadata'] + + +def test_list_workspaces_flattened(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workspaces), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.ListWorkspacesResponse() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.list_workspaces( + parent='parent_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = 'parent_value' + assert arg == mock_val + + +def test_list_workspaces_flattened_error(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.list_workspaces( + dataform.ListWorkspacesRequest(), + parent='parent_value', + ) + +@pytest.mark.asyncio +async def test_list_workspaces_flattened_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workspaces), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.ListWorkspacesResponse() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListWorkspacesResponse()) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.list_workspaces( + parent='parent_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = 'parent_value' + assert arg == mock_val + +@pytest.mark.asyncio +async def test_list_workspaces_flattened_error_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.list_workspaces( + dataform.ListWorkspacesRequest(), + parent='parent_value', + ) + + +def test_list_workspaces_pager(transport_name: str = "grpc"): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workspaces), + '__call__') as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.ListWorkspacesResponse( + workspaces=[ + dataform.Workspace(), + dataform.Workspace(), + dataform.Workspace(), + ], + next_page_token='abc', + ), + dataform.ListWorkspacesResponse( + workspaces=[], + next_page_token='def', + ), + dataform.ListWorkspacesResponse( + workspaces=[ + dataform.Workspace(), + ], + next_page_token='ghi', + ), + dataform.ListWorkspacesResponse( + workspaces=[ + dataform.Workspace(), + dataform.Workspace(), + ], + ), + RuntimeError, + ) + + metadata = () + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ('parent', ''), + )), + ) + pager = client.list_workspaces(request={}) + + assert pager._metadata == metadata + + results = list(pager) + assert len(results) == 6 + assert all(isinstance(i, dataform.Workspace) + for i in results) +def test_list_workspaces_pages(transport_name: str = "grpc"): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workspaces), + '__call__') as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.ListWorkspacesResponse( + workspaces=[ + dataform.Workspace(), + dataform.Workspace(), + dataform.Workspace(), + ], + next_page_token='abc', + ), + dataform.ListWorkspacesResponse( + workspaces=[], + next_page_token='def', + ), + dataform.ListWorkspacesResponse( + workspaces=[ + dataform.Workspace(), + ], + next_page_token='ghi', + ), + dataform.ListWorkspacesResponse( + workspaces=[ + dataform.Workspace(), + dataform.Workspace(), + ], + ), + RuntimeError, + ) + pages = list(client.list_workspaces(request={}).pages) + for page_, token in zip(pages, ['abc','def','ghi', '']): + assert page_.raw_page.next_page_token == token + +@pytest.mark.asyncio +async def test_list_workspaces_async_pager(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workspaces), + '__call__', new_callable=mock.AsyncMock) as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.ListWorkspacesResponse( + workspaces=[ + dataform.Workspace(), + dataform.Workspace(), + dataform.Workspace(), + ], + next_page_token='abc', + ), + dataform.ListWorkspacesResponse( + workspaces=[], + next_page_token='def', + ), + dataform.ListWorkspacesResponse( + workspaces=[ + dataform.Workspace(), + ], + next_page_token='ghi', + ), + dataform.ListWorkspacesResponse( + workspaces=[ + dataform.Workspace(), + dataform.Workspace(), + ], + ), + RuntimeError, + ) + async_pager = await client.list_workspaces(request={},) + assert async_pager.next_page_token == 'abc' + responses = [] + async for response in async_pager: # pragma: no branch + responses.append(response) + + assert len(responses) == 6 + assert all(isinstance(i, dataform.Workspace) + for i in responses) + + +@pytest.mark.asyncio +async def test_list_workspaces_async_pages(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workspaces), + '__call__', new_callable=mock.AsyncMock) as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.ListWorkspacesResponse( + workspaces=[ + dataform.Workspace(), + dataform.Workspace(), + dataform.Workspace(), + ], + next_page_token='abc', + ), + dataform.ListWorkspacesResponse( + workspaces=[], + next_page_token='def', + ), + dataform.ListWorkspacesResponse( + workspaces=[ + dataform.Workspace(), + ], + next_page_token='ghi', + ), + dataform.ListWorkspacesResponse( + workspaces=[ + dataform.Workspace(), + dataform.Workspace(), + ], + ), + RuntimeError, + ) + pages = [] + async for page_ in (await client.list_workspaces(request={})).pages: # pragma: no branch + pages.append(page_) + for page_, token in zip(pages, ['abc','def','ghi', '']): + assert page_.raw_page.next_page_token == token + +@pytest.mark.parametrize("request_type", [ + dataform.GetWorkspaceRequest, + dict, +]) +def test_get_workspace(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_workspace), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.Workspace( + name='name_value', + ) + response = client.get_workspace(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.GetWorkspaceRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.Workspace) + assert response.name == 'name_value' + + +def test_get_workspace_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_workspace), + '__call__') as call: + client.get_workspace() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.GetWorkspaceRequest() + +@pytest.mark.asyncio +async def test_get_workspace_async(transport: str = 'grpc_asyncio', request_type=dataform.GetWorkspaceRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_workspace), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.Workspace( + name='name_value', + )) + response = await client.get_workspace(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.GetWorkspaceRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.Workspace) + assert response.name == 'name_value' + + +@pytest.mark.asyncio +async def test_get_workspace_async_from_dict(): + await test_get_workspace_async(request_type=dict) + + +def test_get_workspace_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.GetWorkspaceRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_workspace), + '__call__') as call: + call.return_value = dataform.Workspace() + client.get_workspace(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_get_workspace_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.GetWorkspaceRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_workspace), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Workspace()) + await client.get_workspace(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +def test_get_workspace_flattened(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_workspace), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.Workspace() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.get_workspace( + name='name_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = 'name_value' + assert arg == mock_val + + +def test_get_workspace_flattened_error(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.get_workspace( + dataform.GetWorkspaceRequest(), + name='name_value', + ) + +@pytest.mark.asyncio +async def test_get_workspace_flattened_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_workspace), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.Workspace() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Workspace()) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.get_workspace( + name='name_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = 'name_value' + assert arg == mock_val + +@pytest.mark.asyncio +async def test_get_workspace_flattened_error_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.get_workspace( + dataform.GetWorkspaceRequest(), + name='name_value', + ) + + +@pytest.mark.parametrize("request_type", [ + dataform.CreateWorkspaceRequest, + dict, +]) +def test_create_workspace(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_workspace), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.Workspace( + name='name_value', + ) + response = client.create_workspace(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.CreateWorkspaceRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.Workspace) + assert response.name == 'name_value' + + +def test_create_workspace_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_workspace), + '__call__') as call: + client.create_workspace() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.CreateWorkspaceRequest() + +@pytest.mark.asyncio +async def test_create_workspace_async(transport: str = 'grpc_asyncio', request_type=dataform.CreateWorkspaceRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_workspace), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.Workspace( + name='name_value', + )) + response = await client.create_workspace(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.CreateWorkspaceRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.Workspace) + assert response.name == 'name_value' + + +@pytest.mark.asyncio +async def test_create_workspace_async_from_dict(): + await test_create_workspace_async(request_type=dict) + + +def test_create_workspace_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.CreateWorkspaceRequest() + + request.parent = 'parent_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_workspace), + '__call__') as call: + call.return_value = dataform.Workspace() + client.create_workspace(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'parent=parent_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_create_workspace_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.CreateWorkspaceRequest() + + request.parent = 'parent_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_workspace), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Workspace()) + await client.create_workspace(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'parent=parent_value', + ) in kw['metadata'] + + +def test_create_workspace_flattened(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_workspace), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.Workspace() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.create_workspace( + parent='parent_value', + workspace=dataform.Workspace(name='name_value'), + workspace_id='workspace_id_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = 'parent_value' + assert arg == mock_val + arg = args[0].workspace + mock_val = dataform.Workspace(name='name_value') + assert arg == mock_val + arg = args[0].workspace_id + mock_val = 'workspace_id_value' + assert arg == mock_val + + +def test_create_workspace_flattened_error(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.create_workspace( + dataform.CreateWorkspaceRequest(), + parent='parent_value', + workspace=dataform.Workspace(name='name_value'), + workspace_id='workspace_id_value', + ) + +@pytest.mark.asyncio +async def test_create_workspace_flattened_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_workspace), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.Workspace() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Workspace()) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.create_workspace( + parent='parent_value', + workspace=dataform.Workspace(name='name_value'), + workspace_id='workspace_id_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = 'parent_value' + assert arg == mock_val + arg = args[0].workspace + mock_val = dataform.Workspace(name='name_value') + assert arg == mock_val + arg = args[0].workspace_id + mock_val = 'workspace_id_value' + assert arg == mock_val + +@pytest.mark.asyncio +async def test_create_workspace_flattened_error_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.create_workspace( + dataform.CreateWorkspaceRequest(), + parent='parent_value', + workspace=dataform.Workspace(name='name_value'), + workspace_id='workspace_id_value', + ) + + +@pytest.mark.parametrize("request_type", [ + dataform.DeleteWorkspaceRequest, + dict, +]) +def test_delete_workspace(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_workspace), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = None + response = client.delete_workspace(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.DeleteWorkspaceRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +def test_delete_workspace_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_workspace), + '__call__') as call: + client.delete_workspace() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.DeleteWorkspaceRequest() + +@pytest.mark.asyncio +async def test_delete_workspace_async(transport: str = 'grpc_asyncio', request_type=dataform.DeleteWorkspaceRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_workspace), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + response = await client.delete_workspace(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.DeleteWorkspaceRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +@pytest.mark.asyncio +async def test_delete_workspace_async_from_dict(): + await test_delete_workspace_async(request_type=dict) + + +def test_delete_workspace_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.DeleteWorkspaceRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_workspace), + '__call__') as call: + call.return_value = None + client.delete_workspace(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_delete_workspace_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.DeleteWorkspaceRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_workspace), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.delete_workspace(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +def test_delete_workspace_flattened(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_workspace), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = None + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.delete_workspace( + name='name_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = 'name_value' + assert arg == mock_val + + +def test_delete_workspace_flattened_error(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.delete_workspace( + dataform.DeleteWorkspaceRequest(), + name='name_value', + ) + +@pytest.mark.asyncio +async def test_delete_workspace_flattened_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_workspace), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = None + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.delete_workspace( + name='name_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = 'name_value' + assert arg == mock_val + +@pytest.mark.asyncio +async def test_delete_workspace_flattened_error_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.delete_workspace( + dataform.DeleteWorkspaceRequest(), + name='name_value', + ) + + +@pytest.mark.parametrize("request_type", [ + dataform.InstallNpmPackagesRequest, + dict, +]) +def test_install_npm_packages(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.install_npm_packages), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.InstallNpmPackagesResponse( + ) + response = client.install_npm_packages(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.InstallNpmPackagesRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.InstallNpmPackagesResponse) + + +def test_install_npm_packages_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.install_npm_packages), + '__call__') as call: + client.install_npm_packages() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.InstallNpmPackagesRequest() + +@pytest.mark.asyncio +async def test_install_npm_packages_async(transport: str = 'grpc_asyncio', request_type=dataform.InstallNpmPackagesRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.install_npm_packages), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.InstallNpmPackagesResponse( + )) + response = await client.install_npm_packages(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.InstallNpmPackagesRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.InstallNpmPackagesResponse) + + +@pytest.mark.asyncio +async def test_install_npm_packages_async_from_dict(): + await test_install_npm_packages_async(request_type=dict) + + +def test_install_npm_packages_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.InstallNpmPackagesRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.install_npm_packages), + '__call__') as call: + call.return_value = dataform.InstallNpmPackagesResponse() + client.install_npm_packages(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_install_npm_packages_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.InstallNpmPackagesRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.install_npm_packages), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.InstallNpmPackagesResponse()) + await client.install_npm_packages(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +@pytest.mark.parametrize("request_type", [ + dataform.PullGitCommitsRequest, + dict, +]) +def test_pull_git_commits(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.pull_git_commits), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = None + response = client.pull_git_commits(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.PullGitCommitsRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +def test_pull_git_commits_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.pull_git_commits), + '__call__') as call: + client.pull_git_commits() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.PullGitCommitsRequest() + +@pytest.mark.asyncio +async def test_pull_git_commits_async(transport: str = 'grpc_asyncio', request_type=dataform.PullGitCommitsRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.pull_git_commits), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + response = await client.pull_git_commits(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.PullGitCommitsRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +@pytest.mark.asyncio +async def test_pull_git_commits_async_from_dict(): + await test_pull_git_commits_async(request_type=dict) + + +def test_pull_git_commits_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.PullGitCommitsRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.pull_git_commits), + '__call__') as call: + call.return_value = None + client.pull_git_commits(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_pull_git_commits_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.PullGitCommitsRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.pull_git_commits), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.pull_git_commits(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.parametrize("request_type", [ + dataform.PushGitCommitsRequest, + dict, +]) +def test_push_git_commits(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.push_git_commits), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = None + response = client.push_git_commits(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.PushGitCommitsRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +def test_push_git_commits_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.push_git_commits), + '__call__') as call: + client.push_git_commits() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.PushGitCommitsRequest() + +@pytest.mark.asyncio +async def test_push_git_commits_async(transport: str = 'grpc_asyncio', request_type=dataform.PushGitCommitsRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.push_git_commits), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + response = await client.push_git_commits(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.PushGitCommitsRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +@pytest.mark.asyncio +async def test_push_git_commits_async_from_dict(): + await test_push_git_commits_async(request_type=dict) + + +def test_push_git_commits_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.PushGitCommitsRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.push_git_commits), + '__call__') as call: + call.return_value = None + client.push_git_commits(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_push_git_commits_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.PushGitCommitsRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.push_git_commits), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.push_git_commits(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.parametrize("request_type", [ + dataform.FetchFileGitStatusesRequest, + dict, +]) +def test_fetch_file_git_statuses(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_file_git_statuses), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.FetchFileGitStatusesResponse( + ) + response = client.fetch_file_git_statuses(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.FetchFileGitStatusesRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.FetchFileGitStatusesResponse) + + +def test_fetch_file_git_statuses_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_file_git_statuses), + '__call__') as call: + client.fetch_file_git_statuses() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.FetchFileGitStatusesRequest() + +@pytest.mark.asyncio +async def test_fetch_file_git_statuses_async(transport: str = 'grpc_asyncio', request_type=dataform.FetchFileGitStatusesRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_file_git_statuses), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.FetchFileGitStatusesResponse( + )) + response = await client.fetch_file_git_statuses(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.FetchFileGitStatusesRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.FetchFileGitStatusesResponse) + + +@pytest.mark.asyncio +async def test_fetch_file_git_statuses_async_from_dict(): + await test_fetch_file_git_statuses_async(request_type=dict) + + +def test_fetch_file_git_statuses_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.FetchFileGitStatusesRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_file_git_statuses), + '__call__') as call: + call.return_value = dataform.FetchFileGitStatusesResponse() + client.fetch_file_git_statuses(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_fetch_file_git_statuses_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.FetchFileGitStatusesRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_file_git_statuses), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.FetchFileGitStatusesResponse()) + await client.fetch_file_git_statuses(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.parametrize("request_type", [ + dataform.FetchGitAheadBehindRequest, + dict, +]) +def test_fetch_git_ahead_behind(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_git_ahead_behind), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.FetchGitAheadBehindResponse( + commits_ahead=1358, + commits_behind=1477, + ) + response = client.fetch_git_ahead_behind(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.FetchGitAheadBehindRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.FetchGitAheadBehindResponse) + assert response.commits_ahead == 1358 + assert response.commits_behind == 1477 + + +def test_fetch_git_ahead_behind_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_git_ahead_behind), + '__call__') as call: + client.fetch_git_ahead_behind() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.FetchGitAheadBehindRequest() + +@pytest.mark.asyncio +async def test_fetch_git_ahead_behind_async(transport: str = 'grpc_asyncio', request_type=dataform.FetchGitAheadBehindRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_git_ahead_behind), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.FetchGitAheadBehindResponse( + commits_ahead=1358, + commits_behind=1477, + )) + response = await client.fetch_git_ahead_behind(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.FetchGitAheadBehindRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.FetchGitAheadBehindResponse) + assert response.commits_ahead == 1358 + assert response.commits_behind == 1477 + + +@pytest.mark.asyncio +async def test_fetch_git_ahead_behind_async_from_dict(): + await test_fetch_git_ahead_behind_async(request_type=dict) + + +def test_fetch_git_ahead_behind_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.FetchGitAheadBehindRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_git_ahead_behind), + '__call__') as call: + call.return_value = dataform.FetchGitAheadBehindResponse() + client.fetch_git_ahead_behind(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_fetch_git_ahead_behind_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.FetchGitAheadBehindRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_git_ahead_behind), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.FetchGitAheadBehindResponse()) + await client.fetch_git_ahead_behind(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.parametrize("request_type", [ + dataform.CommitWorkspaceChangesRequest, + dict, +]) +def test_commit_workspace_changes(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.commit_workspace_changes), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = None + response = client.commit_workspace_changes(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.CommitWorkspaceChangesRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +def test_commit_workspace_changes_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.commit_workspace_changes), + '__call__') as call: + client.commit_workspace_changes() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.CommitWorkspaceChangesRequest() + +@pytest.mark.asyncio +async def test_commit_workspace_changes_async(transport: str = 'grpc_asyncio', request_type=dataform.CommitWorkspaceChangesRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.commit_workspace_changes), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + response = await client.commit_workspace_changes(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.CommitWorkspaceChangesRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +@pytest.mark.asyncio +async def test_commit_workspace_changes_async_from_dict(): + await test_commit_workspace_changes_async(request_type=dict) + + +def test_commit_workspace_changes_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.CommitWorkspaceChangesRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.commit_workspace_changes), + '__call__') as call: + call.return_value = None + client.commit_workspace_changes(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_commit_workspace_changes_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.CommitWorkspaceChangesRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.commit_workspace_changes), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.commit_workspace_changes(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.parametrize("request_type", [ + dataform.ResetWorkspaceChangesRequest, + dict, +]) +def test_reset_workspace_changes(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.reset_workspace_changes), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = None + response = client.reset_workspace_changes(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.ResetWorkspaceChangesRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +def test_reset_workspace_changes_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.reset_workspace_changes), + '__call__') as call: + client.reset_workspace_changes() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.ResetWorkspaceChangesRequest() + +@pytest.mark.asyncio +async def test_reset_workspace_changes_async(transport: str = 'grpc_asyncio', request_type=dataform.ResetWorkspaceChangesRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.reset_workspace_changes), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + response = await client.reset_workspace_changes(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.ResetWorkspaceChangesRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +@pytest.mark.asyncio +async def test_reset_workspace_changes_async_from_dict(): + await test_reset_workspace_changes_async(request_type=dict) + + +def test_reset_workspace_changes_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.ResetWorkspaceChangesRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.reset_workspace_changes), + '__call__') as call: + call.return_value = None + client.reset_workspace_changes(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_reset_workspace_changes_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.ResetWorkspaceChangesRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.reset_workspace_changes), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.reset_workspace_changes(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.parametrize("request_type", [ + dataform.FetchFileDiffRequest, + dict, +]) +def test_fetch_file_diff(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_file_diff), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.FetchFileDiffResponse( + formatted_diff='formatted_diff_value', + ) + response = client.fetch_file_diff(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.FetchFileDiffRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.FetchFileDiffResponse) + assert response.formatted_diff == 'formatted_diff_value' + + +def test_fetch_file_diff_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_file_diff), + '__call__') as call: + client.fetch_file_diff() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.FetchFileDiffRequest() + +@pytest.mark.asyncio +async def test_fetch_file_diff_async(transport: str = 'grpc_asyncio', request_type=dataform.FetchFileDiffRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_file_diff), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.FetchFileDiffResponse( + formatted_diff='formatted_diff_value', + )) + response = await client.fetch_file_diff(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.FetchFileDiffRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.FetchFileDiffResponse) + assert response.formatted_diff == 'formatted_diff_value' + + +@pytest.mark.asyncio +async def test_fetch_file_diff_async_from_dict(): + await test_fetch_file_diff_async(request_type=dict) + + +def test_fetch_file_diff_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.FetchFileDiffRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_file_diff), + '__call__') as call: + call.return_value = dataform.FetchFileDiffResponse() + client.fetch_file_diff(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_fetch_file_diff_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.FetchFileDiffRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.fetch_file_diff), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.FetchFileDiffResponse()) + await client.fetch_file_diff(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +@pytest.mark.parametrize("request_type", [ + dataform.QueryDirectoryContentsRequest, + dict, +]) +def test_query_directory_contents(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_directory_contents), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.QueryDirectoryContentsResponse( + next_page_token='next_page_token_value', + ) + response = client.query_directory_contents(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.QueryDirectoryContentsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.QueryDirectoryContentsPager) + assert response.next_page_token == 'next_page_token_value' + + +def test_query_directory_contents_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_directory_contents), + '__call__') as call: + client.query_directory_contents() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.QueryDirectoryContentsRequest() + +@pytest.mark.asyncio +async def test_query_directory_contents_async(transport: str = 'grpc_asyncio', request_type=dataform.QueryDirectoryContentsRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_directory_contents), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.QueryDirectoryContentsResponse( + next_page_token='next_page_token_value', + )) + response = await client.query_directory_contents(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.QueryDirectoryContentsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.QueryDirectoryContentsAsyncPager) + assert response.next_page_token == 'next_page_token_value' + + +@pytest.mark.asyncio +async def test_query_directory_contents_async_from_dict(): + await test_query_directory_contents_async(request_type=dict) + + +def test_query_directory_contents_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.QueryDirectoryContentsRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_directory_contents), + '__call__') as call: + call.return_value = dataform.QueryDirectoryContentsResponse() + client.query_directory_contents(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_query_directory_contents_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.QueryDirectoryContentsRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_directory_contents), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.QueryDirectoryContentsResponse()) + await client.query_directory_contents(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +def test_query_directory_contents_pager(transport_name: str = "grpc"): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_directory_contents), + '__call__') as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.QueryDirectoryContentsResponse( + directory_entries=[ + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + ], + next_page_token='abc', + ), + dataform.QueryDirectoryContentsResponse( + directory_entries=[], + next_page_token='def', + ), + dataform.QueryDirectoryContentsResponse( + directory_entries=[ + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + ], + next_page_token='ghi', + ), + dataform.QueryDirectoryContentsResponse( + directory_entries=[ + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + ], + ), + RuntimeError, + ) + + metadata = () + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ('workspace', ''), + )), + ) + pager = client.query_directory_contents(request={}) + + assert pager._metadata == metadata + + results = list(pager) + assert len(results) == 6 + assert all(isinstance(i, dataform.QueryDirectoryContentsResponse.DirectoryEntry) + for i in results) +def test_query_directory_contents_pages(transport_name: str = "grpc"): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_directory_contents), + '__call__') as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.QueryDirectoryContentsResponse( + directory_entries=[ + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + ], + next_page_token='abc', + ), + dataform.QueryDirectoryContentsResponse( + directory_entries=[], + next_page_token='def', + ), + dataform.QueryDirectoryContentsResponse( + directory_entries=[ + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + ], + next_page_token='ghi', + ), + dataform.QueryDirectoryContentsResponse( + directory_entries=[ + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + ], + ), + RuntimeError, + ) + pages = list(client.query_directory_contents(request={}).pages) + for page_, token in zip(pages, ['abc','def','ghi', '']): + assert page_.raw_page.next_page_token == token + +@pytest.mark.asyncio +async def test_query_directory_contents_async_pager(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_directory_contents), + '__call__', new_callable=mock.AsyncMock) as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.QueryDirectoryContentsResponse( + directory_entries=[ + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + ], + next_page_token='abc', + ), + dataform.QueryDirectoryContentsResponse( + directory_entries=[], + next_page_token='def', + ), + dataform.QueryDirectoryContentsResponse( + directory_entries=[ + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + ], + next_page_token='ghi', + ), + dataform.QueryDirectoryContentsResponse( + directory_entries=[ + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + ], + ), + RuntimeError, + ) + async_pager = await client.query_directory_contents(request={},) + assert async_pager.next_page_token == 'abc' + responses = [] + async for response in async_pager: # pragma: no branch + responses.append(response) + + assert len(responses) == 6 + assert all(isinstance(i, dataform.QueryDirectoryContentsResponse.DirectoryEntry) + for i in responses) + + +@pytest.mark.asyncio +async def test_query_directory_contents_async_pages(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_directory_contents), + '__call__', new_callable=mock.AsyncMock) as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.QueryDirectoryContentsResponse( + directory_entries=[ + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + ], + next_page_token='abc', + ), + dataform.QueryDirectoryContentsResponse( + directory_entries=[], + next_page_token='def', + ), + dataform.QueryDirectoryContentsResponse( + directory_entries=[ + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + ], + next_page_token='ghi', + ), + dataform.QueryDirectoryContentsResponse( + directory_entries=[ + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + dataform.QueryDirectoryContentsResponse.DirectoryEntry(), + ], + ), + RuntimeError, + ) + pages = [] + async for page_ in (await client.query_directory_contents(request={})).pages: # pragma: no branch + pages.append(page_) + for page_, token in zip(pages, ['abc','def','ghi', '']): + assert page_.raw_page.next_page_token == token + +@pytest.mark.parametrize("request_type", [ + dataform.MakeDirectoryRequest, + dict, +]) +def test_make_directory(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.make_directory), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.MakeDirectoryResponse( + ) + response = client.make_directory(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.MakeDirectoryRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.MakeDirectoryResponse) + + +def test_make_directory_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.make_directory), + '__call__') as call: + client.make_directory() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.MakeDirectoryRequest() + +@pytest.mark.asyncio +async def test_make_directory_async(transport: str = 'grpc_asyncio', request_type=dataform.MakeDirectoryRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.make_directory), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.MakeDirectoryResponse( + )) + response = await client.make_directory(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.MakeDirectoryRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.MakeDirectoryResponse) + + +@pytest.mark.asyncio +async def test_make_directory_async_from_dict(): + await test_make_directory_async(request_type=dict) + + +def test_make_directory_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.MakeDirectoryRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.make_directory), + '__call__') as call: + call.return_value = dataform.MakeDirectoryResponse() + client.make_directory(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_make_directory_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.MakeDirectoryRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.make_directory), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.MakeDirectoryResponse()) + await client.make_directory(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +@pytest.mark.parametrize("request_type", [ + dataform.RemoveDirectoryRequest, + dict, +]) +def test_remove_directory(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_directory), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = None + response = client.remove_directory(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.RemoveDirectoryRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +def test_remove_directory_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_directory), + '__call__') as call: + client.remove_directory() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.RemoveDirectoryRequest() + +@pytest.mark.asyncio +async def test_remove_directory_async(transport: str = 'grpc_asyncio', request_type=dataform.RemoveDirectoryRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_directory), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + response = await client.remove_directory(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.RemoveDirectoryRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +@pytest.mark.asyncio +async def test_remove_directory_async_from_dict(): + await test_remove_directory_async(request_type=dict) + + +def test_remove_directory_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.RemoveDirectoryRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_directory), + '__call__') as call: + call.return_value = None + client.remove_directory(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_remove_directory_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.RemoveDirectoryRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_directory), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.remove_directory(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +@pytest.mark.parametrize("request_type", [ + dataform.MoveDirectoryRequest, + dict, +]) +def test_move_directory(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.move_directory), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.MoveDirectoryResponse( + ) + response = client.move_directory(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.MoveDirectoryRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.MoveDirectoryResponse) + + +def test_move_directory_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.move_directory), + '__call__') as call: + client.move_directory() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.MoveDirectoryRequest() + +@pytest.mark.asyncio +async def test_move_directory_async(transport: str = 'grpc_asyncio', request_type=dataform.MoveDirectoryRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.move_directory), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.MoveDirectoryResponse( + )) + response = await client.move_directory(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.MoveDirectoryRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.MoveDirectoryResponse) + + +@pytest.mark.asyncio +async def test_move_directory_async_from_dict(): + await test_move_directory_async(request_type=dict) + + +def test_move_directory_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.MoveDirectoryRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.move_directory), + '__call__') as call: + call.return_value = dataform.MoveDirectoryResponse() + client.move_directory(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_move_directory_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.MoveDirectoryRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.move_directory), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.MoveDirectoryResponse()) + await client.move_directory(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +@pytest.mark.parametrize("request_type", [ + dataform.ReadFileRequest, + dict, +]) +def test_read_file(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.read_file), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.ReadFileResponse( + file_contents=b'file_contents_blob', + ) + response = client.read_file(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.ReadFileRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.ReadFileResponse) + assert response.file_contents == b'file_contents_blob' + + +def test_read_file_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.read_file), + '__call__') as call: + client.read_file() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.ReadFileRequest() + +@pytest.mark.asyncio +async def test_read_file_async(transport: str = 'grpc_asyncio', request_type=dataform.ReadFileRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.read_file), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.ReadFileResponse( + file_contents=b'file_contents_blob', + )) + response = await client.read_file(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.ReadFileRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.ReadFileResponse) + assert response.file_contents == b'file_contents_blob' + + +@pytest.mark.asyncio +async def test_read_file_async_from_dict(): + await test_read_file_async(request_type=dict) + + +def test_read_file_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.ReadFileRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.read_file), + '__call__') as call: + call.return_value = dataform.ReadFileResponse() + client.read_file(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_read_file_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.ReadFileRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.read_file), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.ReadFileResponse()) + await client.read_file(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +@pytest.mark.parametrize("request_type", [ + dataform.RemoveFileRequest, + dict, +]) +def test_remove_file(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_file), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = None + response = client.remove_file(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.RemoveFileRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +def test_remove_file_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_file), + '__call__') as call: + client.remove_file() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.RemoveFileRequest() + +@pytest.mark.asyncio +async def test_remove_file_async(transport: str = 'grpc_asyncio', request_type=dataform.RemoveFileRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_file), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + response = await client.remove_file(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.RemoveFileRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +@pytest.mark.asyncio +async def test_remove_file_async_from_dict(): + await test_remove_file_async(request_type=dict) + + +def test_remove_file_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.RemoveFileRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_file), + '__call__') as call: + call.return_value = None + client.remove_file(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_remove_file_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.RemoveFileRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_file), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.remove_file(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +@pytest.mark.parametrize("request_type", [ + dataform.MoveFileRequest, + dict, +]) +def test_move_file(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.move_file), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.MoveFileResponse( + ) + response = client.move_file(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.MoveFileRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.MoveFileResponse) + + +def test_move_file_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.move_file), + '__call__') as call: + client.move_file() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.MoveFileRequest() + +@pytest.mark.asyncio +async def test_move_file_async(transport: str = 'grpc_asyncio', request_type=dataform.MoveFileRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.move_file), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.MoveFileResponse( + )) + response = await client.move_file(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.MoveFileRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.MoveFileResponse) + + +@pytest.mark.asyncio +async def test_move_file_async_from_dict(): + await test_move_file_async(request_type=dict) + + +def test_move_file_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.MoveFileRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.move_file), + '__call__') as call: + call.return_value = dataform.MoveFileResponse() + client.move_file(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_move_file_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.MoveFileRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.move_file), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.MoveFileResponse()) + await client.move_file(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +@pytest.mark.parametrize("request_type", [ + dataform.WriteFileRequest, + dict, +]) +def test_write_file(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.write_file), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.WriteFileResponse( + ) + response = client.write_file(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.WriteFileRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.WriteFileResponse) + + +def test_write_file_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.write_file), + '__call__') as call: + client.write_file() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.WriteFileRequest() + +@pytest.mark.asyncio +async def test_write_file_async(transport: str = 'grpc_asyncio', request_type=dataform.WriteFileRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.write_file), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.WriteFileResponse( + )) + response = await client.write_file(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.WriteFileRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.WriteFileResponse) + + +@pytest.mark.asyncio +async def test_write_file_async_from_dict(): + await test_write_file_async(request_type=dict) + + +def test_write_file_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.WriteFileRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.write_file), + '__call__') as call: + call.return_value = dataform.WriteFileResponse() + client.write_file(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_write_file_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.WriteFileRequest() + + request.workspace = 'workspace_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.write_file), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.WriteFileResponse()) + await client.write_file(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'workspace=workspace_value', + ) in kw['metadata'] + + +@pytest.mark.parametrize("request_type", [ + dataform.ListCompilationResultsRequest, + dict, +]) +def test_list_compilation_results(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_compilation_results), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.ListCompilationResultsResponse( + next_page_token='next_page_token_value', + unreachable=['unreachable_value'], + ) + response = client.list_compilation_results(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.ListCompilationResultsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListCompilationResultsPager) + assert response.next_page_token == 'next_page_token_value' + assert response.unreachable == ['unreachable_value'] + + +def test_list_compilation_results_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_compilation_results), + '__call__') as call: + client.list_compilation_results() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.ListCompilationResultsRequest() + +@pytest.mark.asyncio +async def test_list_compilation_results_async(transport: str = 'grpc_asyncio', request_type=dataform.ListCompilationResultsRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_compilation_results), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListCompilationResultsResponse( + next_page_token='next_page_token_value', + unreachable=['unreachable_value'], + )) + response = await client.list_compilation_results(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.ListCompilationResultsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListCompilationResultsAsyncPager) + assert response.next_page_token == 'next_page_token_value' + assert response.unreachable == ['unreachable_value'] + + +@pytest.mark.asyncio +async def test_list_compilation_results_async_from_dict(): + await test_list_compilation_results_async(request_type=dict) + + +def test_list_compilation_results_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.ListCompilationResultsRequest() + + request.parent = 'parent_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_compilation_results), + '__call__') as call: + call.return_value = dataform.ListCompilationResultsResponse() + client.list_compilation_results(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'parent=parent_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_list_compilation_results_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.ListCompilationResultsRequest() + + request.parent = 'parent_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_compilation_results), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListCompilationResultsResponse()) + await client.list_compilation_results(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'parent=parent_value', + ) in kw['metadata'] + + +def test_list_compilation_results_flattened(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_compilation_results), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.ListCompilationResultsResponse() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.list_compilation_results( + parent='parent_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = 'parent_value' + assert arg == mock_val + + +def test_list_compilation_results_flattened_error(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.list_compilation_results( + dataform.ListCompilationResultsRequest(), + parent='parent_value', + ) + +@pytest.mark.asyncio +async def test_list_compilation_results_flattened_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_compilation_results), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.ListCompilationResultsResponse() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListCompilationResultsResponse()) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.list_compilation_results( + parent='parent_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = 'parent_value' + assert arg == mock_val + +@pytest.mark.asyncio +async def test_list_compilation_results_flattened_error_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.list_compilation_results( + dataform.ListCompilationResultsRequest(), + parent='parent_value', + ) + + +def test_list_compilation_results_pager(transport_name: str = "grpc"): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_compilation_results), + '__call__') as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.ListCompilationResultsResponse( + compilation_results=[ + dataform.CompilationResult(), + dataform.CompilationResult(), + dataform.CompilationResult(), + ], + next_page_token='abc', + ), + dataform.ListCompilationResultsResponse( + compilation_results=[], + next_page_token='def', + ), + dataform.ListCompilationResultsResponse( + compilation_results=[ + dataform.CompilationResult(), + ], + next_page_token='ghi', + ), + dataform.ListCompilationResultsResponse( + compilation_results=[ + dataform.CompilationResult(), + dataform.CompilationResult(), + ], + ), + RuntimeError, + ) + + metadata = () + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ('parent', ''), + )), + ) + pager = client.list_compilation_results(request={}) + + assert pager._metadata == metadata + + results = list(pager) + assert len(results) == 6 + assert all(isinstance(i, dataform.CompilationResult) + for i in results) +def test_list_compilation_results_pages(transport_name: str = "grpc"): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_compilation_results), + '__call__') as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.ListCompilationResultsResponse( + compilation_results=[ + dataform.CompilationResult(), + dataform.CompilationResult(), + dataform.CompilationResult(), + ], + next_page_token='abc', + ), + dataform.ListCompilationResultsResponse( + compilation_results=[], + next_page_token='def', + ), + dataform.ListCompilationResultsResponse( + compilation_results=[ + dataform.CompilationResult(), + ], + next_page_token='ghi', + ), + dataform.ListCompilationResultsResponse( + compilation_results=[ + dataform.CompilationResult(), + dataform.CompilationResult(), + ], + ), + RuntimeError, + ) + pages = list(client.list_compilation_results(request={}).pages) + for page_, token in zip(pages, ['abc','def','ghi', '']): + assert page_.raw_page.next_page_token == token + +@pytest.mark.asyncio +async def test_list_compilation_results_async_pager(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_compilation_results), + '__call__', new_callable=mock.AsyncMock) as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.ListCompilationResultsResponse( + compilation_results=[ + dataform.CompilationResult(), + dataform.CompilationResult(), + dataform.CompilationResult(), + ], + next_page_token='abc', + ), + dataform.ListCompilationResultsResponse( + compilation_results=[], + next_page_token='def', + ), + dataform.ListCompilationResultsResponse( + compilation_results=[ + dataform.CompilationResult(), + ], + next_page_token='ghi', + ), + dataform.ListCompilationResultsResponse( + compilation_results=[ + dataform.CompilationResult(), + dataform.CompilationResult(), + ], + ), + RuntimeError, + ) + async_pager = await client.list_compilation_results(request={},) + assert async_pager.next_page_token == 'abc' + responses = [] + async for response in async_pager: # pragma: no branch + responses.append(response) + + assert len(responses) == 6 + assert all(isinstance(i, dataform.CompilationResult) + for i in responses) + + +@pytest.mark.asyncio +async def test_list_compilation_results_async_pages(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_compilation_results), + '__call__', new_callable=mock.AsyncMock) as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.ListCompilationResultsResponse( + compilation_results=[ + dataform.CompilationResult(), + dataform.CompilationResult(), + dataform.CompilationResult(), + ], + next_page_token='abc', + ), + dataform.ListCompilationResultsResponse( + compilation_results=[], + next_page_token='def', + ), + dataform.ListCompilationResultsResponse( + compilation_results=[ + dataform.CompilationResult(), + ], + next_page_token='ghi', + ), + dataform.ListCompilationResultsResponse( + compilation_results=[ + dataform.CompilationResult(), + dataform.CompilationResult(), + ], + ), + RuntimeError, + ) + pages = [] + async for page_ in (await client.list_compilation_results(request={})).pages: # pragma: no branch + pages.append(page_) + for page_, token in zip(pages, ['abc','def','ghi', '']): + assert page_.raw_page.next_page_token == token + +@pytest.mark.parametrize("request_type", [ + dataform.GetCompilationResultRequest, + dict, +]) +def test_get_compilation_result(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_compilation_result), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.CompilationResult( + name='name_value', + dataform_core_version='dataform_core_version_value', + git_commitish='git_commitish_value', + ) + response = client.get_compilation_result(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.GetCompilationResultRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.CompilationResult) + assert response.name == 'name_value' + assert response.dataform_core_version == 'dataform_core_version_value' + + +def test_get_compilation_result_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_compilation_result), + '__call__') as call: + client.get_compilation_result() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.GetCompilationResultRequest() + +@pytest.mark.asyncio +async def test_get_compilation_result_async(transport: str = 'grpc_asyncio', request_type=dataform.GetCompilationResultRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_compilation_result), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.CompilationResult( + name='name_value', + dataform_core_version='dataform_core_version_value', + )) + response = await client.get_compilation_result(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.GetCompilationResultRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.CompilationResult) + assert response.name == 'name_value' + assert response.dataform_core_version == 'dataform_core_version_value' + + +@pytest.mark.asyncio +async def test_get_compilation_result_async_from_dict(): + await test_get_compilation_result_async(request_type=dict) + + +def test_get_compilation_result_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.GetCompilationResultRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_compilation_result), + '__call__') as call: + call.return_value = dataform.CompilationResult() + client.get_compilation_result(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_get_compilation_result_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.GetCompilationResultRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_compilation_result), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.CompilationResult()) + await client.get_compilation_result(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +def test_get_compilation_result_flattened(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_compilation_result), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.CompilationResult() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.get_compilation_result( + name='name_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = 'name_value' + assert arg == mock_val + + +def test_get_compilation_result_flattened_error(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.get_compilation_result( + dataform.GetCompilationResultRequest(), + name='name_value', + ) + +@pytest.mark.asyncio +async def test_get_compilation_result_flattened_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_compilation_result), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.CompilationResult() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.CompilationResult()) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.get_compilation_result( + name='name_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = 'name_value' + assert arg == mock_val + +@pytest.mark.asyncio +async def test_get_compilation_result_flattened_error_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.get_compilation_result( + dataform.GetCompilationResultRequest(), + name='name_value', + ) + + +@pytest.mark.parametrize("request_type", [ + dataform.CreateCompilationResultRequest, + dict, +]) +def test_create_compilation_result(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_compilation_result), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.CompilationResult( + name='name_value', + dataform_core_version='dataform_core_version_value', + git_commitish='git_commitish_value', + ) + response = client.create_compilation_result(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.CreateCompilationResultRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.CompilationResult) + assert response.name == 'name_value' + assert response.dataform_core_version == 'dataform_core_version_value' + + +def test_create_compilation_result_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_compilation_result), + '__call__') as call: + client.create_compilation_result() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.CreateCompilationResultRequest() + +@pytest.mark.asyncio +async def test_create_compilation_result_async(transport: str = 'grpc_asyncio', request_type=dataform.CreateCompilationResultRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_compilation_result), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.CompilationResult( + name='name_value', + dataform_core_version='dataform_core_version_value', + )) + response = await client.create_compilation_result(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.CreateCompilationResultRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.CompilationResult) + assert response.name == 'name_value' + assert response.dataform_core_version == 'dataform_core_version_value' + + +@pytest.mark.asyncio +async def test_create_compilation_result_async_from_dict(): + await test_create_compilation_result_async(request_type=dict) + + +def test_create_compilation_result_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.CreateCompilationResultRequest() + + request.parent = 'parent_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_compilation_result), + '__call__') as call: + call.return_value = dataform.CompilationResult() + client.create_compilation_result(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'parent=parent_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_create_compilation_result_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.CreateCompilationResultRequest() + + request.parent = 'parent_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_compilation_result), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.CompilationResult()) + await client.create_compilation_result(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'parent=parent_value', + ) in kw['metadata'] + + +def test_create_compilation_result_flattened(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_compilation_result), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.CompilationResult() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.create_compilation_result( + parent='parent_value', + compilation_result=dataform.CompilationResult(name='name_value'), + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = 'parent_value' + assert arg == mock_val + arg = args[0].compilation_result + mock_val = dataform.CompilationResult(name='name_value') + assert arg == mock_val + + +def test_create_compilation_result_flattened_error(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.create_compilation_result( + dataform.CreateCompilationResultRequest(), + parent='parent_value', + compilation_result=dataform.CompilationResult(name='name_value'), + ) + +@pytest.mark.asyncio +async def test_create_compilation_result_flattened_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_compilation_result), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.CompilationResult() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.CompilationResult()) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.create_compilation_result( + parent='parent_value', + compilation_result=dataform.CompilationResult(name='name_value'), + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = 'parent_value' + assert arg == mock_val + arg = args[0].compilation_result + mock_val = dataform.CompilationResult(name='name_value') + assert arg == mock_val + +@pytest.mark.asyncio +async def test_create_compilation_result_flattened_error_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.create_compilation_result( + dataform.CreateCompilationResultRequest(), + parent='parent_value', + compilation_result=dataform.CompilationResult(name='name_value'), + ) + + +@pytest.mark.parametrize("request_type", [ + dataform.QueryCompilationResultActionsRequest, + dict, +]) +def test_query_compilation_result_actions(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_compilation_result_actions), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.QueryCompilationResultActionsResponse( + next_page_token='next_page_token_value', + ) + response = client.query_compilation_result_actions(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.QueryCompilationResultActionsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.QueryCompilationResultActionsPager) + assert response.next_page_token == 'next_page_token_value' + + +def test_query_compilation_result_actions_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_compilation_result_actions), + '__call__') as call: + client.query_compilation_result_actions() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.QueryCompilationResultActionsRequest() + +@pytest.mark.asyncio +async def test_query_compilation_result_actions_async(transport: str = 'grpc_asyncio', request_type=dataform.QueryCompilationResultActionsRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_compilation_result_actions), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.QueryCompilationResultActionsResponse( + next_page_token='next_page_token_value', + )) + response = await client.query_compilation_result_actions(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.QueryCompilationResultActionsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.QueryCompilationResultActionsAsyncPager) + assert response.next_page_token == 'next_page_token_value' + + +@pytest.mark.asyncio +async def test_query_compilation_result_actions_async_from_dict(): + await test_query_compilation_result_actions_async(request_type=dict) + + +def test_query_compilation_result_actions_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.QueryCompilationResultActionsRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_compilation_result_actions), + '__call__') as call: + call.return_value = dataform.QueryCompilationResultActionsResponse() + client.query_compilation_result_actions(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_query_compilation_result_actions_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.QueryCompilationResultActionsRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_compilation_result_actions), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.QueryCompilationResultActionsResponse()) + await client.query_compilation_result_actions(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +def test_query_compilation_result_actions_pager(transport_name: str = "grpc"): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_compilation_result_actions), + '__call__') as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.QueryCompilationResultActionsResponse( + compilation_result_actions=[ + dataform.CompilationResultAction(), + dataform.CompilationResultAction(), + dataform.CompilationResultAction(), + ], + next_page_token='abc', + ), + dataform.QueryCompilationResultActionsResponse( + compilation_result_actions=[], + next_page_token='def', + ), + dataform.QueryCompilationResultActionsResponse( + compilation_result_actions=[ + dataform.CompilationResultAction(), + ], + next_page_token='ghi', + ), + dataform.QueryCompilationResultActionsResponse( + compilation_result_actions=[ + dataform.CompilationResultAction(), + dataform.CompilationResultAction(), + ], + ), + RuntimeError, + ) + + metadata = () + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ('name', ''), + )), + ) + pager = client.query_compilation_result_actions(request={}) + + assert pager._metadata == metadata + + results = list(pager) + assert len(results) == 6 + assert all(isinstance(i, dataform.CompilationResultAction) + for i in results) +def test_query_compilation_result_actions_pages(transport_name: str = "grpc"): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_compilation_result_actions), + '__call__') as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.QueryCompilationResultActionsResponse( + compilation_result_actions=[ + dataform.CompilationResultAction(), + dataform.CompilationResultAction(), + dataform.CompilationResultAction(), + ], + next_page_token='abc', + ), + dataform.QueryCompilationResultActionsResponse( + compilation_result_actions=[], + next_page_token='def', + ), + dataform.QueryCompilationResultActionsResponse( + compilation_result_actions=[ + dataform.CompilationResultAction(), + ], + next_page_token='ghi', + ), + dataform.QueryCompilationResultActionsResponse( + compilation_result_actions=[ + dataform.CompilationResultAction(), + dataform.CompilationResultAction(), + ], + ), + RuntimeError, + ) + pages = list(client.query_compilation_result_actions(request={}).pages) + for page_, token in zip(pages, ['abc','def','ghi', '']): + assert page_.raw_page.next_page_token == token + +@pytest.mark.asyncio +async def test_query_compilation_result_actions_async_pager(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_compilation_result_actions), + '__call__', new_callable=mock.AsyncMock) as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.QueryCompilationResultActionsResponse( + compilation_result_actions=[ + dataform.CompilationResultAction(), + dataform.CompilationResultAction(), + dataform.CompilationResultAction(), + ], + next_page_token='abc', + ), + dataform.QueryCompilationResultActionsResponse( + compilation_result_actions=[], + next_page_token='def', + ), + dataform.QueryCompilationResultActionsResponse( + compilation_result_actions=[ + dataform.CompilationResultAction(), + ], + next_page_token='ghi', + ), + dataform.QueryCompilationResultActionsResponse( + compilation_result_actions=[ + dataform.CompilationResultAction(), + dataform.CompilationResultAction(), + ], + ), + RuntimeError, + ) + async_pager = await client.query_compilation_result_actions(request={},) + assert async_pager.next_page_token == 'abc' + responses = [] + async for response in async_pager: # pragma: no branch + responses.append(response) + + assert len(responses) == 6 + assert all(isinstance(i, dataform.CompilationResultAction) + for i in responses) + + +@pytest.mark.asyncio +async def test_query_compilation_result_actions_async_pages(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_compilation_result_actions), + '__call__', new_callable=mock.AsyncMock) as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.QueryCompilationResultActionsResponse( + compilation_result_actions=[ + dataform.CompilationResultAction(), + dataform.CompilationResultAction(), + dataform.CompilationResultAction(), + ], + next_page_token='abc', + ), + dataform.QueryCompilationResultActionsResponse( + compilation_result_actions=[], + next_page_token='def', + ), + dataform.QueryCompilationResultActionsResponse( + compilation_result_actions=[ + dataform.CompilationResultAction(), + ], + next_page_token='ghi', + ), + dataform.QueryCompilationResultActionsResponse( + compilation_result_actions=[ + dataform.CompilationResultAction(), + dataform.CompilationResultAction(), + ], + ), + RuntimeError, + ) + pages = [] + async for page_ in (await client.query_compilation_result_actions(request={})).pages: # pragma: no branch + pages.append(page_) + for page_, token in zip(pages, ['abc','def','ghi', '']): + assert page_.raw_page.next_page_token == token + +@pytest.mark.parametrize("request_type", [ + dataform.ListWorkflowInvocationsRequest, + dict, +]) +def test_list_workflow_invocations(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workflow_invocations), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.ListWorkflowInvocationsResponse( + next_page_token='next_page_token_value', + unreachable=['unreachable_value'], + ) + response = client.list_workflow_invocations(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.ListWorkflowInvocationsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListWorkflowInvocationsPager) + assert response.next_page_token == 'next_page_token_value' + assert response.unreachable == ['unreachable_value'] + + +def test_list_workflow_invocations_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workflow_invocations), + '__call__') as call: + client.list_workflow_invocations() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.ListWorkflowInvocationsRequest() + +@pytest.mark.asyncio +async def test_list_workflow_invocations_async(transport: str = 'grpc_asyncio', request_type=dataform.ListWorkflowInvocationsRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workflow_invocations), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListWorkflowInvocationsResponse( + next_page_token='next_page_token_value', + unreachable=['unreachable_value'], + )) + response = await client.list_workflow_invocations(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.ListWorkflowInvocationsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListWorkflowInvocationsAsyncPager) + assert response.next_page_token == 'next_page_token_value' + assert response.unreachable == ['unreachable_value'] + + +@pytest.mark.asyncio +async def test_list_workflow_invocations_async_from_dict(): + await test_list_workflow_invocations_async(request_type=dict) + + +def test_list_workflow_invocations_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.ListWorkflowInvocationsRequest() + + request.parent = 'parent_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workflow_invocations), + '__call__') as call: + call.return_value = dataform.ListWorkflowInvocationsResponse() + client.list_workflow_invocations(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'parent=parent_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_list_workflow_invocations_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.ListWorkflowInvocationsRequest() + + request.parent = 'parent_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workflow_invocations), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListWorkflowInvocationsResponse()) + await client.list_workflow_invocations(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'parent=parent_value', + ) in kw['metadata'] + + +def test_list_workflow_invocations_flattened(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workflow_invocations), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.ListWorkflowInvocationsResponse() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.list_workflow_invocations( + parent='parent_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = 'parent_value' + assert arg == mock_val + + +def test_list_workflow_invocations_flattened_error(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.list_workflow_invocations( + dataform.ListWorkflowInvocationsRequest(), + parent='parent_value', + ) + +@pytest.mark.asyncio +async def test_list_workflow_invocations_flattened_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workflow_invocations), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.ListWorkflowInvocationsResponse() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListWorkflowInvocationsResponse()) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.list_workflow_invocations( + parent='parent_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = 'parent_value' + assert arg == mock_val + +@pytest.mark.asyncio +async def test_list_workflow_invocations_flattened_error_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.list_workflow_invocations( + dataform.ListWorkflowInvocationsRequest(), + parent='parent_value', + ) + + +def test_list_workflow_invocations_pager(transport_name: str = "grpc"): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workflow_invocations), + '__call__') as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.ListWorkflowInvocationsResponse( + workflow_invocations=[ + dataform.WorkflowInvocation(), + dataform.WorkflowInvocation(), + dataform.WorkflowInvocation(), + ], + next_page_token='abc', + ), + dataform.ListWorkflowInvocationsResponse( + workflow_invocations=[], + next_page_token='def', + ), + dataform.ListWorkflowInvocationsResponse( + workflow_invocations=[ + dataform.WorkflowInvocation(), + ], + next_page_token='ghi', + ), + dataform.ListWorkflowInvocationsResponse( + workflow_invocations=[ + dataform.WorkflowInvocation(), + dataform.WorkflowInvocation(), + ], + ), + RuntimeError, + ) + + metadata = () + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ('parent', ''), + )), + ) + pager = client.list_workflow_invocations(request={}) + + assert pager._metadata == metadata + + results = list(pager) + assert len(results) == 6 + assert all(isinstance(i, dataform.WorkflowInvocation) + for i in results) +def test_list_workflow_invocations_pages(transport_name: str = "grpc"): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workflow_invocations), + '__call__') as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.ListWorkflowInvocationsResponse( + workflow_invocations=[ + dataform.WorkflowInvocation(), + dataform.WorkflowInvocation(), + dataform.WorkflowInvocation(), + ], + next_page_token='abc', + ), + dataform.ListWorkflowInvocationsResponse( + workflow_invocations=[], + next_page_token='def', + ), + dataform.ListWorkflowInvocationsResponse( + workflow_invocations=[ + dataform.WorkflowInvocation(), + ], + next_page_token='ghi', + ), + dataform.ListWorkflowInvocationsResponse( + workflow_invocations=[ + dataform.WorkflowInvocation(), + dataform.WorkflowInvocation(), + ], + ), + RuntimeError, + ) + pages = list(client.list_workflow_invocations(request={}).pages) + for page_, token in zip(pages, ['abc','def','ghi', '']): + assert page_.raw_page.next_page_token == token + +@pytest.mark.asyncio +async def test_list_workflow_invocations_async_pager(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workflow_invocations), + '__call__', new_callable=mock.AsyncMock) as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.ListWorkflowInvocationsResponse( + workflow_invocations=[ + dataform.WorkflowInvocation(), + dataform.WorkflowInvocation(), + dataform.WorkflowInvocation(), + ], + next_page_token='abc', + ), + dataform.ListWorkflowInvocationsResponse( + workflow_invocations=[], + next_page_token='def', + ), + dataform.ListWorkflowInvocationsResponse( + workflow_invocations=[ + dataform.WorkflowInvocation(), + ], + next_page_token='ghi', + ), + dataform.ListWorkflowInvocationsResponse( + workflow_invocations=[ + dataform.WorkflowInvocation(), + dataform.WorkflowInvocation(), + ], + ), + RuntimeError, + ) + async_pager = await client.list_workflow_invocations(request={},) + assert async_pager.next_page_token == 'abc' + responses = [] + async for response in async_pager: # pragma: no branch + responses.append(response) + + assert len(responses) == 6 + assert all(isinstance(i, dataform.WorkflowInvocation) + for i in responses) + + +@pytest.mark.asyncio +async def test_list_workflow_invocations_async_pages(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_workflow_invocations), + '__call__', new_callable=mock.AsyncMock) as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.ListWorkflowInvocationsResponse( + workflow_invocations=[ + dataform.WorkflowInvocation(), + dataform.WorkflowInvocation(), + dataform.WorkflowInvocation(), + ], + next_page_token='abc', + ), + dataform.ListWorkflowInvocationsResponse( + workflow_invocations=[], + next_page_token='def', + ), + dataform.ListWorkflowInvocationsResponse( + workflow_invocations=[ + dataform.WorkflowInvocation(), + ], + next_page_token='ghi', + ), + dataform.ListWorkflowInvocationsResponse( + workflow_invocations=[ + dataform.WorkflowInvocation(), + dataform.WorkflowInvocation(), + ], + ), + RuntimeError, + ) + pages = [] + async for page_ in (await client.list_workflow_invocations(request={})).pages: # pragma: no branch + pages.append(page_) + for page_, token in zip(pages, ['abc','def','ghi', '']): + assert page_.raw_page.next_page_token == token + +@pytest.mark.parametrize("request_type", [ + dataform.GetWorkflowInvocationRequest, + dict, +]) +def test_get_workflow_invocation(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_workflow_invocation), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.WorkflowInvocation( + name='name_value', + compilation_result='compilation_result_value', + state=dataform.WorkflowInvocation.State.RUNNING, + ) + response = client.get_workflow_invocation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.GetWorkflowInvocationRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.WorkflowInvocation) + assert response.name == 'name_value' + assert response.compilation_result == 'compilation_result_value' + assert response.state == dataform.WorkflowInvocation.State.RUNNING + + +def test_get_workflow_invocation_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_workflow_invocation), + '__call__') as call: + client.get_workflow_invocation() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.GetWorkflowInvocationRequest() + +@pytest.mark.asyncio +async def test_get_workflow_invocation_async(transport: str = 'grpc_asyncio', request_type=dataform.GetWorkflowInvocationRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_workflow_invocation), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.WorkflowInvocation( + name='name_value', + compilation_result='compilation_result_value', + state=dataform.WorkflowInvocation.State.RUNNING, + )) + response = await client.get_workflow_invocation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.GetWorkflowInvocationRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.WorkflowInvocation) + assert response.name == 'name_value' + assert response.compilation_result == 'compilation_result_value' + assert response.state == dataform.WorkflowInvocation.State.RUNNING + + +@pytest.mark.asyncio +async def test_get_workflow_invocation_async_from_dict(): + await test_get_workflow_invocation_async(request_type=dict) + + +def test_get_workflow_invocation_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.GetWorkflowInvocationRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_workflow_invocation), + '__call__') as call: + call.return_value = dataform.WorkflowInvocation() + client.get_workflow_invocation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_get_workflow_invocation_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.GetWorkflowInvocationRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_workflow_invocation), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.WorkflowInvocation()) + await client.get_workflow_invocation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +def test_get_workflow_invocation_flattened(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_workflow_invocation), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.WorkflowInvocation() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.get_workflow_invocation( + name='name_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = 'name_value' + assert arg == mock_val + + +def test_get_workflow_invocation_flattened_error(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.get_workflow_invocation( + dataform.GetWorkflowInvocationRequest(), + name='name_value', + ) + +@pytest.mark.asyncio +async def test_get_workflow_invocation_flattened_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_workflow_invocation), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.WorkflowInvocation() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.WorkflowInvocation()) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.get_workflow_invocation( + name='name_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = 'name_value' + assert arg == mock_val + +@pytest.mark.asyncio +async def test_get_workflow_invocation_flattened_error_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.get_workflow_invocation( + dataform.GetWorkflowInvocationRequest(), + name='name_value', + ) + + +@pytest.mark.parametrize("request_type", [ + dataform.CreateWorkflowInvocationRequest, + dict, +]) +def test_create_workflow_invocation(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_workflow_invocation), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.WorkflowInvocation( + name='name_value', + compilation_result='compilation_result_value', + state=dataform.WorkflowInvocation.State.RUNNING, + ) + response = client.create_workflow_invocation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.CreateWorkflowInvocationRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.WorkflowInvocation) + assert response.name == 'name_value' + assert response.compilation_result == 'compilation_result_value' + assert response.state == dataform.WorkflowInvocation.State.RUNNING + + +def test_create_workflow_invocation_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_workflow_invocation), + '__call__') as call: + client.create_workflow_invocation() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.CreateWorkflowInvocationRequest() + +@pytest.mark.asyncio +async def test_create_workflow_invocation_async(transport: str = 'grpc_asyncio', request_type=dataform.CreateWorkflowInvocationRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_workflow_invocation), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.WorkflowInvocation( + name='name_value', + compilation_result='compilation_result_value', + state=dataform.WorkflowInvocation.State.RUNNING, + )) + response = await client.create_workflow_invocation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.CreateWorkflowInvocationRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, dataform.WorkflowInvocation) + assert response.name == 'name_value' + assert response.compilation_result == 'compilation_result_value' + assert response.state == dataform.WorkflowInvocation.State.RUNNING + + +@pytest.mark.asyncio +async def test_create_workflow_invocation_async_from_dict(): + await test_create_workflow_invocation_async(request_type=dict) + + +def test_create_workflow_invocation_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.CreateWorkflowInvocationRequest() + + request.parent = 'parent_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_workflow_invocation), + '__call__') as call: + call.return_value = dataform.WorkflowInvocation() + client.create_workflow_invocation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'parent=parent_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_create_workflow_invocation_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.CreateWorkflowInvocationRequest() + + request.parent = 'parent_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_workflow_invocation), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.WorkflowInvocation()) + await client.create_workflow_invocation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'parent=parent_value', + ) in kw['metadata'] + + +def test_create_workflow_invocation_flattened(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_workflow_invocation), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.WorkflowInvocation() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.create_workflow_invocation( + parent='parent_value', + workflow_invocation=dataform.WorkflowInvocation(name='name_value'), + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = 'parent_value' + assert arg == mock_val + arg = args[0].workflow_invocation + mock_val = dataform.WorkflowInvocation(name='name_value') + assert arg == mock_val + + +def test_create_workflow_invocation_flattened_error(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.create_workflow_invocation( + dataform.CreateWorkflowInvocationRequest(), + parent='parent_value', + workflow_invocation=dataform.WorkflowInvocation(name='name_value'), + ) + +@pytest.mark.asyncio +async def test_create_workflow_invocation_flattened_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_workflow_invocation), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.WorkflowInvocation() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.WorkflowInvocation()) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.create_workflow_invocation( + parent='parent_value', + workflow_invocation=dataform.WorkflowInvocation(name='name_value'), + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = 'parent_value' + assert arg == mock_val + arg = args[0].workflow_invocation + mock_val = dataform.WorkflowInvocation(name='name_value') + assert arg == mock_val + +@pytest.mark.asyncio +async def test_create_workflow_invocation_flattened_error_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.create_workflow_invocation( + dataform.CreateWorkflowInvocationRequest(), + parent='parent_value', + workflow_invocation=dataform.WorkflowInvocation(name='name_value'), + ) + + +@pytest.mark.parametrize("request_type", [ + dataform.DeleteWorkflowInvocationRequest, + dict, +]) +def test_delete_workflow_invocation(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_workflow_invocation), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = None + response = client.delete_workflow_invocation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.DeleteWorkflowInvocationRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +def test_delete_workflow_invocation_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_workflow_invocation), + '__call__') as call: + client.delete_workflow_invocation() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.DeleteWorkflowInvocationRequest() + +@pytest.mark.asyncio +async def test_delete_workflow_invocation_async(transport: str = 'grpc_asyncio', request_type=dataform.DeleteWorkflowInvocationRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_workflow_invocation), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + response = await client.delete_workflow_invocation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.DeleteWorkflowInvocationRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +@pytest.mark.asyncio +async def test_delete_workflow_invocation_async_from_dict(): + await test_delete_workflow_invocation_async(request_type=dict) + + +def test_delete_workflow_invocation_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.DeleteWorkflowInvocationRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_workflow_invocation), + '__call__') as call: + call.return_value = None + client.delete_workflow_invocation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_delete_workflow_invocation_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.DeleteWorkflowInvocationRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_workflow_invocation), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.delete_workflow_invocation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +def test_delete_workflow_invocation_flattened(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_workflow_invocation), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = None + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.delete_workflow_invocation( + name='name_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = 'name_value' + assert arg == mock_val + + +def test_delete_workflow_invocation_flattened_error(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.delete_workflow_invocation( + dataform.DeleteWorkflowInvocationRequest(), + name='name_value', + ) + +@pytest.mark.asyncio +async def test_delete_workflow_invocation_flattened_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_workflow_invocation), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = None + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.delete_workflow_invocation( + name='name_value', + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = 'name_value' + assert arg == mock_val + +@pytest.mark.asyncio +async def test_delete_workflow_invocation_flattened_error_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.delete_workflow_invocation( + dataform.DeleteWorkflowInvocationRequest(), + name='name_value', + ) + + +@pytest.mark.parametrize("request_type", [ + dataform.CancelWorkflowInvocationRequest, + dict, +]) +def test_cancel_workflow_invocation(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.cancel_workflow_invocation), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = None + response = client.cancel_workflow_invocation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.CancelWorkflowInvocationRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +def test_cancel_workflow_invocation_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.cancel_workflow_invocation), + '__call__') as call: + client.cancel_workflow_invocation() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.CancelWorkflowInvocationRequest() + +@pytest.mark.asyncio +async def test_cancel_workflow_invocation_async(transport: str = 'grpc_asyncio', request_type=dataform.CancelWorkflowInvocationRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.cancel_workflow_invocation), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + response = await client.cancel_workflow_invocation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.CancelWorkflowInvocationRequest() + + # Establish that the response is the type that we expect. + assert response is None + + +@pytest.mark.asyncio +async def test_cancel_workflow_invocation_async_from_dict(): + await test_cancel_workflow_invocation_async(request_type=dict) + + +def test_cancel_workflow_invocation_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.CancelWorkflowInvocationRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.cancel_workflow_invocation), + '__call__') as call: + call.return_value = None + client.cancel_workflow_invocation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_cancel_workflow_invocation_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.CancelWorkflowInvocationRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.cancel_workflow_invocation), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.cancel_workflow_invocation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.parametrize("request_type", [ + dataform.QueryWorkflowInvocationActionsRequest, + dict, +]) +def test_query_workflow_invocation_actions(request_type, transport: str = 'grpc'): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_workflow_invocation_actions), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value = dataform.QueryWorkflowInvocationActionsResponse( + next_page_token='next_page_token_value', + ) + response = client.query_workflow_invocation_actions(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.QueryWorkflowInvocationActionsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.QueryWorkflowInvocationActionsPager) + assert response.next_page_token == 'next_page_token_value' + + +def test_query_workflow_invocation_actions_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport='grpc', + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_workflow_invocation_actions), + '__call__') as call: + client.query_workflow_invocation_actions() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.QueryWorkflowInvocationActionsRequest() + +@pytest.mark.asyncio +async def test_query_workflow_invocation_actions_async(transport: str = 'grpc_asyncio', request_type=dataform.QueryWorkflowInvocationActionsRequest): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_workflow_invocation_actions), + '__call__') as call: + # Designate an appropriate return value for the call. + call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.QueryWorkflowInvocationActionsResponse( + next_page_token='next_page_token_value', + )) + response = await client.query_workflow_invocation_actions(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == dataform.QueryWorkflowInvocationActionsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.QueryWorkflowInvocationActionsAsyncPager) + assert response.next_page_token == 'next_page_token_value' + + +@pytest.mark.asyncio +async def test_query_workflow_invocation_actions_async_from_dict(): + await test_query_workflow_invocation_actions_async(request_type=dict) + + +def test_query_workflow_invocation_actions_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.QueryWorkflowInvocationActionsRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_workflow_invocation_actions), + '__call__') as call: + call.return_value = dataform.QueryWorkflowInvocationActionsResponse() + client.query_workflow_invocation_actions(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +@pytest.mark.asyncio +async def test_query_workflow_invocation_actions_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = dataform.QueryWorkflowInvocationActionsRequest() + + request.name = 'name_value' + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_workflow_invocation_actions), + '__call__') as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.QueryWorkflowInvocationActionsResponse()) + await client.query_workflow_invocation_actions(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + 'x-goog-request-params', + 'name=name_value', + ) in kw['metadata'] + + +def test_query_workflow_invocation_actions_pager(transport_name: str = "grpc"): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_workflow_invocation_actions), + '__call__') as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.QueryWorkflowInvocationActionsResponse( + workflow_invocation_actions=[ + dataform.WorkflowInvocationAction(), + dataform.WorkflowInvocationAction(), + dataform.WorkflowInvocationAction(), + ], + next_page_token='abc', + ), + dataform.QueryWorkflowInvocationActionsResponse( + workflow_invocation_actions=[], + next_page_token='def', + ), + dataform.QueryWorkflowInvocationActionsResponse( + workflow_invocation_actions=[ + dataform.WorkflowInvocationAction(), + ], + next_page_token='ghi', + ), + dataform.QueryWorkflowInvocationActionsResponse( + workflow_invocation_actions=[ + dataform.WorkflowInvocationAction(), + dataform.WorkflowInvocationAction(), + ], + ), + RuntimeError, + ) + + metadata = () + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata(( + ('name', ''), + )), + ) + pager = client.query_workflow_invocation_actions(request={}) + + assert pager._metadata == metadata + + results = list(pager) + assert len(results) == 6 + assert all(isinstance(i, dataform.WorkflowInvocationAction) + for i in results) +def test_query_workflow_invocation_actions_pages(transport_name: str = "grpc"): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_workflow_invocation_actions), + '__call__') as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.QueryWorkflowInvocationActionsResponse( + workflow_invocation_actions=[ + dataform.WorkflowInvocationAction(), + dataform.WorkflowInvocationAction(), + dataform.WorkflowInvocationAction(), + ], + next_page_token='abc', + ), + dataform.QueryWorkflowInvocationActionsResponse( + workflow_invocation_actions=[], + next_page_token='def', + ), + dataform.QueryWorkflowInvocationActionsResponse( + workflow_invocation_actions=[ + dataform.WorkflowInvocationAction(), + ], + next_page_token='ghi', + ), + dataform.QueryWorkflowInvocationActionsResponse( + workflow_invocation_actions=[ + dataform.WorkflowInvocationAction(), + dataform.WorkflowInvocationAction(), + ], + ), + RuntimeError, + ) + pages = list(client.query_workflow_invocation_actions(request={}).pages) + for page_, token in zip(pages, ['abc','def','ghi', '']): + assert page_.raw_page.next_page_token == token + +@pytest.mark.asyncio +async def test_query_workflow_invocation_actions_async_pager(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_workflow_invocation_actions), + '__call__', new_callable=mock.AsyncMock) as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.QueryWorkflowInvocationActionsResponse( + workflow_invocation_actions=[ + dataform.WorkflowInvocationAction(), + dataform.WorkflowInvocationAction(), + dataform.WorkflowInvocationAction(), + ], + next_page_token='abc', + ), + dataform.QueryWorkflowInvocationActionsResponse( + workflow_invocation_actions=[], + next_page_token='def', + ), + dataform.QueryWorkflowInvocationActionsResponse( + workflow_invocation_actions=[ + dataform.WorkflowInvocationAction(), + ], + next_page_token='ghi', + ), + dataform.QueryWorkflowInvocationActionsResponse( + workflow_invocation_actions=[ + dataform.WorkflowInvocationAction(), + dataform.WorkflowInvocationAction(), + ], + ), + RuntimeError, + ) + async_pager = await client.query_workflow_invocation_actions(request={},) + assert async_pager.next_page_token == 'abc' + responses = [] + async for response in async_pager: # pragma: no branch + responses.append(response) + + assert len(responses) == 6 + assert all(isinstance(i, dataform.WorkflowInvocationAction) + for i in responses) + + +@pytest.mark.asyncio +async def test_query_workflow_invocation_actions_async_pages(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.query_workflow_invocation_actions), + '__call__', new_callable=mock.AsyncMock) as call: + # Set the response to a series of pages. + call.side_effect = ( + dataform.QueryWorkflowInvocationActionsResponse( + workflow_invocation_actions=[ + dataform.WorkflowInvocationAction(), + dataform.WorkflowInvocationAction(), + dataform.WorkflowInvocationAction(), + ], + next_page_token='abc', + ), + dataform.QueryWorkflowInvocationActionsResponse( + workflow_invocation_actions=[], + next_page_token='def', + ), + dataform.QueryWorkflowInvocationActionsResponse( + workflow_invocation_actions=[ + dataform.WorkflowInvocationAction(), + ], + next_page_token='ghi', + ), + dataform.QueryWorkflowInvocationActionsResponse( + workflow_invocation_actions=[ + dataform.WorkflowInvocationAction(), + dataform.WorkflowInvocationAction(), + ], + ), + RuntimeError, + ) + pages = [] + async for page_ in (await client.query_workflow_invocation_actions(request={})).pages: # pragma: no branch + pages.append(page_) + for page_, token in zip(pages, ['abc','def','ghi', '']): + assert page_.raw_page.next_page_token == token + + +def test_credentials_transport_error(): + # It is an error to provide credentials and a transport instance. + transport = transports.DataformGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # It is an error to provide a credentials file and a transport instance. + transport = transports.DataformGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = DataformClient( + client_options={"credentials_file": "credentials.json"}, + transport=transport, + ) + + # It is an error to provide an api_key and a transport instance. + transport = transports.DataformGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = DataformClient( + client_options=options, + transport=transport, + ) + + # It is an error to provide an api_key and a credential. + options = mock.Mock() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = DataformClient( + client_options=options, + credentials=ga_credentials.AnonymousCredentials() + ) + + # It is an error to provide scopes and a transport instance. + transport = transports.DataformGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = DataformClient( + client_options={"scopes": ["1", "2"]}, + transport=transport, + ) + + +def test_transport_instance(): + # A client may be instantiated with a custom transport instance. + transport = transports.DataformGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + client = DataformClient(transport=transport) + assert client.transport is transport + +def test_transport_get_channel(): + # A client may be instantiated with a custom transport instance. + transport = transports.DataformGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + channel = transport.grpc_channel + assert channel + + transport = transports.DataformGrpcAsyncIOTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + channel = transport.grpc_channel + assert channel + +@pytest.mark.parametrize("transport_class", [ + transports.DataformGrpcTransport, + transports.DataformGrpcAsyncIOTransport, +]) +def test_transport_adc(transport_class): + # Test default credentials are used if not provided. + with mock.patch.object(google.auth, 'default') as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport_class() + adc.assert_called_once() + +@pytest.mark.parametrize("transport_name", [ + "grpc", +]) +def test_transport_kind(transport_name): + transport = DataformClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + +def test_transport_grpc_default(): + # A client should use the gRPC transport by default. + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.DataformGrpcTransport, + ) + +def test_dataform_base_transport_error(): + # Passing both a credentials object and credentials_file should raise an error + with pytest.raises(core_exceptions.DuplicateCredentialArgs): + transport = transports.DataformTransport( + credentials=ga_credentials.AnonymousCredentials(), + credentials_file="credentials.json" + ) + + +def test_dataform_base_transport(): + # Instantiate the base transport. + with mock.patch('google.cloud.dataform_v1beta1.services.dataform.transports.DataformTransport.__init__') as Transport: + Transport.return_value = None + transport = transports.DataformTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Every method on the transport should just blindly + # raise NotImplementedError. + methods = ( + 'list_repositories', + 'get_repository', + 'create_repository', + 'update_repository', + 'delete_repository', + 'fetch_remote_branches', + 'list_workspaces', + 'get_workspace', + 'create_workspace', + 'delete_workspace', + 'install_npm_packages', + 'pull_git_commits', + 'push_git_commits', + 'fetch_file_git_statuses', + 'fetch_git_ahead_behind', + 'commit_workspace_changes', + 'reset_workspace_changes', + 'fetch_file_diff', + 'query_directory_contents', + 'make_directory', + 'remove_directory', + 'move_directory', + 'read_file', + 'remove_file', + 'move_file', + 'write_file', + 'list_compilation_results', + 'get_compilation_result', + 'create_compilation_result', + 'query_compilation_result_actions', + 'list_workflow_invocations', + 'get_workflow_invocation', + 'create_workflow_invocation', + 'delete_workflow_invocation', + 'cancel_workflow_invocation', + 'query_workflow_invocation_actions', + 'get_location', + 'list_locations', + ) + for method in methods: + with pytest.raises(NotImplementedError): + getattr(transport, method)(request=object()) + + with pytest.raises(NotImplementedError): + transport.close() + + # Catch all for all remaining methods and properties + remainder = [ + 'kind', + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + + +def test_dataform_base_transport_with_credentials_file(): + # Instantiate the base transport with a credentials file + with mock.patch.object(google.auth, 'load_credentials_from_file', autospec=True) as load_creds, mock.patch('google.cloud.dataform_v1beta1.services.dataform.transports.DataformTransport._prep_wrapped_messages') as Transport: + Transport.return_value = None + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.DataformTransport( + credentials_file="credentials.json", + quota_project_id="octopus", + ) + load_creds.assert_called_once_with("credentials.json", + scopes=None, + default_scopes=( + 'https://www.googleapis.com/auth/cloud-platform', +), + quota_project_id="octopus", + ) + + +def test_dataform_base_transport_with_adc(): + # Test the default credentials are used if credentials and credentials_file are None. + with mock.patch.object(google.auth, 'default', autospec=True) as adc, mock.patch('google.cloud.dataform_v1beta1.services.dataform.transports.DataformTransport._prep_wrapped_messages') as Transport: + Transport.return_value = None + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.DataformTransport() + adc.assert_called_once() + + +def test_dataform_auth_adc(): + # If no credentials are provided, we should use ADC credentials. + with mock.patch.object(google.auth, 'default', autospec=True) as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + DataformClient() + adc.assert_called_once_with( + scopes=None, + default_scopes=( + 'https://www.googleapis.com/auth/cloud-platform', +), + quota_project_id=None, + ) + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.DataformGrpcTransport, + transports.DataformGrpcAsyncIOTransport, + ], +) +def test_dataform_transport_auth_adc(transport_class): + # If credentials and host are not provided, the transport class should use + # ADC credentials. + with mock.patch.object(google.auth, 'default', autospec=True) as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport_class(quota_project_id="octopus", scopes=["1", "2"]) + adc.assert_called_once_with( + scopes=["1", "2"], + default_scopes=( 'https://www.googleapis.com/auth/cloud-platform',), + quota_project_id="octopus", + ) + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.DataformGrpcTransport, + transports.DataformGrpcAsyncIOTransport, + ], +) +def test_dataform_transport_auth_gdch_credentials(transport_class): + host = 'https://language.com' + api_audience_tests = [None, 'https://language2.com'] + api_audience_expect = [host, 'https://language2.com'] + for t, e in zip(api_audience_tests, api_audience_expect): + with mock.patch.object(google.auth, 'default', autospec=True) as adc: + gdch_mock = mock.MagicMock() + type(gdch_mock).with_gdch_audience = mock.PropertyMock(return_value=gdch_mock) + adc.return_value = (gdch_mock, None) + transport_class(host=host, api_audience=t) + gdch_mock.with_gdch_audience.assert_called_once_with( + e + ) + + +@pytest.mark.parametrize( + "transport_class,grpc_helpers", + [ + (transports.DataformGrpcTransport, grpc_helpers), + (transports.DataformGrpcAsyncIOTransport, grpc_helpers_async) + ], +) +def test_dataform_transport_create_channel(transport_class, grpc_helpers): + # If credentials and host are not provided, the transport class should use + # ADC credentials. + with mock.patch.object(google.auth, "default", autospec=True) as adc, mock.patch.object( + grpc_helpers, "create_channel", autospec=True + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + adc.return_value = (creds, None) + transport_class( + quota_project_id="octopus", + scopes=["1", "2"] + ) + + create_channel.assert_called_with( + "dataform.googleapis.com:443", + credentials=creds, + credentials_file=None, + quota_project_id="octopus", + default_scopes=( + 'https://www.googleapis.com/auth/cloud-platform', +), + scopes=["1", "2"], + default_host="dataform.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + +@pytest.mark.parametrize("transport_class", [transports.DataformGrpcTransport, transports.DataformGrpcAsyncIOTransport]) +def test_dataform_grpc_transport_client_cert_source_for_mtls( + transport_class +): + cred = ga_credentials.AnonymousCredentials() + + # Check ssl_channel_credentials is used if provided. + with mock.patch.object(transport_class, "create_channel") as mock_create_channel: + mock_ssl_channel_creds = mock.Mock() + transport_class( + host="squid.clam.whelk", + credentials=cred, + ssl_channel_credentials=mock_ssl_channel_creds + ) + mock_create_channel.assert_called_once_with( + "squid.clam.whelk:443", + credentials=cred, + credentials_file=None, + scopes=None, + ssl_credentials=mock_ssl_channel_creds, + quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + # Check if ssl_channel_credentials is not provided, then client_cert_source_for_mtls + # is used. + with mock.patch.object(transport_class, "create_channel", return_value=mock.Mock()): + with mock.patch("grpc.ssl_channel_credentials") as mock_ssl_cred: + transport_class( + credentials=cred, + client_cert_source_for_mtls=client_cert_source_callback + ) + expected_cert, expected_key = client_cert_source_callback() + mock_ssl_cred.assert_called_once_with( + certificate_chain=expected_cert, + private_key=expected_key + ) + + +@pytest.mark.parametrize("transport_name", [ + "grpc", + "grpc_asyncio", +]) +def test_dataform_host_no_port(transport_name): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + client_options=client_options.ClientOptions(api_endpoint='dataform.googleapis.com'), + transport=transport_name, + ) + assert client.transport._host == ( + 'dataform.googleapis.com:443' + ) + +@pytest.mark.parametrize("transport_name", [ + "grpc", + "grpc_asyncio", +]) +def test_dataform_host_with_port(transport_name): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + client_options=client_options.ClientOptions(api_endpoint='dataform.googleapis.com:8000'), + transport=transport_name, + ) + assert client.transport._host == ( + 'dataform.googleapis.com:8000' + ) + +def test_dataform_grpc_transport_channel(): + channel = grpc.secure_channel('http://localhost/', grpc.local_channel_credentials()) + + # Check that channel is used if provided. + transport = transports.DataformGrpcTransport( + host="squid.clam.whelk", + channel=channel, + ) + assert transport.grpc_channel == channel + assert transport._host == "squid.clam.whelk:443" + assert transport._ssl_channel_credentials == None + + +def test_dataform_grpc_asyncio_transport_channel(): + channel = aio.secure_channel('http://localhost/', grpc.local_channel_credentials()) + + # Check that channel is used if provided. + transport = transports.DataformGrpcAsyncIOTransport( + host="squid.clam.whelk", + channel=channel, + ) + assert transport.grpc_channel == channel + assert transport._host == "squid.clam.whelk:443" + assert transport._ssl_channel_credentials == None + + +# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are +# removed from grpc/grpc_asyncio transport constructor. +@pytest.mark.parametrize("transport_class", [transports.DataformGrpcTransport, transports.DataformGrpcAsyncIOTransport]) +def test_dataform_transport_channel_mtls_with_client_cert_source( + transport_class +): + with mock.patch("grpc.ssl_channel_credentials", autospec=True) as grpc_ssl_channel_cred: + with mock.patch.object(transport_class, "create_channel") as grpc_create_channel: + mock_ssl_cred = mock.Mock() + grpc_ssl_channel_cred.return_value = mock_ssl_cred + + mock_grpc_channel = mock.Mock() + grpc_create_channel.return_value = mock_grpc_channel + + cred = ga_credentials.AnonymousCredentials() + with pytest.warns(DeprecationWarning): + with mock.patch.object(google.auth, 'default') as adc: + adc.return_value = (cred, None) + transport = transport_class( + host="squid.clam.whelk", + api_mtls_endpoint="mtls.squid.clam.whelk", + client_cert_source=client_cert_source_callback, + ) + adc.assert_called_once() + + grpc_ssl_channel_cred.assert_called_once_with( + certificate_chain=b"cert bytes", private_key=b"key bytes" + ) + grpc_create_channel.assert_called_once_with( + "mtls.squid.clam.whelk:443", + credentials=cred, + credentials_file=None, + scopes=None, + ssl_credentials=mock_ssl_cred, + quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + assert transport.grpc_channel == mock_grpc_channel + assert transport._ssl_channel_credentials == mock_ssl_cred + + +# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are +# removed from grpc/grpc_asyncio transport constructor. +@pytest.mark.parametrize("transport_class", [transports.DataformGrpcTransport, transports.DataformGrpcAsyncIOTransport]) +def test_dataform_transport_channel_mtls_with_adc( + transport_class +): + mock_ssl_cred = mock.Mock() + with mock.patch.multiple( + "google.auth.transport.grpc.SslCredentials", + __init__=mock.Mock(return_value=None), + ssl_credentials=mock.PropertyMock(return_value=mock_ssl_cred), + ): + with mock.patch.object(transport_class, "create_channel") as grpc_create_channel: + mock_grpc_channel = mock.Mock() + grpc_create_channel.return_value = mock_grpc_channel + mock_cred = mock.Mock() + + with pytest.warns(DeprecationWarning): + transport = transport_class( + host="squid.clam.whelk", + credentials=mock_cred, + api_mtls_endpoint="mtls.squid.clam.whelk", + client_cert_source=None, + ) + + grpc_create_channel.assert_called_once_with( + "mtls.squid.clam.whelk:443", + credentials=mock_cred, + credentials_file=None, + scopes=None, + ssl_credentials=mock_ssl_cred, + quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + assert transport.grpc_channel == mock_grpc_channel + + +def test_compilation_result_path(): + project = "squid" + location = "clam" + repository = "whelk" + compilation_result = "octopus" + expected = "projects/{project}/locations/{location}/repositories/{repository}/compilationResults/{compilation_result}".format(project=project, location=location, repository=repository, compilation_result=compilation_result, ) + actual = DataformClient.compilation_result_path(project, location, repository, compilation_result) + assert expected == actual + + +def test_parse_compilation_result_path(): + expected = { + "project": "oyster", + "location": "nudibranch", + "repository": "cuttlefish", + "compilation_result": "mussel", + } + path = DataformClient.compilation_result_path(**expected) + + # Check that the path construction is reversible. + actual = DataformClient.parse_compilation_result_path(path) + assert expected == actual + +def test_repository_path(): + project = "winkle" + location = "nautilus" + repository = "scallop" + expected = "projects/{project}/locations/{location}/repositories/{repository}".format(project=project, location=location, repository=repository, ) + actual = DataformClient.repository_path(project, location, repository) + assert expected == actual + + +def test_parse_repository_path(): + expected = { + "project": "abalone", + "location": "squid", + "repository": "clam", + } + path = DataformClient.repository_path(**expected) + + # Check that the path construction is reversible. + actual = DataformClient.parse_repository_path(path) + assert expected == actual + +def test_secret_version_path(): + project = "whelk" + secret = "octopus" + version = "oyster" + expected = "projects/{project}/secrets/{secret}/versions/{version}".format(project=project, secret=secret, version=version, ) + actual = DataformClient.secret_version_path(project, secret, version) + assert expected == actual + + +def test_parse_secret_version_path(): + expected = { + "project": "nudibranch", + "secret": "cuttlefish", + "version": "mussel", + } + path = DataformClient.secret_version_path(**expected) + + # Check that the path construction is reversible. + actual = DataformClient.parse_secret_version_path(path) + assert expected == actual + +def test_workflow_invocation_path(): + project = "winkle" + location = "nautilus" + repository = "scallop" + workflow_invocation = "abalone" + expected = "projects/{project}/locations/{location}/repositories/{repository}/workflowInvocations/{workflow_invocation}".format(project=project, location=location, repository=repository, workflow_invocation=workflow_invocation, ) + actual = DataformClient.workflow_invocation_path(project, location, repository, workflow_invocation) + assert expected == actual + + +def test_parse_workflow_invocation_path(): + expected = { + "project": "squid", + "location": "clam", + "repository": "whelk", + "workflow_invocation": "octopus", + } + path = DataformClient.workflow_invocation_path(**expected) + + # Check that the path construction is reversible. + actual = DataformClient.parse_workflow_invocation_path(path) + assert expected == actual + +def test_workspace_path(): + project = "oyster" + location = "nudibranch" + repository = "cuttlefish" + workspace = "mussel" + expected = "projects/{project}/locations/{location}/repositories/{repository}/workspaces/{workspace}".format(project=project, location=location, repository=repository, workspace=workspace, ) + actual = DataformClient.workspace_path(project, location, repository, workspace) + assert expected == actual + + +def test_parse_workspace_path(): + expected = { + "project": "winkle", + "location": "nautilus", + "repository": "scallop", + "workspace": "abalone", + } + path = DataformClient.workspace_path(**expected) + + # Check that the path construction is reversible. + actual = DataformClient.parse_workspace_path(path) + assert expected == actual + +def test_common_billing_account_path(): + billing_account = "squid" + expected = "billingAccounts/{billing_account}".format(billing_account=billing_account, ) + actual = DataformClient.common_billing_account_path(billing_account) + assert expected == actual + + +def test_parse_common_billing_account_path(): + expected = { + "billing_account": "clam", + } + path = DataformClient.common_billing_account_path(**expected) + + # Check that the path construction is reversible. + actual = DataformClient.parse_common_billing_account_path(path) + assert expected == actual + +def test_common_folder_path(): + folder = "whelk" + expected = "folders/{folder}".format(folder=folder, ) + actual = DataformClient.common_folder_path(folder) + assert expected == actual + + +def test_parse_common_folder_path(): + expected = { + "folder": "octopus", + } + path = DataformClient.common_folder_path(**expected) + + # Check that the path construction is reversible. + actual = DataformClient.parse_common_folder_path(path) + assert expected == actual + +def test_common_organization_path(): + organization = "oyster" + expected = "organizations/{organization}".format(organization=organization, ) + actual = DataformClient.common_organization_path(organization) + assert expected == actual + + +def test_parse_common_organization_path(): + expected = { + "organization": "nudibranch", + } + path = DataformClient.common_organization_path(**expected) + + # Check that the path construction is reversible. + actual = DataformClient.parse_common_organization_path(path) + assert expected == actual + +def test_common_project_path(): + project = "cuttlefish" + expected = "projects/{project}".format(project=project, ) + actual = DataformClient.common_project_path(project) + assert expected == actual + + +def test_parse_common_project_path(): + expected = { + "project": "mussel", + } + path = DataformClient.common_project_path(**expected) + + # Check that the path construction is reversible. + actual = DataformClient.parse_common_project_path(path) + assert expected == actual + +def test_common_location_path(): + project = "winkle" + location = "nautilus" + expected = "projects/{project}/locations/{location}".format(project=project, location=location, ) + actual = DataformClient.common_location_path(project, location) + assert expected == actual + + +def test_parse_common_location_path(): + expected = { + "project": "scallop", + "location": "abalone", + } + path = DataformClient.common_location_path(**expected) + + # Check that the path construction is reversible. + actual = DataformClient.parse_common_location_path(path) + assert expected == actual + + +def test_client_with_default_client_info(): + client_info = gapic_v1.client_info.ClientInfo() + + with mock.patch.object(transports.DataformTransport, '_prep_wrapped_messages') as prep: + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, + ) + prep.assert_called_once_with(client_info) + + with mock.patch.object(transports.DataformTransport, '_prep_wrapped_messages') as prep: + transport_class = DataformClient.get_transport_class() + transport = transport_class( + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, + ) + prep.assert_called_once_with(client_info) + +@pytest.mark.asyncio +async def test_transport_close_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", + ) + with mock.patch.object(type(getattr(client.transport, "grpc_channel")), "close") as close: + async with client: + close.assert_not_called() + close.assert_called_once() + + +def test_list_locations(transport: str = "grpc"): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = locations_pb2.ListLocationsRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_locations), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = locations_pb2.ListLocationsResponse() + response = client.list_locations(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, locations_pb2.ListLocationsResponse) +@pytest.mark.asyncio +async def test_list_locations_async(transport: str = "grpc"): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = locations_pb2.ListLocationsRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_locations), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + locations_pb2.ListLocationsResponse() + ) + response = await client.list_locations(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, locations_pb2.ListLocationsResponse) + +def test_list_locations_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = locations_pb2.ListLocationsRequest() + request.name = "locations" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_locations), "__call__") as call: + call.return_value = locations_pb2.ListLocationsResponse() + + client.list_locations(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=locations",) in kw["metadata"] +@pytest.mark.asyncio +async def test_list_locations_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = locations_pb2.ListLocationsRequest() + request.name = "locations" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_locations), "__call__") as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + locations_pb2.ListLocationsResponse() + ) + await client.list_locations(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=locations",) in kw["metadata"] + +def test_list_locations_from_dict(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_locations), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = locations_pb2.ListLocationsResponse() + + response = client.list_locations( + request={ + "name": "locations", + } + ) + call.assert_called() +@pytest.mark.asyncio +async def test_list_locations_from_dict_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_locations), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + locations_pb2.ListLocationsResponse() + ) + response = await client.list_locations( + request={ + "name": "locations", + } + ) + call.assert_called() + + +def test_get_location(transport: str = "grpc"): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = locations_pb2.GetLocationRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_location), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = locations_pb2.Location() + response = client.get_location(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, locations_pb2.Location) +@pytest.mark.asyncio +async def test_get_location_async(transport: str = "grpc_asyncio"): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = locations_pb2.GetLocationRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_location), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + locations_pb2.Location() + ) + response = await client.get_location(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, locations_pb2.Location) + +def test_get_location_field_headers(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials()) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = locations_pb2.GetLocationRequest() + request.name = "locations/abc" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_location), "__call__") as call: + call.return_value = locations_pb2.Location() + + client.get_location(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=locations/abc",) in kw["metadata"] +@pytest.mark.asyncio +async def test_get_location_field_headers_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials() + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = locations_pb2.GetLocationRequest() + request.name = "locations/abc" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_location), "__call__") as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + locations_pb2.Location() + ) + await client.get_location(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=locations/abc",) in kw["metadata"] + +def test_get_location_from_dict(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_locations), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = locations_pb2.Location() + + response = client.get_location( + request={ + "name": "locations/abc", + } + ) + call.assert_called() +@pytest.mark.asyncio +async def test_get_location_from_dict_async(): + client = DataformAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_locations), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + locations_pb2.Location() + ) + response = await client.get_location( + request={ + "name": "locations", + } + ) + call.assert_called() + + +def test_transport_close(): + transports = { + "grpc": "_grpc_channel", + } + + for transport, close_name in transports.items(): + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport + ) + with mock.patch.object(type(getattr(client.transport, close_name)), "close") as close: + with client: + close.assert_not_called() + close.assert_called_once() + +def test_client_ctx(): + transports = [ + 'grpc', + ] + for transport in transports: + client = DataformClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport + ) + # Test client calls underlying transport. + with mock.patch.object(type(client.transport), "close") as close: + close.assert_not_called() + with client: + pass + close.assert_called() + +@pytest.mark.parametrize("client_class,transport_class", [ + (DataformClient, transports.DataformGrpcTransport), + (DataformAsyncClient, transports.DataformGrpcAsyncIOTransport), +]) +def test_api_key_credentials(client_class, transport_class): + with mock.patch.object( + google.auth._default, "get_api_key_credentials", create=True + ) as get_api_key_credentials: + mock_cred = mock.Mock() + get_api_key_credentials.return_value = mock_cred + options = client_options.ClientOptions() + options.api_key = "api_key" + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options) + patched.assert_called_once_with( + credentials=mock_cred, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) From edae94b1c65c6f3d9547ab8ea40f9ab20027efcf Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 13 Sep 2022 01:24:13 +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/v1beta1/.coveragerc | 17 - owl-bot-staging/v1beta1/.flake8 | 33 - owl-bot-staging/v1beta1/MANIFEST.in | 2 - owl-bot-staging/v1beta1/README.rst | 49 - owl-bot-staging/v1beta1/docs/conf.py | 376 - .../docs/dataform_v1beta1/dataform.rst | 10 - .../docs/dataform_v1beta1/services.rst | 6 - .../v1beta1/docs/dataform_v1beta1/types.rst | 7 - owl-bot-staging/v1beta1/docs/index.rst | 7 - .../v1beta1/google/cloud/dataform/__init__.py | 147 - .../v1beta1/google/cloud/dataform/py.typed | 2 - .../google/cloud/dataform_v1beta1/__init__.py | 148 - .../dataform_v1beta1/gapic_metadata.json | 383 - .../google/cloud/dataform_v1beta1/py.typed | 2 - .../dataform_v1beta1/services/__init__.py | 15 - .../services/dataform/__init__.py | 22 - .../services/dataform/async_client.py | 3582 ------ .../services/dataform/client.py | 3833 ------- .../services/dataform/pagers.py | 865 -- .../services/dataform/transports/__init__.py | 33 - .../services/dataform/transports/base.py | 664 -- .../services/dataform/transports/grpc.py | 1231 --- .../dataform/transports/grpc_asyncio.py | 1230 --- .../cloud/dataform_v1beta1/types/__init__.py | 144 - .../cloud/dataform_v1beta1/types/dataform.py | 2309 ---- owl-bot-staging/v1beta1/mypy.ini | 3 - owl-bot-staging/v1beta1/noxfile.py | 179 - ...taform_cancel_workflow_invocation_async.py | 50 - ...ataform_cancel_workflow_invocation_sync.py | 50 - ...dataform_commit_workspace_changes_async.py | 55 - ..._dataform_commit_workspace_changes_sync.py | 55 - ...ataform_create_compilation_result_async.py | 56 - ...dataform_create_compilation_result_sync.py | 56 - ...erated_dataform_create_repository_async.py | 53 - ...nerated_dataform_create_repository_sync.py | 53 - ...taform_create_workflow_invocation_async.py | 52 - ...ataform_create_workflow_invocation_sync.py | 52 - ...nerated_dataform_create_workspace_async.py | 53 - ...enerated_dataform_create_workspace_sync.py | 53 - ...erated_dataform_delete_repository_async.py | 50 - ...nerated_dataform_delete_repository_sync.py | 50 - ...taform_delete_workflow_invocation_async.py | 50 - ...ataform_delete_workflow_invocation_sync.py | 50 - ...nerated_dataform_delete_workspace_async.py | 50 - ...enerated_dataform_delete_workspace_sync.py | 50 - ...enerated_dataform_fetch_file_diff_async.py | 53 - ...generated_dataform_fetch_file_diff_sync.py | 53 - ..._dataform_fetch_file_git_statuses_async.py | 52 - ...d_dataform_fetch_file_git_statuses_sync.py | 52 - ...d_dataform_fetch_git_ahead_behind_async.py | 52 - ...ed_dataform_fetch_git_ahead_behind_sync.py | 52 - ...ed_dataform_fetch_remote_branches_async.py | 52 - ...ted_dataform_fetch_remote_branches_sync.py | 52 - ...d_dataform_get_compilation_result_async.py | 52 - ...ed_dataform_get_compilation_result_sync.py | 52 - ...generated_dataform_get_repository_async.py | 52 - ..._generated_dataform_get_repository_sync.py | 52 - ..._dataform_get_workflow_invocation_async.py | 52 - ...d_dataform_get_workflow_invocation_sync.py | 52 - ..._generated_dataform_get_workspace_async.py | 52 - ...1_generated_dataform_get_workspace_sync.py | 52 - ...ted_dataform_install_npm_packages_async.py | 52 - ...ated_dataform_install_npm_packages_sync.py | 52 - ...dataform_list_compilation_results_async.py | 53 - ..._dataform_list_compilation_results_sync.py | 53 - ...erated_dataform_list_repositories_async.py | 53 - ...nerated_dataform_list_repositories_sync.py | 53 - ...ataform_list_workflow_invocations_async.py | 53 - ...dataform_list_workflow_invocations_sync.py | 53 - ...enerated_dataform_list_workspaces_async.py | 53 - ...generated_dataform_list_workspaces_sync.py | 53 - ...generated_dataform_make_directory_async.py | 53 - ..._generated_dataform_make_directory_sync.py | 53 - ...generated_dataform_move_directory_async.py | 54 - ..._generated_dataform_move_directory_sync.py | 54 - ...eta1_generated_dataform_move_file_async.py | 54 - ...beta1_generated_dataform_move_file_sync.py | 54 - ...nerated_dataform_pull_git_commits_async.py | 55 - ...enerated_dataform_pull_git_commits_sync.py | 55 - ...nerated_dataform_push_git_commits_async.py | 50 - ...enerated_dataform_push_git_commits_sync.py | 50 - ..._query_compilation_result_actions_async.py | 53 - ...m_query_compilation_result_actions_sync.py | 53 - ...dataform_query_directory_contents_async.py | 53 - ..._dataform_query_directory_contents_sync.py | 53 - ...query_workflow_invocation_actions_async.py | 53 - ..._query_workflow_invocation_actions_sync.py | 53 - ...eta1_generated_dataform_read_file_async.py | 53 - ...beta1_generated_dataform_read_file_sync.py | 53 - ...nerated_dataform_remove_directory_async.py | 51 - ...enerated_dataform_remove_directory_sync.py | 51 - ...a1_generated_dataform_remove_file_async.py | 51 - ...ta1_generated_dataform_remove_file_sync.py | 51 - ..._dataform_reset_workspace_changes_async.py | 50 - ...d_dataform_reset_workspace_changes_sync.py | 50 - ...erated_dataform_update_repository_async.py | 51 - ...nerated_dataform_update_repository_sync.py | 51 - ...ta1_generated_dataform_write_file_async.py | 54 - ...eta1_generated_dataform_write_file_sync.py | 54 - .../snippet_metadata_dataform_v1beta1.json | 5646 ---------- .../fixup_dataform_v1beta1_keywords.py | 211 - owl-bot-staging/v1beta1/setup.py | 59 - owl-bot-staging/v1beta1/tests/__init__.py | 16 - .../v1beta1/tests/unit/__init__.py | 16 - .../v1beta1/tests/unit/gapic/__init__.py | 16 - .../unit/gapic/dataform_v1beta1/__init__.py | 16 - .../gapic/dataform_v1beta1/test_dataform.py | 9611 ----------------- .../gapic/dataform_v1beta1/test_dataform.py | 2 +- 108 files changed, 1 insertion(+), 34661 deletions(-) delete mode 100644 owl-bot-staging/v1beta1/.coveragerc delete mode 100644 owl-bot-staging/v1beta1/.flake8 delete mode 100644 owl-bot-staging/v1beta1/MANIFEST.in delete mode 100644 owl-bot-staging/v1beta1/README.rst delete mode 100644 owl-bot-staging/v1beta1/docs/conf.py delete mode 100644 owl-bot-staging/v1beta1/docs/dataform_v1beta1/dataform.rst delete mode 100644 owl-bot-staging/v1beta1/docs/dataform_v1beta1/services.rst delete mode 100644 owl-bot-staging/v1beta1/docs/dataform_v1beta1/types.rst delete mode 100644 owl-bot-staging/v1beta1/docs/index.rst delete mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform/__init__.py delete mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform/py.typed delete mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/__init__.py delete mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/py.typed delete mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/__init__.py delete mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/__init__.py delete mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/async_client.py delete mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/client.py delete mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/pagers.py delete mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/__init__.py delete mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/base.py delete mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/grpc.py delete mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/grpc_asyncio.py delete mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/types/__init__.py delete mode 100644 owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/types/dataform.py delete mode 100644 owl-bot-staging/v1beta1/mypy.ini delete mode 100644 owl-bot-staging/v1beta1/noxfile.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_cancel_workflow_invocation_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_cancel_workflow_invocation_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_commit_workspace_changes_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_commit_workspace_changes_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_compilation_result_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_compilation_result_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_repository_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_repository_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workflow_invocation_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workflow_invocation_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workspace_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workspace_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_repository_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_repository_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workflow_invocation_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workflow_invocation_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workspace_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workspace_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_diff_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_diff_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_git_statuses_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_git_statuses_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_remote_branches_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_remote_branches_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_compilation_result_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_compilation_result_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_repository_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_repository_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workflow_invocation_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workflow_invocation_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workspace_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workspace_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_install_npm_packages_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_install_npm_packages_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_compilation_results_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_compilation_results_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_repositories_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_repositories_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workflow_invocations_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workflow_invocations_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workspaces_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workspaces_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_make_directory_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_make_directory_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_directory_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_directory_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_file_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_file_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_pull_git_commits_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_pull_git_commits_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_push_git_commits_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_push_git_commits_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_compilation_result_actions_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_compilation_result_actions_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_directory_contents_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_directory_contents_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_read_file_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_read_file_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_directory_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_directory_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_file_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_file_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_reset_workspace_changes_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_reset_workspace_changes_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_update_repository_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_update_repository_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_write_file_async.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_write_file_sync.py delete mode 100644 owl-bot-staging/v1beta1/samples/generated_samples/snippet_metadata_dataform_v1beta1.json delete mode 100644 owl-bot-staging/v1beta1/scripts/fixup_dataform_v1beta1_keywords.py delete mode 100644 owl-bot-staging/v1beta1/setup.py delete mode 100644 owl-bot-staging/v1beta1/tests/__init__.py delete mode 100644 owl-bot-staging/v1beta1/tests/unit/__init__.py delete mode 100644 owl-bot-staging/v1beta1/tests/unit/gapic/__init__.py delete mode 100644 owl-bot-staging/v1beta1/tests/unit/gapic/dataform_v1beta1/__init__.py delete mode 100644 owl-bot-staging/v1beta1/tests/unit/gapic/dataform_v1beta1/test_dataform.py diff --git a/owl-bot-staging/v1beta1/.coveragerc b/owl-bot-staging/v1beta1/.coveragerc deleted file mode 100644 index e3c571a..0000000 --- a/owl-bot-staging/v1beta1/.coveragerc +++ /dev/null @@ -1,17 +0,0 @@ -[run] -branch = True - -[report] -show_missing = True -omit = - google/cloud/dataform/__init__.py -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore pkg_resources exceptions. - # This is added at the module level as a safeguard for if someone - # generates the code and tries to run it without pip installing. This - # makes it virtually impossible to test properly. - except pkg_resources.DistributionNotFound diff --git a/owl-bot-staging/v1beta1/.flake8 b/owl-bot-staging/v1beta1/.flake8 deleted file mode 100644 index 29227d4..0000000 --- a/owl-bot-staging/v1beta1/.flake8 +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - **/services/** - **/types/** - *_pb2.py - - # Standard linting exemptions. - **/.nox/** - __pycache__, - .git, - *.pyc, - conf.py diff --git a/owl-bot-staging/v1beta1/MANIFEST.in b/owl-bot-staging/v1beta1/MANIFEST.in deleted file mode 100644 index 781c0b0..0000000 --- a/owl-bot-staging/v1beta1/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -recursive-include google/cloud/dataform *.py -recursive-include google/cloud/dataform_v1beta1 *.py diff --git a/owl-bot-staging/v1beta1/README.rst b/owl-bot-staging/v1beta1/README.rst deleted file mode 100644 index 1f42e73..0000000 --- a/owl-bot-staging/v1beta1/README.rst +++ /dev/null @@ -1,49 +0,0 @@ -Python Client for Google Cloud Dataform API -================================================= - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. Enable the Google Cloud Dataform API. -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - python3 -m venv - source /bin/activate - /bin/pip install /path/to/library - - -Windows -^^^^^^^ - -.. code-block:: console - - python3 -m venv - \Scripts\activate - \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/v1beta1/docs/conf.py b/owl-bot-staging/v1beta1/docs/conf.py deleted file mode 100644 index c1af2db..0000000 --- a/owl-bot-staging/v1beta1/docs/conf.py +++ /dev/null @@ -1,376 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# -# google-cloud-dataform documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "4.0.1" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The root toctree document. -root_doc = "index" - -# General information about the project. -project = u"google-cloud-dataform" -copyright = u"2022, Google, LLC" -author = u"Google APIs" # TODO: autogenerate this bit - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-dataform-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - # 'preamble': '', - # Latex figure (float) alignment - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - root_doc, - "google-cloud-dataform.tex", - u"google-cloud-dataform Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - root_doc, - "google-cloud-dataform", - u"Google Cloud Dataform Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - root_doc, - "google-cloud-dataform", - u"google-cloud-dataform Documentation", - author, - "google-cloud-dataform", - "GAPIC library for Google Cloud Dataform API", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("http://requests.kennethreitz.org/en/stable/", None), - "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), - "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/owl-bot-staging/v1beta1/docs/dataform_v1beta1/dataform.rst b/owl-bot-staging/v1beta1/docs/dataform_v1beta1/dataform.rst deleted file mode 100644 index 3d3fd90..0000000 --- a/owl-bot-staging/v1beta1/docs/dataform_v1beta1/dataform.rst +++ /dev/null @@ -1,10 +0,0 @@ -Dataform --------------------------- - -.. automodule:: google.cloud.dataform_v1beta1.services.dataform - :members: - :inherited-members: - -.. automodule:: google.cloud.dataform_v1beta1.services.dataform.pagers - :members: - :inherited-members: diff --git a/owl-bot-staging/v1beta1/docs/dataform_v1beta1/services.rst b/owl-bot-staging/v1beta1/docs/dataform_v1beta1/services.rst deleted file mode 100644 index f6e29bf..0000000 --- a/owl-bot-staging/v1beta1/docs/dataform_v1beta1/services.rst +++ /dev/null @@ -1,6 +0,0 @@ -Services for Google Cloud Dataform v1beta1 API -============================================== -.. toctree:: - :maxdepth: 2 - - dataform diff --git a/owl-bot-staging/v1beta1/docs/dataform_v1beta1/types.rst b/owl-bot-staging/v1beta1/docs/dataform_v1beta1/types.rst deleted file mode 100644 index 7f1fe65..0000000 --- a/owl-bot-staging/v1beta1/docs/dataform_v1beta1/types.rst +++ /dev/null @@ -1,7 +0,0 @@ -Types for Google Cloud Dataform v1beta1 API -=========================================== - -.. automodule:: google.cloud.dataform_v1beta1.types - :members: - :undoc-members: - :show-inheritance: diff --git a/owl-bot-staging/v1beta1/docs/index.rst b/owl-bot-staging/v1beta1/docs/index.rst deleted file mode 100644 index 4cd285b..0000000 --- a/owl-bot-staging/v1beta1/docs/index.rst +++ /dev/null @@ -1,7 +0,0 @@ -API Reference -------------- -.. toctree:: - :maxdepth: 2 - - dataform_v1beta1/services - dataform_v1beta1/types diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform/__init__.py b/owl-bot-staging/v1beta1/google/cloud/dataform/__init__.py deleted file mode 100644 index a4191d0..0000000 --- a/owl-bot-staging/v1beta1/google/cloud/dataform/__init__.py +++ /dev/null @@ -1,147 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# - -from google.cloud.dataform_v1beta1.services.dataform.client import DataformClient -from google.cloud.dataform_v1beta1.services.dataform.async_client import DataformAsyncClient - -from google.cloud.dataform_v1beta1.types.dataform import CancelWorkflowInvocationRequest -from google.cloud.dataform_v1beta1.types.dataform import CommitAuthor -from google.cloud.dataform_v1beta1.types.dataform import CommitWorkspaceChangesRequest -from google.cloud.dataform_v1beta1.types.dataform import CompilationResult -from google.cloud.dataform_v1beta1.types.dataform import CompilationResultAction -from google.cloud.dataform_v1beta1.types.dataform import CreateCompilationResultRequest -from google.cloud.dataform_v1beta1.types.dataform import CreateRepositoryRequest -from google.cloud.dataform_v1beta1.types.dataform import CreateWorkflowInvocationRequest -from google.cloud.dataform_v1beta1.types.dataform import CreateWorkspaceRequest -from google.cloud.dataform_v1beta1.types.dataform import DeleteRepositoryRequest -from google.cloud.dataform_v1beta1.types.dataform import DeleteWorkflowInvocationRequest -from google.cloud.dataform_v1beta1.types.dataform import DeleteWorkspaceRequest -from google.cloud.dataform_v1beta1.types.dataform import FetchFileDiffRequest -from google.cloud.dataform_v1beta1.types.dataform import FetchFileDiffResponse -from google.cloud.dataform_v1beta1.types.dataform import FetchFileGitStatusesRequest -from google.cloud.dataform_v1beta1.types.dataform import FetchFileGitStatusesResponse -from google.cloud.dataform_v1beta1.types.dataform import FetchGitAheadBehindRequest -from google.cloud.dataform_v1beta1.types.dataform import FetchGitAheadBehindResponse -from google.cloud.dataform_v1beta1.types.dataform import FetchRemoteBranchesRequest -from google.cloud.dataform_v1beta1.types.dataform import FetchRemoteBranchesResponse -from google.cloud.dataform_v1beta1.types.dataform import GetCompilationResultRequest -from google.cloud.dataform_v1beta1.types.dataform import GetRepositoryRequest -from google.cloud.dataform_v1beta1.types.dataform import GetWorkflowInvocationRequest -from google.cloud.dataform_v1beta1.types.dataform import GetWorkspaceRequest -from google.cloud.dataform_v1beta1.types.dataform import InstallNpmPackagesRequest -from google.cloud.dataform_v1beta1.types.dataform import InstallNpmPackagesResponse -from google.cloud.dataform_v1beta1.types.dataform import ListCompilationResultsRequest -from google.cloud.dataform_v1beta1.types.dataform import ListCompilationResultsResponse -from google.cloud.dataform_v1beta1.types.dataform import ListRepositoriesRequest -from google.cloud.dataform_v1beta1.types.dataform import ListRepositoriesResponse -from google.cloud.dataform_v1beta1.types.dataform import ListWorkflowInvocationsRequest -from google.cloud.dataform_v1beta1.types.dataform import ListWorkflowInvocationsResponse -from google.cloud.dataform_v1beta1.types.dataform import ListWorkspacesRequest -from google.cloud.dataform_v1beta1.types.dataform import ListWorkspacesResponse -from google.cloud.dataform_v1beta1.types.dataform import MakeDirectoryRequest -from google.cloud.dataform_v1beta1.types.dataform import MakeDirectoryResponse -from google.cloud.dataform_v1beta1.types.dataform import MoveDirectoryRequest -from google.cloud.dataform_v1beta1.types.dataform import MoveDirectoryResponse -from google.cloud.dataform_v1beta1.types.dataform import MoveFileRequest -from google.cloud.dataform_v1beta1.types.dataform import MoveFileResponse -from google.cloud.dataform_v1beta1.types.dataform import PullGitCommitsRequest -from google.cloud.dataform_v1beta1.types.dataform import PushGitCommitsRequest -from google.cloud.dataform_v1beta1.types.dataform import QueryCompilationResultActionsRequest -from google.cloud.dataform_v1beta1.types.dataform import QueryCompilationResultActionsResponse -from google.cloud.dataform_v1beta1.types.dataform import QueryDirectoryContentsRequest -from google.cloud.dataform_v1beta1.types.dataform import QueryDirectoryContentsResponse -from google.cloud.dataform_v1beta1.types.dataform import QueryWorkflowInvocationActionsRequest -from google.cloud.dataform_v1beta1.types.dataform import QueryWorkflowInvocationActionsResponse -from google.cloud.dataform_v1beta1.types.dataform import ReadFileRequest -from google.cloud.dataform_v1beta1.types.dataform import ReadFileResponse -from google.cloud.dataform_v1beta1.types.dataform import RelationDescriptor -from google.cloud.dataform_v1beta1.types.dataform import RemoveDirectoryRequest -from google.cloud.dataform_v1beta1.types.dataform import RemoveFileRequest -from google.cloud.dataform_v1beta1.types.dataform import Repository -from google.cloud.dataform_v1beta1.types.dataform import ResetWorkspaceChangesRequest -from google.cloud.dataform_v1beta1.types.dataform import Target -from google.cloud.dataform_v1beta1.types.dataform import UpdateRepositoryRequest -from google.cloud.dataform_v1beta1.types.dataform import WorkflowInvocation -from google.cloud.dataform_v1beta1.types.dataform import WorkflowInvocationAction -from google.cloud.dataform_v1beta1.types.dataform import Workspace -from google.cloud.dataform_v1beta1.types.dataform import WriteFileRequest -from google.cloud.dataform_v1beta1.types.dataform import WriteFileResponse - -__all__ = ('DataformClient', - 'DataformAsyncClient', - 'CancelWorkflowInvocationRequest', - 'CommitAuthor', - 'CommitWorkspaceChangesRequest', - 'CompilationResult', - 'CompilationResultAction', - 'CreateCompilationResultRequest', - 'CreateRepositoryRequest', - 'CreateWorkflowInvocationRequest', - 'CreateWorkspaceRequest', - 'DeleteRepositoryRequest', - 'DeleteWorkflowInvocationRequest', - 'DeleteWorkspaceRequest', - 'FetchFileDiffRequest', - 'FetchFileDiffResponse', - 'FetchFileGitStatusesRequest', - 'FetchFileGitStatusesResponse', - 'FetchGitAheadBehindRequest', - 'FetchGitAheadBehindResponse', - 'FetchRemoteBranchesRequest', - 'FetchRemoteBranchesResponse', - 'GetCompilationResultRequest', - 'GetRepositoryRequest', - 'GetWorkflowInvocationRequest', - 'GetWorkspaceRequest', - 'InstallNpmPackagesRequest', - 'InstallNpmPackagesResponse', - 'ListCompilationResultsRequest', - 'ListCompilationResultsResponse', - 'ListRepositoriesRequest', - 'ListRepositoriesResponse', - 'ListWorkflowInvocationsRequest', - 'ListWorkflowInvocationsResponse', - 'ListWorkspacesRequest', - 'ListWorkspacesResponse', - 'MakeDirectoryRequest', - 'MakeDirectoryResponse', - 'MoveDirectoryRequest', - 'MoveDirectoryResponse', - 'MoveFileRequest', - 'MoveFileResponse', - 'PullGitCommitsRequest', - 'PushGitCommitsRequest', - 'QueryCompilationResultActionsRequest', - 'QueryCompilationResultActionsResponse', - 'QueryDirectoryContentsRequest', - 'QueryDirectoryContentsResponse', - 'QueryWorkflowInvocationActionsRequest', - 'QueryWorkflowInvocationActionsResponse', - 'ReadFileRequest', - 'ReadFileResponse', - 'RelationDescriptor', - 'RemoveDirectoryRequest', - 'RemoveFileRequest', - 'Repository', - 'ResetWorkspaceChangesRequest', - 'Target', - 'UpdateRepositoryRequest', - 'WorkflowInvocation', - 'WorkflowInvocationAction', - 'Workspace', - 'WriteFileRequest', - 'WriteFileResponse', -) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform/py.typed b/owl-bot-staging/v1beta1/google/cloud/dataform/py.typed deleted file mode 100644 index 060113d..0000000 --- a/owl-bot-staging/v1beta1/google/cloud/dataform/py.typed +++ /dev/null @@ -1,2 +0,0 @@ -# Marker file for PEP 561. -# The google-cloud-dataform package uses inline types. diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/__init__.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/__init__.py deleted file mode 100644 index 43c0350..0000000 --- a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/__init__.py +++ /dev/null @@ -1,148 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# - -from .services.dataform import DataformClient -from .services.dataform import DataformAsyncClient - -from .types.dataform import CancelWorkflowInvocationRequest -from .types.dataform import CommitAuthor -from .types.dataform import CommitWorkspaceChangesRequest -from .types.dataform import CompilationResult -from .types.dataform import CompilationResultAction -from .types.dataform import CreateCompilationResultRequest -from .types.dataform import CreateRepositoryRequest -from .types.dataform import CreateWorkflowInvocationRequest -from .types.dataform import CreateWorkspaceRequest -from .types.dataform import DeleteRepositoryRequest -from .types.dataform import DeleteWorkflowInvocationRequest -from .types.dataform import DeleteWorkspaceRequest -from .types.dataform import FetchFileDiffRequest -from .types.dataform import FetchFileDiffResponse -from .types.dataform import FetchFileGitStatusesRequest -from .types.dataform import FetchFileGitStatusesResponse -from .types.dataform import FetchGitAheadBehindRequest -from .types.dataform import FetchGitAheadBehindResponse -from .types.dataform import FetchRemoteBranchesRequest -from .types.dataform import FetchRemoteBranchesResponse -from .types.dataform import GetCompilationResultRequest -from .types.dataform import GetRepositoryRequest -from .types.dataform import GetWorkflowInvocationRequest -from .types.dataform import GetWorkspaceRequest -from .types.dataform import InstallNpmPackagesRequest -from .types.dataform import InstallNpmPackagesResponse -from .types.dataform import ListCompilationResultsRequest -from .types.dataform import ListCompilationResultsResponse -from .types.dataform import ListRepositoriesRequest -from .types.dataform import ListRepositoriesResponse -from .types.dataform import ListWorkflowInvocationsRequest -from .types.dataform import ListWorkflowInvocationsResponse -from .types.dataform import ListWorkspacesRequest -from .types.dataform import ListWorkspacesResponse -from .types.dataform import MakeDirectoryRequest -from .types.dataform import MakeDirectoryResponse -from .types.dataform import MoveDirectoryRequest -from .types.dataform import MoveDirectoryResponse -from .types.dataform import MoveFileRequest -from .types.dataform import MoveFileResponse -from .types.dataform import PullGitCommitsRequest -from .types.dataform import PushGitCommitsRequest -from .types.dataform import QueryCompilationResultActionsRequest -from .types.dataform import QueryCompilationResultActionsResponse -from .types.dataform import QueryDirectoryContentsRequest -from .types.dataform import QueryDirectoryContentsResponse -from .types.dataform import QueryWorkflowInvocationActionsRequest -from .types.dataform import QueryWorkflowInvocationActionsResponse -from .types.dataform import ReadFileRequest -from .types.dataform import ReadFileResponse -from .types.dataform import RelationDescriptor -from .types.dataform import RemoveDirectoryRequest -from .types.dataform import RemoveFileRequest -from .types.dataform import Repository -from .types.dataform import ResetWorkspaceChangesRequest -from .types.dataform import Target -from .types.dataform import UpdateRepositoryRequest -from .types.dataform import WorkflowInvocation -from .types.dataform import WorkflowInvocationAction -from .types.dataform import Workspace -from .types.dataform import WriteFileRequest -from .types.dataform import WriteFileResponse - -__all__ = ( - 'DataformAsyncClient', -'CancelWorkflowInvocationRequest', -'CommitAuthor', -'CommitWorkspaceChangesRequest', -'CompilationResult', -'CompilationResultAction', -'CreateCompilationResultRequest', -'CreateRepositoryRequest', -'CreateWorkflowInvocationRequest', -'CreateWorkspaceRequest', -'DataformClient', -'DeleteRepositoryRequest', -'DeleteWorkflowInvocationRequest', -'DeleteWorkspaceRequest', -'FetchFileDiffRequest', -'FetchFileDiffResponse', -'FetchFileGitStatusesRequest', -'FetchFileGitStatusesResponse', -'FetchGitAheadBehindRequest', -'FetchGitAheadBehindResponse', -'FetchRemoteBranchesRequest', -'FetchRemoteBranchesResponse', -'GetCompilationResultRequest', -'GetRepositoryRequest', -'GetWorkflowInvocationRequest', -'GetWorkspaceRequest', -'InstallNpmPackagesRequest', -'InstallNpmPackagesResponse', -'ListCompilationResultsRequest', -'ListCompilationResultsResponse', -'ListRepositoriesRequest', -'ListRepositoriesResponse', -'ListWorkflowInvocationsRequest', -'ListWorkflowInvocationsResponse', -'ListWorkspacesRequest', -'ListWorkspacesResponse', -'MakeDirectoryRequest', -'MakeDirectoryResponse', -'MoveDirectoryRequest', -'MoveDirectoryResponse', -'MoveFileRequest', -'MoveFileResponse', -'PullGitCommitsRequest', -'PushGitCommitsRequest', -'QueryCompilationResultActionsRequest', -'QueryCompilationResultActionsResponse', -'QueryDirectoryContentsRequest', -'QueryDirectoryContentsResponse', -'QueryWorkflowInvocationActionsRequest', -'QueryWorkflowInvocationActionsResponse', -'ReadFileRequest', -'ReadFileResponse', -'RelationDescriptor', -'RemoveDirectoryRequest', -'RemoveFileRequest', -'Repository', -'ResetWorkspaceChangesRequest', -'Target', -'UpdateRepositoryRequest', -'WorkflowInvocation', -'WorkflowInvocationAction', -'Workspace', -'WriteFileRequest', -'WriteFileResponse', -) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/gapic_metadata.json b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/gapic_metadata.json deleted file mode 100644 index 312e0ba..0000000 --- a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/gapic_metadata.json +++ /dev/null @@ -1,383 +0,0 @@ - { - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "python", - "libraryPackage": "google.cloud.dataform_v1beta1", - "protoPackage": "google.cloud.dataform.v1beta1", - "schema": "1.0", - "services": { - "Dataform": { - "clients": { - "grpc": { - "libraryClient": "DataformClient", - "rpcs": { - "CancelWorkflowInvocation": { - "methods": [ - "cancel_workflow_invocation" - ] - }, - "CommitWorkspaceChanges": { - "methods": [ - "commit_workspace_changes" - ] - }, - "CreateCompilationResult": { - "methods": [ - "create_compilation_result" - ] - }, - "CreateRepository": { - "methods": [ - "create_repository" - ] - }, - "CreateWorkflowInvocation": { - "methods": [ - "create_workflow_invocation" - ] - }, - "CreateWorkspace": { - "methods": [ - "create_workspace" - ] - }, - "DeleteRepository": { - "methods": [ - "delete_repository" - ] - }, - "DeleteWorkflowInvocation": { - "methods": [ - "delete_workflow_invocation" - ] - }, - "DeleteWorkspace": { - "methods": [ - "delete_workspace" - ] - }, - "FetchFileDiff": { - "methods": [ - "fetch_file_diff" - ] - }, - "FetchFileGitStatuses": { - "methods": [ - "fetch_file_git_statuses" - ] - }, - "FetchGitAheadBehind": { - "methods": [ - "fetch_git_ahead_behind" - ] - }, - "FetchRemoteBranches": { - "methods": [ - "fetch_remote_branches" - ] - }, - "GetCompilationResult": { - "methods": [ - "get_compilation_result" - ] - }, - "GetRepository": { - "methods": [ - "get_repository" - ] - }, - "GetWorkflowInvocation": { - "methods": [ - "get_workflow_invocation" - ] - }, - "GetWorkspace": { - "methods": [ - "get_workspace" - ] - }, - "InstallNpmPackages": { - "methods": [ - "install_npm_packages" - ] - }, - "ListCompilationResults": { - "methods": [ - "list_compilation_results" - ] - }, - "ListRepositories": { - "methods": [ - "list_repositories" - ] - }, - "ListWorkflowInvocations": { - "methods": [ - "list_workflow_invocations" - ] - }, - "ListWorkspaces": { - "methods": [ - "list_workspaces" - ] - }, - "MakeDirectory": { - "methods": [ - "make_directory" - ] - }, - "MoveDirectory": { - "methods": [ - "move_directory" - ] - }, - "MoveFile": { - "methods": [ - "move_file" - ] - }, - "PullGitCommits": { - "methods": [ - "pull_git_commits" - ] - }, - "PushGitCommits": { - "methods": [ - "push_git_commits" - ] - }, - "QueryCompilationResultActions": { - "methods": [ - "query_compilation_result_actions" - ] - }, - "QueryDirectoryContents": { - "methods": [ - "query_directory_contents" - ] - }, - "QueryWorkflowInvocationActions": { - "methods": [ - "query_workflow_invocation_actions" - ] - }, - "ReadFile": { - "methods": [ - "read_file" - ] - }, - "RemoveDirectory": { - "methods": [ - "remove_directory" - ] - }, - "RemoveFile": { - "methods": [ - "remove_file" - ] - }, - "ResetWorkspaceChanges": { - "methods": [ - "reset_workspace_changes" - ] - }, - "UpdateRepository": { - "methods": [ - "update_repository" - ] - }, - "WriteFile": { - "methods": [ - "write_file" - ] - } - } - }, - "grpc-async": { - "libraryClient": "DataformAsyncClient", - "rpcs": { - "CancelWorkflowInvocation": { - "methods": [ - "cancel_workflow_invocation" - ] - }, - "CommitWorkspaceChanges": { - "methods": [ - "commit_workspace_changes" - ] - }, - "CreateCompilationResult": { - "methods": [ - "create_compilation_result" - ] - }, - "CreateRepository": { - "methods": [ - "create_repository" - ] - }, - "CreateWorkflowInvocation": { - "methods": [ - "create_workflow_invocation" - ] - }, - "CreateWorkspace": { - "methods": [ - "create_workspace" - ] - }, - "DeleteRepository": { - "methods": [ - "delete_repository" - ] - }, - "DeleteWorkflowInvocation": { - "methods": [ - "delete_workflow_invocation" - ] - }, - "DeleteWorkspace": { - "methods": [ - "delete_workspace" - ] - }, - "FetchFileDiff": { - "methods": [ - "fetch_file_diff" - ] - }, - "FetchFileGitStatuses": { - "methods": [ - "fetch_file_git_statuses" - ] - }, - "FetchGitAheadBehind": { - "methods": [ - "fetch_git_ahead_behind" - ] - }, - "FetchRemoteBranches": { - "methods": [ - "fetch_remote_branches" - ] - }, - "GetCompilationResult": { - "methods": [ - "get_compilation_result" - ] - }, - "GetRepository": { - "methods": [ - "get_repository" - ] - }, - "GetWorkflowInvocation": { - "methods": [ - "get_workflow_invocation" - ] - }, - "GetWorkspace": { - "methods": [ - "get_workspace" - ] - }, - "InstallNpmPackages": { - "methods": [ - "install_npm_packages" - ] - }, - "ListCompilationResults": { - "methods": [ - "list_compilation_results" - ] - }, - "ListRepositories": { - "methods": [ - "list_repositories" - ] - }, - "ListWorkflowInvocations": { - "methods": [ - "list_workflow_invocations" - ] - }, - "ListWorkspaces": { - "methods": [ - "list_workspaces" - ] - }, - "MakeDirectory": { - "methods": [ - "make_directory" - ] - }, - "MoveDirectory": { - "methods": [ - "move_directory" - ] - }, - "MoveFile": { - "methods": [ - "move_file" - ] - }, - "PullGitCommits": { - "methods": [ - "pull_git_commits" - ] - }, - "PushGitCommits": { - "methods": [ - "push_git_commits" - ] - }, - "QueryCompilationResultActions": { - "methods": [ - "query_compilation_result_actions" - ] - }, - "QueryDirectoryContents": { - "methods": [ - "query_directory_contents" - ] - }, - "QueryWorkflowInvocationActions": { - "methods": [ - "query_workflow_invocation_actions" - ] - }, - "ReadFile": { - "methods": [ - "read_file" - ] - }, - "RemoveDirectory": { - "methods": [ - "remove_directory" - ] - }, - "RemoveFile": { - "methods": [ - "remove_file" - ] - }, - "ResetWorkspaceChanges": { - "methods": [ - "reset_workspace_changes" - ] - }, - "UpdateRepository": { - "methods": [ - "update_repository" - ] - }, - "WriteFile": { - "methods": [ - "write_file" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/py.typed b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/py.typed deleted file mode 100644 index 060113d..0000000 --- a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/py.typed +++ /dev/null @@ -1,2 +0,0 @@ -# Marker file for PEP 561. -# The google-cloud-dataform package uses inline types. diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/__init__.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/__init__.py deleted file mode 100644 index e8e1c38..0000000 --- a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/__init__.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/__init__.py deleted file mode 100644 index 008a1aa..0000000 --- a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -from .client import DataformClient -from .async_client import DataformAsyncClient - -__all__ = ( - 'DataformClient', - 'DataformAsyncClient', -) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/async_client.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/async_client.py deleted file mode 100644 index 5d2b24a..0000000 --- a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/async_client.py +++ /dev/null @@ -1,3582 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -from collections import OrderedDict -import functools -import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources - -from google.api_core.client_options import ClientOptions -from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import retry as retries -from google.auth import credentials as ga_credentials # type: ignore -from google.oauth2 import service_account # type: ignore - -try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] -except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore - -from google.cloud.dataform_v1beta1.services.dataform import pagers -from google.cloud.dataform_v1beta1.types import dataform -from google.cloud.location import locations_pb2 # type: ignore -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.type import interval_pb2 # type: ignore -from .transports.base import DataformTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import DataformGrpcAsyncIOTransport -from .client import DataformClient - - -class DataformAsyncClient: - """Dataform is a service to develop, create, document, test, and - update curated tables in BigQuery. - """ - - _client: DataformClient - - DEFAULT_ENDPOINT = DataformClient.DEFAULT_ENDPOINT - DEFAULT_MTLS_ENDPOINT = DataformClient.DEFAULT_MTLS_ENDPOINT - - compilation_result_path = staticmethod(DataformClient.compilation_result_path) - parse_compilation_result_path = staticmethod(DataformClient.parse_compilation_result_path) - repository_path = staticmethod(DataformClient.repository_path) - parse_repository_path = staticmethod(DataformClient.parse_repository_path) - secret_version_path = staticmethod(DataformClient.secret_version_path) - parse_secret_version_path = staticmethod(DataformClient.parse_secret_version_path) - workflow_invocation_path = staticmethod(DataformClient.workflow_invocation_path) - parse_workflow_invocation_path = staticmethod(DataformClient.parse_workflow_invocation_path) - workspace_path = staticmethod(DataformClient.workspace_path) - parse_workspace_path = staticmethod(DataformClient.parse_workspace_path) - common_billing_account_path = staticmethod(DataformClient.common_billing_account_path) - parse_common_billing_account_path = staticmethod(DataformClient.parse_common_billing_account_path) - common_folder_path = staticmethod(DataformClient.common_folder_path) - parse_common_folder_path = staticmethod(DataformClient.parse_common_folder_path) - common_organization_path = staticmethod(DataformClient.common_organization_path) - parse_common_organization_path = staticmethod(DataformClient.parse_common_organization_path) - common_project_path = staticmethod(DataformClient.common_project_path) - parse_common_project_path = staticmethod(DataformClient.parse_common_project_path) - common_location_path = staticmethod(DataformClient.common_location_path) - parse_common_location_path = staticmethod(DataformClient.parse_common_location_path) - - @classmethod - def from_service_account_info(cls, info: dict, *args, **kwargs): - """Creates an instance of this client using the provided credentials - info. - - Args: - info (dict): The service account private key info. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - DataformAsyncClient: The constructed client. - """ - return DataformClient.from_service_account_info.__func__(DataformAsyncClient, info, *args, **kwargs) # type: ignore - - @classmethod - def from_service_account_file(cls, filename: str, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - DataformAsyncClient: The constructed client. - """ - return DataformClient.from_service_account_file.__func__(DataformAsyncClient, filename, *args, **kwargs) # type: ignore - - from_service_account_json = from_service_account_file - - @classmethod - def get_mtls_endpoint_and_cert_source(cls, client_options: Optional[ClientOptions] = None): - """Return the API endpoint and client cert source for mutual TLS. - - The client cert source is determined in the following order: - (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the - client cert source is None. - (2) if `client_options.client_cert_source` is provided, use the provided one; if the - default client cert source exists, use the default one; otherwise the client cert - source is None. - - The API endpoint is determined in the following order: - (1) if `client_options.api_endpoint` if provided, use the provided one. - (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the - default mTLS endpoint; if the environment variabel is "never", use the default API - endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise - use the default API endpoint. - - More details can be found at https://google.aip.dev/auth/4114. - - Args: - client_options (google.api_core.client_options.ClientOptions): Custom options for the - client. Only the `api_endpoint` and `client_cert_source` properties may be used - in this method. - - Returns: - Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the - client cert source to use. - - Raises: - google.auth.exceptions.MutualTLSChannelError: If any errors happen. - """ - return DataformClient.get_mtls_endpoint_and_cert_source(client_options) # type: ignore - - @property - def transport(self) -> DataformTransport: - """Returns the transport used by the client instance. - - Returns: - DataformTransport: The transport used by the client instance. - """ - return self._client.transport - - get_transport_class = functools.partial(type(DataformClient).get_transport_class, type(DataformClient)) - - def __init__(self, *, - credentials: ga_credentials.Credentials = None, - transport: Union[str, DataformTransport] = "grpc_asyncio", - client_options: ClientOptions = None, - client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, - ) -> None: - """Instantiates the dataform client. - - Args: - credentials (Optional[google.auth.credentials.Credentials]): The - authorization credentials to attach to requests. These - credentials identify the application to the service; if none - are specified, the client will attempt to ascertain the - credentials from the environment. - transport (Union[str, ~.DataformTransport]): The - transport to use. If set to None, a transport is chosen - automatically. - client_options (ClientOptions): Custom options for the client. It - won't take effect if a ``transport`` instance is provided. - (1) The ``api_endpoint`` property can be used to override the - default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT - environment variable can also be used to override the endpoint: - "always" (always use the default mTLS endpoint), "never" (always - use the default regular endpoint) and "auto" (auto switch to the - default mTLS endpoint if client certificate is present, this is - the default value). However, the ``api_endpoint`` property takes - precedence if provided. - (2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable - is "true", then the ``client_cert_source`` property can be used - to provide client certificate for mutual TLS transport. If - not provided, the default SSL client certificate will be used if - present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not - set, no client certificate will be used. - - Raises: - google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport - creation failed for any reason. - """ - self._client = DataformClient( - credentials=credentials, - transport=transport, - client_options=client_options, - client_info=client_info, - - ) - - async def list_repositories(self, - request: Union[dataform.ListRepositoriesRequest, dict] = None, - *, - parent: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> pagers.ListRepositoriesAsyncPager: - r"""Lists Repositories in a given project and location. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_list_repositories(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ListRepositoriesRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_repositories(request=request) - - # Handle the response - async for response in page_result: - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.ListRepositoriesRequest, dict]): - The request object. `ListRepositories` request message. - parent (:class:`str`): - Required. The location in which to list repositories. - Must be in the format ``projects/*/locations/*``. - - This corresponds to the ``parent`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.services.dataform.pagers.ListRepositoriesAsyncPager: - ListRepositories response message. - - Iterating over this object will yield results and - resolve additional pages automatically. - - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([parent]) - if request is not None and has_flattened_params: - raise ValueError("If the `request` argument is set, then none of " - "the individual field arguments should be set.") - - request = dataform.ListRepositoriesRequest(request) - - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if parent is not None: - request.parent = parent - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.list_repositories, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("parent", request.parent), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # This method is paged; wrap the response in a pager, which provides - # an `__aiter__` convenience method. - response = pagers.ListRepositoriesAsyncPager( - method=rpc, - request=request, - response=response, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def get_repository(self, - request: Union[dataform.GetRepositoryRequest, dict] = None, - *, - name: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.Repository: - r"""Fetches a single Repository. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_get_repository(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.GetRepositoryRequest( - name="name_value", - ) - - # Make the request - response = await client.get_repository(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.GetRepositoryRequest, dict]): - The request object. `GetRepository` request message. - name (:class:`str`): - Required. The repository's name. - This corresponds to the ``name`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.Repository: - Represents a Dataform Git repository. - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([name]) - if request is not None and has_flattened_params: - raise ValueError("If the `request` argument is set, then none of " - "the individual field arguments should be set.") - - request = dataform.GetRepositoryRequest(request) - - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if name is not None: - request.name = name - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.get_repository, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def create_repository(self, - request: Union[dataform.CreateRepositoryRequest, dict] = None, - *, - parent: str = None, - repository: dataform.Repository = None, - repository_id: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.Repository: - r"""Creates a new Repository in a given project and - location. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_create_repository(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.CreateRepositoryRequest( - parent="parent_value", - repository_id="repository_id_value", - ) - - # Make the request - response = await client.create_repository(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.CreateRepositoryRequest, dict]): - The request object. `CreateRepository` request message. - parent (:class:`str`): - Required. The location in which to create the - repository. Must be in the format - ``projects/*/locations/*``. - - This corresponds to the ``parent`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - repository (:class:`google.cloud.dataform_v1beta1.types.Repository`): - Required. The repository to create. - This corresponds to the ``repository`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - repository_id (:class:`str`): - Required. The ID to use for the - repository, which will become the final - component of the repository's resource - name. - - This corresponds to the ``repository_id`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.Repository: - Represents a Dataform Git repository. - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([parent, repository, repository_id]) - if request is not None and has_flattened_params: - raise ValueError("If the `request` argument is set, then none of " - "the individual field arguments should be set.") - - request = dataform.CreateRepositoryRequest(request) - - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if parent is not None: - request.parent = parent - if repository is not None: - request.repository = repository - if repository_id is not None: - request.repository_id = repository_id - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.create_repository, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("parent", request.parent), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def update_repository(self, - request: Union[dataform.UpdateRepositoryRequest, dict] = None, - *, - repository: dataform.Repository = None, - update_mask: field_mask_pb2.FieldMask = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.Repository: - r"""Updates a single Repository. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_update_repository(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.UpdateRepositoryRequest( - ) - - # Make the request - response = await client.update_repository(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.UpdateRepositoryRequest, dict]): - The request object. `UpdateRepository` request message. - repository (:class:`google.cloud.dataform_v1beta1.types.Repository`): - Required. The repository to update. - This corresponds to the ``repository`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): - Optional. Specifies the fields to be - updated in the repository. If left - unset, all fields will be updated. - - This corresponds to the ``update_mask`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.Repository: - Represents a Dataform Git repository. - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([repository, update_mask]) - if request is not None and has_flattened_params: - raise ValueError("If the `request` argument is set, then none of " - "the individual field arguments should be set.") - - request = dataform.UpdateRepositoryRequest(request) - - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if repository is not None: - request.repository = repository - if update_mask is not None: - request.update_mask = update_mask - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.update_repository, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("repository.name", request.repository.name), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def delete_repository(self, - request: Union[dataform.DeleteRepositoryRequest, dict] = None, - *, - name: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Deletes a single Repository. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_delete_repository(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.DeleteRepositoryRequest( - name="name_value", - ) - - # Make the request - await client.delete_repository(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.DeleteRepositoryRequest, dict]): - The request object. `DeleteRepository` request message. - name (:class:`str`): - Required. The repository's name. - This corresponds to the ``name`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([name]) - if request is not None and has_flattened_params: - raise ValueError("If the `request` argument is set, then none of " - "the individual field arguments should be set.") - - request = dataform.DeleteRepositoryRequest(request) - - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if name is not None: - request.name = name - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.delete_repository, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - async def fetch_remote_branches(self, - request: Union[dataform.FetchRemoteBranchesRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.FetchRemoteBranchesResponse: - r"""Fetches a Repository's remote branches. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_fetch_remote_branches(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.FetchRemoteBranchesRequest( - name="name_value", - ) - - # Make the request - response = await client.fetch_remote_branches(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.FetchRemoteBranchesRequest, dict]): - The request object. `FetchRemoteBranches` request - message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.FetchRemoteBranchesResponse: - FetchRemoteBranches response message. - """ - # Create or coerce a protobuf request object. - request = dataform.FetchRemoteBranchesRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.fetch_remote_branches, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def list_workspaces(self, - request: Union[dataform.ListWorkspacesRequest, dict] = None, - *, - parent: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> pagers.ListWorkspacesAsyncPager: - r"""Lists Workspaces in a given Repository. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_list_workspaces(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ListWorkspacesRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_workspaces(request=request) - - # Handle the response - async for response in page_result: - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.ListWorkspacesRequest, dict]): - The request object. `ListWorkspaces` request message. - parent (:class:`str`): - Required. The repository in which to list workspaces. - Must be in the format - ``projects/*/locations/*/repositories/*``. - - This corresponds to the ``parent`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.services.dataform.pagers.ListWorkspacesAsyncPager: - ListWorkspaces response message. - - Iterating over this object will yield results and - resolve additional pages automatically. - - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([parent]) - if request is not None and has_flattened_params: - raise ValueError("If the `request` argument is set, then none of " - "the individual field arguments should be set.") - - request = dataform.ListWorkspacesRequest(request) - - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if parent is not None: - request.parent = parent - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.list_workspaces, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("parent", request.parent), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # This method is paged; wrap the response in a pager, which provides - # an `__aiter__` convenience method. - response = pagers.ListWorkspacesAsyncPager( - method=rpc, - request=request, - response=response, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def get_workspace(self, - request: Union[dataform.GetWorkspaceRequest, dict] = None, - *, - name: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.Workspace: - r"""Fetches a single Workspace. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_get_workspace(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.GetWorkspaceRequest( - name="name_value", - ) - - # Make the request - response = await client.get_workspace(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.GetWorkspaceRequest, dict]): - The request object. `GetWorkspace` request message. - name (:class:`str`): - Required. The workspace's name. - This corresponds to the ``name`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.Workspace: - Represents a Dataform Git workspace. - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([name]) - if request is not None and has_flattened_params: - raise ValueError("If the `request` argument is set, then none of " - "the individual field arguments should be set.") - - request = dataform.GetWorkspaceRequest(request) - - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if name is not None: - request.name = name - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.get_workspace, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def create_workspace(self, - request: Union[dataform.CreateWorkspaceRequest, dict] = None, - *, - parent: str = None, - workspace: dataform.Workspace = None, - workspace_id: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.Workspace: - r"""Creates a new Workspace in a given Repository. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_create_workspace(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.CreateWorkspaceRequest( - parent="parent_value", - workspace_id="workspace_id_value", - ) - - # Make the request - response = await client.create_workspace(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.CreateWorkspaceRequest, dict]): - The request object. `CreateWorkspace` request message. - parent (:class:`str`): - Required. The repository in which to create the - workspace. Must be in the format - ``projects/*/locations/*/repositories/*``. - - This corresponds to the ``parent`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - workspace (:class:`google.cloud.dataform_v1beta1.types.Workspace`): - Required. The workspace to create. - This corresponds to the ``workspace`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - workspace_id (:class:`str`): - Required. The ID to use for the - workspace, which will become the final - component of the workspace's resource - name. - - This corresponds to the ``workspace_id`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.Workspace: - Represents a Dataform Git workspace. - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([parent, workspace, workspace_id]) - if request is not None and has_flattened_params: - raise ValueError("If the `request` argument is set, then none of " - "the individual field arguments should be set.") - - request = dataform.CreateWorkspaceRequest(request) - - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if parent is not None: - request.parent = parent - if workspace is not None: - request.workspace = workspace - if workspace_id is not None: - request.workspace_id = workspace_id - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.create_workspace, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("parent", request.parent), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def delete_workspace(self, - request: Union[dataform.DeleteWorkspaceRequest, dict] = None, - *, - name: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Deletes a single Workspace. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_delete_workspace(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.DeleteWorkspaceRequest( - name="name_value", - ) - - # Make the request - await client.delete_workspace(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.DeleteWorkspaceRequest, dict]): - The request object. `DeleteWorkspace` request message. - name (:class:`str`): - Required. The workspace resource's - name. - - This corresponds to the ``name`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([name]) - if request is not None and has_flattened_params: - raise ValueError("If the `request` argument is set, then none of " - "the individual field arguments should be set.") - - request = dataform.DeleteWorkspaceRequest(request) - - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if name is not None: - request.name = name - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.delete_workspace, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - async def install_npm_packages(self, - request: Union[dataform.InstallNpmPackagesRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.InstallNpmPackagesResponse: - r"""Installs dependency NPM packages (inside a - Workspace). - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_install_npm_packages(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.InstallNpmPackagesRequest( - workspace="workspace_value", - ) - - # Make the request - response = await client.install_npm_packages(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.InstallNpmPackagesRequest, dict]): - The request object. `InstallNpmPackages` request - message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.InstallNpmPackagesResponse: - InstallNpmPackages response message. - """ - # Create or coerce a protobuf request object. - request = dataform.InstallNpmPackagesRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.install_npm_packages, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def pull_git_commits(self, - request: Union[dataform.PullGitCommitsRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Pulls Git commits from the Repository's remote into a - Workspace. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_pull_git_commits(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - author = dataform_v1beta1.CommitAuthor() - author.name = "name_value" - author.email_address = "email_address_value" - - request = dataform_v1beta1.PullGitCommitsRequest( - name="name_value", - author=author, - ) - - # Make the request - await client.pull_git_commits(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.PullGitCommitsRequest, dict]): - The request object. `PullGitCommits` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - request = dataform.PullGitCommitsRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.pull_git_commits, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - async def push_git_commits(self, - request: Union[dataform.PushGitCommitsRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Pushes Git commits from a Workspace to the - Repository's remote. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_push_git_commits(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.PushGitCommitsRequest( - name="name_value", - ) - - # Make the request - await client.push_git_commits(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.PushGitCommitsRequest, dict]): - The request object. `PushGitCommits` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - request = dataform.PushGitCommitsRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.push_git_commits, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - async def fetch_file_git_statuses(self, - request: Union[dataform.FetchFileGitStatusesRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.FetchFileGitStatusesResponse: - r"""Fetches Git statuses for the files in a Workspace. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_fetch_file_git_statuses(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.FetchFileGitStatusesRequest( - name="name_value", - ) - - # Make the request - response = await client.fetch_file_git_statuses(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.FetchFileGitStatusesRequest, dict]): - The request object. `FetchFileGitStatuses` request - message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.FetchFileGitStatusesResponse: - FetchFileGitStatuses response message. - """ - # Create or coerce a protobuf request object. - request = dataform.FetchFileGitStatusesRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.fetch_file_git_statuses, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def fetch_git_ahead_behind(self, - request: Union[dataform.FetchGitAheadBehindRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.FetchGitAheadBehindResponse: - r"""Fetches Git ahead/behind against a remote branch. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_fetch_git_ahead_behind(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.FetchGitAheadBehindRequest( - name="name_value", - ) - - # Make the request - response = await client.fetch_git_ahead_behind(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.FetchGitAheadBehindRequest, dict]): - The request object. `FetchGitAheadBehind` request - message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.FetchGitAheadBehindResponse: - FetchGitAheadBehind response message. - """ - # Create or coerce a protobuf request object. - request = dataform.FetchGitAheadBehindRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.fetch_git_ahead_behind, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def commit_workspace_changes(self, - request: Union[dataform.CommitWorkspaceChangesRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Applies a Git commit for uncommitted files in a - Workspace. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_commit_workspace_changes(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - author = dataform_v1beta1.CommitAuthor() - author.name = "name_value" - author.email_address = "email_address_value" - - request = dataform_v1beta1.CommitWorkspaceChangesRequest( - name="name_value", - author=author, - ) - - # Make the request - await client.commit_workspace_changes(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.CommitWorkspaceChangesRequest, dict]): - The request object. `CommitWorkspaceChanges` request - message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - request = dataform.CommitWorkspaceChangesRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.commit_workspace_changes, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - async def reset_workspace_changes(self, - request: Union[dataform.ResetWorkspaceChangesRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Performs a Git reset for uncommitted files in a - Workspace. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_reset_workspace_changes(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ResetWorkspaceChangesRequest( - name="name_value", - ) - - # Make the request - await client.reset_workspace_changes(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.ResetWorkspaceChangesRequest, dict]): - The request object. `ResetWorkspaceChanges` request - message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - request = dataform.ResetWorkspaceChangesRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.reset_workspace_changes, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - async def fetch_file_diff(self, - request: Union[dataform.FetchFileDiffRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.FetchFileDiffResponse: - r"""Fetches Git diff for an uncommitted file in a - Workspace. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_fetch_file_diff(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.FetchFileDiffRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - response = await client.fetch_file_diff(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.FetchFileDiffRequest, dict]): - The request object. `FetchFileDiff` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.FetchFileDiffResponse: - FetchFileDiff response message. - """ - # Create or coerce a protobuf request object. - request = dataform.FetchFileDiffRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.fetch_file_diff, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def query_directory_contents(self, - request: Union[dataform.QueryDirectoryContentsRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> pagers.QueryDirectoryContentsAsyncPager: - r"""Returns the contents of a given Workspace directory. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_query_directory_contents(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.QueryDirectoryContentsRequest( - workspace="workspace_value", - ) - - # Make the request - page_result = client.query_directory_contents(request=request) - - # Handle the response - async for response in page_result: - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.QueryDirectoryContentsRequest, dict]): - The request object. `QueryDirectoryContents` request - message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.services.dataform.pagers.QueryDirectoryContentsAsyncPager: - QueryDirectoryContents response message. - - Iterating over this object will yield results and - resolve additional pages automatically. - - """ - # Create or coerce a protobuf request object. - request = dataform.QueryDirectoryContentsRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.query_directory_contents, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # This method is paged; wrap the response in a pager, which provides - # an `__aiter__` convenience method. - response = pagers.QueryDirectoryContentsAsyncPager( - method=rpc, - request=request, - response=response, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def make_directory(self, - request: Union[dataform.MakeDirectoryRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.MakeDirectoryResponse: - r"""Creates a directory inside a Workspace. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_make_directory(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.MakeDirectoryRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - response = await client.make_directory(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.MakeDirectoryRequest, dict]): - The request object. `MakeDirectory` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.MakeDirectoryResponse: - MakeDirectory response message. - """ - # Create or coerce a protobuf request object. - request = dataform.MakeDirectoryRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.make_directory, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def remove_directory(self, - request: Union[dataform.RemoveDirectoryRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Deletes a directory (inside a Workspace) and all of - its contents. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_remove_directory(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.RemoveDirectoryRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - await client.remove_directory(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.RemoveDirectoryRequest, dict]): - The request object. `RemoveDirectory` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - request = dataform.RemoveDirectoryRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.remove_directory, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - async def move_directory(self, - request: Union[dataform.MoveDirectoryRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.MoveDirectoryResponse: - r"""Moves a directory (inside a Workspace), and all of - its contents, to a new location. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_move_directory(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.MoveDirectoryRequest( - workspace="workspace_value", - path="path_value", - new_path="new_path_value", - ) - - # Make the request - response = await client.move_directory(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.MoveDirectoryRequest, dict]): - The request object. `MoveDirectory` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.MoveDirectoryResponse: - MoveDirectory response message. - """ - # Create or coerce a protobuf request object. - request = dataform.MoveDirectoryRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.move_directory, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def read_file(self, - request: Union[dataform.ReadFileRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.ReadFileResponse: - r"""Returns the contents of a file (inside a Workspace). - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_read_file(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ReadFileRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - response = await client.read_file(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.ReadFileRequest, dict]): - The request object. `ReadFile` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.ReadFileResponse: - ReadFile response message. - """ - # Create or coerce a protobuf request object. - request = dataform.ReadFileRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.read_file, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def remove_file(self, - request: Union[dataform.RemoveFileRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Deletes a file (inside a Workspace). - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_remove_file(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.RemoveFileRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - await client.remove_file(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.RemoveFileRequest, dict]): - The request object. `RemoveFile` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - request = dataform.RemoveFileRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.remove_file, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - async def move_file(self, - request: Union[dataform.MoveFileRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.MoveFileResponse: - r"""Moves a file (inside a Workspace) to a new location. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_move_file(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.MoveFileRequest( - workspace="workspace_value", - path="path_value", - new_path="new_path_value", - ) - - # Make the request - response = await client.move_file(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.MoveFileRequest, dict]): - The request object. `MoveFile` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.MoveFileResponse: - MoveFile response message. - """ - # Create or coerce a protobuf request object. - request = dataform.MoveFileRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.move_file, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def write_file(self, - request: Union[dataform.WriteFileRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.WriteFileResponse: - r"""Writes to a file (inside a Workspace). - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_write_file(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.WriteFileRequest( - workspace="workspace_value", - path="path_value", - contents=b'contents_blob', - ) - - # Make the request - response = await client.write_file(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.WriteFileRequest, dict]): - The request object. `WriteFile` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.WriteFileResponse: - WriteFile response message. - """ - # Create or coerce a protobuf request object. - request = dataform.WriteFileRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.write_file, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def list_compilation_results(self, - request: Union[dataform.ListCompilationResultsRequest, dict] = None, - *, - parent: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> pagers.ListCompilationResultsAsyncPager: - r"""Lists CompilationResults in a given Repository. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_list_compilation_results(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ListCompilationResultsRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_compilation_results(request=request) - - # Handle the response - async for response in page_result: - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.ListCompilationResultsRequest, dict]): - The request object. `ListCompilationResults` request - message. - parent (:class:`str`): - Required. The repository in which to list compilation - results. Must be in the format - ``projects/*/locations/*/repositories/*``. - - This corresponds to the ``parent`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.services.dataform.pagers.ListCompilationResultsAsyncPager: - ListCompilationResults response message. - - Iterating over this object will yield results and - resolve additional pages automatically. - - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([parent]) - if request is not None and has_flattened_params: - raise ValueError("If the `request` argument is set, then none of " - "the individual field arguments should be set.") - - request = dataform.ListCompilationResultsRequest(request) - - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if parent is not None: - request.parent = parent - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.list_compilation_results, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("parent", request.parent), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # This method is paged; wrap the response in a pager, which provides - # an `__aiter__` convenience method. - response = pagers.ListCompilationResultsAsyncPager( - method=rpc, - request=request, - response=response, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def get_compilation_result(self, - request: Union[dataform.GetCompilationResultRequest, dict] = None, - *, - name: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.CompilationResult: - r"""Fetches a single CompilationResult. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_get_compilation_result(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.GetCompilationResultRequest( - name="name_value", - ) - - # Make the request - response = await client.get_compilation_result(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.GetCompilationResultRequest, dict]): - The request object. `GetCompilationResult` request - message. - name (:class:`str`): - Required. The compilation result's - name. - - This corresponds to the ``name`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.CompilationResult: - Represents the result of compiling a - Dataform project. - - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([name]) - if request is not None and has_flattened_params: - raise ValueError("If the `request` argument is set, then none of " - "the individual field arguments should be set.") - - request = dataform.GetCompilationResultRequest(request) - - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if name is not None: - request.name = name - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.get_compilation_result, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def create_compilation_result(self, - request: Union[dataform.CreateCompilationResultRequest, dict] = None, - *, - parent: str = None, - compilation_result: dataform.CompilationResult = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.CompilationResult: - r"""Creates a new CompilationResult in a given project - and location. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_create_compilation_result(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - compilation_result = dataform_v1beta1.CompilationResult() - compilation_result.git_commitish = "git_commitish_value" - - request = dataform_v1beta1.CreateCompilationResultRequest( - parent="parent_value", - compilation_result=compilation_result, - ) - - # Make the request - response = await client.create_compilation_result(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.CreateCompilationResultRequest, dict]): - The request object. `CreateCompilationResult` request - message. - parent (:class:`str`): - Required. The repository in which to create the - compilation result. Must be in the format - ``projects/*/locations/*/repositories/*``. - - This corresponds to the ``parent`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - compilation_result (:class:`google.cloud.dataform_v1beta1.types.CompilationResult`): - Required. The compilation result to - create. - - This corresponds to the ``compilation_result`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.CompilationResult: - Represents the result of compiling a - Dataform project. - - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([parent, compilation_result]) - if request is not None and has_flattened_params: - raise ValueError("If the `request` argument is set, then none of " - "the individual field arguments should be set.") - - request = dataform.CreateCompilationResultRequest(request) - - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if parent is not None: - request.parent = parent - if compilation_result is not None: - request.compilation_result = compilation_result - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.create_compilation_result, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("parent", request.parent), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def query_compilation_result_actions(self, - request: Union[dataform.QueryCompilationResultActionsRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> pagers.QueryCompilationResultActionsAsyncPager: - r"""Returns CompilationResultActions in a given - CompilationResult. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_query_compilation_result_actions(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.QueryCompilationResultActionsRequest( - name="name_value", - ) - - # Make the request - page_result = client.query_compilation_result_actions(request=request) - - # Handle the response - async for response in page_result: - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsRequest, dict]): - The request object. `QueryCompilationResultActions` - request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.services.dataform.pagers.QueryCompilationResultActionsAsyncPager: - QueryCompilationResultActions response message. - - Iterating over this object will yield results and - resolve additional pages automatically. - - """ - # Create or coerce a protobuf request object. - request = dataform.QueryCompilationResultActionsRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.query_compilation_result_actions, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # This method is paged; wrap the response in a pager, which provides - # an `__aiter__` convenience method. - response = pagers.QueryCompilationResultActionsAsyncPager( - method=rpc, - request=request, - response=response, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def list_workflow_invocations(self, - request: Union[dataform.ListWorkflowInvocationsRequest, dict] = None, - *, - parent: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> pagers.ListWorkflowInvocationsAsyncPager: - r"""Lists WorkflowInvocations in a given Repository. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_list_workflow_invocations(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ListWorkflowInvocationsRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_workflow_invocations(request=request) - - # Handle the response - async for response in page_result: - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsRequest, dict]): - The request object. `ListWorkflowInvocations` request - message. - parent (:class:`str`): - Required. The parent resource of the WorkflowInvocation - type. Must be in the format - ``projects/*/locations/*/repositories/*``. - - This corresponds to the ``parent`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.services.dataform.pagers.ListWorkflowInvocationsAsyncPager: - ListWorkflowInvocations response message. - - Iterating over this object will yield results and - resolve additional pages automatically. - - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([parent]) - if request is not None and has_flattened_params: - raise ValueError("If the `request` argument is set, then none of " - "the individual field arguments should be set.") - - request = dataform.ListWorkflowInvocationsRequest(request) - - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if parent is not None: - request.parent = parent - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.list_workflow_invocations, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("parent", request.parent), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # This method is paged; wrap the response in a pager, which provides - # an `__aiter__` convenience method. - response = pagers.ListWorkflowInvocationsAsyncPager( - method=rpc, - request=request, - response=response, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def get_workflow_invocation(self, - request: Union[dataform.GetWorkflowInvocationRequest, dict] = None, - *, - name: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.WorkflowInvocation: - r"""Fetches a single WorkflowInvocation. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_get_workflow_invocation(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.GetWorkflowInvocationRequest( - name="name_value", - ) - - # Make the request - response = await client.get_workflow_invocation(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.GetWorkflowInvocationRequest, dict]): - The request object. `GetWorkflowInvocation` request - message. - name (:class:`str`): - Required. The workflow invocation - resource's name. - - This corresponds to the ``name`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.WorkflowInvocation: - Represents a single invocation of a - compilation result. - - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([name]) - if request is not None and has_flattened_params: - raise ValueError("If the `request` argument is set, then none of " - "the individual field arguments should be set.") - - request = dataform.GetWorkflowInvocationRequest(request) - - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if name is not None: - request.name = name - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.get_workflow_invocation, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def create_workflow_invocation(self, - request: Union[dataform.CreateWorkflowInvocationRequest, dict] = None, - *, - parent: str = None, - workflow_invocation: dataform.WorkflowInvocation = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.WorkflowInvocation: - r"""Creates a new WorkflowInvocation in a given - Repository. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_create_workflow_invocation(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.CreateWorkflowInvocationRequest( - parent="parent_value", - ) - - # Make the request - response = await client.create_workflow_invocation(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.CreateWorkflowInvocationRequest, dict]): - The request object. `CreateWorkflowInvocation` request - message. - parent (:class:`str`): - Required. The repository in which to create the workflow - invocation. Must be in the format - ``projects/*/locations/*/repositories/*``. - - This corresponds to the ``parent`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - workflow_invocation (:class:`google.cloud.dataform_v1beta1.types.WorkflowInvocation`): - Required. The workflow invocation - resource to create. - - This corresponds to the ``workflow_invocation`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.WorkflowInvocation: - Represents a single invocation of a - compilation result. - - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([parent, workflow_invocation]) - if request is not None and has_flattened_params: - raise ValueError("If the `request` argument is set, then none of " - "the individual field arguments should be set.") - - request = dataform.CreateWorkflowInvocationRequest(request) - - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if parent is not None: - request.parent = parent - if workflow_invocation is not None: - request.workflow_invocation = workflow_invocation - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.create_workflow_invocation, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("parent", request.parent), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def delete_workflow_invocation(self, - request: Union[dataform.DeleteWorkflowInvocationRequest, dict] = None, - *, - name: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Deletes a single WorkflowInvocation. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_delete_workflow_invocation(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.DeleteWorkflowInvocationRequest( - name="name_value", - ) - - # Make the request - await client.delete_workflow_invocation(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.DeleteWorkflowInvocationRequest, dict]): - The request object. `DeleteWorkflowInvocation` request - message. - name (:class:`str`): - Required. The workflow invocation - resource's name. - - This corresponds to the ``name`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([name]) - if request is not None and has_flattened_params: - raise ValueError("If the `request` argument is set, then none of " - "the individual field arguments should be set.") - - request = dataform.DeleteWorkflowInvocationRequest(request) - - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if name is not None: - request.name = name - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.delete_workflow_invocation, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - async def cancel_workflow_invocation(self, - request: Union[dataform.CancelWorkflowInvocationRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Requests cancellation of a running - WorkflowInvocation. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_cancel_workflow_invocation(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.CancelWorkflowInvocationRequest( - name="name_value", - ) - - # Make the request - await client.cancel_workflow_invocation(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.CancelWorkflowInvocationRequest, dict]): - The request object. `CancelWorkflowInvocation` request - message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - request = dataform.CancelWorkflowInvocationRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.cancel_workflow_invocation, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - async def query_workflow_invocation_actions(self, - request: Union[dataform.QueryWorkflowInvocationActionsRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> pagers.QueryWorkflowInvocationActionsAsyncPager: - r"""Returns WorkflowInvocationActions in a given - WorkflowInvocation. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - async def sample_query_workflow_invocation_actions(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.QueryWorkflowInvocationActionsRequest( - name="name_value", - ) - - # Make the request - page_result = client.query_workflow_invocation_actions(request=request) - - # Handle the response - async for response in page_result: - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsRequest, dict]): - The request object. `QueryWorkflowInvocationActions` - request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.services.dataform.pagers.QueryWorkflowInvocationActionsAsyncPager: - QueryWorkflowInvocationActions response message. - - Iterating over this object will yield results and - resolve additional pages automatically. - - """ - # Create or coerce a protobuf request object. - request = dataform.QueryWorkflowInvocationActionsRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.query_workflow_invocation_actions, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # This method is paged; wrap the response in a pager, which provides - # an `__aiter__` convenience method. - response = pagers.QueryWorkflowInvocationActionsAsyncPager( - method=rpc, - request=request, - response=response, - metadata=metadata, - ) - - # Done; return the response. - return response - - async def get_location( - self, - request: locations_pb2.GetLocationRequest = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> locations_pb2.Location: - r"""Gets information about a location. - - Args: - request (:class:`~.location_pb2.GetLocationRequest`): - The request object. Request message for - `GetLocation` method. - retry (google.api_core.retry.Retry): Designation of what errors, - if any, should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - Returns: - ~.location_pb2.Location: - Location object. - """ - # Create or coerce a protobuf request object. - # The request isn't a proto-plus wrapped type, - # so it must be constructed via keyword expansion. - if isinstance(request, dict): - request = locations_pb2.GetLocationRequest(**request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method.wrap_method( - self._client._transport.get_location, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata( - (("name", request.name),)), - ) - - # Send the request. - response = await rpc( - request, retry=retry, timeout=timeout, metadata=metadata,) - - # Done; return the response. - return response - - async def list_locations( - self, - request: locations_pb2.ListLocationsRequest = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> locations_pb2.ListLocationsResponse: - r"""Lists information about the supported locations for this service. - - Args: - request (:class:`~.location_pb2.ListLocationsRequest`): - The request object. Request message for - `ListLocations` method. - retry (google.api_core.retry.Retry): Designation of what errors, - if any, should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - Returns: - ~.location_pb2.ListLocationsResponse: - Response message for ``ListLocations`` method. - """ - # Create or coerce a protobuf request object. - # The request isn't a proto-plus wrapped type, - # so it must be constructed via keyword expansion. - if isinstance(request, dict): - request = locations_pb2.ListLocationsRequest(**request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method.wrap_method( - self._client._transport.list_locations, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata( - (("name", request.name),)), - ) - - # Send the request. - response = await rpc( - request, retry=retry, timeout=timeout, metadata=metadata,) - - # Done; return the response. - return response - - async def __aenter__(self): - return self - - async def __aexit__(self, exc_type, exc, tb): - await self.transport.close() - -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataform", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() - - -__all__ = ( - "DataformAsyncClient", -) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/client.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/client.py deleted file mode 100644 index ed5204d..0000000 --- a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/client.py +++ /dev/null @@ -1,3833 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -from collections import OrderedDict -import os -import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources - -from google.api_core import client_options as client_options_lib -from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import retry as retries -from google.auth import credentials as ga_credentials # type: ignore -from google.auth.transport import mtls # type: ignore -from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore -from google.oauth2 import service_account # type: ignore - -try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] -except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore - -from google.cloud.dataform_v1beta1.services.dataform import pagers -from google.cloud.dataform_v1beta1.types import dataform -from google.cloud.location import locations_pb2 # type: ignore -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.type import interval_pb2 # type: ignore -from .transports.base import DataformTransport, DEFAULT_CLIENT_INFO -from .transports.grpc import DataformGrpcTransport -from .transports.grpc_asyncio import DataformGrpcAsyncIOTransport - - -class DataformClientMeta(type): - """Metaclass for the Dataform client. - - This provides class-level methods for building and retrieving - support objects (e.g. transport) without polluting the client instance - objects. - """ - _transport_registry = OrderedDict() # type: Dict[str, Type[DataformTransport]] - _transport_registry["grpc"] = DataformGrpcTransport - _transport_registry["grpc_asyncio"] = DataformGrpcAsyncIOTransport - - def get_transport_class(cls, - label: str = None, - ) -> Type[DataformTransport]: - """Returns an appropriate transport class. - - Args: - label: The name of the desired transport. If none is - provided, then the first transport in the registry is used. - - Returns: - The transport class to use. - """ - # If a specific transport is requested, return that one. - if label: - return cls._transport_registry[label] - - # No transport is requested; return the default (that is, the first one - # in the dictionary). - return next(iter(cls._transport_registry.values())) - - -class DataformClient(metaclass=DataformClientMeta): - """Dataform is a service to develop, create, document, test, and - update curated tables in BigQuery. - """ - - @staticmethod - def _get_default_mtls_endpoint(api_endpoint): - """Converts api endpoint to mTLS endpoint. - - Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to - "*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively. - Args: - api_endpoint (Optional[str]): the api endpoint to convert. - Returns: - str: converted mTLS api endpoint. - """ - if not api_endpoint: - return api_endpoint - - mtls_endpoint_re = re.compile( - r"(?P[^.]+)(?P\.mtls)?(?P\.sandbox)?(?P\.googleapis\.com)?" - ) - - m = mtls_endpoint_re.match(api_endpoint) - name, mtls, sandbox, googledomain = m.groups() - if mtls or not googledomain: - return api_endpoint - - if sandbox: - return api_endpoint.replace( - "sandbox.googleapis.com", "mtls.sandbox.googleapis.com" - ) - - return api_endpoint.replace(".googleapis.com", ".mtls.googleapis.com") - - DEFAULT_ENDPOINT = "dataform.googleapis.com" - DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore - DEFAULT_ENDPOINT - ) - - @classmethod - def from_service_account_info(cls, info: dict, *args, **kwargs): - """Creates an instance of this client using the provided credentials - info. - - Args: - info (dict): The service account private key info. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - DataformClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_info(info) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - @classmethod - def from_service_account_file(cls, filename: str, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - DataformClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file( - filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @property - def transport(self) -> DataformTransport: - """Returns the transport used by the client instance. - - Returns: - DataformTransport: The transport used by the client - instance. - """ - return self._transport - - @staticmethod - def compilation_result_path(project: str,location: str,repository: str,compilation_result: str,) -> str: - """Returns a fully-qualified compilation_result string.""" - return "projects/{project}/locations/{location}/repositories/{repository}/compilationResults/{compilation_result}".format(project=project, location=location, repository=repository, compilation_result=compilation_result, ) - - @staticmethod - def parse_compilation_result_path(path: str) -> Dict[str,str]: - """Parses a compilation_result path into its component segments.""" - m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)/repositories/(?P.+?)/compilationResults/(?P.+?)$", path) - return m.groupdict() if m else {} - - @staticmethod - def repository_path(project: str,location: str,repository: str,) -> str: - """Returns a fully-qualified repository string.""" - return "projects/{project}/locations/{location}/repositories/{repository}".format(project=project, location=location, repository=repository, ) - - @staticmethod - def parse_repository_path(path: str) -> Dict[str,str]: - """Parses a repository path into its component segments.""" - m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)/repositories/(?P.+?)$", path) - return m.groupdict() if m else {} - - @staticmethod - def secret_version_path(project: str,secret: str,version: str,) -> str: - """Returns a fully-qualified secret_version string.""" - return "projects/{project}/secrets/{secret}/versions/{version}".format(project=project, secret=secret, version=version, ) - - @staticmethod - def parse_secret_version_path(path: str) -> Dict[str,str]: - """Parses a secret_version path into its component segments.""" - m = re.match(r"^projects/(?P.+?)/secrets/(?P.+?)/versions/(?P.+?)$", path) - return m.groupdict() if m else {} - - @staticmethod - def workflow_invocation_path(project: str,location: str,repository: str,workflow_invocation: str,) -> str: - """Returns a fully-qualified workflow_invocation string.""" - return "projects/{project}/locations/{location}/repositories/{repository}/workflowInvocations/{workflow_invocation}".format(project=project, location=location, repository=repository, workflow_invocation=workflow_invocation, ) - - @staticmethod - def parse_workflow_invocation_path(path: str) -> Dict[str,str]: - """Parses a workflow_invocation path into its component segments.""" - m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)/repositories/(?P.+?)/workflowInvocations/(?P.+?)$", path) - return m.groupdict() if m else {} - - @staticmethod - def workspace_path(project: str,location: str,repository: str,workspace: str,) -> str: - """Returns a fully-qualified workspace string.""" - return "projects/{project}/locations/{location}/repositories/{repository}/workspaces/{workspace}".format(project=project, location=location, repository=repository, workspace=workspace, ) - - @staticmethod - def parse_workspace_path(path: str) -> Dict[str,str]: - """Parses a workspace path into its component segments.""" - m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)/repositories/(?P.+?)/workspaces/(?P.+?)$", path) - return m.groupdict() if m else {} - - @staticmethod - def common_billing_account_path(billing_account: str, ) -> str: - """Returns a fully-qualified billing_account string.""" - return "billingAccounts/{billing_account}".format(billing_account=billing_account, ) - - @staticmethod - def parse_common_billing_account_path(path: str) -> Dict[str,str]: - """Parse a billing_account path into its component segments.""" - m = re.match(r"^billingAccounts/(?P.+?)$", path) - return m.groupdict() if m else {} - - @staticmethod - def common_folder_path(folder: str, ) -> str: - """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder, ) - - @staticmethod - def parse_common_folder_path(path: str) -> Dict[str,str]: - """Parse a folder path into its component segments.""" - m = re.match(r"^folders/(?P.+?)$", path) - return m.groupdict() if m else {} - - @staticmethod - def common_organization_path(organization: str, ) -> str: - """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization, ) - - @staticmethod - def parse_common_organization_path(path: str) -> Dict[str,str]: - """Parse a organization path into its component segments.""" - m = re.match(r"^organizations/(?P.+?)$", path) - return m.groupdict() if m else {} - - @staticmethod - def common_project_path(project: str, ) -> str: - """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project, ) - - @staticmethod - def parse_common_project_path(path: str) -> Dict[str,str]: - """Parse a project path into its component segments.""" - m = re.match(r"^projects/(?P.+?)$", path) - return m.groupdict() if m else {} - - @staticmethod - def common_location_path(project: str, location: str, ) -> str: - """Returns a fully-qualified location string.""" - return "projects/{project}/locations/{location}".format(project=project, location=location, ) - - @staticmethod - def parse_common_location_path(path: str) -> Dict[str,str]: - """Parse a location path into its component segments.""" - m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)$", path) - return m.groupdict() if m else {} - - @classmethod - def get_mtls_endpoint_and_cert_source(cls, client_options: Optional[client_options_lib.ClientOptions] = None): - """Return the API endpoint and client cert source for mutual TLS. - - The client cert source is determined in the following order: - (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the - client cert source is None. - (2) if `client_options.client_cert_source` is provided, use the provided one; if the - default client cert source exists, use the default one; otherwise the client cert - source is None. - - The API endpoint is determined in the following order: - (1) if `client_options.api_endpoint` if provided, use the provided one. - (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the - default mTLS endpoint; if the environment variabel is "never", use the default API - endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise - use the default API endpoint. - - More details can be found at https://google.aip.dev/auth/4114. - - Args: - client_options (google.api_core.client_options.ClientOptions): Custom options for the - client. Only the `api_endpoint` and `client_cert_source` properties may be used - in this method. - - Returns: - Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the - client cert source to use. - - Raises: - google.auth.exceptions.MutualTLSChannelError: If any errors happen. - """ - if client_options is None: - client_options = client_options_lib.ClientOptions() - use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") - use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto") - if use_client_cert not in ("true", "false"): - raise ValueError("Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`") - if use_mtls_endpoint not in ("auto", "never", "always"): - raise MutualTLSChannelError("Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`") - - # Figure out the client cert source to use. - client_cert_source = None - if use_client_cert == "true": - if client_options.client_cert_source: - client_cert_source = client_options.client_cert_source - elif mtls.has_default_client_cert_source(): - client_cert_source = mtls.default_client_cert_source() - - # Figure out which api endpoint to use. - if client_options.api_endpoint is not None: - api_endpoint = client_options.api_endpoint - elif use_mtls_endpoint == "always" or (use_mtls_endpoint == "auto" and client_cert_source): - api_endpoint = cls.DEFAULT_MTLS_ENDPOINT - else: - api_endpoint = cls.DEFAULT_ENDPOINT - - return api_endpoint, client_cert_source - - def __init__(self, *, - credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, DataformTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, - client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, - ) -> None: - """Instantiates the dataform client. - - Args: - credentials (Optional[google.auth.credentials.Credentials]): The - authorization credentials to attach to requests. These - credentials identify the application to the service; if none - are specified, the client will attempt to ascertain the - credentials from the environment. - transport (Union[str, DataformTransport]): The - transport to use. If set to None, a transport is chosen - automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the - client. It won't take effect if a ``transport`` instance is provided. - (1) The ``api_endpoint`` property can be used to override the - default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT - environment variable can also be used to override the endpoint: - "always" (always use the default mTLS endpoint), "never" (always - use the default regular endpoint) and "auto" (auto switch to the - default mTLS endpoint if client certificate is present, this is - the default value). However, the ``api_endpoint`` property takes - precedence if provided. - (2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable - is "true", then the ``client_cert_source`` property can be used - to provide client certificate for mutual TLS transport. If - not provided, the default SSL client certificate will be used if - present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not - set, no client certificate will be used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - - Raises: - google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport - creation failed for any reason. - """ - if isinstance(client_options, dict): - client_options = client_options_lib.from_dict(client_options) - if client_options is None: - client_options = client_options_lib.ClientOptions() - - api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source(client_options) - - api_key_value = getattr(client_options, "api_key", None) - if api_key_value and credentials: - raise ValueError("client_options.api_key and credentials are mutually exclusive") - - # Save or instantiate the transport. - # Ordinarily, we provide the transport, but allowing a custom transport - # instance provides an extensibility point for unusual situations. - if isinstance(transport, DataformTransport): - # transport is a DataformTransport instance. - if credentials or client_options.credentials_file or api_key_value: - raise ValueError("When providing a transport instance, " - "provide its credentials directly.") - if client_options.scopes: - raise ValueError( - "When providing a transport instance, provide its scopes " - "directly." - ) - self._transport = transport - else: - import google.auth._default # type: ignore - - if api_key_value and hasattr(google.auth._default, "get_api_key_credentials"): - credentials = google.auth._default.get_api_key_credentials(api_key_value) - - Transport = type(self).get_transport_class(transport) - self._transport = Transport( - credentials=credentials, - credentials_file=client_options.credentials_file, - host=api_endpoint, - scopes=client_options.scopes, - client_cert_source_for_mtls=client_cert_source_func, - quota_project_id=client_options.quota_project_id, - client_info=client_info, - always_use_jwt_access=True, - api_audience=client_options.api_audience, - ) - - def list_repositories(self, - request: Union[dataform.ListRepositoriesRequest, dict] = None, - *, - parent: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> pagers.ListRepositoriesPager: - r"""Lists Repositories in a given project and location. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_list_repositories(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ListRepositoriesRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_repositories(request=request) - - # Handle the response - for response in page_result: - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.ListRepositoriesRequest, dict]): - The request object. `ListRepositories` request message. - parent (str): - Required. The location in which to list repositories. - Must be in the format ``projects/*/locations/*``. - - This corresponds to the ``parent`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.services.dataform.pagers.ListRepositoriesPager: - ListRepositories response message. - - Iterating over this object will yield results and - resolve additional pages automatically. - - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([parent]) - if request is not None and has_flattened_params: - raise ValueError('If the `request` argument is set, then none of ' - 'the individual field arguments should be set.') - - # Minor optimization to avoid making a copy if the user passes - # in a dataform.ListRepositoriesRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.ListRepositoriesRequest): - request = dataform.ListRepositoriesRequest(request) - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if parent is not None: - request.parent = parent - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.list_repositories] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("parent", request.parent), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # This method is paged; wrap the response in a pager, which provides - # an `__iter__` convenience method. - response = pagers.ListRepositoriesPager( - method=rpc, - request=request, - response=response, - metadata=metadata, - ) - - # Done; return the response. - return response - - def get_repository(self, - request: Union[dataform.GetRepositoryRequest, dict] = None, - *, - name: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.Repository: - r"""Fetches a single Repository. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_get_repository(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.GetRepositoryRequest( - name="name_value", - ) - - # Make the request - response = client.get_repository(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.GetRepositoryRequest, dict]): - The request object. `GetRepository` request message. - name (str): - Required. The repository's name. - This corresponds to the ``name`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.Repository: - Represents a Dataform Git repository. - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([name]) - if request is not None and has_flattened_params: - raise ValueError('If the `request` argument is set, then none of ' - 'the individual field arguments should be set.') - - # Minor optimization to avoid making a copy if the user passes - # in a dataform.GetRepositoryRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.GetRepositoryRequest): - request = dataform.GetRepositoryRequest(request) - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if name is not None: - request.name = name - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.get_repository] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - def create_repository(self, - request: Union[dataform.CreateRepositoryRequest, dict] = None, - *, - parent: str = None, - repository: dataform.Repository = None, - repository_id: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.Repository: - r"""Creates a new Repository in a given project and - location. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_create_repository(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.CreateRepositoryRequest( - parent="parent_value", - repository_id="repository_id_value", - ) - - # Make the request - response = client.create_repository(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.CreateRepositoryRequest, dict]): - The request object. `CreateRepository` request message. - parent (str): - Required. The location in which to create the - repository. Must be in the format - ``projects/*/locations/*``. - - This corresponds to the ``parent`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - repository (google.cloud.dataform_v1beta1.types.Repository): - Required. The repository to create. - This corresponds to the ``repository`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - repository_id (str): - Required. The ID to use for the - repository, which will become the final - component of the repository's resource - name. - - This corresponds to the ``repository_id`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.Repository: - Represents a Dataform Git repository. - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([parent, repository, repository_id]) - if request is not None and has_flattened_params: - raise ValueError('If the `request` argument is set, then none of ' - 'the individual field arguments should be set.') - - # Minor optimization to avoid making a copy if the user passes - # in a dataform.CreateRepositoryRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.CreateRepositoryRequest): - request = dataform.CreateRepositoryRequest(request) - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if parent is not None: - request.parent = parent - if repository is not None: - request.repository = repository - if repository_id is not None: - request.repository_id = repository_id - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.create_repository] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("parent", request.parent), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - def update_repository(self, - request: Union[dataform.UpdateRepositoryRequest, dict] = None, - *, - repository: dataform.Repository = None, - update_mask: field_mask_pb2.FieldMask = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.Repository: - r"""Updates a single Repository. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_update_repository(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.UpdateRepositoryRequest( - ) - - # Make the request - response = client.update_repository(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.UpdateRepositoryRequest, dict]): - The request object. `UpdateRepository` request message. - repository (google.cloud.dataform_v1beta1.types.Repository): - Required. The repository to update. - This corresponds to the ``repository`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - update_mask (google.protobuf.field_mask_pb2.FieldMask): - Optional. Specifies the fields to be - updated in the repository. If left - unset, all fields will be updated. - - This corresponds to the ``update_mask`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.Repository: - Represents a Dataform Git repository. - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([repository, update_mask]) - if request is not None and has_flattened_params: - raise ValueError('If the `request` argument is set, then none of ' - 'the individual field arguments should be set.') - - # Minor optimization to avoid making a copy if the user passes - # in a dataform.UpdateRepositoryRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.UpdateRepositoryRequest): - request = dataform.UpdateRepositoryRequest(request) - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if repository is not None: - request.repository = repository - if update_mask is not None: - request.update_mask = update_mask - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.update_repository] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("repository.name", request.repository.name), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - def delete_repository(self, - request: Union[dataform.DeleteRepositoryRequest, dict] = None, - *, - name: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Deletes a single Repository. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_delete_repository(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.DeleteRepositoryRequest( - name="name_value", - ) - - # Make the request - client.delete_repository(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.DeleteRepositoryRequest, dict]): - The request object. `DeleteRepository` request message. - name (str): - Required. The repository's name. - This corresponds to the ``name`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([name]) - if request is not None and has_flattened_params: - raise ValueError('If the `request` argument is set, then none of ' - 'the individual field arguments should be set.') - - # Minor optimization to avoid making a copy if the user passes - # in a dataform.DeleteRepositoryRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.DeleteRepositoryRequest): - request = dataform.DeleteRepositoryRequest(request) - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if name is not None: - request.name = name - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.delete_repository] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - def fetch_remote_branches(self, - request: Union[dataform.FetchRemoteBranchesRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.FetchRemoteBranchesResponse: - r"""Fetches a Repository's remote branches. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_fetch_remote_branches(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.FetchRemoteBranchesRequest( - name="name_value", - ) - - # Make the request - response = client.fetch_remote_branches(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.FetchRemoteBranchesRequest, dict]): - The request object. `FetchRemoteBranches` request - message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.FetchRemoteBranchesResponse: - FetchRemoteBranches response message. - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.FetchRemoteBranchesRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.FetchRemoteBranchesRequest): - request = dataform.FetchRemoteBranchesRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.fetch_remote_branches] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - def list_workspaces(self, - request: Union[dataform.ListWorkspacesRequest, dict] = None, - *, - parent: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> pagers.ListWorkspacesPager: - r"""Lists Workspaces in a given Repository. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_list_workspaces(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ListWorkspacesRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_workspaces(request=request) - - # Handle the response - for response in page_result: - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.ListWorkspacesRequest, dict]): - The request object. `ListWorkspaces` request message. - parent (str): - Required. The repository in which to list workspaces. - Must be in the format - ``projects/*/locations/*/repositories/*``. - - This corresponds to the ``parent`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.services.dataform.pagers.ListWorkspacesPager: - ListWorkspaces response message. - - Iterating over this object will yield results and - resolve additional pages automatically. - - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([parent]) - if request is not None and has_flattened_params: - raise ValueError('If the `request` argument is set, then none of ' - 'the individual field arguments should be set.') - - # Minor optimization to avoid making a copy if the user passes - # in a dataform.ListWorkspacesRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.ListWorkspacesRequest): - request = dataform.ListWorkspacesRequest(request) - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if parent is not None: - request.parent = parent - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.list_workspaces] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("parent", request.parent), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # This method is paged; wrap the response in a pager, which provides - # an `__iter__` convenience method. - response = pagers.ListWorkspacesPager( - method=rpc, - request=request, - response=response, - metadata=metadata, - ) - - # Done; return the response. - return response - - def get_workspace(self, - request: Union[dataform.GetWorkspaceRequest, dict] = None, - *, - name: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.Workspace: - r"""Fetches a single Workspace. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_get_workspace(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.GetWorkspaceRequest( - name="name_value", - ) - - # Make the request - response = client.get_workspace(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.GetWorkspaceRequest, dict]): - The request object. `GetWorkspace` request message. - name (str): - Required. The workspace's name. - This corresponds to the ``name`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.Workspace: - Represents a Dataform Git workspace. - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([name]) - if request is not None and has_flattened_params: - raise ValueError('If the `request` argument is set, then none of ' - 'the individual field arguments should be set.') - - # Minor optimization to avoid making a copy if the user passes - # in a dataform.GetWorkspaceRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.GetWorkspaceRequest): - request = dataform.GetWorkspaceRequest(request) - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if name is not None: - request.name = name - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.get_workspace] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - def create_workspace(self, - request: Union[dataform.CreateWorkspaceRequest, dict] = None, - *, - parent: str = None, - workspace: dataform.Workspace = None, - workspace_id: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.Workspace: - r"""Creates a new Workspace in a given Repository. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_create_workspace(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.CreateWorkspaceRequest( - parent="parent_value", - workspace_id="workspace_id_value", - ) - - # Make the request - response = client.create_workspace(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.CreateWorkspaceRequest, dict]): - The request object. `CreateWorkspace` request message. - parent (str): - Required. The repository in which to create the - workspace. Must be in the format - ``projects/*/locations/*/repositories/*``. - - This corresponds to the ``parent`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - workspace (google.cloud.dataform_v1beta1.types.Workspace): - Required. The workspace to create. - This corresponds to the ``workspace`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - workspace_id (str): - Required. The ID to use for the - workspace, which will become the final - component of the workspace's resource - name. - - This corresponds to the ``workspace_id`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.Workspace: - Represents a Dataform Git workspace. - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([parent, workspace, workspace_id]) - if request is not None and has_flattened_params: - raise ValueError('If the `request` argument is set, then none of ' - 'the individual field arguments should be set.') - - # Minor optimization to avoid making a copy if the user passes - # in a dataform.CreateWorkspaceRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.CreateWorkspaceRequest): - request = dataform.CreateWorkspaceRequest(request) - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if parent is not None: - request.parent = parent - if workspace is not None: - request.workspace = workspace - if workspace_id is not None: - request.workspace_id = workspace_id - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.create_workspace] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("parent", request.parent), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - def delete_workspace(self, - request: Union[dataform.DeleteWorkspaceRequest, dict] = None, - *, - name: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Deletes a single Workspace. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_delete_workspace(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.DeleteWorkspaceRequest( - name="name_value", - ) - - # Make the request - client.delete_workspace(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.DeleteWorkspaceRequest, dict]): - The request object. `DeleteWorkspace` request message. - name (str): - Required. The workspace resource's - name. - - This corresponds to the ``name`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([name]) - if request is not None and has_flattened_params: - raise ValueError('If the `request` argument is set, then none of ' - 'the individual field arguments should be set.') - - # Minor optimization to avoid making a copy if the user passes - # in a dataform.DeleteWorkspaceRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.DeleteWorkspaceRequest): - request = dataform.DeleteWorkspaceRequest(request) - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if name is not None: - request.name = name - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.delete_workspace] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - def install_npm_packages(self, - request: Union[dataform.InstallNpmPackagesRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.InstallNpmPackagesResponse: - r"""Installs dependency NPM packages (inside a - Workspace). - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_install_npm_packages(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.InstallNpmPackagesRequest( - workspace="workspace_value", - ) - - # Make the request - response = client.install_npm_packages(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.InstallNpmPackagesRequest, dict]): - The request object. `InstallNpmPackages` request - message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.InstallNpmPackagesResponse: - InstallNpmPackages response message. - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.InstallNpmPackagesRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.InstallNpmPackagesRequest): - request = dataform.InstallNpmPackagesRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.install_npm_packages] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - def pull_git_commits(self, - request: Union[dataform.PullGitCommitsRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Pulls Git commits from the Repository's remote into a - Workspace. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_pull_git_commits(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - author = dataform_v1beta1.CommitAuthor() - author.name = "name_value" - author.email_address = "email_address_value" - - request = dataform_v1beta1.PullGitCommitsRequest( - name="name_value", - author=author, - ) - - # Make the request - client.pull_git_commits(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.PullGitCommitsRequest, dict]): - The request object. `PullGitCommits` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.PullGitCommitsRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.PullGitCommitsRequest): - request = dataform.PullGitCommitsRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.pull_git_commits] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - def push_git_commits(self, - request: Union[dataform.PushGitCommitsRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Pushes Git commits from a Workspace to the - Repository's remote. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_push_git_commits(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.PushGitCommitsRequest( - name="name_value", - ) - - # Make the request - client.push_git_commits(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.PushGitCommitsRequest, dict]): - The request object. `PushGitCommits` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.PushGitCommitsRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.PushGitCommitsRequest): - request = dataform.PushGitCommitsRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.push_git_commits] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - def fetch_file_git_statuses(self, - request: Union[dataform.FetchFileGitStatusesRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.FetchFileGitStatusesResponse: - r"""Fetches Git statuses for the files in a Workspace. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_fetch_file_git_statuses(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.FetchFileGitStatusesRequest( - name="name_value", - ) - - # Make the request - response = client.fetch_file_git_statuses(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.FetchFileGitStatusesRequest, dict]): - The request object. `FetchFileGitStatuses` request - message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.FetchFileGitStatusesResponse: - FetchFileGitStatuses response message. - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.FetchFileGitStatusesRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.FetchFileGitStatusesRequest): - request = dataform.FetchFileGitStatusesRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.fetch_file_git_statuses] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - def fetch_git_ahead_behind(self, - request: Union[dataform.FetchGitAheadBehindRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.FetchGitAheadBehindResponse: - r"""Fetches Git ahead/behind against a remote branch. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_fetch_git_ahead_behind(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.FetchGitAheadBehindRequest( - name="name_value", - ) - - # Make the request - response = client.fetch_git_ahead_behind(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.FetchGitAheadBehindRequest, dict]): - The request object. `FetchGitAheadBehind` request - message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.FetchGitAheadBehindResponse: - FetchGitAheadBehind response message. - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.FetchGitAheadBehindRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.FetchGitAheadBehindRequest): - request = dataform.FetchGitAheadBehindRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.fetch_git_ahead_behind] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - def commit_workspace_changes(self, - request: Union[dataform.CommitWorkspaceChangesRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Applies a Git commit for uncommitted files in a - Workspace. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_commit_workspace_changes(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - author = dataform_v1beta1.CommitAuthor() - author.name = "name_value" - author.email_address = "email_address_value" - - request = dataform_v1beta1.CommitWorkspaceChangesRequest( - name="name_value", - author=author, - ) - - # Make the request - client.commit_workspace_changes(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.CommitWorkspaceChangesRequest, dict]): - The request object. `CommitWorkspaceChanges` request - message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.CommitWorkspaceChangesRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.CommitWorkspaceChangesRequest): - request = dataform.CommitWorkspaceChangesRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.commit_workspace_changes] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - def reset_workspace_changes(self, - request: Union[dataform.ResetWorkspaceChangesRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Performs a Git reset for uncommitted files in a - Workspace. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_reset_workspace_changes(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ResetWorkspaceChangesRequest( - name="name_value", - ) - - # Make the request - client.reset_workspace_changes(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.ResetWorkspaceChangesRequest, dict]): - The request object. `ResetWorkspaceChanges` request - message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.ResetWorkspaceChangesRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.ResetWorkspaceChangesRequest): - request = dataform.ResetWorkspaceChangesRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.reset_workspace_changes] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - def fetch_file_diff(self, - request: Union[dataform.FetchFileDiffRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.FetchFileDiffResponse: - r"""Fetches Git diff for an uncommitted file in a - Workspace. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_fetch_file_diff(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.FetchFileDiffRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - response = client.fetch_file_diff(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.FetchFileDiffRequest, dict]): - The request object. `FetchFileDiff` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.FetchFileDiffResponse: - FetchFileDiff response message. - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.FetchFileDiffRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.FetchFileDiffRequest): - request = dataform.FetchFileDiffRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.fetch_file_diff] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - def query_directory_contents(self, - request: Union[dataform.QueryDirectoryContentsRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> pagers.QueryDirectoryContentsPager: - r"""Returns the contents of a given Workspace directory. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_query_directory_contents(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.QueryDirectoryContentsRequest( - workspace="workspace_value", - ) - - # Make the request - page_result = client.query_directory_contents(request=request) - - # Handle the response - for response in page_result: - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.QueryDirectoryContentsRequest, dict]): - The request object. `QueryDirectoryContents` request - message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.services.dataform.pagers.QueryDirectoryContentsPager: - QueryDirectoryContents response message. - - Iterating over this object will yield results and - resolve additional pages automatically. - - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.QueryDirectoryContentsRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.QueryDirectoryContentsRequest): - request = dataform.QueryDirectoryContentsRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.query_directory_contents] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # This method is paged; wrap the response in a pager, which provides - # an `__iter__` convenience method. - response = pagers.QueryDirectoryContentsPager( - method=rpc, - request=request, - response=response, - metadata=metadata, - ) - - # Done; return the response. - return response - - def make_directory(self, - request: Union[dataform.MakeDirectoryRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.MakeDirectoryResponse: - r"""Creates a directory inside a Workspace. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_make_directory(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.MakeDirectoryRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - response = client.make_directory(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.MakeDirectoryRequest, dict]): - The request object. `MakeDirectory` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.MakeDirectoryResponse: - MakeDirectory response message. - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.MakeDirectoryRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.MakeDirectoryRequest): - request = dataform.MakeDirectoryRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.make_directory] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - def remove_directory(self, - request: Union[dataform.RemoveDirectoryRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Deletes a directory (inside a Workspace) and all of - its contents. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_remove_directory(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.RemoveDirectoryRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - client.remove_directory(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.RemoveDirectoryRequest, dict]): - The request object. `RemoveDirectory` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.RemoveDirectoryRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.RemoveDirectoryRequest): - request = dataform.RemoveDirectoryRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.remove_directory] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - def move_directory(self, - request: Union[dataform.MoveDirectoryRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.MoveDirectoryResponse: - r"""Moves a directory (inside a Workspace), and all of - its contents, to a new location. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_move_directory(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.MoveDirectoryRequest( - workspace="workspace_value", - path="path_value", - new_path="new_path_value", - ) - - # Make the request - response = client.move_directory(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.MoveDirectoryRequest, dict]): - The request object. `MoveDirectory` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.MoveDirectoryResponse: - MoveDirectory response message. - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.MoveDirectoryRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.MoveDirectoryRequest): - request = dataform.MoveDirectoryRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.move_directory] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - def read_file(self, - request: Union[dataform.ReadFileRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.ReadFileResponse: - r"""Returns the contents of a file (inside a Workspace). - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_read_file(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ReadFileRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - response = client.read_file(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.ReadFileRequest, dict]): - The request object. `ReadFile` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.ReadFileResponse: - ReadFile response message. - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.ReadFileRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.ReadFileRequest): - request = dataform.ReadFileRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.read_file] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - def remove_file(self, - request: Union[dataform.RemoveFileRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Deletes a file (inside a Workspace). - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_remove_file(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.RemoveFileRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - client.remove_file(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.RemoveFileRequest, dict]): - The request object. `RemoveFile` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.RemoveFileRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.RemoveFileRequest): - request = dataform.RemoveFileRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.remove_file] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - def move_file(self, - request: Union[dataform.MoveFileRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.MoveFileResponse: - r"""Moves a file (inside a Workspace) to a new location. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_move_file(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.MoveFileRequest( - workspace="workspace_value", - path="path_value", - new_path="new_path_value", - ) - - # Make the request - response = client.move_file(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.MoveFileRequest, dict]): - The request object. `MoveFile` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.MoveFileResponse: - MoveFile response message. - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.MoveFileRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.MoveFileRequest): - request = dataform.MoveFileRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.move_file] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - def write_file(self, - request: Union[dataform.WriteFileRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.WriteFileResponse: - r"""Writes to a file (inside a Workspace). - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_write_file(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.WriteFileRequest( - workspace="workspace_value", - path="path_value", - contents=b'contents_blob', - ) - - # Make the request - response = client.write_file(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.WriteFileRequest, dict]): - The request object. `WriteFile` request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.WriteFileResponse: - WriteFile response message. - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.WriteFileRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.WriteFileRequest): - request = dataform.WriteFileRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.write_file] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("workspace", request.workspace), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - def list_compilation_results(self, - request: Union[dataform.ListCompilationResultsRequest, dict] = None, - *, - parent: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> pagers.ListCompilationResultsPager: - r"""Lists CompilationResults in a given Repository. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_list_compilation_results(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ListCompilationResultsRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_compilation_results(request=request) - - # Handle the response - for response in page_result: - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.ListCompilationResultsRequest, dict]): - The request object. `ListCompilationResults` request - message. - parent (str): - Required. The repository in which to list compilation - results. Must be in the format - ``projects/*/locations/*/repositories/*``. - - This corresponds to the ``parent`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.services.dataform.pagers.ListCompilationResultsPager: - ListCompilationResults response message. - - Iterating over this object will yield results and - resolve additional pages automatically. - - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([parent]) - if request is not None and has_flattened_params: - raise ValueError('If the `request` argument is set, then none of ' - 'the individual field arguments should be set.') - - # Minor optimization to avoid making a copy if the user passes - # in a dataform.ListCompilationResultsRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.ListCompilationResultsRequest): - request = dataform.ListCompilationResultsRequest(request) - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if parent is not None: - request.parent = parent - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.list_compilation_results] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("parent", request.parent), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # This method is paged; wrap the response in a pager, which provides - # an `__iter__` convenience method. - response = pagers.ListCompilationResultsPager( - method=rpc, - request=request, - response=response, - metadata=metadata, - ) - - # Done; return the response. - return response - - def get_compilation_result(self, - request: Union[dataform.GetCompilationResultRequest, dict] = None, - *, - name: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.CompilationResult: - r"""Fetches a single CompilationResult. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_get_compilation_result(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.GetCompilationResultRequest( - name="name_value", - ) - - # Make the request - response = client.get_compilation_result(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.GetCompilationResultRequest, dict]): - The request object. `GetCompilationResult` request - message. - name (str): - Required. The compilation result's - name. - - This corresponds to the ``name`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.CompilationResult: - Represents the result of compiling a - Dataform project. - - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([name]) - if request is not None and has_flattened_params: - raise ValueError('If the `request` argument is set, then none of ' - 'the individual field arguments should be set.') - - # Minor optimization to avoid making a copy if the user passes - # in a dataform.GetCompilationResultRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.GetCompilationResultRequest): - request = dataform.GetCompilationResultRequest(request) - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if name is not None: - request.name = name - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.get_compilation_result] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - def create_compilation_result(self, - request: Union[dataform.CreateCompilationResultRequest, dict] = None, - *, - parent: str = None, - compilation_result: dataform.CompilationResult = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.CompilationResult: - r"""Creates a new CompilationResult in a given project - and location. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_create_compilation_result(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - compilation_result = dataform_v1beta1.CompilationResult() - compilation_result.git_commitish = "git_commitish_value" - - request = dataform_v1beta1.CreateCompilationResultRequest( - parent="parent_value", - compilation_result=compilation_result, - ) - - # Make the request - response = client.create_compilation_result(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.CreateCompilationResultRequest, dict]): - The request object. `CreateCompilationResult` request - message. - parent (str): - Required. The repository in which to create the - compilation result. Must be in the format - ``projects/*/locations/*/repositories/*``. - - This corresponds to the ``parent`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - compilation_result (google.cloud.dataform_v1beta1.types.CompilationResult): - Required. The compilation result to - create. - - This corresponds to the ``compilation_result`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.CompilationResult: - Represents the result of compiling a - Dataform project. - - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([parent, compilation_result]) - if request is not None and has_flattened_params: - raise ValueError('If the `request` argument is set, then none of ' - 'the individual field arguments should be set.') - - # Minor optimization to avoid making a copy if the user passes - # in a dataform.CreateCompilationResultRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.CreateCompilationResultRequest): - request = dataform.CreateCompilationResultRequest(request) - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if parent is not None: - request.parent = parent - if compilation_result is not None: - request.compilation_result = compilation_result - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.create_compilation_result] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("parent", request.parent), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - def query_compilation_result_actions(self, - request: Union[dataform.QueryCompilationResultActionsRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> pagers.QueryCompilationResultActionsPager: - r"""Returns CompilationResultActions in a given - CompilationResult. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_query_compilation_result_actions(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.QueryCompilationResultActionsRequest( - name="name_value", - ) - - # Make the request - page_result = client.query_compilation_result_actions(request=request) - - # Handle the response - for response in page_result: - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsRequest, dict]): - The request object. `QueryCompilationResultActions` - request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.services.dataform.pagers.QueryCompilationResultActionsPager: - QueryCompilationResultActions response message. - - Iterating over this object will yield results and - resolve additional pages automatically. - - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.QueryCompilationResultActionsRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.QueryCompilationResultActionsRequest): - request = dataform.QueryCompilationResultActionsRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.query_compilation_result_actions] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # This method is paged; wrap the response in a pager, which provides - # an `__iter__` convenience method. - response = pagers.QueryCompilationResultActionsPager( - method=rpc, - request=request, - response=response, - metadata=metadata, - ) - - # Done; return the response. - return response - - def list_workflow_invocations(self, - request: Union[dataform.ListWorkflowInvocationsRequest, dict] = None, - *, - parent: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> pagers.ListWorkflowInvocationsPager: - r"""Lists WorkflowInvocations in a given Repository. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_list_workflow_invocations(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ListWorkflowInvocationsRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_workflow_invocations(request=request) - - # Handle the response - for response in page_result: - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsRequest, dict]): - The request object. `ListWorkflowInvocations` request - message. - parent (str): - Required. The parent resource of the WorkflowInvocation - type. Must be in the format - ``projects/*/locations/*/repositories/*``. - - This corresponds to the ``parent`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.services.dataform.pagers.ListWorkflowInvocationsPager: - ListWorkflowInvocations response message. - - Iterating over this object will yield results and - resolve additional pages automatically. - - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([parent]) - if request is not None and has_flattened_params: - raise ValueError('If the `request` argument is set, then none of ' - 'the individual field arguments should be set.') - - # Minor optimization to avoid making a copy if the user passes - # in a dataform.ListWorkflowInvocationsRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.ListWorkflowInvocationsRequest): - request = dataform.ListWorkflowInvocationsRequest(request) - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if parent is not None: - request.parent = parent - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.list_workflow_invocations] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("parent", request.parent), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # This method is paged; wrap the response in a pager, which provides - # an `__iter__` convenience method. - response = pagers.ListWorkflowInvocationsPager( - method=rpc, - request=request, - response=response, - metadata=metadata, - ) - - # Done; return the response. - return response - - def get_workflow_invocation(self, - request: Union[dataform.GetWorkflowInvocationRequest, dict] = None, - *, - name: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.WorkflowInvocation: - r"""Fetches a single WorkflowInvocation. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_get_workflow_invocation(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.GetWorkflowInvocationRequest( - name="name_value", - ) - - # Make the request - response = client.get_workflow_invocation(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.GetWorkflowInvocationRequest, dict]): - The request object. `GetWorkflowInvocation` request - message. - name (str): - Required. The workflow invocation - resource's name. - - This corresponds to the ``name`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.WorkflowInvocation: - Represents a single invocation of a - compilation result. - - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([name]) - if request is not None and has_flattened_params: - raise ValueError('If the `request` argument is set, then none of ' - 'the individual field arguments should be set.') - - # Minor optimization to avoid making a copy if the user passes - # in a dataform.GetWorkflowInvocationRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.GetWorkflowInvocationRequest): - request = dataform.GetWorkflowInvocationRequest(request) - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if name is not None: - request.name = name - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.get_workflow_invocation] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - def create_workflow_invocation(self, - request: Union[dataform.CreateWorkflowInvocationRequest, dict] = None, - *, - parent: str = None, - workflow_invocation: dataform.WorkflowInvocation = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> dataform.WorkflowInvocation: - r"""Creates a new WorkflowInvocation in a given - Repository. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_create_workflow_invocation(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.CreateWorkflowInvocationRequest( - parent="parent_value", - ) - - # Make the request - response = client.create_workflow_invocation(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.CreateWorkflowInvocationRequest, dict]): - The request object. `CreateWorkflowInvocation` request - message. - parent (str): - Required. The repository in which to create the workflow - invocation. Must be in the format - ``projects/*/locations/*/repositories/*``. - - This corresponds to the ``parent`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - workflow_invocation (google.cloud.dataform_v1beta1.types.WorkflowInvocation): - Required. The workflow invocation - resource to create. - - This corresponds to the ``workflow_invocation`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.types.WorkflowInvocation: - Represents a single invocation of a - compilation result. - - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([parent, workflow_invocation]) - if request is not None and has_flattened_params: - raise ValueError('If the `request` argument is set, then none of ' - 'the individual field arguments should be set.') - - # Minor optimization to avoid making a copy if the user passes - # in a dataform.CreateWorkflowInvocationRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.CreateWorkflowInvocationRequest): - request = dataform.CreateWorkflowInvocationRequest(request) - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if parent is not None: - request.parent = parent - if workflow_invocation is not None: - request.workflow_invocation = workflow_invocation - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.create_workflow_invocation] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("parent", request.parent), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - - def delete_workflow_invocation(self, - request: Union[dataform.DeleteWorkflowInvocationRequest, dict] = None, - *, - name: str = None, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Deletes a single WorkflowInvocation. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_delete_workflow_invocation(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.DeleteWorkflowInvocationRequest( - name="name_value", - ) - - # Make the request - client.delete_workflow_invocation(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.DeleteWorkflowInvocationRequest, dict]): - The request object. `DeleteWorkflowInvocation` request - message. - name (str): - Required. The workflow invocation - resource's name. - - This corresponds to the ``name`` field - on the ``request`` instance; if ``request`` is provided, this - should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - # Quick check: If we got a request object, we should *not* have - # gotten any keyword arguments that map to the request. - has_flattened_params = any([name]) - if request is not None and has_flattened_params: - raise ValueError('If the `request` argument is set, then none of ' - 'the individual field arguments should be set.') - - # Minor optimization to avoid making a copy if the user passes - # in a dataform.DeleteWorkflowInvocationRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.DeleteWorkflowInvocationRequest): - request = dataform.DeleteWorkflowInvocationRequest(request) - # If we have keyword arguments corresponding to fields on the - # request, apply these. - if name is not None: - request.name = name - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.delete_workflow_invocation] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - def cancel_workflow_invocation(self, - request: Union[dataform.CancelWorkflowInvocationRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> None: - r"""Requests cancellation of a running - WorkflowInvocation. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_cancel_workflow_invocation(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.CancelWorkflowInvocationRequest( - name="name_value", - ) - - # Make the request - client.cancel_workflow_invocation(request=request) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.CancelWorkflowInvocationRequest, dict]): - The request object. `CancelWorkflowInvocation` request - message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.CancelWorkflowInvocationRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.CancelWorkflowInvocationRequest): - request = dataform.CancelWorkflowInvocationRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.cancel_workflow_invocation] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - def query_workflow_invocation_actions(self, - request: Union[dataform.QueryWorkflowInvocationActionsRequest, dict] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> pagers.QueryWorkflowInvocationActionsPager: - r"""Returns WorkflowInvocationActions in a given - WorkflowInvocation. - - .. code-block:: python - - # 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. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import dataform_v1beta1 - - def sample_query_workflow_invocation_actions(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.QueryWorkflowInvocationActionsRequest( - name="name_value", - ) - - # Make the request - page_result = client.query_workflow_invocation_actions(request=request) - - # Handle the response - for response in page_result: - print(response) - - Args: - request (Union[google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsRequest, dict]): - The request object. `QueryWorkflowInvocationActions` - request message. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.dataform_v1beta1.services.dataform.pagers.QueryWorkflowInvocationActionsPager: - QueryWorkflowInvocationActions response message. - - Iterating over this object will yield results and - resolve additional pages automatically. - - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a dataform.QueryWorkflowInvocationActionsRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, dataform.QueryWorkflowInvocationActionsRequest): - request = dataform.QueryWorkflowInvocationActionsRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.query_workflow_invocation_actions] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ("name", request.name), - )), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # This method is paged; wrap the response in a pager, which provides - # an `__iter__` convenience method. - response = pagers.QueryWorkflowInvocationActionsPager( - method=rpc, - request=request, - response=response, - metadata=metadata, - ) - - # Done; return the response. - return response - - def __enter__(self): - return self - - def __exit__(self, type, value, traceback): - """Releases underlying transport's resources. - - .. warning:: - ONLY use as a context manager if the transport is NOT shared - with other clients! Exiting the with block will CLOSE the transport - and may cause errors in other clients! - """ - self.transport.close() - - def get_location( - self, - request: locations_pb2.GetLocationRequest = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> locations_pb2.Location: - r"""Gets information about a location. - - Args: - request (:class:`~.location_pb2.GetLocationRequest`): - The request object. Request message for - `GetLocation` method. - retry (google.api_core.retry.Retry): Designation of what errors, - if any, should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - Returns: - ~.location_pb2.Location: - Location object. - """ - # Create or coerce a protobuf request object. - # The request isn't a proto-plus wrapped type, - # so it must be constructed via keyword expansion. - if isinstance(request, dict): - request = locations_pb2.GetLocationRequest(**request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method.wrap_method( - self._transport.get_location, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata( - (("name", request.name),)), - ) - - # Send the request. - response = rpc( - request, retry=retry, timeout=timeout, metadata=metadata,) - - # Done; return the response. - return response - - def list_locations( - self, - request: locations_pb2.ListLocationsRequest = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, - metadata: Sequence[Tuple[str, str]] = (), - ) -> locations_pb2.ListLocationsResponse: - r"""Lists information about the supported locations for this service. - - Args: - request (:class:`~.location_pb2.ListLocationsRequest`): - The request object. Request message for - `ListLocations` method. - retry (google.api_core.retry.Retry): Designation of what errors, - if any, should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - Returns: - ~.location_pb2.ListLocationsResponse: - Response message for ``ListLocations`` method. - """ - # Create or coerce a protobuf request object. - # The request isn't a proto-plus wrapped type, - # so it must be constructed via keyword expansion. - if isinstance(request, dict): - request = locations_pb2.ListLocationsRequest(**request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method.wrap_method( - self._transport.list_locations, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata( - (("name", request.name),)), - ) - - # Send the request. - response = rpc( - request, retry=retry, timeout=timeout, metadata=metadata,) - - # Done; return the response. - return response - -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataform", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() - - -__all__ = ( - "DataformClient", -) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/pagers.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/pagers.py deleted file mode 100644 index 35cf1eb..0000000 --- a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/pagers.py +++ /dev/null @@ -1,865 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -from typing import Any, AsyncIterator, Awaitable, Callable, Sequence, Tuple, Optional, Iterator - -from google.cloud.dataform_v1beta1.types import dataform - - -class ListRepositoriesPager: - """A pager for iterating through ``list_repositories`` requests. - - This class thinly wraps an initial - :class:`google.cloud.dataform_v1beta1.types.ListRepositoriesResponse` object, and - provides an ``__iter__`` method to iterate through its - ``repositories`` field. - - If there are more pages, the ``__iter__`` method will make additional - ``ListRepositories`` requests and continue to iterate - through the ``repositories`` field on the - corresponding responses. - - All the usual :class:`google.cloud.dataform_v1beta1.types.ListRepositoriesResponse` - attributes are available on the pager. If multiple requests are made, only - the most recent response is retained, and thus used for attribute lookup. - """ - def __init__(self, - method: Callable[..., dataform.ListRepositoriesResponse], - request: dataform.ListRepositoriesRequest, - response: dataform.ListRepositoriesResponse, - *, - metadata: Sequence[Tuple[str, str]] = ()): - """Instantiate the pager. - - Args: - method (Callable): The method that was originally called, and - which instantiated this pager. - request (google.cloud.dataform_v1beta1.types.ListRepositoriesRequest): - The initial request object. - response (google.cloud.dataform_v1beta1.types.ListRepositoriesResponse): - The initial response object. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - self._method = method - self._request = dataform.ListRepositoriesRequest(request) - self._response = response - self._metadata = metadata - - def __getattr__(self, name: str) -> Any: - return getattr(self._response, name) - - @property - def pages(self) -> Iterator[dataform.ListRepositoriesResponse]: - yield self._response - while self._response.next_page_token: - self._request.page_token = self._response.next_page_token - self._response = self._method(self._request, metadata=self._metadata) - yield self._response - - def __iter__(self) -> Iterator[dataform.Repository]: - for page in self.pages: - yield from page.repositories - - def __repr__(self) -> str: - return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) - - -class ListRepositoriesAsyncPager: - """A pager for iterating through ``list_repositories`` requests. - - This class thinly wraps an initial - :class:`google.cloud.dataform_v1beta1.types.ListRepositoriesResponse` object, and - provides an ``__aiter__`` method to iterate through its - ``repositories`` field. - - If there are more pages, the ``__aiter__`` method will make additional - ``ListRepositories`` requests and continue to iterate - through the ``repositories`` field on the - corresponding responses. - - All the usual :class:`google.cloud.dataform_v1beta1.types.ListRepositoriesResponse` - attributes are available on the pager. If multiple requests are made, only - the most recent response is retained, and thus used for attribute lookup. - """ - def __init__(self, - method: Callable[..., Awaitable[dataform.ListRepositoriesResponse]], - request: dataform.ListRepositoriesRequest, - response: dataform.ListRepositoriesResponse, - *, - metadata: Sequence[Tuple[str, str]] = ()): - """Instantiates the pager. - - Args: - method (Callable): The method that was originally called, and - which instantiated this pager. - request (google.cloud.dataform_v1beta1.types.ListRepositoriesRequest): - The initial request object. - response (google.cloud.dataform_v1beta1.types.ListRepositoriesResponse): - The initial response object. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - self._method = method - self._request = dataform.ListRepositoriesRequest(request) - self._response = response - self._metadata = metadata - - def __getattr__(self, name: str) -> Any: - return getattr(self._response, name) - - @property - async def pages(self) -> AsyncIterator[dataform.ListRepositoriesResponse]: - yield self._response - while self._response.next_page_token: - self._request.page_token = self._response.next_page_token - self._response = await self._method(self._request, metadata=self._metadata) - yield self._response - def __aiter__(self) -> AsyncIterator[dataform.Repository]: - async def async_generator(): - async for page in self.pages: - for response in page.repositories: - yield response - - return async_generator() - - def __repr__(self) -> str: - return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) - - -class ListWorkspacesPager: - """A pager for iterating through ``list_workspaces`` requests. - - This class thinly wraps an initial - :class:`google.cloud.dataform_v1beta1.types.ListWorkspacesResponse` object, and - provides an ``__iter__`` method to iterate through its - ``workspaces`` field. - - If there are more pages, the ``__iter__`` method will make additional - ``ListWorkspaces`` requests and continue to iterate - through the ``workspaces`` field on the - corresponding responses. - - All the usual :class:`google.cloud.dataform_v1beta1.types.ListWorkspacesResponse` - attributes are available on the pager. If multiple requests are made, only - the most recent response is retained, and thus used for attribute lookup. - """ - def __init__(self, - method: Callable[..., dataform.ListWorkspacesResponse], - request: dataform.ListWorkspacesRequest, - response: dataform.ListWorkspacesResponse, - *, - metadata: Sequence[Tuple[str, str]] = ()): - """Instantiate the pager. - - Args: - method (Callable): The method that was originally called, and - which instantiated this pager. - request (google.cloud.dataform_v1beta1.types.ListWorkspacesRequest): - The initial request object. - response (google.cloud.dataform_v1beta1.types.ListWorkspacesResponse): - The initial response object. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - self._method = method - self._request = dataform.ListWorkspacesRequest(request) - self._response = response - self._metadata = metadata - - def __getattr__(self, name: str) -> Any: - return getattr(self._response, name) - - @property - def pages(self) -> Iterator[dataform.ListWorkspacesResponse]: - yield self._response - while self._response.next_page_token: - self._request.page_token = self._response.next_page_token - self._response = self._method(self._request, metadata=self._metadata) - yield self._response - - def __iter__(self) -> Iterator[dataform.Workspace]: - for page in self.pages: - yield from page.workspaces - - def __repr__(self) -> str: - return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) - - -class ListWorkspacesAsyncPager: - """A pager for iterating through ``list_workspaces`` requests. - - This class thinly wraps an initial - :class:`google.cloud.dataform_v1beta1.types.ListWorkspacesResponse` object, and - provides an ``__aiter__`` method to iterate through its - ``workspaces`` field. - - If there are more pages, the ``__aiter__`` method will make additional - ``ListWorkspaces`` requests and continue to iterate - through the ``workspaces`` field on the - corresponding responses. - - All the usual :class:`google.cloud.dataform_v1beta1.types.ListWorkspacesResponse` - attributes are available on the pager. If multiple requests are made, only - the most recent response is retained, and thus used for attribute lookup. - """ - def __init__(self, - method: Callable[..., Awaitable[dataform.ListWorkspacesResponse]], - request: dataform.ListWorkspacesRequest, - response: dataform.ListWorkspacesResponse, - *, - metadata: Sequence[Tuple[str, str]] = ()): - """Instantiates the pager. - - Args: - method (Callable): The method that was originally called, and - which instantiated this pager. - request (google.cloud.dataform_v1beta1.types.ListWorkspacesRequest): - The initial request object. - response (google.cloud.dataform_v1beta1.types.ListWorkspacesResponse): - The initial response object. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - self._method = method - self._request = dataform.ListWorkspacesRequest(request) - self._response = response - self._metadata = metadata - - def __getattr__(self, name: str) -> Any: - return getattr(self._response, name) - - @property - async def pages(self) -> AsyncIterator[dataform.ListWorkspacesResponse]: - yield self._response - while self._response.next_page_token: - self._request.page_token = self._response.next_page_token - self._response = await self._method(self._request, metadata=self._metadata) - yield self._response - def __aiter__(self) -> AsyncIterator[dataform.Workspace]: - async def async_generator(): - async for page in self.pages: - for response in page.workspaces: - yield response - - return async_generator() - - def __repr__(self) -> str: - return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) - - -class QueryDirectoryContentsPager: - """A pager for iterating through ``query_directory_contents`` requests. - - This class thinly wraps an initial - :class:`google.cloud.dataform_v1beta1.types.QueryDirectoryContentsResponse` object, and - provides an ``__iter__`` method to iterate through its - ``directory_entries`` field. - - If there are more pages, the ``__iter__`` method will make additional - ``QueryDirectoryContents`` requests and continue to iterate - through the ``directory_entries`` field on the - corresponding responses. - - All the usual :class:`google.cloud.dataform_v1beta1.types.QueryDirectoryContentsResponse` - attributes are available on the pager. If multiple requests are made, only - the most recent response is retained, and thus used for attribute lookup. - """ - def __init__(self, - method: Callable[..., dataform.QueryDirectoryContentsResponse], - request: dataform.QueryDirectoryContentsRequest, - response: dataform.QueryDirectoryContentsResponse, - *, - metadata: Sequence[Tuple[str, str]] = ()): - """Instantiate the pager. - - Args: - method (Callable): The method that was originally called, and - which instantiated this pager. - request (google.cloud.dataform_v1beta1.types.QueryDirectoryContentsRequest): - The initial request object. - response (google.cloud.dataform_v1beta1.types.QueryDirectoryContentsResponse): - The initial response object. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - self._method = method - self._request = dataform.QueryDirectoryContentsRequest(request) - self._response = response - self._metadata = metadata - - def __getattr__(self, name: str) -> Any: - return getattr(self._response, name) - - @property - def pages(self) -> Iterator[dataform.QueryDirectoryContentsResponse]: - yield self._response - while self._response.next_page_token: - self._request.page_token = self._response.next_page_token - self._response = self._method(self._request, metadata=self._metadata) - yield self._response - - def __iter__(self) -> Iterator[dataform.QueryDirectoryContentsResponse.DirectoryEntry]: - for page in self.pages: - yield from page.directory_entries - - def __repr__(self) -> str: - return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) - - -class QueryDirectoryContentsAsyncPager: - """A pager for iterating through ``query_directory_contents`` requests. - - This class thinly wraps an initial - :class:`google.cloud.dataform_v1beta1.types.QueryDirectoryContentsResponse` object, and - provides an ``__aiter__`` method to iterate through its - ``directory_entries`` field. - - If there are more pages, the ``__aiter__`` method will make additional - ``QueryDirectoryContents`` requests and continue to iterate - through the ``directory_entries`` field on the - corresponding responses. - - All the usual :class:`google.cloud.dataform_v1beta1.types.QueryDirectoryContentsResponse` - attributes are available on the pager. If multiple requests are made, only - the most recent response is retained, and thus used for attribute lookup. - """ - def __init__(self, - method: Callable[..., Awaitable[dataform.QueryDirectoryContentsResponse]], - request: dataform.QueryDirectoryContentsRequest, - response: dataform.QueryDirectoryContentsResponse, - *, - metadata: Sequence[Tuple[str, str]] = ()): - """Instantiates the pager. - - Args: - method (Callable): The method that was originally called, and - which instantiated this pager. - request (google.cloud.dataform_v1beta1.types.QueryDirectoryContentsRequest): - The initial request object. - response (google.cloud.dataform_v1beta1.types.QueryDirectoryContentsResponse): - The initial response object. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - self._method = method - self._request = dataform.QueryDirectoryContentsRequest(request) - self._response = response - self._metadata = metadata - - def __getattr__(self, name: str) -> Any: - return getattr(self._response, name) - - @property - async def pages(self) -> AsyncIterator[dataform.QueryDirectoryContentsResponse]: - yield self._response - while self._response.next_page_token: - self._request.page_token = self._response.next_page_token - self._response = await self._method(self._request, metadata=self._metadata) - yield self._response - def __aiter__(self) -> AsyncIterator[dataform.QueryDirectoryContentsResponse.DirectoryEntry]: - async def async_generator(): - async for page in self.pages: - for response in page.directory_entries: - yield response - - return async_generator() - - def __repr__(self) -> str: - return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) - - -class ListCompilationResultsPager: - """A pager for iterating through ``list_compilation_results`` requests. - - This class thinly wraps an initial - :class:`google.cloud.dataform_v1beta1.types.ListCompilationResultsResponse` object, and - provides an ``__iter__`` method to iterate through its - ``compilation_results`` field. - - If there are more pages, the ``__iter__`` method will make additional - ``ListCompilationResults`` requests and continue to iterate - through the ``compilation_results`` field on the - corresponding responses. - - All the usual :class:`google.cloud.dataform_v1beta1.types.ListCompilationResultsResponse` - attributes are available on the pager. If multiple requests are made, only - the most recent response is retained, and thus used for attribute lookup. - """ - def __init__(self, - method: Callable[..., dataform.ListCompilationResultsResponse], - request: dataform.ListCompilationResultsRequest, - response: dataform.ListCompilationResultsResponse, - *, - metadata: Sequence[Tuple[str, str]] = ()): - """Instantiate the pager. - - Args: - method (Callable): The method that was originally called, and - which instantiated this pager. - request (google.cloud.dataform_v1beta1.types.ListCompilationResultsRequest): - The initial request object. - response (google.cloud.dataform_v1beta1.types.ListCompilationResultsResponse): - The initial response object. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - self._method = method - self._request = dataform.ListCompilationResultsRequest(request) - self._response = response - self._metadata = metadata - - def __getattr__(self, name: str) -> Any: - return getattr(self._response, name) - - @property - def pages(self) -> Iterator[dataform.ListCompilationResultsResponse]: - yield self._response - while self._response.next_page_token: - self._request.page_token = self._response.next_page_token - self._response = self._method(self._request, metadata=self._metadata) - yield self._response - - def __iter__(self) -> Iterator[dataform.CompilationResult]: - for page in self.pages: - yield from page.compilation_results - - def __repr__(self) -> str: - return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) - - -class ListCompilationResultsAsyncPager: - """A pager for iterating through ``list_compilation_results`` requests. - - This class thinly wraps an initial - :class:`google.cloud.dataform_v1beta1.types.ListCompilationResultsResponse` object, and - provides an ``__aiter__`` method to iterate through its - ``compilation_results`` field. - - If there are more pages, the ``__aiter__`` method will make additional - ``ListCompilationResults`` requests and continue to iterate - through the ``compilation_results`` field on the - corresponding responses. - - All the usual :class:`google.cloud.dataform_v1beta1.types.ListCompilationResultsResponse` - attributes are available on the pager. If multiple requests are made, only - the most recent response is retained, and thus used for attribute lookup. - """ - def __init__(self, - method: Callable[..., Awaitable[dataform.ListCompilationResultsResponse]], - request: dataform.ListCompilationResultsRequest, - response: dataform.ListCompilationResultsResponse, - *, - metadata: Sequence[Tuple[str, str]] = ()): - """Instantiates the pager. - - Args: - method (Callable): The method that was originally called, and - which instantiated this pager. - request (google.cloud.dataform_v1beta1.types.ListCompilationResultsRequest): - The initial request object. - response (google.cloud.dataform_v1beta1.types.ListCompilationResultsResponse): - The initial response object. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - self._method = method - self._request = dataform.ListCompilationResultsRequest(request) - self._response = response - self._metadata = metadata - - def __getattr__(self, name: str) -> Any: - return getattr(self._response, name) - - @property - async def pages(self) -> AsyncIterator[dataform.ListCompilationResultsResponse]: - yield self._response - while self._response.next_page_token: - self._request.page_token = self._response.next_page_token - self._response = await self._method(self._request, metadata=self._metadata) - yield self._response - def __aiter__(self) -> AsyncIterator[dataform.CompilationResult]: - async def async_generator(): - async for page in self.pages: - for response in page.compilation_results: - yield response - - return async_generator() - - def __repr__(self) -> str: - return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) - - -class QueryCompilationResultActionsPager: - """A pager for iterating through ``query_compilation_result_actions`` requests. - - This class thinly wraps an initial - :class:`google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsResponse` object, and - provides an ``__iter__`` method to iterate through its - ``compilation_result_actions`` field. - - If there are more pages, the ``__iter__`` method will make additional - ``QueryCompilationResultActions`` requests and continue to iterate - through the ``compilation_result_actions`` field on the - corresponding responses. - - All the usual :class:`google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsResponse` - attributes are available on the pager. If multiple requests are made, only - the most recent response is retained, and thus used for attribute lookup. - """ - def __init__(self, - method: Callable[..., dataform.QueryCompilationResultActionsResponse], - request: dataform.QueryCompilationResultActionsRequest, - response: dataform.QueryCompilationResultActionsResponse, - *, - metadata: Sequence[Tuple[str, str]] = ()): - """Instantiate the pager. - - Args: - method (Callable): The method that was originally called, and - which instantiated this pager. - request (google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsRequest): - The initial request object. - response (google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsResponse): - The initial response object. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - self._method = method - self._request = dataform.QueryCompilationResultActionsRequest(request) - self._response = response - self._metadata = metadata - - def __getattr__(self, name: str) -> Any: - return getattr(self._response, name) - - @property - def pages(self) -> Iterator[dataform.QueryCompilationResultActionsResponse]: - yield self._response - while self._response.next_page_token: - self._request.page_token = self._response.next_page_token - self._response = self._method(self._request, metadata=self._metadata) - yield self._response - - def __iter__(self) -> Iterator[dataform.CompilationResultAction]: - for page in self.pages: - yield from page.compilation_result_actions - - def __repr__(self) -> str: - return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) - - -class QueryCompilationResultActionsAsyncPager: - """A pager for iterating through ``query_compilation_result_actions`` requests. - - This class thinly wraps an initial - :class:`google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsResponse` object, and - provides an ``__aiter__`` method to iterate through its - ``compilation_result_actions`` field. - - If there are more pages, the ``__aiter__`` method will make additional - ``QueryCompilationResultActions`` requests and continue to iterate - through the ``compilation_result_actions`` field on the - corresponding responses. - - All the usual :class:`google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsResponse` - attributes are available on the pager. If multiple requests are made, only - the most recent response is retained, and thus used for attribute lookup. - """ - def __init__(self, - method: Callable[..., Awaitable[dataform.QueryCompilationResultActionsResponse]], - request: dataform.QueryCompilationResultActionsRequest, - response: dataform.QueryCompilationResultActionsResponse, - *, - metadata: Sequence[Tuple[str, str]] = ()): - """Instantiates the pager. - - Args: - method (Callable): The method that was originally called, and - which instantiated this pager. - request (google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsRequest): - The initial request object. - response (google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsResponse): - The initial response object. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - self._method = method - self._request = dataform.QueryCompilationResultActionsRequest(request) - self._response = response - self._metadata = metadata - - def __getattr__(self, name: str) -> Any: - return getattr(self._response, name) - - @property - async def pages(self) -> AsyncIterator[dataform.QueryCompilationResultActionsResponse]: - yield self._response - while self._response.next_page_token: - self._request.page_token = self._response.next_page_token - self._response = await self._method(self._request, metadata=self._metadata) - yield self._response - def __aiter__(self) -> AsyncIterator[dataform.CompilationResultAction]: - async def async_generator(): - async for page in self.pages: - for response in page.compilation_result_actions: - yield response - - return async_generator() - - def __repr__(self) -> str: - return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) - - -class ListWorkflowInvocationsPager: - """A pager for iterating through ``list_workflow_invocations`` requests. - - This class thinly wraps an initial - :class:`google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsResponse` object, and - provides an ``__iter__`` method to iterate through its - ``workflow_invocations`` field. - - If there are more pages, the ``__iter__`` method will make additional - ``ListWorkflowInvocations`` requests and continue to iterate - through the ``workflow_invocations`` field on the - corresponding responses. - - All the usual :class:`google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsResponse` - attributes are available on the pager. If multiple requests are made, only - the most recent response is retained, and thus used for attribute lookup. - """ - def __init__(self, - method: Callable[..., dataform.ListWorkflowInvocationsResponse], - request: dataform.ListWorkflowInvocationsRequest, - response: dataform.ListWorkflowInvocationsResponse, - *, - metadata: Sequence[Tuple[str, str]] = ()): - """Instantiate the pager. - - Args: - method (Callable): The method that was originally called, and - which instantiated this pager. - request (google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsRequest): - The initial request object. - response (google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsResponse): - The initial response object. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - self._method = method - self._request = dataform.ListWorkflowInvocationsRequest(request) - self._response = response - self._metadata = metadata - - def __getattr__(self, name: str) -> Any: - return getattr(self._response, name) - - @property - def pages(self) -> Iterator[dataform.ListWorkflowInvocationsResponse]: - yield self._response - while self._response.next_page_token: - self._request.page_token = self._response.next_page_token - self._response = self._method(self._request, metadata=self._metadata) - yield self._response - - def __iter__(self) -> Iterator[dataform.WorkflowInvocation]: - for page in self.pages: - yield from page.workflow_invocations - - def __repr__(self) -> str: - return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) - - -class ListWorkflowInvocationsAsyncPager: - """A pager for iterating through ``list_workflow_invocations`` requests. - - This class thinly wraps an initial - :class:`google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsResponse` object, and - provides an ``__aiter__`` method to iterate through its - ``workflow_invocations`` field. - - If there are more pages, the ``__aiter__`` method will make additional - ``ListWorkflowInvocations`` requests and continue to iterate - through the ``workflow_invocations`` field on the - corresponding responses. - - All the usual :class:`google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsResponse` - attributes are available on the pager. If multiple requests are made, only - the most recent response is retained, and thus used for attribute lookup. - """ - def __init__(self, - method: Callable[..., Awaitable[dataform.ListWorkflowInvocationsResponse]], - request: dataform.ListWorkflowInvocationsRequest, - response: dataform.ListWorkflowInvocationsResponse, - *, - metadata: Sequence[Tuple[str, str]] = ()): - """Instantiates the pager. - - Args: - method (Callable): The method that was originally called, and - which instantiated this pager. - request (google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsRequest): - The initial request object. - response (google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsResponse): - The initial response object. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - self._method = method - self._request = dataform.ListWorkflowInvocationsRequest(request) - self._response = response - self._metadata = metadata - - def __getattr__(self, name: str) -> Any: - return getattr(self._response, name) - - @property - async def pages(self) -> AsyncIterator[dataform.ListWorkflowInvocationsResponse]: - yield self._response - while self._response.next_page_token: - self._request.page_token = self._response.next_page_token - self._response = await self._method(self._request, metadata=self._metadata) - yield self._response - def __aiter__(self) -> AsyncIterator[dataform.WorkflowInvocation]: - async def async_generator(): - async for page in self.pages: - for response in page.workflow_invocations: - yield response - - return async_generator() - - def __repr__(self) -> str: - return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) - - -class QueryWorkflowInvocationActionsPager: - """A pager for iterating through ``query_workflow_invocation_actions`` requests. - - This class thinly wraps an initial - :class:`google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsResponse` object, and - provides an ``__iter__`` method to iterate through its - ``workflow_invocation_actions`` field. - - If there are more pages, the ``__iter__`` method will make additional - ``QueryWorkflowInvocationActions`` requests and continue to iterate - through the ``workflow_invocation_actions`` field on the - corresponding responses. - - All the usual :class:`google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsResponse` - attributes are available on the pager. If multiple requests are made, only - the most recent response is retained, and thus used for attribute lookup. - """ - def __init__(self, - method: Callable[..., dataform.QueryWorkflowInvocationActionsResponse], - request: dataform.QueryWorkflowInvocationActionsRequest, - response: dataform.QueryWorkflowInvocationActionsResponse, - *, - metadata: Sequence[Tuple[str, str]] = ()): - """Instantiate the pager. - - Args: - method (Callable): The method that was originally called, and - which instantiated this pager. - request (google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsRequest): - The initial request object. - response (google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsResponse): - The initial response object. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - self._method = method - self._request = dataform.QueryWorkflowInvocationActionsRequest(request) - self._response = response - self._metadata = metadata - - def __getattr__(self, name: str) -> Any: - return getattr(self._response, name) - - @property - def pages(self) -> Iterator[dataform.QueryWorkflowInvocationActionsResponse]: - yield self._response - while self._response.next_page_token: - self._request.page_token = self._response.next_page_token - self._response = self._method(self._request, metadata=self._metadata) - yield self._response - - def __iter__(self) -> Iterator[dataform.WorkflowInvocationAction]: - for page in self.pages: - yield from page.workflow_invocation_actions - - def __repr__(self) -> str: - return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) - - -class QueryWorkflowInvocationActionsAsyncPager: - """A pager for iterating through ``query_workflow_invocation_actions`` requests. - - This class thinly wraps an initial - :class:`google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsResponse` object, and - provides an ``__aiter__`` method to iterate through its - ``workflow_invocation_actions`` field. - - If there are more pages, the ``__aiter__`` method will make additional - ``QueryWorkflowInvocationActions`` requests and continue to iterate - through the ``workflow_invocation_actions`` field on the - corresponding responses. - - All the usual :class:`google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsResponse` - attributes are available on the pager. If multiple requests are made, only - the most recent response is retained, and thus used for attribute lookup. - """ - def __init__(self, - method: Callable[..., Awaitable[dataform.QueryWorkflowInvocationActionsResponse]], - request: dataform.QueryWorkflowInvocationActionsRequest, - response: dataform.QueryWorkflowInvocationActionsResponse, - *, - metadata: Sequence[Tuple[str, str]] = ()): - """Instantiates the pager. - - Args: - method (Callable): The method that was originally called, and - which instantiated this pager. - request (google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsRequest): - The initial request object. - response (google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsResponse): - The initial response object. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - """ - self._method = method - self._request = dataform.QueryWorkflowInvocationActionsRequest(request) - self._response = response - self._metadata = metadata - - def __getattr__(self, name: str) -> Any: - return getattr(self._response, name) - - @property - async def pages(self) -> AsyncIterator[dataform.QueryWorkflowInvocationActionsResponse]: - yield self._response - while self._response.next_page_token: - self._request.page_token = self._response.next_page_token - self._response = await self._method(self._request, metadata=self._metadata) - yield self._response - def __aiter__(self) -> AsyncIterator[dataform.WorkflowInvocationAction]: - async def async_generator(): - async for page in self.pages: - for response in page.workflow_invocation_actions: - yield response - - return async_generator() - - def __repr__(self) -> str: - return '{0}<{1!r}>'.format(self.__class__.__name__, self._response) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/__init__.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/__init__.py deleted file mode 100644 index c4201d8..0000000 --- a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -from collections import OrderedDict -from typing import Dict, Type - -from .base import DataformTransport -from .grpc import DataformGrpcTransport -from .grpc_asyncio import DataformGrpcAsyncIOTransport - - -# Compile a registry of transports. -_transport_registry = OrderedDict() # type: Dict[str, Type[DataformTransport]] -_transport_registry['grpc'] = DataformGrpcTransport -_transport_registry['grpc_asyncio'] = DataformGrpcAsyncIOTransport - -__all__ = ( - 'DataformTransport', - 'DataformGrpcTransport', - 'DataformGrpcAsyncIOTransport', -) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/base.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/base.py deleted file mode 100644 index a9b8db2..0000000 --- a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/base.py +++ /dev/null @@ -1,664 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -import abc -from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources - -import google.auth # type: ignore -import google.api_core -from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import retry as retries -from google.auth import credentials as ga_credentials # type: ignore -from google.oauth2 import service_account # type: ignore - -from google.cloud.dataform_v1beta1.types import dataform -from google.cloud.location import locations_pb2 # type: ignore -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore - -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - 'google-cloud-dataform', - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() - - -class DataformTransport(abc.ABC): - """Abstract transport class for Dataform.""" - - AUTH_SCOPES = ( - 'https://www.googleapis.com/auth/cloud-platform', - ) - - DEFAULT_HOST: str = 'dataform.googleapis.com' - def __init__( - self, *, - host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, - credentials_file: Optional[str] = None, - scopes: Optional[Sequence[str]] = None, - quota_project_id: Optional[str] = None, - client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, - always_use_jwt_access: Optional[bool] = False, - api_audience: Optional[str] = None, - **kwargs, - ) -> None: - """Instantiate the transport. - - Args: - host (Optional[str]): - The hostname to connect to. - credentials (Optional[google.auth.credentials.Credentials]): The - authorization credentials to attach to requests. These - credentials identify the application to the service; if none - are specified, the client will attempt to ascertain the - credentials from the environment. - credentials_file (Optional[str]): A file with credentials that can - be loaded with :func:`google.auth.load_credentials_from_file`. - This argument is mutually exclusive with credentials. - scopes (Optional[Sequence[str]]): A list of scopes. - quota_project_id (Optional[str]): An optional project to use for billing - and quota. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - always_use_jwt_access (Optional[bool]): Whether self signed JWT should - be used for service account credentials. - """ - - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - - # Save the scopes. - self._scopes = scopes - - # If no credentials are provided, then determine the appropriate - # defaults. - if credentials and credentials_file: - raise core_exceptions.DuplicateCredentialArgs("'credentials_file' and 'credentials' are mutually exclusive") - - if credentials_file is not None: - credentials, _ = google.auth.load_credentials_from_file( - credentials_file, - **scopes_kwargs, - quota_project_id=quota_project_id - ) - elif credentials is None: - credentials, _ = google.auth.default(**scopes_kwargs, quota_project_id=quota_project_id) - # Don't apply audience if the credentials file passed from user. - if hasattr(credentials, "with_gdch_audience"): - credentials = credentials.with_gdch_audience(api_audience if api_audience else host) - - # If the credentials are service account credentials, then always try to use self signed JWT. - if always_use_jwt_access and isinstance(credentials, service_account.Credentials) and hasattr(service_account.Credentials, "with_always_use_jwt_access"): - credentials = credentials.with_always_use_jwt_access(True) - - # Save the credentials. - self._credentials = credentials - - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ':' not in host: - host += ':443' - self._host = host - - def _prep_wrapped_messages(self, client_info): - # Precompute the wrapped methods. - self._wrapped_methods = { - self.list_repositories: gapic_v1.method.wrap_method( - self.list_repositories, - default_timeout=None, - client_info=client_info, - ), - self.get_repository: gapic_v1.method.wrap_method( - self.get_repository, - default_timeout=None, - client_info=client_info, - ), - self.create_repository: gapic_v1.method.wrap_method( - self.create_repository, - default_timeout=None, - client_info=client_info, - ), - self.update_repository: gapic_v1.method.wrap_method( - self.update_repository, - default_timeout=None, - client_info=client_info, - ), - self.delete_repository: gapic_v1.method.wrap_method( - self.delete_repository, - default_timeout=None, - client_info=client_info, - ), - self.fetch_remote_branches: gapic_v1.method.wrap_method( - self.fetch_remote_branches, - default_timeout=None, - client_info=client_info, - ), - self.list_workspaces: gapic_v1.method.wrap_method( - self.list_workspaces, - default_timeout=None, - client_info=client_info, - ), - self.get_workspace: gapic_v1.method.wrap_method( - self.get_workspace, - default_timeout=None, - client_info=client_info, - ), - self.create_workspace: gapic_v1.method.wrap_method( - self.create_workspace, - default_timeout=None, - client_info=client_info, - ), - self.delete_workspace: gapic_v1.method.wrap_method( - self.delete_workspace, - default_timeout=None, - client_info=client_info, - ), - self.install_npm_packages: gapic_v1.method.wrap_method( - self.install_npm_packages, - default_timeout=None, - client_info=client_info, - ), - self.pull_git_commits: gapic_v1.method.wrap_method( - self.pull_git_commits, - default_timeout=None, - client_info=client_info, - ), - self.push_git_commits: gapic_v1.method.wrap_method( - self.push_git_commits, - default_timeout=None, - client_info=client_info, - ), - self.fetch_file_git_statuses: gapic_v1.method.wrap_method( - self.fetch_file_git_statuses, - default_timeout=None, - client_info=client_info, - ), - self.fetch_git_ahead_behind: gapic_v1.method.wrap_method( - self.fetch_git_ahead_behind, - default_timeout=None, - client_info=client_info, - ), - self.commit_workspace_changes: gapic_v1.method.wrap_method( - self.commit_workspace_changes, - default_timeout=None, - client_info=client_info, - ), - self.reset_workspace_changes: gapic_v1.method.wrap_method( - self.reset_workspace_changes, - default_timeout=None, - client_info=client_info, - ), - self.fetch_file_diff: gapic_v1.method.wrap_method( - self.fetch_file_diff, - default_timeout=None, - client_info=client_info, - ), - self.query_directory_contents: gapic_v1.method.wrap_method( - self.query_directory_contents, - default_timeout=None, - client_info=client_info, - ), - self.make_directory: gapic_v1.method.wrap_method( - self.make_directory, - default_timeout=None, - client_info=client_info, - ), - self.remove_directory: gapic_v1.method.wrap_method( - self.remove_directory, - default_timeout=None, - client_info=client_info, - ), - self.move_directory: gapic_v1.method.wrap_method( - self.move_directory, - default_timeout=None, - client_info=client_info, - ), - self.read_file: gapic_v1.method.wrap_method( - self.read_file, - default_timeout=None, - client_info=client_info, - ), - self.remove_file: gapic_v1.method.wrap_method( - self.remove_file, - default_timeout=None, - client_info=client_info, - ), - self.move_file: gapic_v1.method.wrap_method( - self.move_file, - default_timeout=None, - client_info=client_info, - ), - self.write_file: gapic_v1.method.wrap_method( - self.write_file, - default_timeout=None, - client_info=client_info, - ), - self.list_compilation_results: gapic_v1.method.wrap_method( - self.list_compilation_results, - default_timeout=None, - client_info=client_info, - ), - self.get_compilation_result: gapic_v1.method.wrap_method( - self.get_compilation_result, - default_timeout=None, - client_info=client_info, - ), - self.create_compilation_result: gapic_v1.method.wrap_method( - self.create_compilation_result, - default_timeout=None, - client_info=client_info, - ), - self.query_compilation_result_actions: gapic_v1.method.wrap_method( - self.query_compilation_result_actions, - default_timeout=None, - client_info=client_info, - ), - self.list_workflow_invocations: gapic_v1.method.wrap_method( - self.list_workflow_invocations, - default_timeout=None, - client_info=client_info, - ), - self.get_workflow_invocation: gapic_v1.method.wrap_method( - self.get_workflow_invocation, - default_timeout=None, - client_info=client_info, - ), - self.create_workflow_invocation: gapic_v1.method.wrap_method( - self.create_workflow_invocation, - default_timeout=None, - client_info=client_info, - ), - self.delete_workflow_invocation: gapic_v1.method.wrap_method( - self.delete_workflow_invocation, - default_timeout=None, - client_info=client_info, - ), - self.cancel_workflow_invocation: gapic_v1.method.wrap_method( - self.cancel_workflow_invocation, - default_timeout=None, - client_info=client_info, - ), - self.query_workflow_invocation_actions: gapic_v1.method.wrap_method( - self.query_workflow_invocation_actions, - default_timeout=None, - client_info=client_info, - ), - } - - def close(self): - """Closes resources associated with the transport. - - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! - """ - raise NotImplementedError() - - @property - def list_repositories(self) -> Callable[ - [dataform.ListRepositoriesRequest], - Union[ - dataform.ListRepositoriesResponse, - Awaitable[dataform.ListRepositoriesResponse] - ]]: - raise NotImplementedError() - - @property - def get_repository(self) -> Callable[ - [dataform.GetRepositoryRequest], - Union[ - dataform.Repository, - Awaitable[dataform.Repository] - ]]: - raise NotImplementedError() - - @property - def create_repository(self) -> Callable[ - [dataform.CreateRepositoryRequest], - Union[ - dataform.Repository, - Awaitable[dataform.Repository] - ]]: - raise NotImplementedError() - - @property - def update_repository(self) -> Callable[ - [dataform.UpdateRepositoryRequest], - Union[ - dataform.Repository, - Awaitable[dataform.Repository] - ]]: - raise NotImplementedError() - - @property - def delete_repository(self) -> Callable[ - [dataform.DeleteRepositoryRequest], - Union[ - empty_pb2.Empty, - Awaitable[empty_pb2.Empty] - ]]: - raise NotImplementedError() - - @property - def fetch_remote_branches(self) -> Callable[ - [dataform.FetchRemoteBranchesRequest], - Union[ - dataform.FetchRemoteBranchesResponse, - Awaitable[dataform.FetchRemoteBranchesResponse] - ]]: - raise NotImplementedError() - - @property - def list_workspaces(self) -> Callable[ - [dataform.ListWorkspacesRequest], - Union[ - dataform.ListWorkspacesResponse, - Awaitable[dataform.ListWorkspacesResponse] - ]]: - raise NotImplementedError() - - @property - def get_workspace(self) -> Callable[ - [dataform.GetWorkspaceRequest], - Union[ - dataform.Workspace, - Awaitable[dataform.Workspace] - ]]: - raise NotImplementedError() - - @property - def create_workspace(self) -> Callable[ - [dataform.CreateWorkspaceRequest], - Union[ - dataform.Workspace, - Awaitable[dataform.Workspace] - ]]: - raise NotImplementedError() - - @property - def delete_workspace(self) -> Callable[ - [dataform.DeleteWorkspaceRequest], - Union[ - empty_pb2.Empty, - Awaitable[empty_pb2.Empty] - ]]: - raise NotImplementedError() - - @property - def install_npm_packages(self) -> Callable[ - [dataform.InstallNpmPackagesRequest], - Union[ - dataform.InstallNpmPackagesResponse, - Awaitable[dataform.InstallNpmPackagesResponse] - ]]: - raise NotImplementedError() - - @property - def pull_git_commits(self) -> Callable[ - [dataform.PullGitCommitsRequest], - Union[ - empty_pb2.Empty, - Awaitable[empty_pb2.Empty] - ]]: - raise NotImplementedError() - - @property - def push_git_commits(self) -> Callable[ - [dataform.PushGitCommitsRequest], - Union[ - empty_pb2.Empty, - Awaitable[empty_pb2.Empty] - ]]: - raise NotImplementedError() - - @property - def fetch_file_git_statuses(self) -> Callable[ - [dataform.FetchFileGitStatusesRequest], - Union[ - dataform.FetchFileGitStatusesResponse, - Awaitable[dataform.FetchFileGitStatusesResponse] - ]]: - raise NotImplementedError() - - @property - def fetch_git_ahead_behind(self) -> Callable[ - [dataform.FetchGitAheadBehindRequest], - Union[ - dataform.FetchGitAheadBehindResponse, - Awaitable[dataform.FetchGitAheadBehindResponse] - ]]: - raise NotImplementedError() - - @property - def commit_workspace_changes(self) -> Callable[ - [dataform.CommitWorkspaceChangesRequest], - Union[ - empty_pb2.Empty, - Awaitable[empty_pb2.Empty] - ]]: - raise NotImplementedError() - - @property - def reset_workspace_changes(self) -> Callable[ - [dataform.ResetWorkspaceChangesRequest], - Union[ - empty_pb2.Empty, - Awaitable[empty_pb2.Empty] - ]]: - raise NotImplementedError() - - @property - def fetch_file_diff(self) -> Callable[ - [dataform.FetchFileDiffRequest], - Union[ - dataform.FetchFileDiffResponse, - Awaitable[dataform.FetchFileDiffResponse] - ]]: - raise NotImplementedError() - - @property - def query_directory_contents(self) -> Callable[ - [dataform.QueryDirectoryContentsRequest], - Union[ - dataform.QueryDirectoryContentsResponse, - Awaitable[dataform.QueryDirectoryContentsResponse] - ]]: - raise NotImplementedError() - - @property - def make_directory(self) -> Callable[ - [dataform.MakeDirectoryRequest], - Union[ - dataform.MakeDirectoryResponse, - Awaitable[dataform.MakeDirectoryResponse] - ]]: - raise NotImplementedError() - - @property - def remove_directory(self) -> Callable[ - [dataform.RemoveDirectoryRequest], - Union[ - empty_pb2.Empty, - Awaitable[empty_pb2.Empty] - ]]: - raise NotImplementedError() - - @property - def move_directory(self) -> Callable[ - [dataform.MoveDirectoryRequest], - Union[ - dataform.MoveDirectoryResponse, - Awaitable[dataform.MoveDirectoryResponse] - ]]: - raise NotImplementedError() - - @property - def read_file(self) -> Callable[ - [dataform.ReadFileRequest], - Union[ - dataform.ReadFileResponse, - Awaitable[dataform.ReadFileResponse] - ]]: - raise NotImplementedError() - - @property - def remove_file(self) -> Callable[ - [dataform.RemoveFileRequest], - Union[ - empty_pb2.Empty, - Awaitable[empty_pb2.Empty] - ]]: - raise NotImplementedError() - - @property - def move_file(self) -> Callable[ - [dataform.MoveFileRequest], - Union[ - dataform.MoveFileResponse, - Awaitable[dataform.MoveFileResponse] - ]]: - raise NotImplementedError() - - @property - def write_file(self) -> Callable[ - [dataform.WriteFileRequest], - Union[ - dataform.WriteFileResponse, - Awaitable[dataform.WriteFileResponse] - ]]: - raise NotImplementedError() - - @property - def list_compilation_results(self) -> Callable[ - [dataform.ListCompilationResultsRequest], - Union[ - dataform.ListCompilationResultsResponse, - Awaitable[dataform.ListCompilationResultsResponse] - ]]: - raise NotImplementedError() - - @property - def get_compilation_result(self) -> Callable[ - [dataform.GetCompilationResultRequest], - Union[ - dataform.CompilationResult, - Awaitable[dataform.CompilationResult] - ]]: - raise NotImplementedError() - - @property - def create_compilation_result(self) -> Callable[ - [dataform.CreateCompilationResultRequest], - Union[ - dataform.CompilationResult, - Awaitable[dataform.CompilationResult] - ]]: - raise NotImplementedError() - - @property - def query_compilation_result_actions(self) -> Callable[ - [dataform.QueryCompilationResultActionsRequest], - Union[ - dataform.QueryCompilationResultActionsResponse, - Awaitable[dataform.QueryCompilationResultActionsResponse] - ]]: - raise NotImplementedError() - - @property - def list_workflow_invocations(self) -> Callable[ - [dataform.ListWorkflowInvocationsRequest], - Union[ - dataform.ListWorkflowInvocationsResponse, - Awaitable[dataform.ListWorkflowInvocationsResponse] - ]]: - raise NotImplementedError() - - @property - def get_workflow_invocation(self) -> Callable[ - [dataform.GetWorkflowInvocationRequest], - Union[ - dataform.WorkflowInvocation, - Awaitable[dataform.WorkflowInvocation] - ]]: - raise NotImplementedError() - - @property - def create_workflow_invocation(self) -> Callable[ - [dataform.CreateWorkflowInvocationRequest], - Union[ - dataform.WorkflowInvocation, - Awaitable[dataform.WorkflowInvocation] - ]]: - raise NotImplementedError() - - @property - def delete_workflow_invocation(self) -> Callable[ - [dataform.DeleteWorkflowInvocationRequest], - Union[ - empty_pb2.Empty, - Awaitable[empty_pb2.Empty] - ]]: - raise NotImplementedError() - - @property - def cancel_workflow_invocation(self) -> Callable[ - [dataform.CancelWorkflowInvocationRequest], - Union[ - empty_pb2.Empty, - Awaitable[empty_pb2.Empty] - ]]: - raise NotImplementedError() - - @property - def query_workflow_invocation_actions(self) -> Callable[ - [dataform.QueryWorkflowInvocationActionsRequest], - Union[ - dataform.QueryWorkflowInvocationActionsResponse, - Awaitable[dataform.QueryWorkflowInvocationActionsResponse] - ]]: - raise NotImplementedError() - - @property - def get_location(self, - ) -> Callable[ - [locations_pb2.GetLocationRequest], - Union[locations_pb2.Location, Awaitable[locations_pb2.Location]], - ]: - raise NotImplementedError() - - @property - def list_locations(self, - ) -> Callable[ - [locations_pb2.ListLocationsRequest], - Union[locations_pb2.ListLocationsResponse, Awaitable[locations_pb2.ListLocationsResponse]], - ]: - raise NotImplementedError() - - @property - def kind(self) -> str: - raise NotImplementedError() - - -__all__ = ( - 'DataformTransport', -) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/grpc.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/grpc.py deleted file mode 100644 index 1ca9e02..0000000 --- a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/grpc.py +++ /dev/null @@ -1,1231 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -import warnings -from typing import Callable, Dict, Optional, Sequence, Tuple, Union - -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 -import google.auth # type: ignore -from google.auth import credentials as ga_credentials # type: ignore -from google.auth.transport.grpc import SslCredentials # type: ignore - -import grpc # type: ignore - -from google.cloud.dataform_v1beta1.types import dataform -from google.cloud.location import locations_pb2 # type: ignore -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore -from .base import DataformTransport, DEFAULT_CLIENT_INFO - - -class DataformGrpcTransport(DataformTransport): - """gRPC backend transport for Dataform. - - Dataform is a service to develop, create, document, test, and - update curated tables in BigQuery. - - This class defines the same methods as the primary client, so the - primary client can load the underlying transport implementation - and call it. - - It sends protocol buffers over the wire using gRPC (which is built on - top of HTTP/2); the ``grpcio`` package must be installed. - """ - _stubs: Dict[str, Callable] - - def __init__(self, *, - host: str = 'dataform.googleapis.com', - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id: Optional[str] = None, - client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, - always_use_jwt_access: Optional[bool] = False, - api_audience: Optional[str] = None, - ) -> None: - """Instantiate the transport. - - Args: - host (Optional[str]): - The hostname to connect to. - credentials (Optional[google.auth.credentials.Credentials]): The - authorization credentials to attach to requests. These - credentials identify the application to the service; if none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is ignored if ``channel`` is provided. - credentials_file (Optional[str]): A file with credentials that can - be loaded with :func:`google.auth.load_credentials_from_file`. - This argument is ignored if ``channel`` is provided. - scopes (Optional(Sequence[str])): A list of scopes. This argument is - ignored if ``channel`` is provided. - channel (Optional[grpc.Channel]): A ``Channel`` instance through - which to make calls. - api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. - If provided, it overrides the ``host`` argument and tries to create - a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or application default SSL credentials. - client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): - Deprecated. A callback to provide client SSL certificate bytes and - private key bytes, both in PEM format. It is ignored if - ``api_mtls_endpoint`` is None. - ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for the grpc channel. It is ignored if ``channel`` is provided. - client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): - A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure a mutual TLS channel. It is - ignored if ``channel`` or ``ssl_channel_credentials`` is provided. - quota_project_id (Optional[str]): An optional project to use for billing - and quota. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - always_use_jwt_access (Optional[bool]): Whether self signed JWT should - be used for service account credentials. - - Raises: - google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport - creation failed for any reason. - google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` - and ``credentials_file`` are passed. - """ - self._grpc_channel = None - self._ssl_channel_credentials = ssl_channel_credentials - self._stubs: Dict[str, Callable] = {} - - if api_mtls_endpoint: - warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) - if client_cert_source: - warnings.warn("client_cert_source is deprecated", DeprecationWarning) - - if channel: - # Ignore credentials if a channel was passed. - credentials = False - # If a channel was explicitly provided, set it. - self._grpc_channel = channel - self._ssl_channel_credentials = None - - else: - if api_mtls_endpoint: - host = api_mtls_endpoint - - # Create SSL credentials with client_cert_source or application - # default SSL credentials. - if client_cert_source: - cert, key = client_cert_source() - self._ssl_channel_credentials = grpc.ssl_channel_credentials( - certificate_chain=cert, private_key=key - ) - else: - self._ssl_channel_credentials = SslCredentials().ssl_credentials - - else: - if client_cert_source_for_mtls and not ssl_channel_credentials: - cert, key = client_cert_source_for_mtls() - self._ssl_channel_credentials = grpc.ssl_channel_credentials( - certificate_chain=cert, private_key=key - ) - - # The base transport sets the host, credentials and scopes - super().__init__( - host=host, - credentials=credentials, - credentials_file=credentials_file, - scopes=scopes, - quota_project_id=quota_project_id, - client_info=client_info, - always_use_jwt_access=always_use_jwt_access, - api_audience=api_audience, - ) - - if not self._grpc_channel: - self._grpc_channel = type(self).create_channel( - self._host, - # use the credentials which are saved - credentials=self._credentials, - # Set ``credentials_file`` to ``None`` here as - # the credentials that we saved earlier should be used. - credentials_file=None, - scopes=self._scopes, - ssl_credentials=self._ssl_channel_credentials, - quota_project_id=quota_project_id, - options=[ - ("grpc.max_send_message_length", -1), - ("grpc.max_receive_message_length", -1), - ], - ) - - # Wrap messages. This must be done after self._grpc_channel exists - self._prep_wrapped_messages(client_info) - - @classmethod - def create_channel(cls, - host: str = 'dataform.googleapis.com', - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Optional[Sequence[str]] = None, - quota_project_id: Optional[str] = None, - **kwargs) -> grpc.Channel: - """Create and return a gRPC channel object. - Args: - host (Optional[str]): The host for the channel to use. - credentials (Optional[~.Credentials]): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - credentials_file (Optional[str]): A file with credentials that can - be loaded with :func:`google.auth.load_credentials_from_file`. - This argument is mutually exclusive with credentials. - scopes (Optional[Sequence[str]]): A optional list of scopes needed for this - service. These are only used when credentials are not specified and - are passed to :func:`google.auth.default`. - quota_project_id (Optional[str]): An optional project to use for billing - and quota. - kwargs (Optional[dict]): Keyword arguments, which are passed to the - channel creation. - Returns: - grpc.Channel: A gRPC channel object. - - Raises: - google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` - and ``credentials_file`` are passed. - """ - - return grpc_helpers.create_channel( - host, - credentials=credentials, - credentials_file=credentials_file, - quota_project_id=quota_project_id, - default_scopes=cls.AUTH_SCOPES, - scopes=scopes, - default_host=cls.DEFAULT_HOST, - **kwargs - ) - - @property - def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ - return self._grpc_channel - - @property - def list_repositories(self) -> Callable[ - [dataform.ListRepositoriesRequest], - dataform.ListRepositoriesResponse]: - r"""Return a callable for the list repositories method over gRPC. - - Lists Repositories in a given project and location. - - Returns: - Callable[[~.ListRepositoriesRequest], - ~.ListRepositoriesResponse]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'list_repositories' not in self._stubs: - self._stubs['list_repositories'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/ListRepositories', - request_serializer=dataform.ListRepositoriesRequest.serialize, - response_deserializer=dataform.ListRepositoriesResponse.deserialize, - ) - return self._stubs['list_repositories'] - - @property - def get_repository(self) -> Callable[ - [dataform.GetRepositoryRequest], - dataform.Repository]: - r"""Return a callable for the get repository method over gRPC. - - Fetches a single Repository. - - Returns: - Callable[[~.GetRepositoryRequest], - ~.Repository]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'get_repository' not in self._stubs: - self._stubs['get_repository'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/GetRepository', - request_serializer=dataform.GetRepositoryRequest.serialize, - response_deserializer=dataform.Repository.deserialize, - ) - return self._stubs['get_repository'] - - @property - def create_repository(self) -> Callable[ - [dataform.CreateRepositoryRequest], - dataform.Repository]: - r"""Return a callable for the create repository method over gRPC. - - Creates a new Repository in a given project and - location. - - Returns: - Callable[[~.CreateRepositoryRequest], - ~.Repository]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'create_repository' not in self._stubs: - self._stubs['create_repository'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/CreateRepository', - request_serializer=dataform.CreateRepositoryRequest.serialize, - response_deserializer=dataform.Repository.deserialize, - ) - return self._stubs['create_repository'] - - @property - def update_repository(self) -> Callable[ - [dataform.UpdateRepositoryRequest], - dataform.Repository]: - r"""Return a callable for the update repository method over gRPC. - - Updates a single Repository. - - Returns: - Callable[[~.UpdateRepositoryRequest], - ~.Repository]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'update_repository' not in self._stubs: - self._stubs['update_repository'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/UpdateRepository', - request_serializer=dataform.UpdateRepositoryRequest.serialize, - response_deserializer=dataform.Repository.deserialize, - ) - return self._stubs['update_repository'] - - @property - def delete_repository(self) -> Callable[ - [dataform.DeleteRepositoryRequest], - empty_pb2.Empty]: - r"""Return a callable for the delete repository method over gRPC. - - Deletes a single Repository. - - Returns: - Callable[[~.DeleteRepositoryRequest], - ~.Empty]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'delete_repository' not in self._stubs: - self._stubs['delete_repository'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/DeleteRepository', - request_serializer=dataform.DeleteRepositoryRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['delete_repository'] - - @property - def fetch_remote_branches(self) -> Callable[ - [dataform.FetchRemoteBranchesRequest], - dataform.FetchRemoteBranchesResponse]: - r"""Return a callable for the fetch remote branches method over gRPC. - - Fetches a Repository's remote branches. - - Returns: - Callable[[~.FetchRemoteBranchesRequest], - ~.FetchRemoteBranchesResponse]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'fetch_remote_branches' not in self._stubs: - self._stubs['fetch_remote_branches'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/FetchRemoteBranches', - request_serializer=dataform.FetchRemoteBranchesRequest.serialize, - response_deserializer=dataform.FetchRemoteBranchesResponse.deserialize, - ) - return self._stubs['fetch_remote_branches'] - - @property - def list_workspaces(self) -> Callable[ - [dataform.ListWorkspacesRequest], - dataform.ListWorkspacesResponse]: - r"""Return a callable for the list workspaces method over gRPC. - - Lists Workspaces in a given Repository. - - Returns: - Callable[[~.ListWorkspacesRequest], - ~.ListWorkspacesResponse]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'list_workspaces' not in self._stubs: - self._stubs['list_workspaces'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/ListWorkspaces', - request_serializer=dataform.ListWorkspacesRequest.serialize, - response_deserializer=dataform.ListWorkspacesResponse.deserialize, - ) - return self._stubs['list_workspaces'] - - @property - def get_workspace(self) -> Callable[ - [dataform.GetWorkspaceRequest], - dataform.Workspace]: - r"""Return a callable for the get workspace method over gRPC. - - Fetches a single Workspace. - - Returns: - Callable[[~.GetWorkspaceRequest], - ~.Workspace]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'get_workspace' not in self._stubs: - self._stubs['get_workspace'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/GetWorkspace', - request_serializer=dataform.GetWorkspaceRequest.serialize, - response_deserializer=dataform.Workspace.deserialize, - ) - return self._stubs['get_workspace'] - - @property - def create_workspace(self) -> Callable[ - [dataform.CreateWorkspaceRequest], - dataform.Workspace]: - r"""Return a callable for the create workspace method over gRPC. - - Creates a new Workspace in a given Repository. - - Returns: - Callable[[~.CreateWorkspaceRequest], - ~.Workspace]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'create_workspace' not in self._stubs: - self._stubs['create_workspace'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/CreateWorkspace', - request_serializer=dataform.CreateWorkspaceRequest.serialize, - response_deserializer=dataform.Workspace.deserialize, - ) - return self._stubs['create_workspace'] - - @property - def delete_workspace(self) -> Callable[ - [dataform.DeleteWorkspaceRequest], - empty_pb2.Empty]: - r"""Return a callable for the delete workspace method over gRPC. - - Deletes a single Workspace. - - Returns: - Callable[[~.DeleteWorkspaceRequest], - ~.Empty]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'delete_workspace' not in self._stubs: - self._stubs['delete_workspace'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/DeleteWorkspace', - request_serializer=dataform.DeleteWorkspaceRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['delete_workspace'] - - @property - def install_npm_packages(self) -> Callable[ - [dataform.InstallNpmPackagesRequest], - dataform.InstallNpmPackagesResponse]: - r"""Return a callable for the install npm packages method over gRPC. - - Installs dependency NPM packages (inside a - Workspace). - - Returns: - Callable[[~.InstallNpmPackagesRequest], - ~.InstallNpmPackagesResponse]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'install_npm_packages' not in self._stubs: - self._stubs['install_npm_packages'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/InstallNpmPackages', - request_serializer=dataform.InstallNpmPackagesRequest.serialize, - response_deserializer=dataform.InstallNpmPackagesResponse.deserialize, - ) - return self._stubs['install_npm_packages'] - - @property - def pull_git_commits(self) -> Callable[ - [dataform.PullGitCommitsRequest], - empty_pb2.Empty]: - r"""Return a callable for the pull git commits method over gRPC. - - Pulls Git commits from the Repository's remote into a - Workspace. - - Returns: - Callable[[~.PullGitCommitsRequest], - ~.Empty]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'pull_git_commits' not in self._stubs: - self._stubs['pull_git_commits'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/PullGitCommits', - request_serializer=dataform.PullGitCommitsRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['pull_git_commits'] - - @property - def push_git_commits(self) -> Callable[ - [dataform.PushGitCommitsRequest], - empty_pb2.Empty]: - r"""Return a callable for the push git commits method over gRPC. - - Pushes Git commits from a Workspace to the - Repository's remote. - - Returns: - Callable[[~.PushGitCommitsRequest], - ~.Empty]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'push_git_commits' not in self._stubs: - self._stubs['push_git_commits'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/PushGitCommits', - request_serializer=dataform.PushGitCommitsRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['push_git_commits'] - - @property - def fetch_file_git_statuses(self) -> Callable[ - [dataform.FetchFileGitStatusesRequest], - dataform.FetchFileGitStatusesResponse]: - r"""Return a callable for the fetch file git statuses method over gRPC. - - Fetches Git statuses for the files in a Workspace. - - Returns: - Callable[[~.FetchFileGitStatusesRequest], - ~.FetchFileGitStatusesResponse]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'fetch_file_git_statuses' not in self._stubs: - self._stubs['fetch_file_git_statuses'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/FetchFileGitStatuses', - request_serializer=dataform.FetchFileGitStatusesRequest.serialize, - response_deserializer=dataform.FetchFileGitStatusesResponse.deserialize, - ) - return self._stubs['fetch_file_git_statuses'] - - @property - def fetch_git_ahead_behind(self) -> Callable[ - [dataform.FetchGitAheadBehindRequest], - dataform.FetchGitAheadBehindResponse]: - r"""Return a callable for the fetch git ahead behind method over gRPC. - - Fetches Git ahead/behind against a remote branch. - - Returns: - Callable[[~.FetchGitAheadBehindRequest], - ~.FetchGitAheadBehindResponse]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'fetch_git_ahead_behind' not in self._stubs: - self._stubs['fetch_git_ahead_behind'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/FetchGitAheadBehind', - request_serializer=dataform.FetchGitAheadBehindRequest.serialize, - response_deserializer=dataform.FetchGitAheadBehindResponse.deserialize, - ) - return self._stubs['fetch_git_ahead_behind'] - - @property - def commit_workspace_changes(self) -> Callable[ - [dataform.CommitWorkspaceChangesRequest], - empty_pb2.Empty]: - r"""Return a callable for the commit workspace changes method over gRPC. - - Applies a Git commit for uncommitted files in a - Workspace. - - Returns: - Callable[[~.CommitWorkspaceChangesRequest], - ~.Empty]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'commit_workspace_changes' not in self._stubs: - self._stubs['commit_workspace_changes'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/CommitWorkspaceChanges', - request_serializer=dataform.CommitWorkspaceChangesRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['commit_workspace_changes'] - - @property - def reset_workspace_changes(self) -> Callable[ - [dataform.ResetWorkspaceChangesRequest], - empty_pb2.Empty]: - r"""Return a callable for the reset workspace changes method over gRPC. - - Performs a Git reset for uncommitted files in a - Workspace. - - Returns: - Callable[[~.ResetWorkspaceChangesRequest], - ~.Empty]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'reset_workspace_changes' not in self._stubs: - self._stubs['reset_workspace_changes'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/ResetWorkspaceChanges', - request_serializer=dataform.ResetWorkspaceChangesRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['reset_workspace_changes'] - - @property - def fetch_file_diff(self) -> Callable[ - [dataform.FetchFileDiffRequest], - dataform.FetchFileDiffResponse]: - r"""Return a callable for the fetch file diff method over gRPC. - - Fetches Git diff for an uncommitted file in a - Workspace. - - Returns: - Callable[[~.FetchFileDiffRequest], - ~.FetchFileDiffResponse]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'fetch_file_diff' not in self._stubs: - self._stubs['fetch_file_diff'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/FetchFileDiff', - request_serializer=dataform.FetchFileDiffRequest.serialize, - response_deserializer=dataform.FetchFileDiffResponse.deserialize, - ) - return self._stubs['fetch_file_diff'] - - @property - def query_directory_contents(self) -> Callable[ - [dataform.QueryDirectoryContentsRequest], - dataform.QueryDirectoryContentsResponse]: - r"""Return a callable for the query directory contents method over gRPC. - - Returns the contents of a given Workspace directory. - - Returns: - Callable[[~.QueryDirectoryContentsRequest], - ~.QueryDirectoryContentsResponse]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'query_directory_contents' not in self._stubs: - self._stubs['query_directory_contents'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/QueryDirectoryContents', - request_serializer=dataform.QueryDirectoryContentsRequest.serialize, - response_deserializer=dataform.QueryDirectoryContentsResponse.deserialize, - ) - return self._stubs['query_directory_contents'] - - @property - def make_directory(self) -> Callable[ - [dataform.MakeDirectoryRequest], - dataform.MakeDirectoryResponse]: - r"""Return a callable for the make directory method over gRPC. - - Creates a directory inside a Workspace. - - Returns: - Callable[[~.MakeDirectoryRequest], - ~.MakeDirectoryResponse]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'make_directory' not in self._stubs: - self._stubs['make_directory'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/MakeDirectory', - request_serializer=dataform.MakeDirectoryRequest.serialize, - response_deserializer=dataform.MakeDirectoryResponse.deserialize, - ) - return self._stubs['make_directory'] - - @property - def remove_directory(self) -> Callable[ - [dataform.RemoveDirectoryRequest], - empty_pb2.Empty]: - r"""Return a callable for the remove directory method over gRPC. - - Deletes a directory (inside a Workspace) and all of - its contents. - - Returns: - Callable[[~.RemoveDirectoryRequest], - ~.Empty]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'remove_directory' not in self._stubs: - self._stubs['remove_directory'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/RemoveDirectory', - request_serializer=dataform.RemoveDirectoryRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['remove_directory'] - - @property - def move_directory(self) -> Callable[ - [dataform.MoveDirectoryRequest], - dataform.MoveDirectoryResponse]: - r"""Return a callable for the move directory method over gRPC. - - Moves a directory (inside a Workspace), and all of - its contents, to a new location. - - Returns: - Callable[[~.MoveDirectoryRequest], - ~.MoveDirectoryResponse]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'move_directory' not in self._stubs: - self._stubs['move_directory'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/MoveDirectory', - request_serializer=dataform.MoveDirectoryRequest.serialize, - response_deserializer=dataform.MoveDirectoryResponse.deserialize, - ) - return self._stubs['move_directory'] - - @property - def read_file(self) -> Callable[ - [dataform.ReadFileRequest], - dataform.ReadFileResponse]: - r"""Return a callable for the read file method over gRPC. - - Returns the contents of a file (inside a Workspace). - - Returns: - Callable[[~.ReadFileRequest], - ~.ReadFileResponse]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'read_file' not in self._stubs: - self._stubs['read_file'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/ReadFile', - request_serializer=dataform.ReadFileRequest.serialize, - response_deserializer=dataform.ReadFileResponse.deserialize, - ) - return self._stubs['read_file'] - - @property - def remove_file(self) -> Callable[ - [dataform.RemoveFileRequest], - empty_pb2.Empty]: - r"""Return a callable for the remove file method over gRPC. - - Deletes a file (inside a Workspace). - - Returns: - Callable[[~.RemoveFileRequest], - ~.Empty]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'remove_file' not in self._stubs: - self._stubs['remove_file'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/RemoveFile', - request_serializer=dataform.RemoveFileRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['remove_file'] - - @property - def move_file(self) -> Callable[ - [dataform.MoveFileRequest], - dataform.MoveFileResponse]: - r"""Return a callable for the move file method over gRPC. - - Moves a file (inside a Workspace) to a new location. - - Returns: - Callable[[~.MoveFileRequest], - ~.MoveFileResponse]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'move_file' not in self._stubs: - self._stubs['move_file'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/MoveFile', - request_serializer=dataform.MoveFileRequest.serialize, - response_deserializer=dataform.MoveFileResponse.deserialize, - ) - return self._stubs['move_file'] - - @property - def write_file(self) -> Callable[ - [dataform.WriteFileRequest], - dataform.WriteFileResponse]: - r"""Return a callable for the write file method over gRPC. - - Writes to a file (inside a Workspace). - - Returns: - Callable[[~.WriteFileRequest], - ~.WriteFileResponse]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'write_file' not in self._stubs: - self._stubs['write_file'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/WriteFile', - request_serializer=dataform.WriteFileRequest.serialize, - response_deserializer=dataform.WriteFileResponse.deserialize, - ) - return self._stubs['write_file'] - - @property - def list_compilation_results(self) -> Callable[ - [dataform.ListCompilationResultsRequest], - dataform.ListCompilationResultsResponse]: - r"""Return a callable for the list compilation results method over gRPC. - - Lists CompilationResults in a given Repository. - - Returns: - Callable[[~.ListCompilationResultsRequest], - ~.ListCompilationResultsResponse]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'list_compilation_results' not in self._stubs: - self._stubs['list_compilation_results'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/ListCompilationResults', - request_serializer=dataform.ListCompilationResultsRequest.serialize, - response_deserializer=dataform.ListCompilationResultsResponse.deserialize, - ) - return self._stubs['list_compilation_results'] - - @property - def get_compilation_result(self) -> Callable[ - [dataform.GetCompilationResultRequest], - dataform.CompilationResult]: - r"""Return a callable for the get compilation result method over gRPC. - - Fetches a single CompilationResult. - - Returns: - Callable[[~.GetCompilationResultRequest], - ~.CompilationResult]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'get_compilation_result' not in self._stubs: - self._stubs['get_compilation_result'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/GetCompilationResult', - request_serializer=dataform.GetCompilationResultRequest.serialize, - response_deserializer=dataform.CompilationResult.deserialize, - ) - return self._stubs['get_compilation_result'] - - @property - def create_compilation_result(self) -> Callable[ - [dataform.CreateCompilationResultRequest], - dataform.CompilationResult]: - r"""Return a callable for the create compilation result method over gRPC. - - Creates a new CompilationResult in a given project - and location. - - Returns: - Callable[[~.CreateCompilationResultRequest], - ~.CompilationResult]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'create_compilation_result' not in self._stubs: - self._stubs['create_compilation_result'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/CreateCompilationResult', - request_serializer=dataform.CreateCompilationResultRequest.serialize, - response_deserializer=dataform.CompilationResult.deserialize, - ) - return self._stubs['create_compilation_result'] - - @property - def query_compilation_result_actions(self) -> Callable[ - [dataform.QueryCompilationResultActionsRequest], - dataform.QueryCompilationResultActionsResponse]: - r"""Return a callable for the query compilation result - actions method over gRPC. - - Returns CompilationResultActions in a given - CompilationResult. - - Returns: - Callable[[~.QueryCompilationResultActionsRequest], - ~.QueryCompilationResultActionsResponse]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'query_compilation_result_actions' not in self._stubs: - self._stubs['query_compilation_result_actions'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/QueryCompilationResultActions', - request_serializer=dataform.QueryCompilationResultActionsRequest.serialize, - response_deserializer=dataform.QueryCompilationResultActionsResponse.deserialize, - ) - return self._stubs['query_compilation_result_actions'] - - @property - def list_workflow_invocations(self) -> Callable[ - [dataform.ListWorkflowInvocationsRequest], - dataform.ListWorkflowInvocationsResponse]: - r"""Return a callable for the list workflow invocations method over gRPC. - - Lists WorkflowInvocations in a given Repository. - - Returns: - Callable[[~.ListWorkflowInvocationsRequest], - ~.ListWorkflowInvocationsResponse]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'list_workflow_invocations' not in self._stubs: - self._stubs['list_workflow_invocations'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/ListWorkflowInvocations', - request_serializer=dataform.ListWorkflowInvocationsRequest.serialize, - response_deserializer=dataform.ListWorkflowInvocationsResponse.deserialize, - ) - return self._stubs['list_workflow_invocations'] - - @property - def get_workflow_invocation(self) -> Callable[ - [dataform.GetWorkflowInvocationRequest], - dataform.WorkflowInvocation]: - r"""Return a callable for the get workflow invocation method over gRPC. - - Fetches a single WorkflowInvocation. - - Returns: - Callable[[~.GetWorkflowInvocationRequest], - ~.WorkflowInvocation]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'get_workflow_invocation' not in self._stubs: - self._stubs['get_workflow_invocation'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/GetWorkflowInvocation', - request_serializer=dataform.GetWorkflowInvocationRequest.serialize, - response_deserializer=dataform.WorkflowInvocation.deserialize, - ) - return self._stubs['get_workflow_invocation'] - - @property - def create_workflow_invocation(self) -> Callable[ - [dataform.CreateWorkflowInvocationRequest], - dataform.WorkflowInvocation]: - r"""Return a callable for the create workflow invocation method over gRPC. - - Creates a new WorkflowInvocation in a given - Repository. - - Returns: - Callable[[~.CreateWorkflowInvocationRequest], - ~.WorkflowInvocation]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'create_workflow_invocation' not in self._stubs: - self._stubs['create_workflow_invocation'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/CreateWorkflowInvocation', - request_serializer=dataform.CreateWorkflowInvocationRequest.serialize, - response_deserializer=dataform.WorkflowInvocation.deserialize, - ) - return self._stubs['create_workflow_invocation'] - - @property - def delete_workflow_invocation(self) -> Callable[ - [dataform.DeleteWorkflowInvocationRequest], - empty_pb2.Empty]: - r"""Return a callable for the delete workflow invocation method over gRPC. - - Deletes a single WorkflowInvocation. - - Returns: - Callable[[~.DeleteWorkflowInvocationRequest], - ~.Empty]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'delete_workflow_invocation' not in self._stubs: - self._stubs['delete_workflow_invocation'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/DeleteWorkflowInvocation', - request_serializer=dataform.DeleteWorkflowInvocationRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['delete_workflow_invocation'] - - @property - def cancel_workflow_invocation(self) -> Callable[ - [dataform.CancelWorkflowInvocationRequest], - empty_pb2.Empty]: - r"""Return a callable for the cancel workflow invocation method over gRPC. - - Requests cancellation of a running - WorkflowInvocation. - - Returns: - Callable[[~.CancelWorkflowInvocationRequest], - ~.Empty]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'cancel_workflow_invocation' not in self._stubs: - self._stubs['cancel_workflow_invocation'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/CancelWorkflowInvocation', - request_serializer=dataform.CancelWorkflowInvocationRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['cancel_workflow_invocation'] - - @property - def query_workflow_invocation_actions(self) -> Callable[ - [dataform.QueryWorkflowInvocationActionsRequest], - dataform.QueryWorkflowInvocationActionsResponse]: - r"""Return a callable for the query workflow invocation - actions method over gRPC. - - Returns WorkflowInvocationActions in a given - WorkflowInvocation. - - Returns: - Callable[[~.QueryWorkflowInvocationActionsRequest], - ~.QueryWorkflowInvocationActionsResponse]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'query_workflow_invocation_actions' not in self._stubs: - self._stubs['query_workflow_invocation_actions'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/QueryWorkflowInvocationActions', - request_serializer=dataform.QueryWorkflowInvocationActionsRequest.serialize, - response_deserializer=dataform.QueryWorkflowInvocationActionsResponse.deserialize, - ) - return self._stubs['query_workflow_invocation_actions'] - - def close(self): - self.grpc_channel.close() - - @property - def list_locations( - self, - ) -> Callable[[locations_pb2.ListLocationsRequest], locations_pb2.ListLocationsResponse]: - r"""Return a callable for the list locations method over gRPC. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if "list_locations" not in self._stubs: - self._stubs["list_locations"] = self.grpc_channel.unary_unary( - "/google.cloud.location.Locations/ListLocations", - request_serializer=locations_pb2.ListLocationsRequest.SerializeToString, - response_deserializer=locations_pb2.ListLocationsResponse.FromString, - ) - return self._stubs["list_locations"] - - @property - def get_location( - self, - ) -> Callable[[locations_pb2.GetLocationRequest], locations_pb2.Location]: - r"""Return a callable for the list locations method over gRPC. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if "get_location" not in self._stubs: - self._stubs["get_location"] = self.grpc_channel.unary_unary( - "/google.cloud.location.Locations/GetLocation", - request_serializer=locations_pb2.GetLocationRequest.SerializeToString, - response_deserializer=locations_pb2.Location.FromString, - ) - return self._stubs["get_location"] - - @property - def kind(self) -> str: - return "grpc" - - -__all__ = ( - 'DataformGrpcTransport', -) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/grpc_asyncio.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/grpc_asyncio.py deleted file mode 100644 index 31672b4..0000000 --- a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/services/dataform/transports/grpc_asyncio.py +++ /dev/null @@ -1,1230 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -import warnings -from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union - -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async -from google.auth import credentials as ga_credentials # type: ignore -from google.auth.transport.grpc import SslCredentials # type: ignore - -import grpc # type: ignore -from grpc.experimental import aio # type: ignore - -from google.cloud.dataform_v1beta1.types import dataform -from google.cloud.location import locations_pb2 # type: ignore -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore -from .base import DataformTransport, DEFAULT_CLIENT_INFO -from .grpc import DataformGrpcTransport - - -class DataformGrpcAsyncIOTransport(DataformTransport): - """gRPC AsyncIO backend transport for Dataform. - - Dataform is a service to develop, create, document, test, and - update curated tables in BigQuery. - - This class defines the same methods as the primary client, so the - primary client can load the underlying transport implementation - and call it. - - It sends protocol buffers over the wire using gRPC (which is built on - top of HTTP/2); the ``grpcio`` package must be installed. - """ - - _grpc_channel: aio.Channel - _stubs: Dict[str, Callable] = {} - - @classmethod - def create_channel(cls, - host: str = 'dataform.googleapis.com', - credentials: ga_credentials.Credentials = None, - credentials_file: Optional[str] = None, - scopes: Optional[Sequence[str]] = None, - quota_project_id: Optional[str] = None, - **kwargs) -> aio.Channel: - """Create and return a gRPC AsyncIO channel object. - Args: - host (Optional[str]): The host for the channel to use. - credentials (Optional[~.Credentials]): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - credentials_file (Optional[str]): A file with credentials that can - be loaded with :func:`google.auth.load_credentials_from_file`. - This argument is ignored if ``channel`` is provided. - scopes (Optional[Sequence[str]]): A optional list of scopes needed for this - service. These are only used when credentials are not specified and - are passed to :func:`google.auth.default`. - quota_project_id (Optional[str]): An optional project to use for billing - and quota. - kwargs (Optional[dict]): Keyword arguments, which are passed to the - channel creation. - Returns: - aio.Channel: A gRPC AsyncIO channel object. - """ - - return grpc_helpers_async.create_channel( - host, - credentials=credentials, - credentials_file=credentials_file, - quota_project_id=quota_project_id, - default_scopes=cls.AUTH_SCOPES, - scopes=scopes, - default_host=cls.DEFAULT_HOST, - **kwargs - ) - - def __init__(self, *, - host: str = 'dataform.googleapis.com', - credentials: ga_credentials.Credentials = None, - credentials_file: Optional[str] = None, - scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, - client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, - always_use_jwt_access: Optional[bool] = False, - api_audience: Optional[str] = None, - ) -> None: - """Instantiate the transport. - - Args: - host (Optional[str]): - The hostname to connect to. - credentials (Optional[google.auth.credentials.Credentials]): The - authorization credentials to attach to requests. These - credentials identify the application to the service; if none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is ignored if ``channel`` is provided. - credentials_file (Optional[str]): A file with credentials that can - be loaded with :func:`google.auth.load_credentials_from_file`. - This argument is ignored if ``channel`` is provided. - scopes (Optional[Sequence[str]]): A optional list of scopes needed for this - service. These are only used when credentials are not specified and - are passed to :func:`google.auth.default`. - channel (Optional[aio.Channel]): A ``Channel`` instance through - which to make calls. - api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. - If provided, it overrides the ``host`` argument and tries to create - a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or application default SSL credentials. - client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): - Deprecated. A callback to provide client SSL certificate bytes and - private key bytes, both in PEM format. It is ignored if - ``api_mtls_endpoint`` is None. - ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for the grpc channel. It is ignored if ``channel`` is provided. - client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): - A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure a mutual TLS channel. It is - ignored if ``channel`` or ``ssl_channel_credentials`` is provided. - quota_project_id (Optional[str]): An optional project to use for billing - and quota. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - always_use_jwt_access (Optional[bool]): Whether self signed JWT should - be used for service account credentials. - - Raises: - google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport - creation failed for any reason. - google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` - and ``credentials_file`` are passed. - """ - self._grpc_channel = None - self._ssl_channel_credentials = ssl_channel_credentials - self._stubs: Dict[str, Callable] = {} - - if api_mtls_endpoint: - warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) - if client_cert_source: - warnings.warn("client_cert_source is deprecated", DeprecationWarning) - - if channel: - # Ignore credentials if a channel was passed. - credentials = False - # If a channel was explicitly provided, set it. - self._grpc_channel = channel - self._ssl_channel_credentials = None - else: - if api_mtls_endpoint: - host = api_mtls_endpoint - - # Create SSL credentials with client_cert_source or application - # default SSL credentials. - if client_cert_source: - cert, key = client_cert_source() - self._ssl_channel_credentials = grpc.ssl_channel_credentials( - certificate_chain=cert, private_key=key - ) - else: - self._ssl_channel_credentials = SslCredentials().ssl_credentials - - else: - if client_cert_source_for_mtls and not ssl_channel_credentials: - cert, key = client_cert_source_for_mtls() - self._ssl_channel_credentials = grpc.ssl_channel_credentials( - certificate_chain=cert, private_key=key - ) - - # The base transport sets the host, credentials and scopes - super().__init__( - host=host, - credentials=credentials, - credentials_file=credentials_file, - scopes=scopes, - quota_project_id=quota_project_id, - client_info=client_info, - always_use_jwt_access=always_use_jwt_access, - api_audience=api_audience, - ) - - if not self._grpc_channel: - self._grpc_channel = type(self).create_channel( - self._host, - # use the credentials which are saved - credentials=self._credentials, - # Set ``credentials_file`` to ``None`` here as - # the credentials that we saved earlier should be used. - credentials_file=None, - scopes=self._scopes, - ssl_credentials=self._ssl_channel_credentials, - quota_project_id=quota_project_id, - options=[ - ("grpc.max_send_message_length", -1), - ("grpc.max_receive_message_length", -1), - ], - ) - - # Wrap messages. This must be done after self._grpc_channel exists - self._prep_wrapped_messages(client_info) - - @property - def grpc_channel(self) -> aio.Channel: - """Create the channel designed to connect to this service. - - This property caches on the instance; repeated calls return - the same channel. - """ - # Return the channel from cache. - return self._grpc_channel - - @property - def list_repositories(self) -> Callable[ - [dataform.ListRepositoriesRequest], - Awaitable[dataform.ListRepositoriesResponse]]: - r"""Return a callable for the list repositories method over gRPC. - - Lists Repositories in a given project and location. - - Returns: - Callable[[~.ListRepositoriesRequest], - Awaitable[~.ListRepositoriesResponse]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'list_repositories' not in self._stubs: - self._stubs['list_repositories'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/ListRepositories', - request_serializer=dataform.ListRepositoriesRequest.serialize, - response_deserializer=dataform.ListRepositoriesResponse.deserialize, - ) - return self._stubs['list_repositories'] - - @property - def get_repository(self) -> Callable[ - [dataform.GetRepositoryRequest], - Awaitable[dataform.Repository]]: - r"""Return a callable for the get repository method over gRPC. - - Fetches a single Repository. - - Returns: - Callable[[~.GetRepositoryRequest], - Awaitable[~.Repository]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'get_repository' not in self._stubs: - self._stubs['get_repository'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/GetRepository', - request_serializer=dataform.GetRepositoryRequest.serialize, - response_deserializer=dataform.Repository.deserialize, - ) - return self._stubs['get_repository'] - - @property - def create_repository(self) -> Callable[ - [dataform.CreateRepositoryRequest], - Awaitable[dataform.Repository]]: - r"""Return a callable for the create repository method over gRPC. - - Creates a new Repository in a given project and - location. - - Returns: - Callable[[~.CreateRepositoryRequest], - Awaitable[~.Repository]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'create_repository' not in self._stubs: - self._stubs['create_repository'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/CreateRepository', - request_serializer=dataform.CreateRepositoryRequest.serialize, - response_deserializer=dataform.Repository.deserialize, - ) - return self._stubs['create_repository'] - - @property - def update_repository(self) -> Callable[ - [dataform.UpdateRepositoryRequest], - Awaitable[dataform.Repository]]: - r"""Return a callable for the update repository method over gRPC. - - Updates a single Repository. - - Returns: - Callable[[~.UpdateRepositoryRequest], - Awaitable[~.Repository]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'update_repository' not in self._stubs: - self._stubs['update_repository'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/UpdateRepository', - request_serializer=dataform.UpdateRepositoryRequest.serialize, - response_deserializer=dataform.Repository.deserialize, - ) - return self._stubs['update_repository'] - - @property - def delete_repository(self) -> Callable[ - [dataform.DeleteRepositoryRequest], - Awaitable[empty_pb2.Empty]]: - r"""Return a callable for the delete repository method over gRPC. - - Deletes a single Repository. - - Returns: - Callable[[~.DeleteRepositoryRequest], - Awaitable[~.Empty]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'delete_repository' not in self._stubs: - self._stubs['delete_repository'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/DeleteRepository', - request_serializer=dataform.DeleteRepositoryRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['delete_repository'] - - @property - def fetch_remote_branches(self) -> Callable[ - [dataform.FetchRemoteBranchesRequest], - Awaitable[dataform.FetchRemoteBranchesResponse]]: - r"""Return a callable for the fetch remote branches method over gRPC. - - Fetches a Repository's remote branches. - - Returns: - Callable[[~.FetchRemoteBranchesRequest], - Awaitable[~.FetchRemoteBranchesResponse]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'fetch_remote_branches' not in self._stubs: - self._stubs['fetch_remote_branches'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/FetchRemoteBranches', - request_serializer=dataform.FetchRemoteBranchesRequest.serialize, - response_deserializer=dataform.FetchRemoteBranchesResponse.deserialize, - ) - return self._stubs['fetch_remote_branches'] - - @property - def list_workspaces(self) -> Callable[ - [dataform.ListWorkspacesRequest], - Awaitable[dataform.ListWorkspacesResponse]]: - r"""Return a callable for the list workspaces method over gRPC. - - Lists Workspaces in a given Repository. - - Returns: - Callable[[~.ListWorkspacesRequest], - Awaitable[~.ListWorkspacesResponse]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'list_workspaces' not in self._stubs: - self._stubs['list_workspaces'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/ListWorkspaces', - request_serializer=dataform.ListWorkspacesRequest.serialize, - response_deserializer=dataform.ListWorkspacesResponse.deserialize, - ) - return self._stubs['list_workspaces'] - - @property - def get_workspace(self) -> Callable[ - [dataform.GetWorkspaceRequest], - Awaitable[dataform.Workspace]]: - r"""Return a callable for the get workspace method over gRPC. - - Fetches a single Workspace. - - Returns: - Callable[[~.GetWorkspaceRequest], - Awaitable[~.Workspace]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'get_workspace' not in self._stubs: - self._stubs['get_workspace'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/GetWorkspace', - request_serializer=dataform.GetWorkspaceRequest.serialize, - response_deserializer=dataform.Workspace.deserialize, - ) - return self._stubs['get_workspace'] - - @property - def create_workspace(self) -> Callable[ - [dataform.CreateWorkspaceRequest], - Awaitable[dataform.Workspace]]: - r"""Return a callable for the create workspace method over gRPC. - - Creates a new Workspace in a given Repository. - - Returns: - Callable[[~.CreateWorkspaceRequest], - Awaitable[~.Workspace]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'create_workspace' not in self._stubs: - self._stubs['create_workspace'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/CreateWorkspace', - request_serializer=dataform.CreateWorkspaceRequest.serialize, - response_deserializer=dataform.Workspace.deserialize, - ) - return self._stubs['create_workspace'] - - @property - def delete_workspace(self) -> Callable[ - [dataform.DeleteWorkspaceRequest], - Awaitable[empty_pb2.Empty]]: - r"""Return a callable for the delete workspace method over gRPC. - - Deletes a single Workspace. - - Returns: - Callable[[~.DeleteWorkspaceRequest], - Awaitable[~.Empty]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'delete_workspace' not in self._stubs: - self._stubs['delete_workspace'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/DeleteWorkspace', - request_serializer=dataform.DeleteWorkspaceRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['delete_workspace'] - - @property - def install_npm_packages(self) -> Callable[ - [dataform.InstallNpmPackagesRequest], - Awaitable[dataform.InstallNpmPackagesResponse]]: - r"""Return a callable for the install npm packages method over gRPC. - - Installs dependency NPM packages (inside a - Workspace). - - Returns: - Callable[[~.InstallNpmPackagesRequest], - Awaitable[~.InstallNpmPackagesResponse]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'install_npm_packages' not in self._stubs: - self._stubs['install_npm_packages'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/InstallNpmPackages', - request_serializer=dataform.InstallNpmPackagesRequest.serialize, - response_deserializer=dataform.InstallNpmPackagesResponse.deserialize, - ) - return self._stubs['install_npm_packages'] - - @property - def pull_git_commits(self) -> Callable[ - [dataform.PullGitCommitsRequest], - Awaitable[empty_pb2.Empty]]: - r"""Return a callable for the pull git commits method over gRPC. - - Pulls Git commits from the Repository's remote into a - Workspace. - - Returns: - Callable[[~.PullGitCommitsRequest], - Awaitable[~.Empty]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'pull_git_commits' not in self._stubs: - self._stubs['pull_git_commits'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/PullGitCommits', - request_serializer=dataform.PullGitCommitsRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['pull_git_commits'] - - @property - def push_git_commits(self) -> Callable[ - [dataform.PushGitCommitsRequest], - Awaitable[empty_pb2.Empty]]: - r"""Return a callable for the push git commits method over gRPC. - - Pushes Git commits from a Workspace to the - Repository's remote. - - Returns: - Callable[[~.PushGitCommitsRequest], - Awaitable[~.Empty]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'push_git_commits' not in self._stubs: - self._stubs['push_git_commits'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/PushGitCommits', - request_serializer=dataform.PushGitCommitsRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['push_git_commits'] - - @property - def fetch_file_git_statuses(self) -> Callable[ - [dataform.FetchFileGitStatusesRequest], - Awaitable[dataform.FetchFileGitStatusesResponse]]: - r"""Return a callable for the fetch file git statuses method over gRPC. - - Fetches Git statuses for the files in a Workspace. - - Returns: - Callable[[~.FetchFileGitStatusesRequest], - Awaitable[~.FetchFileGitStatusesResponse]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'fetch_file_git_statuses' not in self._stubs: - self._stubs['fetch_file_git_statuses'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/FetchFileGitStatuses', - request_serializer=dataform.FetchFileGitStatusesRequest.serialize, - response_deserializer=dataform.FetchFileGitStatusesResponse.deserialize, - ) - return self._stubs['fetch_file_git_statuses'] - - @property - def fetch_git_ahead_behind(self) -> Callable[ - [dataform.FetchGitAheadBehindRequest], - Awaitable[dataform.FetchGitAheadBehindResponse]]: - r"""Return a callable for the fetch git ahead behind method over gRPC. - - Fetches Git ahead/behind against a remote branch. - - Returns: - Callable[[~.FetchGitAheadBehindRequest], - Awaitable[~.FetchGitAheadBehindResponse]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'fetch_git_ahead_behind' not in self._stubs: - self._stubs['fetch_git_ahead_behind'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/FetchGitAheadBehind', - request_serializer=dataform.FetchGitAheadBehindRequest.serialize, - response_deserializer=dataform.FetchGitAheadBehindResponse.deserialize, - ) - return self._stubs['fetch_git_ahead_behind'] - - @property - def commit_workspace_changes(self) -> Callable[ - [dataform.CommitWorkspaceChangesRequest], - Awaitable[empty_pb2.Empty]]: - r"""Return a callable for the commit workspace changes method over gRPC. - - Applies a Git commit for uncommitted files in a - Workspace. - - Returns: - Callable[[~.CommitWorkspaceChangesRequest], - Awaitable[~.Empty]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'commit_workspace_changes' not in self._stubs: - self._stubs['commit_workspace_changes'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/CommitWorkspaceChanges', - request_serializer=dataform.CommitWorkspaceChangesRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['commit_workspace_changes'] - - @property - def reset_workspace_changes(self) -> Callable[ - [dataform.ResetWorkspaceChangesRequest], - Awaitable[empty_pb2.Empty]]: - r"""Return a callable for the reset workspace changes method over gRPC. - - Performs a Git reset for uncommitted files in a - Workspace. - - Returns: - Callable[[~.ResetWorkspaceChangesRequest], - Awaitable[~.Empty]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'reset_workspace_changes' not in self._stubs: - self._stubs['reset_workspace_changes'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/ResetWorkspaceChanges', - request_serializer=dataform.ResetWorkspaceChangesRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['reset_workspace_changes'] - - @property - def fetch_file_diff(self) -> Callable[ - [dataform.FetchFileDiffRequest], - Awaitable[dataform.FetchFileDiffResponse]]: - r"""Return a callable for the fetch file diff method over gRPC. - - Fetches Git diff for an uncommitted file in a - Workspace. - - Returns: - Callable[[~.FetchFileDiffRequest], - Awaitable[~.FetchFileDiffResponse]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'fetch_file_diff' not in self._stubs: - self._stubs['fetch_file_diff'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/FetchFileDiff', - request_serializer=dataform.FetchFileDiffRequest.serialize, - response_deserializer=dataform.FetchFileDiffResponse.deserialize, - ) - return self._stubs['fetch_file_diff'] - - @property - def query_directory_contents(self) -> Callable[ - [dataform.QueryDirectoryContentsRequest], - Awaitable[dataform.QueryDirectoryContentsResponse]]: - r"""Return a callable for the query directory contents method over gRPC. - - Returns the contents of a given Workspace directory. - - Returns: - Callable[[~.QueryDirectoryContentsRequest], - Awaitable[~.QueryDirectoryContentsResponse]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'query_directory_contents' not in self._stubs: - self._stubs['query_directory_contents'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/QueryDirectoryContents', - request_serializer=dataform.QueryDirectoryContentsRequest.serialize, - response_deserializer=dataform.QueryDirectoryContentsResponse.deserialize, - ) - return self._stubs['query_directory_contents'] - - @property - def make_directory(self) -> Callable[ - [dataform.MakeDirectoryRequest], - Awaitable[dataform.MakeDirectoryResponse]]: - r"""Return a callable for the make directory method over gRPC. - - Creates a directory inside a Workspace. - - Returns: - Callable[[~.MakeDirectoryRequest], - Awaitable[~.MakeDirectoryResponse]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'make_directory' not in self._stubs: - self._stubs['make_directory'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/MakeDirectory', - request_serializer=dataform.MakeDirectoryRequest.serialize, - response_deserializer=dataform.MakeDirectoryResponse.deserialize, - ) - return self._stubs['make_directory'] - - @property - def remove_directory(self) -> Callable[ - [dataform.RemoveDirectoryRequest], - Awaitable[empty_pb2.Empty]]: - r"""Return a callable for the remove directory method over gRPC. - - Deletes a directory (inside a Workspace) and all of - its contents. - - Returns: - Callable[[~.RemoveDirectoryRequest], - Awaitable[~.Empty]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'remove_directory' not in self._stubs: - self._stubs['remove_directory'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/RemoveDirectory', - request_serializer=dataform.RemoveDirectoryRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['remove_directory'] - - @property - def move_directory(self) -> Callable[ - [dataform.MoveDirectoryRequest], - Awaitable[dataform.MoveDirectoryResponse]]: - r"""Return a callable for the move directory method over gRPC. - - Moves a directory (inside a Workspace), and all of - its contents, to a new location. - - Returns: - Callable[[~.MoveDirectoryRequest], - Awaitable[~.MoveDirectoryResponse]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'move_directory' not in self._stubs: - self._stubs['move_directory'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/MoveDirectory', - request_serializer=dataform.MoveDirectoryRequest.serialize, - response_deserializer=dataform.MoveDirectoryResponse.deserialize, - ) - return self._stubs['move_directory'] - - @property - def read_file(self) -> Callable[ - [dataform.ReadFileRequest], - Awaitable[dataform.ReadFileResponse]]: - r"""Return a callable for the read file method over gRPC. - - Returns the contents of a file (inside a Workspace). - - Returns: - Callable[[~.ReadFileRequest], - Awaitable[~.ReadFileResponse]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'read_file' not in self._stubs: - self._stubs['read_file'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/ReadFile', - request_serializer=dataform.ReadFileRequest.serialize, - response_deserializer=dataform.ReadFileResponse.deserialize, - ) - return self._stubs['read_file'] - - @property - def remove_file(self) -> Callable[ - [dataform.RemoveFileRequest], - Awaitable[empty_pb2.Empty]]: - r"""Return a callable for the remove file method over gRPC. - - Deletes a file (inside a Workspace). - - Returns: - Callable[[~.RemoveFileRequest], - Awaitable[~.Empty]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'remove_file' not in self._stubs: - self._stubs['remove_file'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/RemoveFile', - request_serializer=dataform.RemoveFileRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['remove_file'] - - @property - def move_file(self) -> Callable[ - [dataform.MoveFileRequest], - Awaitable[dataform.MoveFileResponse]]: - r"""Return a callable for the move file method over gRPC. - - Moves a file (inside a Workspace) to a new location. - - Returns: - Callable[[~.MoveFileRequest], - Awaitable[~.MoveFileResponse]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'move_file' not in self._stubs: - self._stubs['move_file'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/MoveFile', - request_serializer=dataform.MoveFileRequest.serialize, - response_deserializer=dataform.MoveFileResponse.deserialize, - ) - return self._stubs['move_file'] - - @property - def write_file(self) -> Callable[ - [dataform.WriteFileRequest], - Awaitable[dataform.WriteFileResponse]]: - r"""Return a callable for the write file method over gRPC. - - Writes to a file (inside a Workspace). - - Returns: - Callable[[~.WriteFileRequest], - Awaitable[~.WriteFileResponse]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'write_file' not in self._stubs: - self._stubs['write_file'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/WriteFile', - request_serializer=dataform.WriteFileRequest.serialize, - response_deserializer=dataform.WriteFileResponse.deserialize, - ) - return self._stubs['write_file'] - - @property - def list_compilation_results(self) -> Callable[ - [dataform.ListCompilationResultsRequest], - Awaitable[dataform.ListCompilationResultsResponse]]: - r"""Return a callable for the list compilation results method over gRPC. - - Lists CompilationResults in a given Repository. - - Returns: - Callable[[~.ListCompilationResultsRequest], - Awaitable[~.ListCompilationResultsResponse]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'list_compilation_results' not in self._stubs: - self._stubs['list_compilation_results'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/ListCompilationResults', - request_serializer=dataform.ListCompilationResultsRequest.serialize, - response_deserializer=dataform.ListCompilationResultsResponse.deserialize, - ) - return self._stubs['list_compilation_results'] - - @property - def get_compilation_result(self) -> Callable[ - [dataform.GetCompilationResultRequest], - Awaitable[dataform.CompilationResult]]: - r"""Return a callable for the get compilation result method over gRPC. - - Fetches a single CompilationResult. - - Returns: - Callable[[~.GetCompilationResultRequest], - Awaitable[~.CompilationResult]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'get_compilation_result' not in self._stubs: - self._stubs['get_compilation_result'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/GetCompilationResult', - request_serializer=dataform.GetCompilationResultRequest.serialize, - response_deserializer=dataform.CompilationResult.deserialize, - ) - return self._stubs['get_compilation_result'] - - @property - def create_compilation_result(self) -> Callable[ - [dataform.CreateCompilationResultRequest], - Awaitable[dataform.CompilationResult]]: - r"""Return a callable for the create compilation result method over gRPC. - - Creates a new CompilationResult in a given project - and location. - - Returns: - Callable[[~.CreateCompilationResultRequest], - Awaitable[~.CompilationResult]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'create_compilation_result' not in self._stubs: - self._stubs['create_compilation_result'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/CreateCompilationResult', - request_serializer=dataform.CreateCompilationResultRequest.serialize, - response_deserializer=dataform.CompilationResult.deserialize, - ) - return self._stubs['create_compilation_result'] - - @property - def query_compilation_result_actions(self) -> Callable[ - [dataform.QueryCompilationResultActionsRequest], - Awaitable[dataform.QueryCompilationResultActionsResponse]]: - r"""Return a callable for the query compilation result - actions method over gRPC. - - Returns CompilationResultActions in a given - CompilationResult. - - Returns: - Callable[[~.QueryCompilationResultActionsRequest], - Awaitable[~.QueryCompilationResultActionsResponse]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'query_compilation_result_actions' not in self._stubs: - self._stubs['query_compilation_result_actions'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/QueryCompilationResultActions', - request_serializer=dataform.QueryCompilationResultActionsRequest.serialize, - response_deserializer=dataform.QueryCompilationResultActionsResponse.deserialize, - ) - return self._stubs['query_compilation_result_actions'] - - @property - def list_workflow_invocations(self) -> Callable[ - [dataform.ListWorkflowInvocationsRequest], - Awaitable[dataform.ListWorkflowInvocationsResponse]]: - r"""Return a callable for the list workflow invocations method over gRPC. - - Lists WorkflowInvocations in a given Repository. - - Returns: - Callable[[~.ListWorkflowInvocationsRequest], - Awaitable[~.ListWorkflowInvocationsResponse]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'list_workflow_invocations' not in self._stubs: - self._stubs['list_workflow_invocations'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/ListWorkflowInvocations', - request_serializer=dataform.ListWorkflowInvocationsRequest.serialize, - response_deserializer=dataform.ListWorkflowInvocationsResponse.deserialize, - ) - return self._stubs['list_workflow_invocations'] - - @property - def get_workflow_invocation(self) -> Callable[ - [dataform.GetWorkflowInvocationRequest], - Awaitable[dataform.WorkflowInvocation]]: - r"""Return a callable for the get workflow invocation method over gRPC. - - Fetches a single WorkflowInvocation. - - Returns: - Callable[[~.GetWorkflowInvocationRequest], - Awaitable[~.WorkflowInvocation]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'get_workflow_invocation' not in self._stubs: - self._stubs['get_workflow_invocation'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/GetWorkflowInvocation', - request_serializer=dataform.GetWorkflowInvocationRequest.serialize, - response_deserializer=dataform.WorkflowInvocation.deserialize, - ) - return self._stubs['get_workflow_invocation'] - - @property - def create_workflow_invocation(self) -> Callable[ - [dataform.CreateWorkflowInvocationRequest], - Awaitable[dataform.WorkflowInvocation]]: - r"""Return a callable for the create workflow invocation method over gRPC. - - Creates a new WorkflowInvocation in a given - Repository. - - Returns: - Callable[[~.CreateWorkflowInvocationRequest], - Awaitable[~.WorkflowInvocation]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'create_workflow_invocation' not in self._stubs: - self._stubs['create_workflow_invocation'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/CreateWorkflowInvocation', - request_serializer=dataform.CreateWorkflowInvocationRequest.serialize, - response_deserializer=dataform.WorkflowInvocation.deserialize, - ) - return self._stubs['create_workflow_invocation'] - - @property - def delete_workflow_invocation(self) -> Callable[ - [dataform.DeleteWorkflowInvocationRequest], - Awaitable[empty_pb2.Empty]]: - r"""Return a callable for the delete workflow invocation method over gRPC. - - Deletes a single WorkflowInvocation. - - Returns: - Callable[[~.DeleteWorkflowInvocationRequest], - Awaitable[~.Empty]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'delete_workflow_invocation' not in self._stubs: - self._stubs['delete_workflow_invocation'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/DeleteWorkflowInvocation', - request_serializer=dataform.DeleteWorkflowInvocationRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['delete_workflow_invocation'] - - @property - def cancel_workflow_invocation(self) -> Callable[ - [dataform.CancelWorkflowInvocationRequest], - Awaitable[empty_pb2.Empty]]: - r"""Return a callable for the cancel workflow invocation method over gRPC. - - Requests cancellation of a running - WorkflowInvocation. - - Returns: - Callable[[~.CancelWorkflowInvocationRequest], - Awaitable[~.Empty]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'cancel_workflow_invocation' not in self._stubs: - self._stubs['cancel_workflow_invocation'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/CancelWorkflowInvocation', - request_serializer=dataform.CancelWorkflowInvocationRequest.serialize, - response_deserializer=empty_pb2.Empty.FromString, - ) - return self._stubs['cancel_workflow_invocation'] - - @property - def query_workflow_invocation_actions(self) -> Callable[ - [dataform.QueryWorkflowInvocationActionsRequest], - Awaitable[dataform.QueryWorkflowInvocationActionsResponse]]: - r"""Return a callable for the query workflow invocation - actions method over gRPC. - - Returns WorkflowInvocationActions in a given - WorkflowInvocation. - - Returns: - Callable[[~.QueryWorkflowInvocationActionsRequest], - Awaitable[~.QueryWorkflowInvocationActionsResponse]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if 'query_workflow_invocation_actions' not in self._stubs: - self._stubs['query_workflow_invocation_actions'] = self.grpc_channel.unary_unary( - '/google.cloud.dataform.v1beta1.Dataform/QueryWorkflowInvocationActions', - request_serializer=dataform.QueryWorkflowInvocationActionsRequest.serialize, - response_deserializer=dataform.QueryWorkflowInvocationActionsResponse.deserialize, - ) - return self._stubs['query_workflow_invocation_actions'] - - def close(self): - return self.grpc_channel.close() - - @property - def list_locations( - self, - ) -> Callable[[locations_pb2.ListLocationsRequest], locations_pb2.ListLocationsResponse]: - r"""Return a callable for the list locations method over gRPC. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if "list_locations" not in self._stubs: - self._stubs["list_locations"] = self.grpc_channel.unary_unary( - "/google.cloud.location.Locations/ListLocations", - request_serializer=locations_pb2.ListLocationsRequest.SerializeToString, - response_deserializer=locations_pb2.ListLocationsResponse.FromString, - ) - return self._stubs["list_locations"] - - @property - def get_location( - self, - ) -> Callable[[locations_pb2.GetLocationRequest], locations_pb2.Location]: - r"""Return a callable for the list locations method over gRPC. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if "get_location" not in self._stubs: - self._stubs["get_location"] = self.grpc_channel.unary_unary( - "/google.cloud.location.Locations/GetLocation", - request_serializer=locations_pb2.GetLocationRequest.SerializeToString, - response_deserializer=locations_pb2.Location.FromString, - ) - return self._stubs["get_location"] - - -__all__ = ( - 'DataformGrpcAsyncIOTransport', -) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/types/__init__.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/types/__init__.py deleted file mode 100644 index 37a0679..0000000 --- a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/types/__init__.py +++ /dev/null @@ -1,144 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -from .dataform import ( - CancelWorkflowInvocationRequest, - CommitAuthor, - CommitWorkspaceChangesRequest, - CompilationResult, - CompilationResultAction, - CreateCompilationResultRequest, - CreateRepositoryRequest, - CreateWorkflowInvocationRequest, - CreateWorkspaceRequest, - DeleteRepositoryRequest, - DeleteWorkflowInvocationRequest, - DeleteWorkspaceRequest, - FetchFileDiffRequest, - FetchFileDiffResponse, - FetchFileGitStatusesRequest, - FetchFileGitStatusesResponse, - FetchGitAheadBehindRequest, - FetchGitAheadBehindResponse, - FetchRemoteBranchesRequest, - FetchRemoteBranchesResponse, - GetCompilationResultRequest, - GetRepositoryRequest, - GetWorkflowInvocationRequest, - GetWorkspaceRequest, - InstallNpmPackagesRequest, - InstallNpmPackagesResponse, - ListCompilationResultsRequest, - ListCompilationResultsResponse, - ListRepositoriesRequest, - ListRepositoriesResponse, - ListWorkflowInvocationsRequest, - ListWorkflowInvocationsResponse, - ListWorkspacesRequest, - ListWorkspacesResponse, - MakeDirectoryRequest, - MakeDirectoryResponse, - MoveDirectoryRequest, - MoveDirectoryResponse, - MoveFileRequest, - MoveFileResponse, - PullGitCommitsRequest, - PushGitCommitsRequest, - QueryCompilationResultActionsRequest, - QueryCompilationResultActionsResponse, - QueryDirectoryContentsRequest, - QueryDirectoryContentsResponse, - QueryWorkflowInvocationActionsRequest, - QueryWorkflowInvocationActionsResponse, - ReadFileRequest, - ReadFileResponse, - RelationDescriptor, - RemoveDirectoryRequest, - RemoveFileRequest, - Repository, - ResetWorkspaceChangesRequest, - Target, - UpdateRepositoryRequest, - WorkflowInvocation, - WorkflowInvocationAction, - Workspace, - WriteFileRequest, - WriteFileResponse, -) - -__all__ = ( - 'CancelWorkflowInvocationRequest', - 'CommitAuthor', - 'CommitWorkspaceChangesRequest', - 'CompilationResult', - 'CompilationResultAction', - 'CreateCompilationResultRequest', - 'CreateRepositoryRequest', - 'CreateWorkflowInvocationRequest', - 'CreateWorkspaceRequest', - 'DeleteRepositoryRequest', - 'DeleteWorkflowInvocationRequest', - 'DeleteWorkspaceRequest', - 'FetchFileDiffRequest', - 'FetchFileDiffResponse', - 'FetchFileGitStatusesRequest', - 'FetchFileGitStatusesResponse', - 'FetchGitAheadBehindRequest', - 'FetchGitAheadBehindResponse', - 'FetchRemoteBranchesRequest', - 'FetchRemoteBranchesResponse', - 'GetCompilationResultRequest', - 'GetRepositoryRequest', - 'GetWorkflowInvocationRequest', - 'GetWorkspaceRequest', - 'InstallNpmPackagesRequest', - 'InstallNpmPackagesResponse', - 'ListCompilationResultsRequest', - 'ListCompilationResultsResponse', - 'ListRepositoriesRequest', - 'ListRepositoriesResponse', - 'ListWorkflowInvocationsRequest', - 'ListWorkflowInvocationsResponse', - 'ListWorkspacesRequest', - 'ListWorkspacesResponse', - 'MakeDirectoryRequest', - 'MakeDirectoryResponse', - 'MoveDirectoryRequest', - 'MoveDirectoryResponse', - 'MoveFileRequest', - 'MoveFileResponse', - 'PullGitCommitsRequest', - 'PushGitCommitsRequest', - 'QueryCompilationResultActionsRequest', - 'QueryCompilationResultActionsResponse', - 'QueryDirectoryContentsRequest', - 'QueryDirectoryContentsResponse', - 'QueryWorkflowInvocationActionsRequest', - 'QueryWorkflowInvocationActionsResponse', - 'ReadFileRequest', - 'ReadFileResponse', - 'RelationDescriptor', - 'RemoveDirectoryRequest', - 'RemoveFileRequest', - 'Repository', - 'ResetWorkspaceChangesRequest', - 'Target', - 'UpdateRepositoryRequest', - 'WorkflowInvocation', - 'WorkflowInvocationAction', - 'Workspace', - 'WriteFileRequest', - 'WriteFileResponse', -) diff --git a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/types/dataform.py b/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/types/dataform.py deleted file mode 100644 index 85a8311..0000000 --- a/owl-bot-staging/v1beta1/google/cloud/dataform_v1beta1/types/dataform.py +++ /dev/null @@ -1,2309 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -import proto # type: ignore - -from google.protobuf import field_mask_pb2 # type: ignore -from google.type import interval_pb2 # type: ignore - - -__protobuf__ = proto.module( - package='google.cloud.dataform.v1beta1', - manifest={ - 'Repository', - 'ListRepositoriesRequest', - 'ListRepositoriesResponse', - 'GetRepositoryRequest', - 'CreateRepositoryRequest', - 'UpdateRepositoryRequest', - 'DeleteRepositoryRequest', - 'FetchRemoteBranchesRequest', - 'FetchRemoteBranchesResponse', - 'Workspace', - 'ListWorkspacesRequest', - 'ListWorkspacesResponse', - 'GetWorkspaceRequest', - 'CreateWorkspaceRequest', - 'DeleteWorkspaceRequest', - 'CommitAuthor', - 'PullGitCommitsRequest', - 'PushGitCommitsRequest', - 'FetchFileGitStatusesRequest', - 'FetchFileGitStatusesResponse', - 'FetchGitAheadBehindRequest', - 'FetchGitAheadBehindResponse', - 'CommitWorkspaceChangesRequest', - 'ResetWorkspaceChangesRequest', - 'FetchFileDiffRequest', - 'FetchFileDiffResponse', - 'QueryDirectoryContentsRequest', - 'QueryDirectoryContentsResponse', - 'MakeDirectoryRequest', - 'MakeDirectoryResponse', - 'RemoveDirectoryRequest', - 'MoveDirectoryRequest', - 'MoveDirectoryResponse', - 'ReadFileRequest', - 'ReadFileResponse', - 'RemoveFileRequest', - 'MoveFileRequest', - 'MoveFileResponse', - 'WriteFileRequest', - 'WriteFileResponse', - 'InstallNpmPackagesRequest', - 'InstallNpmPackagesResponse', - 'CompilationResult', - 'ListCompilationResultsRequest', - 'ListCompilationResultsResponse', - 'GetCompilationResultRequest', - 'CreateCompilationResultRequest', - 'Target', - 'RelationDescriptor', - 'CompilationResultAction', - 'QueryCompilationResultActionsRequest', - 'QueryCompilationResultActionsResponse', - 'WorkflowInvocation', - 'ListWorkflowInvocationsRequest', - 'ListWorkflowInvocationsResponse', - 'GetWorkflowInvocationRequest', - 'CreateWorkflowInvocationRequest', - 'DeleteWorkflowInvocationRequest', - 'CancelWorkflowInvocationRequest', - 'WorkflowInvocationAction', - 'QueryWorkflowInvocationActionsRequest', - 'QueryWorkflowInvocationActionsResponse', - }, -) - - -class Repository(proto.Message): - r"""Represents a Dataform Git repository. - - Attributes: - name (str): - Output only. The repository's name. - git_remote_settings (google.cloud.dataform_v1beta1.types.Repository.GitRemoteSettings): - Optional. If set, configures this repository - to be linked to a Git remote. - """ - - class GitRemoteSettings(proto.Message): - r"""Controls Git remote configuration for a repository. - - Attributes: - url (str): - Required. The Git remote's URL. - default_branch (str): - Required. The Git remote's default branch - name. - authentication_token_secret_version (str): - 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/*``. - token_status (google.cloud.dataform_v1beta1.types.Repository.GitRemoteSettings.TokenStatus): - Output only. Indicates the status of the Git - access token. - """ - class TokenStatus(proto.Enum): - r"""Indicates the status of a Git authentication token.""" - TOKEN_STATUS_UNSPECIFIED = 0 - NOT_FOUND = 1 - INVALID = 2 - VALID = 3 - - url = proto.Field( - proto.STRING, - number=1, - ) - default_branch = proto.Field( - proto.STRING, - number=2, - ) - authentication_token_secret_version = proto.Field( - proto.STRING, - number=3, - ) - token_status = proto.Field( - proto.ENUM, - number=4, - enum='Repository.GitRemoteSettings.TokenStatus', - ) - - name = proto.Field( - proto.STRING, - number=1, - ) - git_remote_settings = proto.Field( - proto.MESSAGE, - number=2, - message=GitRemoteSettings, - ) - - -class ListRepositoriesRequest(proto.Message): - r"""``ListRepositories`` request message. - - Attributes: - parent (str): - Required. The location in which to list repositories. Must - be in the format ``projects/*/locations/*``. - page_size (int): - Optional. Maximum number of repositories to - return. The server may return fewer items than - requested. If unspecified, the server will pick - an appropriate default. - page_token (str): - 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. - order_by (str): - 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. - filter (str): - Optional. Filter for the returned list. - """ - - parent = proto.Field( - proto.STRING, - number=1, - ) - page_size = proto.Field( - proto.INT32, - number=2, - ) - page_token = proto.Field( - proto.STRING, - number=3, - ) - order_by = proto.Field( - proto.STRING, - number=4, - ) - filter = proto.Field( - proto.STRING, - number=5, - ) - - -class ListRepositoriesResponse(proto.Message): - r"""``ListRepositories`` response message. - - Attributes: - repositories (Sequence[google.cloud.dataform_v1beta1.types.Repository]): - List of repositories. - next_page_token (str): - A token which can be sent as ``page_token`` to retrieve the - next page. If this field is omitted, there are no subsequent - pages. - unreachable (Sequence[str]): - Locations which could not be reached. - """ - - @property - def raw_page(self): - return self - - repositories = proto.RepeatedField( - proto.MESSAGE, - number=1, - message='Repository', - ) - next_page_token = proto.Field( - proto.STRING, - number=2, - ) - unreachable = proto.RepeatedField( - proto.STRING, - number=3, - ) - - -class GetRepositoryRequest(proto.Message): - r"""``GetRepository`` request message. - - Attributes: - name (str): - Required. The repository's name. - """ - - name = proto.Field( - proto.STRING, - number=1, - ) - - -class CreateRepositoryRequest(proto.Message): - r"""``CreateRepository`` request message. - - Attributes: - parent (str): - Required. The location in which to create the repository. - Must be in the format ``projects/*/locations/*``. - repository (google.cloud.dataform_v1beta1.types.Repository): - Required. The repository to create. - repository_id (str): - Required. The ID to use for the repository, - which will become the final component of the - repository's resource name. - """ - - parent = proto.Field( - proto.STRING, - number=1, - ) - repository = proto.Field( - proto.MESSAGE, - number=2, - message='Repository', - ) - repository_id = proto.Field( - proto.STRING, - number=3, - ) - - -class UpdateRepositoryRequest(proto.Message): - r"""``UpdateRepository`` request message. - - Attributes: - update_mask (google.protobuf.field_mask_pb2.FieldMask): - Optional. Specifies the fields to be updated - in the repository. If left unset, all fields - will be updated. - repository (google.cloud.dataform_v1beta1.types.Repository): - Required. The repository to update. - """ - - update_mask = proto.Field( - proto.MESSAGE, - number=1, - message=field_mask_pb2.FieldMask, - ) - repository = proto.Field( - proto.MESSAGE, - number=2, - message='Repository', - ) - - -class DeleteRepositoryRequest(proto.Message): - r"""``DeleteRepository`` request message. - - Attributes: - name (str): - Required. The repository's name. - force (bool): - 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.) - """ - - name = proto.Field( - proto.STRING, - number=1, - ) - force = proto.Field( - proto.BOOL, - number=2, - ) - - -class FetchRemoteBranchesRequest(proto.Message): - r"""``FetchRemoteBranches`` request message. - - Attributes: - name (str): - Required. The repository's name. - """ - - name = proto.Field( - proto.STRING, - number=1, - ) - - -class FetchRemoteBranchesResponse(proto.Message): - r"""``FetchRemoteBranches`` response message. - - Attributes: - branches (Sequence[str]): - The remote repository's branch names. - """ - - branches = proto.RepeatedField( - proto.STRING, - number=1, - ) - - -class Workspace(proto.Message): - r"""Represents a Dataform Git workspace. - - Attributes: - name (str): - Output only. The workspace's name. - """ - - name = proto.Field( - proto.STRING, - number=1, - ) - - -class ListWorkspacesRequest(proto.Message): - r"""``ListWorkspaces`` request message. - - Attributes: - parent (str): - Required. The repository in which to list workspaces. Must - be in the format ``projects/*/locations/*/repositories/*``. - page_size (int): - Optional. Maximum number of workspaces to - return. The server may return fewer items than - requested. If unspecified, the server will pick - an appropriate default. - page_token (str): - 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. - order_by (str): - 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. - filter (str): - Optional. Filter for the returned list. - """ - - parent = proto.Field( - proto.STRING, - number=1, - ) - page_size = proto.Field( - proto.INT32, - number=2, - ) - page_token = proto.Field( - proto.STRING, - number=3, - ) - order_by = proto.Field( - proto.STRING, - number=4, - ) - filter = proto.Field( - proto.STRING, - number=5, - ) - - -class ListWorkspacesResponse(proto.Message): - r"""``ListWorkspaces`` response message. - - Attributes: - workspaces (Sequence[google.cloud.dataform_v1beta1.types.Workspace]): - List of workspaces. - next_page_token (str): - A token, which can be sent as ``page_token`` to retrieve the - next page. If this field is omitted, there are no subsequent - pages. - unreachable (Sequence[str]): - Locations which could not be reached. - """ - - @property - def raw_page(self): - return self - - workspaces = proto.RepeatedField( - proto.MESSAGE, - number=1, - message='Workspace', - ) - next_page_token = proto.Field( - proto.STRING, - number=2, - ) - unreachable = proto.RepeatedField( - proto.STRING, - number=3, - ) - - -class GetWorkspaceRequest(proto.Message): - r"""``GetWorkspace`` request message. - - Attributes: - name (str): - Required. The workspace's name. - """ - - name = proto.Field( - proto.STRING, - number=1, - ) - - -class CreateWorkspaceRequest(proto.Message): - r"""``CreateWorkspace`` request message. - - Attributes: - parent (str): - Required. The repository in which to create the workspace. - Must be in the format - ``projects/*/locations/*/repositories/*``. - workspace (google.cloud.dataform_v1beta1.types.Workspace): - Required. The workspace to create. - workspace_id (str): - Required. The ID to use for the workspace, - which will become the final component of the - workspace's resource name. - """ - - parent = proto.Field( - proto.STRING, - number=1, - ) - workspace = proto.Field( - proto.MESSAGE, - number=2, - message='Workspace', - ) - workspace_id = proto.Field( - proto.STRING, - number=3, - ) - - -class DeleteWorkspaceRequest(proto.Message): - r"""``DeleteWorkspace`` request message. - - Attributes: - name (str): - Required. The workspace resource's name. - """ - - name = proto.Field( - proto.STRING, - number=1, - ) - - -class CommitAuthor(proto.Message): - r"""Represents the author of a Git commit. - - Attributes: - name (str): - Required. The commit author's name. - email_address (str): - Required. The commit author's email address. - """ - - name = proto.Field( - proto.STRING, - number=1, - ) - email_address = proto.Field( - proto.STRING, - number=2, - ) - - -class PullGitCommitsRequest(proto.Message): - r"""``PullGitCommits`` request message. - - Attributes: - name (str): - Required. The workspace's name. - remote_branch (str): - 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. - author (google.cloud.dataform_v1beta1.types.CommitAuthor): - Required. The author of any merge commit - which may be created as a result of merging - fetched Git commits into this workspace. - """ - - name = proto.Field( - proto.STRING, - number=1, - ) - remote_branch = proto.Field( - proto.STRING, - number=2, - ) - author = proto.Field( - proto.MESSAGE, - number=3, - message='CommitAuthor', - ) - - -class PushGitCommitsRequest(proto.Message): - r"""``PushGitCommits`` request message. - - Attributes: - name (str): - Required. The workspace's name. - remote_branch (str): - 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. - """ - - name = proto.Field( - proto.STRING, - number=1, - ) - remote_branch = proto.Field( - proto.STRING, - number=2, - ) - - -class FetchFileGitStatusesRequest(proto.Message): - r"""``FetchFileGitStatuses`` request message. - - Attributes: - name (str): - Required. The workspace's name. - """ - - name = proto.Field( - proto.STRING, - number=1, - ) - - -class FetchFileGitStatusesResponse(proto.Message): - r"""``FetchFileGitStatuses`` response message. - - Attributes: - uncommitted_file_changes (Sequence[google.cloud.dataform_v1beta1.types.FetchFileGitStatusesResponse.UncommittedFileChange]): - A list of all files which have uncommitted - Git changes. There will only be a single entry - for any given file. - """ - - class UncommittedFileChange(proto.Message): - r"""Represents the Git state of a file with uncommitted changes. - - Attributes: - path (str): - The file's full path including filename, - relative to the workspace root. - state (google.cloud.dataform_v1beta1.types.FetchFileGitStatusesResponse.UncommittedFileChange.State): - Indicates the status of the file. - """ - class State(proto.Enum): - r"""Indicates the status of an uncommitted file change.""" - STATE_UNSPECIFIED = 0 - ADDED = 1 - DELETED = 2 - MODIFIED = 3 - HAS_CONFLICTS = 4 - - path = proto.Field( - proto.STRING, - number=1, - ) - state = proto.Field( - proto.ENUM, - number=2, - enum='FetchFileGitStatusesResponse.UncommittedFileChange.State', - ) - - uncommitted_file_changes = proto.RepeatedField( - proto.MESSAGE, - number=1, - message=UncommittedFileChange, - ) - - -class FetchGitAheadBehindRequest(proto.Message): - r"""``FetchGitAheadBehind`` request message. - - Attributes: - name (str): - Required. The workspace's name. - remote_branch (str): - 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. - """ - - name = proto.Field( - proto.STRING, - number=1, - ) - remote_branch = proto.Field( - proto.STRING, - number=2, - ) - - -class FetchGitAheadBehindResponse(proto.Message): - r"""``FetchGitAheadBehind`` response message. - - Attributes: - commits_ahead (int): - The number of commits in the remote branch - that are not in the workspace. - commits_behind (int): - The number of commits in the workspace that - are not in the remote branch. - """ - - commits_ahead = proto.Field( - proto.INT32, - number=1, - ) - commits_behind = proto.Field( - proto.INT32, - number=2, - ) - - -class CommitWorkspaceChangesRequest(proto.Message): - r"""``CommitWorkspaceChanges`` request message. - - Attributes: - name (str): - Required. The workspace's name. - author (google.cloud.dataform_v1beta1.types.CommitAuthor): - Required. The commit's author. - commit_message (str): - Optional. The commit's message. - paths (Sequence[str]): - Optional. Full file paths to commit including - filename, rooted at workspace root. If left - empty, all files will be committed. - """ - - name = proto.Field( - proto.STRING, - number=1, - ) - author = proto.Field( - proto.MESSAGE, - number=4, - message='CommitAuthor', - ) - commit_message = proto.Field( - proto.STRING, - number=2, - ) - paths = proto.RepeatedField( - proto.STRING, - number=3, - ) - - -class ResetWorkspaceChangesRequest(proto.Message): - r"""``ResetWorkspaceChanges`` request message. - - Attributes: - name (str): - Required. The workspace's name. - paths (Sequence[str]): - 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. - clean (bool): - Optional. If set to true, untracked files - will be deleted. - """ - - name = proto.Field( - proto.STRING, - number=1, - ) - paths = proto.RepeatedField( - proto.STRING, - number=2, - ) - clean = proto.Field( - proto.BOOL, - number=3, - ) - - -class FetchFileDiffRequest(proto.Message): - r"""``FetchFileDiff`` request message. - - Attributes: - workspace (str): - Required. The workspace's name. - path (str): - Required. The file's full path including - filename, relative to the workspace root. - """ - - workspace = proto.Field( - proto.STRING, - number=1, - ) - path = proto.Field( - proto.STRING, - number=2, - ) - - -class FetchFileDiffResponse(proto.Message): - r"""``FetchFileDiff`` response message. - - Attributes: - formatted_diff (str): - The raw formatted Git diff for the file. - """ - - formatted_diff = proto.Field( - proto.STRING, - number=1, - ) - - -class QueryDirectoryContentsRequest(proto.Message): - r"""``QueryDirectoryContents`` request message. - - Attributes: - workspace (str): - Required. The workspace's name. - path (str): - Optional. The directory's full path including - directory name, relative to the workspace root. - If left unset, the workspace root is used. - page_size (int): - Optional. Maximum number of paths to return. - The server may return fewer items than - requested. If unspecified, the server will pick - an appropriate default. - page_token (str): - 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. - """ - - workspace = proto.Field( - proto.STRING, - number=1, - ) - path = proto.Field( - proto.STRING, - number=2, - ) - page_size = proto.Field( - proto.INT32, - number=3, - ) - page_token = proto.Field( - proto.STRING, - number=4, - ) - - -class QueryDirectoryContentsResponse(proto.Message): - r"""``QueryDirectoryContents`` response message. - - Attributes: - directory_entries (Sequence[google.cloud.dataform_v1beta1.types.QueryDirectoryContentsResponse.DirectoryEntry]): - List of entries in the directory. - next_page_token (str): - A token, which can be sent as ``page_token`` to retrieve the - next page. If this field is omitted, there are no subsequent - pages. - """ - - class DirectoryEntry(proto.Message): - r"""Represents a single entry in a workspace directory. - - This message has `oneof`_ fields (mutually exclusive fields). - For each oneof, at most one member field can be set at the same time. - Setting any member of the oneof automatically clears all other - members. - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - file (str): - A file in the directory. - - This field is a member of `oneof`_ ``entry``. - directory (str): - A child directory in the directory. - - This field is a member of `oneof`_ ``entry``. - """ - - file = proto.Field( - proto.STRING, - number=1, - oneof='entry', - ) - directory = proto.Field( - proto.STRING, - number=2, - oneof='entry', - ) - - @property - def raw_page(self): - return self - - directory_entries = proto.RepeatedField( - proto.MESSAGE, - number=1, - message=DirectoryEntry, - ) - next_page_token = proto.Field( - proto.STRING, - number=2, - ) - - -class MakeDirectoryRequest(proto.Message): - r"""``MakeDirectory`` request message. - - Attributes: - workspace (str): - Required. The workspace's name. - path (str): - Required. The directory's full path including - directory name, relative to the workspace root. - """ - - workspace = proto.Field( - proto.STRING, - number=1, - ) - path = proto.Field( - proto.STRING, - number=2, - ) - - -class MakeDirectoryResponse(proto.Message): - r"""``MakeDirectory`` response message. - """ - - -class RemoveDirectoryRequest(proto.Message): - r"""``RemoveDirectory`` request message. - - Attributes: - workspace (str): - Required. The workspace's name. - path (str): - Required. The directory's full path including - directory name, relative to the workspace root. - """ - - workspace = proto.Field( - proto.STRING, - number=1, - ) - path = proto.Field( - proto.STRING, - number=2, - ) - - -class MoveDirectoryRequest(proto.Message): - r"""``MoveDirectory`` request message. - - Attributes: - workspace (str): - Required. The workspace's name. - path (str): - Required. The directory's full path including - directory name, relative to the workspace root. - new_path (str): - Required. The new path for the directory - including directory name, rooted at workspace - root. - """ - - workspace = proto.Field( - proto.STRING, - number=1, - ) - path = proto.Field( - proto.STRING, - number=2, - ) - new_path = proto.Field( - proto.STRING, - number=3, - ) - - -class MoveDirectoryResponse(proto.Message): - r"""``MoveDirectory`` response message. - """ - - -class ReadFileRequest(proto.Message): - r"""``ReadFile`` request message. - - Attributes: - workspace (str): - Required. The workspace's name. - path (str): - Required. The file's full path including - filename, relative to the workspace root. - """ - - workspace = proto.Field( - proto.STRING, - number=1, - ) - path = proto.Field( - proto.STRING, - number=2, - ) - - -class ReadFileResponse(proto.Message): - r"""``ReadFile`` response message. - - Attributes: - file_contents (bytes): - The file's contents. - """ - - file_contents = proto.Field( - proto.BYTES, - number=1, - ) - - -class RemoveFileRequest(proto.Message): - r"""``RemoveFile`` request message. - - Attributes: - workspace (str): - Required. The workspace's name. - path (str): - Required. The file's full path including - filename, relative to the workspace root. - """ - - workspace = proto.Field( - proto.STRING, - number=1, - ) - path = proto.Field( - proto.STRING, - number=2, - ) - - -class MoveFileRequest(proto.Message): - r"""``MoveFile`` request message. - - Attributes: - workspace (str): - Required. The workspace's name. - path (str): - Required. The file's full path including - filename, relative to the workspace root. - new_path (str): - Required. The file's new path including - filename, relative to the workspace root. - """ - - workspace = proto.Field( - proto.STRING, - number=1, - ) - path = proto.Field( - proto.STRING, - number=2, - ) - new_path = proto.Field( - proto.STRING, - number=3, - ) - - -class MoveFileResponse(proto.Message): - r"""``MoveFile`` response message. - """ - - -class WriteFileRequest(proto.Message): - r"""``WriteFile`` request message. - - Attributes: - workspace (str): - Required. The workspace's name. - path (str): - Required. The file. - contents (bytes): - Required. The file's contents. - """ - - workspace = proto.Field( - proto.STRING, - number=1, - ) - path = proto.Field( - proto.STRING, - number=2, - ) - contents = proto.Field( - proto.BYTES, - number=3, - ) - - -class WriteFileResponse(proto.Message): - r"""``WriteFile`` response message. - """ - - -class InstallNpmPackagesRequest(proto.Message): - r"""``InstallNpmPackages`` request message. - - Attributes: - workspace (str): - Required. The workspace's name. - """ - - workspace = proto.Field( - proto.STRING, - number=1, - ) - - -class InstallNpmPackagesResponse(proto.Message): - r"""``InstallNpmPackages`` response message. - """ - - -class CompilationResult(proto.Message): - r"""Represents the result of compiling a Dataform project. - - This message has `oneof`_ fields (mutually exclusive fields). - For each oneof, at most one member field can be set at the same time. - Setting any member of the oneof automatically clears all other - members. - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - name (str): - Output only. The compilation result's name. - git_commitish (str): - 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`` - - This field is a member of `oneof`_ ``source``. - workspace (str): - Immutable. The name of the workspace to compile. Must be in - the format - ``projects/*/locations/*/repositories/*/workspaces/*``. - - This field is a member of `oneof`_ ``source``. - code_compilation_config (google.cloud.dataform_v1beta1.types.CompilationResult.CodeCompilationConfig): - Immutable. If set, fields of ``code_compilation_overrides`` - override the default compilation settings that are specified - in dataform.json. - dataform_core_version (str): - Output only. The version of ``@dataform/core`` that was used - for compilation. - compilation_errors (Sequence[google.cloud.dataform_v1beta1.types.CompilationResult.CompilationError]): - Output only. Errors encountered during - project compilation. - """ - - class CodeCompilationConfig(proto.Message): - r"""Configures various aspects of Dataform code compilation. - - Attributes: - default_database (str): - Optional. The default database (Google Cloud - project ID). - default_schema (str): - Optional. The default schema (BigQuery - dataset ID). - default_location (str): - 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. - assertion_schema (str): - Optional. The default schema (BigQuery - dataset ID) for assertions. - vars_ (Mapping[str, str]): - Optional. User-defined variables that are - made available to project code during - compilation. - database_suffix (str): - Optional. The suffix that should be appended - to all database (Google Cloud project ID) names. - schema_suffix (str): - Optional. The suffix that should be appended - to all schema (BigQuery dataset ID) names. - table_prefix (str): - Optional. The prefix that should be prepended - to all table names. - """ - - default_database = proto.Field( - proto.STRING, - number=1, - ) - default_schema = proto.Field( - proto.STRING, - number=2, - ) - default_location = proto.Field( - proto.STRING, - number=8, - ) - assertion_schema = proto.Field( - proto.STRING, - number=3, - ) - vars_ = proto.MapField( - proto.STRING, - proto.STRING, - number=4, - ) - database_suffix = proto.Field( - proto.STRING, - number=5, - ) - schema_suffix = proto.Field( - proto.STRING, - number=6, - ) - table_prefix = proto.Field( - proto.STRING, - number=7, - ) - - class CompilationError(proto.Message): - r"""An error encountered when attempting to compile a Dataform - project. - - Attributes: - message (str): - Output only. The error's top level message. - stack (str): - Output only. The error's full stack trace. - path (str): - Output only. The path of the file where this - error occurred, if available, relative to the - project root. - action_target (google.cloud.dataform_v1beta1.types.Target): - Output only. The identifier of the action - where this error occurred, if available. - """ - - message = proto.Field( - proto.STRING, - number=1, - ) - stack = proto.Field( - proto.STRING, - number=2, - ) - path = proto.Field( - proto.STRING, - number=3, - ) - action_target = proto.Field( - proto.MESSAGE, - number=4, - message='Target', - ) - - name = proto.Field( - proto.STRING, - number=1, - ) - git_commitish = proto.Field( - proto.STRING, - number=2, - oneof='source', - ) - workspace = proto.Field( - proto.STRING, - number=3, - oneof='source', - ) - code_compilation_config = proto.Field( - proto.MESSAGE, - number=4, - message=CodeCompilationConfig, - ) - dataform_core_version = proto.Field( - proto.STRING, - number=5, - ) - compilation_errors = proto.RepeatedField( - proto.MESSAGE, - number=6, - message=CompilationError, - ) - - -class ListCompilationResultsRequest(proto.Message): - r"""``ListCompilationResults`` request message. - - Attributes: - parent (str): - Required. The repository in which to list compilation - results. Must be in the format - ``projects/*/locations/*/repositories/*``. - page_size (int): - 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. - page_token (str): - 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. - """ - - parent = proto.Field( - proto.STRING, - number=1, - ) - page_size = proto.Field( - proto.INT32, - number=2, - ) - page_token = proto.Field( - proto.STRING, - number=3, - ) - - -class ListCompilationResultsResponse(proto.Message): - r"""``ListCompilationResults`` response message. - - Attributes: - compilation_results (Sequence[google.cloud.dataform_v1beta1.types.CompilationResult]): - List of compilation results. - next_page_token (str): - A token, which can be sent as ``page_token`` to retrieve the - next page. If this field is omitted, there are no subsequent - pages. - unreachable (Sequence[str]): - Locations which could not be reached. - """ - - @property - def raw_page(self): - return self - - compilation_results = proto.RepeatedField( - proto.MESSAGE, - number=1, - message='CompilationResult', - ) - next_page_token = proto.Field( - proto.STRING, - number=2, - ) - unreachable = proto.RepeatedField( - proto.STRING, - number=3, - ) - - -class GetCompilationResultRequest(proto.Message): - r"""``GetCompilationResult`` request message. - - Attributes: - name (str): - Required. The compilation result's name. - """ - - name = proto.Field( - proto.STRING, - number=1, - ) - - -class CreateCompilationResultRequest(proto.Message): - r"""``CreateCompilationResult`` request message. - - Attributes: - parent (str): - Required. The repository in which to create the compilation - result. Must be in the format - ``projects/*/locations/*/repositories/*``. - compilation_result (google.cloud.dataform_v1beta1.types.CompilationResult): - Required. The compilation result to create. - """ - - parent = proto.Field( - proto.STRING, - number=1, - ) - compilation_result = proto.Field( - proto.MESSAGE, - number=2, - message='CompilationResult', - ) - - -class Target(proto.Message): - r"""Represents an action identifier. If the action writes output, - the output will be written to the referenced database object. - - Attributes: - database (str): - The action's database (Google Cloud project - ID) . - schema (str): - The action's schema (BigQuery dataset ID), within - ``database``. - name (str): - The action's name, within ``database`` and ``schema``. - """ - - database = proto.Field( - proto.STRING, - number=1, - ) - schema = proto.Field( - proto.STRING, - number=2, - ) - name = proto.Field( - proto.STRING, - number=3, - ) - - -class RelationDescriptor(proto.Message): - r"""Describes a relation and its columns. - - Attributes: - description (str): - A text description of the relation. - columns (Sequence[google.cloud.dataform_v1beta1.types.RelationDescriptor.ColumnDescriptor]): - A list of descriptions of columns within the - relation. - bigquery_labels (Mapping[str, str]): - A set of BigQuery labels that should be - applied to the relation. - """ - - class ColumnDescriptor(proto.Message): - r"""Describes a column. - - Attributes: - path (Sequence[str]): - The identifier for the column. Each entry in ``path`` - represents one level of nesting. - description (str): - A textual description of the column. - bigquery_policy_tags (Sequence[str]): - A list of BigQuery policy tags that will be - applied to the column. - """ - - path = proto.RepeatedField( - proto.STRING, - number=1, - ) - description = proto.Field( - proto.STRING, - number=2, - ) - bigquery_policy_tags = proto.RepeatedField( - proto.STRING, - number=3, - ) - - description = proto.Field( - proto.STRING, - number=1, - ) - columns = proto.RepeatedField( - proto.MESSAGE, - number=2, - message=ColumnDescriptor, - ) - bigquery_labels = proto.MapField( - proto.STRING, - proto.STRING, - number=3, - ) - - -class CompilationResultAction(proto.Message): - r"""Represents a single Dataform action in a compilation result. - - This message has `oneof`_ fields (mutually exclusive fields). - For each oneof, at most one member field can be set at the same time. - Setting any member of the oneof automatically clears all other - members. - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - target (google.cloud.dataform_v1beta1.types.Target): - This action's identifier. Unique within the - compilation result. - canonical_target (google.cloud.dataform_v1beta1.types.Target): - The action's identifier if the project had - been compiled without any overrides configured. - Unique within the compilation result. - file_path (str): - The full path including filename in which - this action is located, relative to the - workspace root. - relation (google.cloud.dataform_v1beta1.types.CompilationResultAction.Relation): - The database relation created/updated by this - action. - - This field is a member of `oneof`_ ``compiled_object``. - operations (google.cloud.dataform_v1beta1.types.CompilationResultAction.Operations): - The database operations executed by this - action. - - This field is a member of `oneof`_ ``compiled_object``. - assertion (google.cloud.dataform_v1beta1.types.CompilationResultAction.Assertion): - The assertion executed by this action. - - This field is a member of `oneof`_ ``compiled_object``. - declaration (google.cloud.dataform_v1beta1.types.CompilationResultAction.Declaration): - The declaration declared by this action. - - This field is a member of `oneof`_ ``compiled_object``. - """ - - class Relation(proto.Message): - r"""Represents a database relation. - - Attributes: - dependency_targets (Sequence[google.cloud.dataform_v1beta1.types.Target]): - A list of actions that this action depends - on. - disabled (bool): - Whether this action is disabled (i.e. should - not be run). - tags (Sequence[str]): - Arbitrary, user-defined tags on this action. - relation_descriptor (google.cloud.dataform_v1beta1.types.RelationDescriptor): - Descriptor for the relation and its columns. - relation_type (google.cloud.dataform_v1beta1.types.CompilationResultAction.Relation.RelationType): - The type of this relation. - select_query (str): - The SELECT query which returns rows which - this relation should contain. - pre_operations (Sequence[str]): - SQL statements to be executed before creating - the relation. - post_operations (Sequence[str]): - SQL statements to be executed after creating - the relation. - incremental_table_config (google.cloud.dataform_v1beta1.types.CompilationResultAction.Relation.IncrementalTableConfig): - Configures ``INCREMENTAL_TABLE`` settings for this relation. - Only set if ``relation_type`` is ``INCREMENTAL_TABLE``. - partition_expression (str): - The SQL expression used to partition the - relation. - cluster_expressions (Sequence[str]): - A list of columns or SQL expressions used to - cluster the table. - partition_expiration_days (int): - Sets the partition expiration in days. - require_partition_filter (bool): - Specifies whether queries on this table must - include a predicate filter that filters on the - partitioning column. - additional_options (Mapping[str, str]): - 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. - """ - class RelationType(proto.Enum): - r"""Indicates the type of this relation.""" - RELATION_TYPE_UNSPECIFIED = 0 - TABLE = 1 - VIEW = 2 - INCREMENTAL_TABLE = 3 - MATERIALIZED_VIEW = 4 - - class IncrementalTableConfig(proto.Message): - r"""Contains settings for relations of type ``INCREMENTAL_TABLE``. - - Attributes: - incremental_select_query (str): - The SELECT query which returns rows which - should be inserted into the relation if it - already exists and is not being refreshed. - refresh_disabled (bool): - Whether this table should be protected from - being refreshed. - unique_key_parts (Sequence[str]): - 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. - update_partition_filter (str): - A SQL expression conditional used to limit the set of - existing rows considered for a merge operation (see - ``unique_key_parts`` for more information). - incremental_pre_operations (Sequence[str]): - SQL statements to be executed before - inserting new rows into the relation. - incremental_post_operations (Sequence[str]): - SQL statements to be executed after inserting - new rows into the relation. - """ - - incremental_select_query = proto.Field( - proto.STRING, - number=1, - ) - refresh_disabled = proto.Field( - proto.BOOL, - number=2, - ) - unique_key_parts = proto.RepeatedField( - proto.STRING, - number=3, - ) - update_partition_filter = proto.Field( - proto.STRING, - number=4, - ) - incremental_pre_operations = proto.RepeatedField( - proto.STRING, - number=5, - ) - incremental_post_operations = proto.RepeatedField( - proto.STRING, - number=6, - ) - - dependency_targets = proto.RepeatedField( - proto.MESSAGE, - number=1, - message='Target', - ) - disabled = proto.Field( - proto.BOOL, - number=2, - ) - tags = proto.RepeatedField( - proto.STRING, - number=3, - ) - relation_descriptor = proto.Field( - proto.MESSAGE, - number=4, - message='RelationDescriptor', - ) - relation_type = proto.Field( - proto.ENUM, - number=5, - enum='CompilationResultAction.Relation.RelationType', - ) - select_query = proto.Field( - proto.STRING, - number=6, - ) - pre_operations = proto.RepeatedField( - proto.STRING, - number=7, - ) - post_operations = proto.RepeatedField( - proto.STRING, - number=8, - ) - incremental_table_config = proto.Field( - proto.MESSAGE, - number=9, - message='CompilationResultAction.Relation.IncrementalTableConfig', - ) - partition_expression = proto.Field( - proto.STRING, - number=10, - ) - cluster_expressions = proto.RepeatedField( - proto.STRING, - number=11, - ) - partition_expiration_days = proto.Field( - proto.INT32, - number=12, - ) - require_partition_filter = proto.Field( - proto.BOOL, - number=13, - ) - additional_options = proto.MapField( - proto.STRING, - proto.STRING, - number=14, - ) - - class Operations(proto.Message): - r"""Represents a list of arbitrary database operations. - - Attributes: - dependency_targets (Sequence[google.cloud.dataform_v1beta1.types.Target]): - A list of actions that this action depends - on. - disabled (bool): - Whether this action is disabled (i.e. should - not be run). - tags (Sequence[str]): - Arbitrary, user-defined tags on this action. - relation_descriptor (google.cloud.dataform_v1beta1.types.RelationDescriptor): - Descriptor for any output relation and its columns. Only set - if ``has_output`` is true. - queries (Sequence[str]): - A list of arbitrary SQL statements that will - be executed without alteration. - has_output (bool): - Whether these operations produce an output - relation. - """ - - dependency_targets = proto.RepeatedField( - proto.MESSAGE, - number=1, - message='Target', - ) - disabled = proto.Field( - proto.BOOL, - number=2, - ) - tags = proto.RepeatedField( - proto.STRING, - number=3, - ) - relation_descriptor = proto.Field( - proto.MESSAGE, - number=6, - message='RelationDescriptor', - ) - queries = proto.RepeatedField( - proto.STRING, - number=4, - ) - has_output = proto.Field( - proto.BOOL, - number=5, - ) - - class Assertion(proto.Message): - r"""Represents an assertion upon a SQL query which is required - return zero rows. - - Attributes: - dependency_targets (Sequence[google.cloud.dataform_v1beta1.types.Target]): - A list of actions that this action depends - on. - parent_action (google.cloud.dataform_v1beta1.types.Target): - The parent action of this assertion. Only set - if this assertion was automatically generated. - disabled (bool): - Whether this action is disabled (i.e. should - not be run). - tags (Sequence[str]): - Arbitrary, user-defined tags on this action. - select_query (str): - The SELECT query which must return zero rows - in order for this assertion to succeed. - relation_descriptor (google.cloud.dataform_v1beta1.types.RelationDescriptor): - Descriptor for the assertion's - automatically-generated view and its columns. - """ - - dependency_targets = proto.RepeatedField( - proto.MESSAGE, - number=1, - message='Target', - ) - parent_action = proto.Field( - proto.MESSAGE, - number=5, - message='Target', - ) - disabled = proto.Field( - proto.BOOL, - number=2, - ) - tags = proto.RepeatedField( - proto.STRING, - number=3, - ) - select_query = proto.Field( - proto.STRING, - number=4, - ) - relation_descriptor = proto.Field( - proto.MESSAGE, - number=6, - message='RelationDescriptor', - ) - - class Declaration(proto.Message): - r"""Represents a relation which is not managed by Dataform but - which may be referenced by Dataform actions. - - Attributes: - relation_descriptor (google.cloud.dataform_v1beta1.types.RelationDescriptor): - 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. - """ - - relation_descriptor = proto.Field( - proto.MESSAGE, - number=1, - message='RelationDescriptor', - ) - - target = proto.Field( - proto.MESSAGE, - number=1, - message='Target', - ) - canonical_target = proto.Field( - proto.MESSAGE, - number=2, - message='Target', - ) - file_path = proto.Field( - proto.STRING, - number=3, - ) - relation = proto.Field( - proto.MESSAGE, - number=4, - oneof='compiled_object', - message=Relation, - ) - operations = proto.Field( - proto.MESSAGE, - number=5, - oneof='compiled_object', - message=Operations, - ) - assertion = proto.Field( - proto.MESSAGE, - number=6, - oneof='compiled_object', - message=Assertion, - ) - declaration = proto.Field( - proto.MESSAGE, - number=7, - oneof='compiled_object', - message=Declaration, - ) - - -class QueryCompilationResultActionsRequest(proto.Message): - r"""``QueryCompilationResultActions`` request message. - - Attributes: - name (str): - Required. The compilation result's name. - page_size (int): - 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. - page_token (str): - 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. - filter (str): - Optional. Optional filter for the returned list. Filtering - is only currently supported on the ``file_path`` field. - """ - - name = proto.Field( - proto.STRING, - number=1, - ) - page_size = proto.Field( - proto.INT32, - number=2, - ) - page_token = proto.Field( - proto.STRING, - number=3, - ) - filter = proto.Field( - proto.STRING, - number=4, - ) - - -class QueryCompilationResultActionsResponse(proto.Message): - r"""``QueryCompilationResultActions`` response message. - - Attributes: - compilation_result_actions (Sequence[google.cloud.dataform_v1beta1.types.CompilationResultAction]): - List of compilation result actions. - next_page_token (str): - A token, which can be sent as ``page_token`` to retrieve the - next page. If this field is omitted, there are no subsequent - pages. - """ - - @property - def raw_page(self): - return self - - compilation_result_actions = proto.RepeatedField( - proto.MESSAGE, - number=1, - message='CompilationResultAction', - ) - next_page_token = proto.Field( - proto.STRING, - number=2, - ) - - -class WorkflowInvocation(proto.Message): - r"""Represents a single invocation of a compilation result. - - Attributes: - name (str): - Output only. The workflow invocation's name. - compilation_result (str): - Immutable. The name of the compilation result to compile. - Must be in the format - ``projects/*/locations/*/repositories/*/compilationResults/*``. - invocation_config (google.cloud.dataform_v1beta1.types.WorkflowInvocation.InvocationConfig): - Immutable. If left unset, a default - InvocationConfig will be used. - state (google.cloud.dataform_v1beta1.types.WorkflowInvocation.State): - Output only. This workflow invocation's - current state. - invocation_timing (google.type.interval_pb2.Interval): - Output only. This workflow invocation's - timing details. - """ - class State(proto.Enum): - r"""Represents the current state of a workflow invocation.""" - STATE_UNSPECIFIED = 0 - RUNNING = 1 - SUCCEEDED = 2 - CANCELLED = 3 - FAILED = 4 - CANCELING = 5 - - class InvocationConfig(proto.Message): - r"""Includes various configuration options for this workflow invocation. - If both ``included_targets`` and ``included_tags`` are unset, all - actions will be included. - - Attributes: - included_targets (Sequence[google.cloud.dataform_v1beta1.types.Target]): - Immutable. The set of action identifiers to - include. - included_tags (Sequence[str]): - Immutable. The set of tags to include. - transitive_dependencies_included (bool): - Immutable. When set to true, transitive - dependencies of included actions will be - executed. - transitive_dependents_included (bool): - Immutable. When set to true, transitive - dependents of included actions will be executed. - fully_refresh_incremental_tables_enabled (bool): - Immutable. When set to true, any incremental - tables will be fully refreshed. - """ - - included_targets = proto.RepeatedField( - proto.MESSAGE, - number=1, - message='Target', - ) - included_tags = proto.RepeatedField( - proto.STRING, - number=2, - ) - transitive_dependencies_included = proto.Field( - proto.BOOL, - number=3, - ) - transitive_dependents_included = proto.Field( - proto.BOOL, - number=4, - ) - fully_refresh_incremental_tables_enabled = proto.Field( - proto.BOOL, - number=5, - ) - - name = proto.Field( - proto.STRING, - number=1, - ) - compilation_result = proto.Field( - proto.STRING, - number=2, - ) - invocation_config = proto.Field( - proto.MESSAGE, - number=3, - message=InvocationConfig, - ) - state = proto.Field( - proto.ENUM, - number=4, - enum=State, - ) - invocation_timing = proto.Field( - proto.MESSAGE, - number=5, - message=interval_pb2.Interval, - ) - - -class ListWorkflowInvocationsRequest(proto.Message): - r"""``ListWorkflowInvocations`` request message. - - Attributes: - parent (str): - Required. The parent resource of the WorkflowInvocation - type. Must be in the format - ``projects/*/locations/*/repositories/*``. - page_size (int): - 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. - page_token (str): - 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. - """ - - parent = proto.Field( - proto.STRING, - number=1, - ) - page_size = proto.Field( - proto.INT32, - number=2, - ) - page_token = proto.Field( - proto.STRING, - number=3, - ) - - -class ListWorkflowInvocationsResponse(proto.Message): - r"""``ListWorkflowInvocations`` response message. - - Attributes: - workflow_invocations (Sequence[google.cloud.dataform_v1beta1.types.WorkflowInvocation]): - List of workflow invocations. - next_page_token (str): - A token, which can be sent as ``page_token`` to retrieve the - next page. If this field is omitted, there are no subsequent - pages. - unreachable (Sequence[str]): - Locations which could not be reached. - """ - - @property - def raw_page(self): - return self - - workflow_invocations = proto.RepeatedField( - proto.MESSAGE, - number=1, - message='WorkflowInvocation', - ) - next_page_token = proto.Field( - proto.STRING, - number=2, - ) - unreachable = proto.RepeatedField( - proto.STRING, - number=3, - ) - - -class GetWorkflowInvocationRequest(proto.Message): - r"""``GetWorkflowInvocation`` request message. - - Attributes: - name (str): - Required. The workflow invocation resource's - name. - """ - - name = proto.Field( - proto.STRING, - number=1, - ) - - -class CreateWorkflowInvocationRequest(proto.Message): - r"""``CreateWorkflowInvocation`` request message. - - Attributes: - parent (str): - Required. The repository in which to create the workflow - invocation. Must be in the format - ``projects/*/locations/*/repositories/*``. - workflow_invocation (google.cloud.dataform_v1beta1.types.WorkflowInvocation): - Required. The workflow invocation resource to - create. - """ - - parent = proto.Field( - proto.STRING, - number=1, - ) - workflow_invocation = proto.Field( - proto.MESSAGE, - number=2, - message='WorkflowInvocation', - ) - - -class DeleteWorkflowInvocationRequest(proto.Message): - r"""``DeleteWorkflowInvocation`` request message. - - Attributes: - name (str): - Required. The workflow invocation resource's - name. - """ - - name = proto.Field( - proto.STRING, - number=1, - ) - - -class CancelWorkflowInvocationRequest(proto.Message): - r"""``CancelWorkflowInvocation`` request message. - - Attributes: - name (str): - Required. The workflow invocation resource's - name. - """ - - name = proto.Field( - proto.STRING, - number=1, - ) - - -class WorkflowInvocationAction(proto.Message): - r"""Represents a single action in a workflow invocation. - - Attributes: - target (google.cloud.dataform_v1beta1.types.Target): - Output only. This action's identifier. Unique - within the workflow invocation. - canonical_target (google.cloud.dataform_v1beta1.types.Target): - Output only. The action's identifier if the - project had been compiled without any overrides - configured. Unique within the compilation - result. - state (google.cloud.dataform_v1beta1.types.WorkflowInvocationAction.State): - Output only. This action's current state. - failure_reason (str): - Output only. If and only if action's state is - FAILED a failure reason is set. - invocation_timing (google.type.interval_pb2.Interval): - 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. - bigquery_action (google.cloud.dataform_v1beta1.types.WorkflowInvocationAction.BigQueryAction): - Output only. The workflow action's bigquery - action details. - """ - class State(proto.Enum): - r"""Represents the current state of an workflow invocation - action. - """ - PENDING = 0 - RUNNING = 1 - SKIPPED = 2 - DISABLED = 3 - SUCCEEDED = 4 - CANCELLED = 5 - FAILED = 6 - - class BigQueryAction(proto.Message): - r"""Represents a workflow action that will run against BigQuery. - - Attributes: - sql_script (str): - Output only. The generated BigQuery SQL - script that will be executed. - """ - - sql_script = proto.Field( - proto.STRING, - number=1, - ) - - target = proto.Field( - proto.MESSAGE, - number=1, - message='Target', - ) - canonical_target = proto.Field( - proto.MESSAGE, - number=2, - message='Target', - ) - state = proto.Field( - proto.ENUM, - number=4, - enum=State, - ) - failure_reason = proto.Field( - proto.STRING, - number=7, - ) - invocation_timing = proto.Field( - proto.MESSAGE, - number=5, - message=interval_pb2.Interval, - ) - bigquery_action = proto.Field( - proto.MESSAGE, - number=6, - message=BigQueryAction, - ) - - -class QueryWorkflowInvocationActionsRequest(proto.Message): - r"""``QueryWorkflowInvocationActions`` request message. - - Attributes: - name (str): - Required. The workflow invocation's name. - page_size (int): - 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. - page_token (str): - 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. - """ - - name = proto.Field( - proto.STRING, - number=1, - ) - page_size = proto.Field( - proto.INT32, - number=2, - ) - page_token = proto.Field( - proto.STRING, - number=3, - ) - - -class QueryWorkflowInvocationActionsResponse(proto.Message): - r"""``QueryWorkflowInvocationActions`` response message. - - Attributes: - workflow_invocation_actions (Sequence[google.cloud.dataform_v1beta1.types.WorkflowInvocationAction]): - List of workflow invocation actions. - next_page_token (str): - A token, which can be sent as ``page_token`` to retrieve the - next page. If this field is omitted, there are no subsequent - pages. - """ - - @property - def raw_page(self): - return self - - workflow_invocation_actions = proto.RepeatedField( - proto.MESSAGE, - number=1, - message='WorkflowInvocationAction', - ) - next_page_token = proto.Field( - proto.STRING, - number=2, - ) - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/v1beta1/mypy.ini b/owl-bot-staging/v1beta1/mypy.ini deleted file mode 100644 index 574c5ae..0000000 --- a/owl-bot-staging/v1beta1/mypy.ini +++ /dev/null @@ -1,3 +0,0 @@ -[mypy] -python_version = 3.7 -namespace_packages = True diff --git a/owl-bot-staging/v1beta1/noxfile.py b/owl-bot-staging/v1beta1/noxfile.py deleted file mode 100644 index 965629c..0000000 --- a/owl-bot-staging/v1beta1/noxfile.py +++ /dev/null @@ -1,179 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -import os -import pathlib -import shutil -import subprocess -import sys - - -import nox # type: ignore - -ALL_PYTHON = [ - "3.7", - "3.8", - "3.9", - "3.10", -] - -CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() - -LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" -PACKAGE_NAME = subprocess.check_output([sys.executable, "setup.py", "--name"], encoding="utf-8") - -BLACK_VERSION = "black==22.3.0" -BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] -DEFAULT_PYTHON_VERSION = "3.10" - -nox.sessions = [ - "unit", - "cover", - "mypy", - "check_lower_bounds" - # exclude update_lower_bounds from default - "docs", - "blacken", - "lint", - "lint_setup_py", -] - -@nox.session(python=ALL_PYTHON) -def unit(session): - """Run the unit test suite.""" - - session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') - session.install('-e', '.') - - session.run( - 'py.test', - '--quiet', - '--cov=google/cloud/dataform_v1beta1/', - '--cov=tests/', - '--cov-config=.coveragerc', - '--cov-report=term', - '--cov-report=html', - os.path.join('tests', 'unit', ''.join(session.posargs)) - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def cover(session): - """Run the final coverage report. - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python=ALL_PYTHON) -def mypy(session): - """Run the type checker.""" - session.install('mypy', 'types-pkg_resources') - session.install('.') - session.run( - 'mypy', - '--explicit-package-bases', - 'google', - ) - - -@nox.session -def update_lower_bounds(session): - """Update lower bounds in constraints.txt to match setup.py""" - session.install('google-cloud-testutils') - session.install('.') - - session.run( - 'lower-bound-checker', - 'update', - '--package-name', - PACKAGE_NAME, - '--constraints-file', - str(LOWER_BOUND_CONSTRAINTS_FILE), - ) - - -@nox.session -def check_lower_bounds(session): - """Check lower bounds in setup.py are reflected in constraints file""" - session.install('google-cloud-testutils') - session.install('.') - - session.run( - 'lower-bound-checker', - 'check', - '--package-name', - PACKAGE_NAME, - '--constraints-file', - str(LOWER_BOUND_CONSTRAINTS_FILE), - ) - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx==4.0.1", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION) - session.run( - "black", - "--check", - *BLACK_PATHS, - ) - session.run("flake8", "google", "tests", "samples") - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def blacken(session): - """Run black. Format code to uniform standard.""" - session.install(BLACK_VERSION) - session.run( - "black", - *BLACK_PATHS, - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_cancel_workflow_invocation_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_cancel_workflow_invocation_async.py deleted file mode 100644 index b837244..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_cancel_workflow_invocation_async.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CancelWorkflowInvocation -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_cancel_workflow_invocation(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.CancelWorkflowInvocationRequest( - name="name_value", - ) - - # Make the request - await client.cancel_workflow_invocation(request=request) - - -# [END dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_cancel_workflow_invocation_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_cancel_workflow_invocation_sync.py deleted file mode 100644 index 566f192..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_cancel_workflow_invocation_sync.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CancelWorkflowInvocation -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_cancel_workflow_invocation(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.CancelWorkflowInvocationRequest( - name="name_value", - ) - - # Make the request - client.cancel_workflow_invocation(request=request) - - -# [END dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_commit_workspace_changes_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_commit_workspace_changes_async.py deleted file mode 100644 index ef053ba..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_commit_workspace_changes_async.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CommitWorkspaceChanges -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_commit_workspace_changes(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - author = dataform_v1beta1.CommitAuthor() - author.name = "name_value" - author.email_address = "email_address_value" - - request = dataform_v1beta1.CommitWorkspaceChangesRequest( - name="name_value", - author=author, - ) - - # Make the request - await client.commit_workspace_changes(request=request) - - -# [END dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_commit_workspace_changes_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_commit_workspace_changes_sync.py deleted file mode 100644 index 2a2baad..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_commit_workspace_changes_sync.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CommitWorkspaceChanges -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_commit_workspace_changes(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - author = dataform_v1beta1.CommitAuthor() - author.name = "name_value" - author.email_address = "email_address_value" - - request = dataform_v1beta1.CommitWorkspaceChangesRequest( - name="name_value", - author=author, - ) - - # Make the request - client.commit_workspace_changes(request=request) - - -# [END dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_compilation_result_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_compilation_result_async.py deleted file mode 100644 index 6cec1c3..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_compilation_result_async.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CreateCompilationResult -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_create_compilation_result(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - compilation_result = dataform_v1beta1.CompilationResult() - compilation_result.git_commitish = "git_commitish_value" - - request = dataform_v1beta1.CreateCompilationResultRequest( - parent="parent_value", - compilation_result=compilation_result, - ) - - # Make the request - response = await client.create_compilation_result(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_CreateCompilationResult_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_compilation_result_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_compilation_result_sync.py deleted file mode 100644 index d44ccee..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_compilation_result_sync.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CreateCompilationResult -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_CreateCompilationResult_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_create_compilation_result(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - compilation_result = dataform_v1beta1.CompilationResult() - compilation_result.git_commitish = "git_commitish_value" - - request = dataform_v1beta1.CreateCompilationResultRequest( - parent="parent_value", - compilation_result=compilation_result, - ) - - # Make the request - response = client.create_compilation_result(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_CreateCompilationResult_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_repository_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_repository_async.py deleted file mode 100644 index 9cb6d7d..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_repository_async.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CreateRepository -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_create_repository(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.CreateRepositoryRequest( - parent="parent_value", - repository_id="repository_id_value", - ) - - # Make the request - response = await client.create_repository(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_CreateRepository_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_repository_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_repository_sync.py deleted file mode 100644 index 0f0719e..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_repository_sync.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CreateRepository -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_CreateRepository_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_create_repository(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.CreateRepositoryRequest( - parent="parent_value", - repository_id="repository_id_value", - ) - - # Make the request - response = client.create_repository(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_CreateRepository_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workflow_invocation_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workflow_invocation_async.py deleted file mode 100644 index 80ae5d3..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workflow_invocation_async.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CreateWorkflowInvocation -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_create_workflow_invocation(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.CreateWorkflowInvocationRequest( - parent="parent_value", - ) - - # Make the request - response = await client.create_workflow_invocation(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workflow_invocation_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workflow_invocation_sync.py deleted file mode 100644 index 65974f1..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workflow_invocation_sync.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CreateWorkflowInvocation -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_create_workflow_invocation(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.CreateWorkflowInvocationRequest( - parent="parent_value", - ) - - # Make the request - response = client.create_workflow_invocation(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workspace_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workspace_async.py deleted file mode 100644 index e521029..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workspace_async.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CreateWorkspace -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_create_workspace(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.CreateWorkspaceRequest( - parent="parent_value", - workspace_id="workspace_id_value", - ) - - # Make the request - response = await client.create_workspace(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_CreateWorkspace_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workspace_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workspace_sync.py deleted file mode 100644 index 0005a29..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_create_workspace_sync.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CreateWorkspace -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_CreateWorkspace_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_create_workspace(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.CreateWorkspaceRequest( - parent="parent_value", - workspace_id="workspace_id_value", - ) - - # Make the request - response = client.create_workspace(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_CreateWorkspace_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_repository_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_repository_async.py deleted file mode 100644 index 211bab3..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_repository_async.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for DeleteRepository -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_delete_repository(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.DeleteRepositoryRequest( - name="name_value", - ) - - # Make the request - await client.delete_repository(request=request) - - -# [END dataform_v1beta1_generated_Dataform_DeleteRepository_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_repository_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_repository_sync.py deleted file mode 100644 index 4ba2349..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_repository_sync.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for DeleteRepository -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_DeleteRepository_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_delete_repository(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.DeleteRepositoryRequest( - name="name_value", - ) - - # Make the request - client.delete_repository(request=request) - - -# [END dataform_v1beta1_generated_Dataform_DeleteRepository_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workflow_invocation_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workflow_invocation_async.py deleted file mode 100644 index 0773958..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workflow_invocation_async.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for DeleteWorkflowInvocation -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_delete_workflow_invocation(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.DeleteWorkflowInvocationRequest( - name="name_value", - ) - - # Make the request - await client.delete_workflow_invocation(request=request) - - -# [END dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workflow_invocation_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workflow_invocation_sync.py deleted file mode 100644 index 184ffd8..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workflow_invocation_sync.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for DeleteWorkflowInvocation -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_delete_workflow_invocation(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.DeleteWorkflowInvocationRequest( - name="name_value", - ) - - # Make the request - client.delete_workflow_invocation(request=request) - - -# [END dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workspace_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workspace_async.py deleted file mode 100644 index a5f76d9..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workspace_async.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for DeleteWorkspace -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_delete_workspace(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.DeleteWorkspaceRequest( - name="name_value", - ) - - # Make the request - await client.delete_workspace(request=request) - - -# [END dataform_v1beta1_generated_Dataform_DeleteWorkspace_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workspace_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workspace_sync.py deleted file mode 100644 index 1458c0b..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_delete_workspace_sync.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for DeleteWorkspace -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_DeleteWorkspace_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_delete_workspace(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.DeleteWorkspaceRequest( - name="name_value", - ) - - # Make the request - client.delete_workspace(request=request) - - -# [END dataform_v1beta1_generated_Dataform_DeleteWorkspace_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_diff_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_diff_async.py deleted file mode 100644 index e99cc5f..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_diff_async.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for FetchFileDiff -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_fetch_file_diff(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.FetchFileDiffRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - response = await client.fetch_file_diff(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_FetchFileDiff_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_diff_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_diff_sync.py deleted file mode 100644 index a26b604..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_diff_sync.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for FetchFileDiff -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_FetchFileDiff_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_fetch_file_diff(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.FetchFileDiffRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - response = client.fetch_file_diff(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_FetchFileDiff_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_git_statuses_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_git_statuses_async.py deleted file mode 100644 index 289dd0e..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_git_statuses_async.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for FetchFileGitStatuses -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_fetch_file_git_statuses(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.FetchFileGitStatusesRequest( - name="name_value", - ) - - # Make the request - response = await client.fetch_file_git_statuses(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_git_statuses_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_git_statuses_sync.py deleted file mode 100644 index 6cdd072..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_file_git_statuses_sync.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for FetchFileGitStatuses -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_fetch_file_git_statuses(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.FetchFileGitStatusesRequest( - name="name_value", - ) - - # Make the request - response = client.fetch_file_git_statuses(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_async.py deleted file mode 100644 index aa31603..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_async.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for FetchGitAheadBehind -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_fetch_git_ahead_behind(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.FetchGitAheadBehindRequest( - name="name_value", - ) - - # Make the request - response = await client.fetch_git_ahead_behind(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_sync.py deleted file mode 100644 index 6088b62..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_sync.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for FetchGitAheadBehind -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_fetch_git_ahead_behind(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.FetchGitAheadBehindRequest( - name="name_value", - ) - - # Make the request - response = client.fetch_git_ahead_behind(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_remote_branches_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_remote_branches_async.py deleted file mode 100644 index d6a2eb7..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_remote_branches_async.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for FetchRemoteBranches -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_fetch_remote_branches(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.FetchRemoteBranchesRequest( - name="name_value", - ) - - # Make the request - response = await client.fetch_remote_branches(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_FetchRemoteBranches_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_remote_branches_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_remote_branches_sync.py deleted file mode 100644 index 74c7bb1..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_fetch_remote_branches_sync.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for FetchRemoteBranches -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_FetchRemoteBranches_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_fetch_remote_branches(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.FetchRemoteBranchesRequest( - name="name_value", - ) - - # Make the request - response = client.fetch_remote_branches(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_FetchRemoteBranches_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_compilation_result_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_compilation_result_async.py deleted file mode 100644 index 6e42896..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_compilation_result_async.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetCompilationResult -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_get_compilation_result(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.GetCompilationResultRequest( - name="name_value", - ) - - # Make the request - response = await client.get_compilation_result(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_GetCompilationResult_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_compilation_result_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_compilation_result_sync.py deleted file mode 100644 index 4b37ab2..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_compilation_result_sync.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetCompilationResult -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_GetCompilationResult_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_get_compilation_result(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.GetCompilationResultRequest( - name="name_value", - ) - - # Make the request - response = client.get_compilation_result(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_GetCompilationResult_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_repository_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_repository_async.py deleted file mode 100644 index b90fd17..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_repository_async.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetRepository -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_get_repository(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.GetRepositoryRequest( - name="name_value", - ) - - # Make the request - response = await client.get_repository(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_GetRepository_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_repository_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_repository_sync.py deleted file mode 100644 index 499bfc5..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_repository_sync.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetRepository -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_GetRepository_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_get_repository(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.GetRepositoryRequest( - name="name_value", - ) - - # Make the request - response = client.get_repository(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_GetRepository_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workflow_invocation_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workflow_invocation_async.py deleted file mode 100644 index 3e28ad6..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workflow_invocation_async.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetWorkflowInvocation -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_get_workflow_invocation(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.GetWorkflowInvocationRequest( - name="name_value", - ) - - # Make the request - response = await client.get_workflow_invocation(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workflow_invocation_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workflow_invocation_sync.py deleted file mode 100644 index e3d2eaa..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workflow_invocation_sync.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetWorkflowInvocation -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_get_workflow_invocation(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.GetWorkflowInvocationRequest( - name="name_value", - ) - - # Make the request - response = client.get_workflow_invocation(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workspace_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workspace_async.py deleted file mode 100644 index 8f4cb60..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workspace_async.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetWorkspace -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_get_workspace(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.GetWorkspaceRequest( - name="name_value", - ) - - # Make the request - response = await client.get_workspace(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_GetWorkspace_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workspace_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workspace_sync.py deleted file mode 100644 index 1704f66..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_get_workspace_sync.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetWorkspace -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_GetWorkspace_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_get_workspace(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.GetWorkspaceRequest( - name="name_value", - ) - - # Make the request - response = client.get_workspace(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_GetWorkspace_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_install_npm_packages_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_install_npm_packages_async.py deleted file mode 100644 index ea40b65..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_install_npm_packages_async.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for InstallNpmPackages -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_install_npm_packages(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.InstallNpmPackagesRequest( - workspace="workspace_value", - ) - - # Make the request - response = await client.install_npm_packages(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_InstallNpmPackages_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_install_npm_packages_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_install_npm_packages_sync.py deleted file mode 100644 index f63ffe0..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_install_npm_packages_sync.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for InstallNpmPackages -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_InstallNpmPackages_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_install_npm_packages(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.InstallNpmPackagesRequest( - workspace="workspace_value", - ) - - # Make the request - response = client.install_npm_packages(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_InstallNpmPackages_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_compilation_results_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_compilation_results_async.py deleted file mode 100644 index 06cb733..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_compilation_results_async.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListCompilationResults -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_list_compilation_results(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ListCompilationResultsRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_compilation_results(request=request) - - # Handle the response - async for response in page_result: - print(response) - -# [END dataform_v1beta1_generated_Dataform_ListCompilationResults_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_compilation_results_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_compilation_results_sync.py deleted file mode 100644 index 9726782..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_compilation_results_sync.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListCompilationResults -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_ListCompilationResults_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_list_compilation_results(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ListCompilationResultsRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_compilation_results(request=request) - - # Handle the response - for response in page_result: - print(response) - -# [END dataform_v1beta1_generated_Dataform_ListCompilationResults_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_repositories_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_repositories_async.py deleted file mode 100644 index 5302adc..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_repositories_async.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListRepositories -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_list_repositories(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ListRepositoriesRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_repositories(request=request) - - # Handle the response - async for response in page_result: - print(response) - -# [END dataform_v1beta1_generated_Dataform_ListRepositories_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_repositories_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_repositories_sync.py deleted file mode 100644 index 5210900..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_repositories_sync.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListRepositories -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_ListRepositories_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_list_repositories(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ListRepositoriesRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_repositories(request=request) - - # Handle the response - for response in page_result: - print(response) - -# [END dataform_v1beta1_generated_Dataform_ListRepositories_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workflow_invocations_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workflow_invocations_async.py deleted file mode 100644 index 41b6e4d..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workflow_invocations_async.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListWorkflowInvocations -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_list_workflow_invocations(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ListWorkflowInvocationsRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_workflow_invocations(request=request) - - # Handle the response - async for response in page_result: - print(response) - -# [END dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workflow_invocations_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workflow_invocations_sync.py deleted file mode 100644 index e19c771..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workflow_invocations_sync.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListWorkflowInvocations -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_list_workflow_invocations(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ListWorkflowInvocationsRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_workflow_invocations(request=request) - - # Handle the response - for response in page_result: - print(response) - -# [END dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workspaces_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workspaces_async.py deleted file mode 100644 index ab69fca..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workspaces_async.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListWorkspaces -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_list_workspaces(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ListWorkspacesRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_workspaces(request=request) - - # Handle the response - async for response in page_result: - print(response) - -# [END dataform_v1beta1_generated_Dataform_ListWorkspaces_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workspaces_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workspaces_sync.py deleted file mode 100644 index 6b2cdab..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_list_workspaces_sync.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListWorkspaces -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_ListWorkspaces_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_list_workspaces(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ListWorkspacesRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_workspaces(request=request) - - # Handle the response - for response in page_result: - print(response) - -# [END dataform_v1beta1_generated_Dataform_ListWorkspaces_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_make_directory_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_make_directory_async.py deleted file mode 100644 index b6b2110..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_make_directory_async.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for MakeDirectory -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_make_directory(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.MakeDirectoryRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - response = await client.make_directory(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_MakeDirectory_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_make_directory_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_make_directory_sync.py deleted file mode 100644 index 511e194..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_make_directory_sync.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for MakeDirectory -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_MakeDirectory_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_make_directory(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.MakeDirectoryRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - response = client.make_directory(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_MakeDirectory_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_directory_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_directory_async.py deleted file mode 100644 index 54f69cd..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_directory_async.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for MoveDirectory -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_move_directory(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.MoveDirectoryRequest( - workspace="workspace_value", - path="path_value", - new_path="new_path_value", - ) - - # Make the request - response = await client.move_directory(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_MoveDirectory_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_directory_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_directory_sync.py deleted file mode 100644 index 15a8f58..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_directory_sync.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for MoveDirectory -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_MoveDirectory_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_move_directory(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.MoveDirectoryRequest( - workspace="workspace_value", - path="path_value", - new_path="new_path_value", - ) - - # Make the request - response = client.move_directory(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_MoveDirectory_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_file_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_file_async.py deleted file mode 100644 index 4266481..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_file_async.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for MoveFile -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_move_file(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.MoveFileRequest( - workspace="workspace_value", - path="path_value", - new_path="new_path_value", - ) - - # Make the request - response = await client.move_file(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_MoveFile_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_file_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_file_sync.py deleted file mode 100644 index 7e2c7c3..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_move_file_sync.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for MoveFile -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_MoveFile_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_move_file(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.MoveFileRequest( - workspace="workspace_value", - path="path_value", - new_path="new_path_value", - ) - - # Make the request - response = client.move_file(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_MoveFile_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_pull_git_commits_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_pull_git_commits_async.py deleted file mode 100644 index d89788e..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_pull_git_commits_async.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for PullGitCommits -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_pull_git_commits(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - author = dataform_v1beta1.CommitAuthor() - author.name = "name_value" - author.email_address = "email_address_value" - - request = dataform_v1beta1.PullGitCommitsRequest( - name="name_value", - author=author, - ) - - # Make the request - await client.pull_git_commits(request=request) - - -# [END dataform_v1beta1_generated_Dataform_PullGitCommits_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_pull_git_commits_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_pull_git_commits_sync.py deleted file mode 100644 index 5327931..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_pull_git_commits_sync.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for PullGitCommits -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_PullGitCommits_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_pull_git_commits(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - author = dataform_v1beta1.CommitAuthor() - author.name = "name_value" - author.email_address = "email_address_value" - - request = dataform_v1beta1.PullGitCommitsRequest( - name="name_value", - author=author, - ) - - # Make the request - client.pull_git_commits(request=request) - - -# [END dataform_v1beta1_generated_Dataform_PullGitCommits_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_push_git_commits_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_push_git_commits_async.py deleted file mode 100644 index 4d83316..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_push_git_commits_async.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for PushGitCommits -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_push_git_commits(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.PushGitCommitsRequest( - name="name_value", - ) - - # Make the request - await client.push_git_commits(request=request) - - -# [END dataform_v1beta1_generated_Dataform_PushGitCommits_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_push_git_commits_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_push_git_commits_sync.py deleted file mode 100644 index 73fdf41..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_push_git_commits_sync.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for PushGitCommits -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_PushGitCommits_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_push_git_commits(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.PushGitCommitsRequest( - name="name_value", - ) - - # Make the request - client.push_git_commits(request=request) - - -# [END dataform_v1beta1_generated_Dataform_PushGitCommits_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_compilation_result_actions_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_compilation_result_actions_async.py deleted file mode 100644 index 52f444b..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_compilation_result_actions_async.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for QueryCompilationResultActions -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_query_compilation_result_actions(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.QueryCompilationResultActionsRequest( - name="name_value", - ) - - # Make the request - page_result = client.query_compilation_result_actions(request=request) - - # Handle the response - async for response in page_result: - print(response) - -# [END dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_compilation_result_actions_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_compilation_result_actions_sync.py deleted file mode 100644 index ce85bda..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_compilation_result_actions_sync.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for QueryCompilationResultActions -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_query_compilation_result_actions(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.QueryCompilationResultActionsRequest( - name="name_value", - ) - - # Make the request - page_result = client.query_compilation_result_actions(request=request) - - # Handle the response - for response in page_result: - print(response) - -# [END dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_directory_contents_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_directory_contents_async.py deleted file mode 100644 index a2874e2..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_directory_contents_async.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for QueryDirectoryContents -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_query_directory_contents(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.QueryDirectoryContentsRequest( - workspace="workspace_value", - ) - - # Make the request - page_result = client.query_directory_contents(request=request) - - # Handle the response - async for response in page_result: - print(response) - -# [END dataform_v1beta1_generated_Dataform_QueryDirectoryContents_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_directory_contents_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_directory_contents_sync.py deleted file mode 100644 index 6758fdf..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_directory_contents_sync.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for QueryDirectoryContents -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_QueryDirectoryContents_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_query_directory_contents(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.QueryDirectoryContentsRequest( - workspace="workspace_value", - ) - - # Make the request - page_result = client.query_directory_contents(request=request) - - # Handle the response - for response in page_result: - print(response) - -# [END dataform_v1beta1_generated_Dataform_QueryDirectoryContents_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_async.py deleted file mode 100644 index 27cfaaf..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_async.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for QueryWorkflowInvocationActions -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_query_workflow_invocation_actions(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.QueryWorkflowInvocationActionsRequest( - name="name_value", - ) - - # Make the request - page_result = client.query_workflow_invocation_actions(request=request) - - # Handle the response - async for response in page_result: - print(response) - -# [END dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_sync.py deleted file mode 100644 index 9858402..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_sync.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for QueryWorkflowInvocationActions -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_query_workflow_invocation_actions(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.QueryWorkflowInvocationActionsRequest( - name="name_value", - ) - - # Make the request - page_result = client.query_workflow_invocation_actions(request=request) - - # Handle the response - for response in page_result: - print(response) - -# [END dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_read_file_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_read_file_async.py deleted file mode 100644 index b5d8fc0..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_read_file_async.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ReadFile -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_read_file(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ReadFileRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - response = await client.read_file(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_ReadFile_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_read_file_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_read_file_sync.py deleted file mode 100644 index d39b4ba..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_read_file_sync.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ReadFile -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_ReadFile_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_read_file(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ReadFileRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - response = client.read_file(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_ReadFile_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_directory_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_directory_async.py deleted file mode 100644 index e5af286..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_directory_async.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for RemoveDirectory -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_remove_directory(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.RemoveDirectoryRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - await client.remove_directory(request=request) - - -# [END dataform_v1beta1_generated_Dataform_RemoveDirectory_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_directory_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_directory_sync.py deleted file mode 100644 index 8c7c1d1..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_directory_sync.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for RemoveDirectory -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_RemoveDirectory_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_remove_directory(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.RemoveDirectoryRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - client.remove_directory(request=request) - - -# [END dataform_v1beta1_generated_Dataform_RemoveDirectory_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_file_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_file_async.py deleted file mode 100644 index 8882913..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_file_async.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for RemoveFile -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_remove_file(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.RemoveFileRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - await client.remove_file(request=request) - - -# [END dataform_v1beta1_generated_Dataform_RemoveFile_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_file_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_file_sync.py deleted file mode 100644 index e16511f..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_remove_file_sync.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for RemoveFile -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_RemoveFile_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_remove_file(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.RemoveFileRequest( - workspace="workspace_value", - path="path_value", - ) - - # Make the request - client.remove_file(request=request) - - -# [END dataform_v1beta1_generated_Dataform_RemoveFile_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_reset_workspace_changes_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_reset_workspace_changes_async.py deleted file mode 100644 index 35ea778..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_reset_workspace_changes_async.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ResetWorkspaceChanges -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_reset_workspace_changes(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ResetWorkspaceChangesRequest( - name="name_value", - ) - - # Make the request - await client.reset_workspace_changes(request=request) - - -# [END dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_reset_workspace_changes_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_reset_workspace_changes_sync.py deleted file mode 100644 index be8a247..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_reset_workspace_changes_sync.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ResetWorkspaceChanges -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_reset_workspace_changes(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.ResetWorkspaceChangesRequest( - name="name_value", - ) - - # Make the request - client.reset_workspace_changes(request=request) - - -# [END dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_update_repository_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_update_repository_async.py deleted file mode 100644 index 678711d..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_update_repository_async.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for UpdateRepository -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_update_repository(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.UpdateRepositoryRequest( - ) - - # Make the request - response = await client.update_repository(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_UpdateRepository_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_update_repository_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_update_repository_sync.py deleted file mode 100644 index 761dbd4..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_update_repository_sync.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for UpdateRepository -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_UpdateRepository_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_update_repository(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.UpdateRepositoryRequest( - ) - - # Make the request - response = client.update_repository(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_UpdateRepository_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_write_file_async.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_write_file_async.py deleted file mode 100644 index 4a07b88..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_write_file_async.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for WriteFile -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -async def sample_write_file(): - # Create a client - client = dataform_v1beta1.DataformAsyncClient() - - # Initialize request argument(s) - request = dataform_v1beta1.WriteFileRequest( - workspace="workspace_value", - path="path_value", - contents=b'contents_blob', - ) - - # Make the request - response = await client.write_file(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_WriteFile_async] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_write_file_sync.py b/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_write_file_sync.py deleted file mode 100644 index 3b7f5d4..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/dataform_v1beta1_generated_dataform_write_file_sync.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -# Generated code. DO NOT EDIT! -# -# Snippet for WriteFile -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dataform - - -# [START dataform_v1beta1_generated_Dataform_WriteFile_sync] -# 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. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import dataform_v1beta1 - - -def sample_write_file(): - # Create a client - client = dataform_v1beta1.DataformClient() - - # Initialize request argument(s) - request = dataform_v1beta1.WriteFileRequest( - workspace="workspace_value", - path="path_value", - contents=b'contents_blob', - ) - - # Make the request - response = client.write_file(request=request) - - # Handle the response - print(response) - -# [END dataform_v1beta1_generated_Dataform_WriteFile_sync] diff --git a/owl-bot-staging/v1beta1/samples/generated_samples/snippet_metadata_dataform_v1beta1.json b/owl-bot-staging/v1beta1/samples/generated_samples/snippet_metadata_dataform_v1beta1.json deleted file mode 100644 index 9a32187..0000000 --- a/owl-bot-staging/v1beta1/samples/generated_samples/snippet_metadata_dataform_v1beta1.json +++ /dev/null @@ -1,5646 +0,0 @@ -{ - "clientLibrary": { - "apis": [ - { - "id": "google.cloud.dataform.v1beta1", - "version": "v1beta1" - } - ], - "language": "PYTHON", - "name": "google-cloud-dataform" - }, - "snippets": [ - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.cancel_workflow_invocation", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.CancelWorkflowInvocation", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "CancelWorkflowInvocation" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.CancelWorkflowInvocationRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "cancel_workflow_invocation" - }, - "description": "Sample for CancelWorkflowInvocation", - "file": "dataform_v1beta1_generated_dataform_cancel_workflow_invocation_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_async", - "segments": [ - { - "end": 49, - "start": 27, - "type": "FULL" - }, - { - "end": 49, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_cancel_workflow_invocation_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.cancel_workflow_invocation", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.CancelWorkflowInvocation", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "CancelWorkflowInvocation" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.CancelWorkflowInvocationRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "cancel_workflow_invocation" - }, - "description": "Sample for CancelWorkflowInvocation", - "file": "dataform_v1beta1_generated_dataform_cancel_workflow_invocation_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_sync", - "segments": [ - { - "end": 49, - "start": 27, - "type": "FULL" - }, - { - "end": 49, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_cancel_workflow_invocation_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.commit_workspace_changes", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.CommitWorkspaceChanges", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "CommitWorkspaceChanges" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.CommitWorkspaceChangesRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "commit_workspace_changes" - }, - "description": "Sample for CommitWorkspaceChanges", - "file": "dataform_v1beta1_generated_dataform_commit_workspace_changes_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_async", - "segments": [ - { - "end": 54, - "start": 27, - "type": "FULL" - }, - { - "end": 54, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 50, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 51, - "type": "REQUEST_EXECUTION" - }, - { - "end": 55, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_commit_workspace_changes_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.commit_workspace_changes", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.CommitWorkspaceChanges", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "CommitWorkspaceChanges" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.CommitWorkspaceChangesRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "commit_workspace_changes" - }, - "description": "Sample for CommitWorkspaceChanges", - "file": "dataform_v1beta1_generated_dataform_commit_workspace_changes_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_sync", - "segments": [ - { - "end": 54, - "start": 27, - "type": "FULL" - }, - { - "end": 54, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 50, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 51, - "type": "REQUEST_EXECUTION" - }, - { - "end": 55, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_commit_workspace_changes_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.create_compilation_result", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateCompilationResult", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "CreateCompilationResult" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.CreateCompilationResultRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "compilation_result", - "type": "google.cloud.dataform_v1beta1.types.CompilationResult" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.CompilationResult", - "shortName": "create_compilation_result" - }, - "description": "Sample for CreateCompilationResult", - "file": "dataform_v1beta1_generated_dataform_create_compilation_result_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_CreateCompilationResult_async", - "segments": [ - { - "end": 55, - "start": 27, - "type": "FULL" - }, - { - "end": 55, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 49, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 52, - "start": 50, - "type": "REQUEST_EXECUTION" - }, - { - "end": 56, - "start": 53, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_create_compilation_result_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.create_compilation_result", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateCompilationResult", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "CreateCompilationResult" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.CreateCompilationResultRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "compilation_result", - "type": "google.cloud.dataform_v1beta1.types.CompilationResult" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.CompilationResult", - "shortName": "create_compilation_result" - }, - "description": "Sample for CreateCompilationResult", - "file": "dataform_v1beta1_generated_dataform_create_compilation_result_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_CreateCompilationResult_sync", - "segments": [ - { - "end": 55, - "start": 27, - "type": "FULL" - }, - { - "end": 55, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 49, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 52, - "start": 50, - "type": "REQUEST_EXECUTION" - }, - { - "end": 56, - "start": 53, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_create_compilation_result_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.create_repository", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateRepository", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "CreateRepository" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.CreateRepositoryRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "repository", - "type": "google.cloud.dataform_v1beta1.types.Repository" - }, - { - "name": "repository_id", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.Repository", - "shortName": "create_repository" - }, - "description": "Sample for CreateRepository", - "file": "dataform_v1beta1_generated_dataform_create_repository_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_CreateRepository_async", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 49, - "start": 47, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_create_repository_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.create_repository", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateRepository", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "CreateRepository" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.CreateRepositoryRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "repository", - "type": "google.cloud.dataform_v1beta1.types.Repository" - }, - { - "name": "repository_id", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.Repository", - "shortName": "create_repository" - }, - "description": "Sample for CreateRepository", - "file": "dataform_v1beta1_generated_dataform_create_repository_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_CreateRepository_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 49, - "start": 47, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_create_repository_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.create_workflow_invocation", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateWorkflowInvocation", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "CreateWorkflowInvocation" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.CreateWorkflowInvocationRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "workflow_invocation", - "type": "google.cloud.dataform_v1beta1.types.WorkflowInvocation" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.WorkflowInvocation", - "shortName": "create_workflow_invocation" - }, - "description": "Sample for CreateWorkflowInvocation", - "file": "dataform_v1beta1_generated_dataform_create_workflow_invocation_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_async", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_create_workflow_invocation_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.create_workflow_invocation", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateWorkflowInvocation", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "CreateWorkflowInvocation" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.CreateWorkflowInvocationRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "workflow_invocation", - "type": "google.cloud.dataform_v1beta1.types.WorkflowInvocation" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.WorkflowInvocation", - "shortName": "create_workflow_invocation" - }, - "description": "Sample for CreateWorkflowInvocation", - "file": "dataform_v1beta1_generated_dataform_create_workflow_invocation_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_create_workflow_invocation_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.create_workspace", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateWorkspace", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "CreateWorkspace" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.CreateWorkspaceRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "workspace", - "type": "google.cloud.dataform_v1beta1.types.Workspace" - }, - { - "name": "workspace_id", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.Workspace", - "shortName": "create_workspace" - }, - "description": "Sample for CreateWorkspace", - "file": "dataform_v1beta1_generated_dataform_create_workspace_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_CreateWorkspace_async", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 49, - "start": 47, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_create_workspace_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.create_workspace", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateWorkspace", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "CreateWorkspace" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.CreateWorkspaceRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "workspace", - "type": "google.cloud.dataform_v1beta1.types.Workspace" - }, - { - "name": "workspace_id", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.Workspace", - "shortName": "create_workspace" - }, - "description": "Sample for CreateWorkspace", - "file": "dataform_v1beta1_generated_dataform_create_workspace_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_CreateWorkspace_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 49, - "start": 47, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_create_workspace_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.delete_repository", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteRepository", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "DeleteRepository" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.DeleteRepositoryRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "delete_repository" - }, - "description": "Sample for DeleteRepository", - "file": "dataform_v1beta1_generated_dataform_delete_repository_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_DeleteRepository_async", - "segments": [ - { - "end": 49, - "start": 27, - "type": "FULL" - }, - { - "end": 49, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_delete_repository_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.delete_repository", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteRepository", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "DeleteRepository" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.DeleteRepositoryRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "delete_repository" - }, - "description": "Sample for DeleteRepository", - "file": "dataform_v1beta1_generated_dataform_delete_repository_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_DeleteRepository_sync", - "segments": [ - { - "end": 49, - "start": 27, - "type": "FULL" - }, - { - "end": 49, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_delete_repository_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.delete_workflow_invocation", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteWorkflowInvocation", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "DeleteWorkflowInvocation" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.DeleteWorkflowInvocationRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "delete_workflow_invocation" - }, - "description": "Sample for DeleteWorkflowInvocation", - "file": "dataform_v1beta1_generated_dataform_delete_workflow_invocation_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_async", - "segments": [ - { - "end": 49, - "start": 27, - "type": "FULL" - }, - { - "end": 49, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_delete_workflow_invocation_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.delete_workflow_invocation", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteWorkflowInvocation", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "DeleteWorkflowInvocation" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.DeleteWorkflowInvocationRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "delete_workflow_invocation" - }, - "description": "Sample for DeleteWorkflowInvocation", - "file": "dataform_v1beta1_generated_dataform_delete_workflow_invocation_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_sync", - "segments": [ - { - "end": 49, - "start": 27, - "type": "FULL" - }, - { - "end": 49, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_delete_workflow_invocation_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.delete_workspace", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteWorkspace", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "DeleteWorkspace" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.DeleteWorkspaceRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "delete_workspace" - }, - "description": "Sample for DeleteWorkspace", - "file": "dataform_v1beta1_generated_dataform_delete_workspace_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_DeleteWorkspace_async", - "segments": [ - { - "end": 49, - "start": 27, - "type": "FULL" - }, - { - "end": 49, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_delete_workspace_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.delete_workspace", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteWorkspace", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "DeleteWorkspace" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.DeleteWorkspaceRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "delete_workspace" - }, - "description": "Sample for DeleteWorkspace", - "file": "dataform_v1beta1_generated_dataform_delete_workspace_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_DeleteWorkspace_sync", - "segments": [ - { - "end": 49, - "start": 27, - "type": "FULL" - }, - { - "end": 49, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_delete_workspace_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.fetch_file_diff", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchFileDiff", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "FetchFileDiff" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.FetchFileDiffRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.FetchFileDiffResponse", - "shortName": "fetch_file_diff" - }, - "description": "Sample for FetchFileDiff", - "file": "dataform_v1beta1_generated_dataform_fetch_file_diff_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_FetchFileDiff_async", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 49, - "start": 47, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_fetch_file_diff_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.fetch_file_diff", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchFileDiff", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "FetchFileDiff" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.FetchFileDiffRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.FetchFileDiffResponse", - "shortName": "fetch_file_diff" - }, - "description": "Sample for FetchFileDiff", - "file": "dataform_v1beta1_generated_dataform_fetch_file_diff_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_FetchFileDiff_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 49, - "start": 47, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_fetch_file_diff_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.fetch_file_git_statuses", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchFileGitStatuses", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "FetchFileGitStatuses" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.FetchFileGitStatusesRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.FetchFileGitStatusesResponse", - "shortName": "fetch_file_git_statuses" - }, - "description": "Sample for FetchFileGitStatuses", - "file": "dataform_v1beta1_generated_dataform_fetch_file_git_statuses_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_async", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_fetch_file_git_statuses_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.fetch_file_git_statuses", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchFileGitStatuses", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "FetchFileGitStatuses" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.FetchFileGitStatusesRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.FetchFileGitStatusesResponse", - "shortName": "fetch_file_git_statuses" - }, - "description": "Sample for FetchFileGitStatuses", - "file": "dataform_v1beta1_generated_dataform_fetch_file_git_statuses_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_fetch_file_git_statuses_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.fetch_git_ahead_behind", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchGitAheadBehind", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "FetchGitAheadBehind" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.FetchGitAheadBehindRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.FetchGitAheadBehindResponse", - "shortName": "fetch_git_ahead_behind" - }, - "description": "Sample for FetchGitAheadBehind", - "file": "dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_async", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.fetch_git_ahead_behind", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchGitAheadBehind", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "FetchGitAheadBehind" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.FetchGitAheadBehindRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.FetchGitAheadBehindResponse", - "shortName": "fetch_git_ahead_behind" - }, - "description": "Sample for FetchGitAheadBehind", - "file": "dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_fetch_git_ahead_behind_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.fetch_remote_branches", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchRemoteBranches", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "FetchRemoteBranches" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.FetchRemoteBranchesRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.FetchRemoteBranchesResponse", - "shortName": "fetch_remote_branches" - }, - "description": "Sample for FetchRemoteBranches", - "file": "dataform_v1beta1_generated_dataform_fetch_remote_branches_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_FetchRemoteBranches_async", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_fetch_remote_branches_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.fetch_remote_branches", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchRemoteBranches", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "FetchRemoteBranches" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.FetchRemoteBranchesRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.FetchRemoteBranchesResponse", - "shortName": "fetch_remote_branches" - }, - "description": "Sample for FetchRemoteBranches", - "file": "dataform_v1beta1_generated_dataform_fetch_remote_branches_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_FetchRemoteBranches_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_fetch_remote_branches_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.get_compilation_result", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.GetCompilationResult", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "GetCompilationResult" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.GetCompilationResultRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.CompilationResult", - "shortName": "get_compilation_result" - }, - "description": "Sample for GetCompilationResult", - "file": "dataform_v1beta1_generated_dataform_get_compilation_result_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_GetCompilationResult_async", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_get_compilation_result_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.get_compilation_result", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.GetCompilationResult", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "GetCompilationResult" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.GetCompilationResultRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.CompilationResult", - "shortName": "get_compilation_result" - }, - "description": "Sample for GetCompilationResult", - "file": "dataform_v1beta1_generated_dataform_get_compilation_result_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_GetCompilationResult_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_get_compilation_result_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.get_repository", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.GetRepository", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "GetRepository" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.GetRepositoryRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.Repository", - "shortName": "get_repository" - }, - "description": "Sample for GetRepository", - "file": "dataform_v1beta1_generated_dataform_get_repository_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_GetRepository_async", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_get_repository_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.get_repository", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.GetRepository", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "GetRepository" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.GetRepositoryRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.Repository", - "shortName": "get_repository" - }, - "description": "Sample for GetRepository", - "file": "dataform_v1beta1_generated_dataform_get_repository_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_GetRepository_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_get_repository_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.get_workflow_invocation", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.GetWorkflowInvocation", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "GetWorkflowInvocation" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.GetWorkflowInvocationRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.WorkflowInvocation", - "shortName": "get_workflow_invocation" - }, - "description": "Sample for GetWorkflowInvocation", - "file": "dataform_v1beta1_generated_dataform_get_workflow_invocation_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_async", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_get_workflow_invocation_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.get_workflow_invocation", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.GetWorkflowInvocation", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "GetWorkflowInvocation" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.GetWorkflowInvocationRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.WorkflowInvocation", - "shortName": "get_workflow_invocation" - }, - "description": "Sample for GetWorkflowInvocation", - "file": "dataform_v1beta1_generated_dataform_get_workflow_invocation_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_get_workflow_invocation_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.get_workspace", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.GetWorkspace", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "GetWorkspace" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.GetWorkspaceRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.Workspace", - "shortName": "get_workspace" - }, - "description": "Sample for GetWorkspace", - "file": "dataform_v1beta1_generated_dataform_get_workspace_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_GetWorkspace_async", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_get_workspace_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.get_workspace", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.GetWorkspace", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "GetWorkspace" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.GetWorkspaceRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.Workspace", - "shortName": "get_workspace" - }, - "description": "Sample for GetWorkspace", - "file": "dataform_v1beta1_generated_dataform_get_workspace_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_GetWorkspace_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_get_workspace_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.install_npm_packages", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.InstallNpmPackages", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "InstallNpmPackages" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.InstallNpmPackagesRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.InstallNpmPackagesResponse", - "shortName": "install_npm_packages" - }, - "description": "Sample for InstallNpmPackages", - "file": "dataform_v1beta1_generated_dataform_install_npm_packages_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_InstallNpmPackages_async", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_install_npm_packages_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.install_npm_packages", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.InstallNpmPackages", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "InstallNpmPackages" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.InstallNpmPackagesRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.InstallNpmPackagesResponse", - "shortName": "install_npm_packages" - }, - "description": "Sample for InstallNpmPackages", - "file": "dataform_v1beta1_generated_dataform_install_npm_packages_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_InstallNpmPackages_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_install_npm_packages_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.list_compilation_results", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.ListCompilationResults", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "ListCompilationResults" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.ListCompilationResultsRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.ListCompilationResultsAsyncPager", - "shortName": "list_compilation_results" - }, - "description": "Sample for ListCompilationResults", - "file": "dataform_v1beta1_generated_dataform_list_compilation_results_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_ListCompilationResults_async", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_list_compilation_results_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.list_compilation_results", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.ListCompilationResults", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "ListCompilationResults" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.ListCompilationResultsRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.ListCompilationResultsPager", - "shortName": "list_compilation_results" - }, - "description": "Sample for ListCompilationResults", - "file": "dataform_v1beta1_generated_dataform_list_compilation_results_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_ListCompilationResults_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_list_compilation_results_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.list_repositories", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.ListRepositories", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "ListRepositories" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.ListRepositoriesRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.ListRepositoriesAsyncPager", - "shortName": "list_repositories" - }, - "description": "Sample for ListRepositories", - "file": "dataform_v1beta1_generated_dataform_list_repositories_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_ListRepositories_async", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_list_repositories_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.list_repositories", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.ListRepositories", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "ListRepositories" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.ListRepositoriesRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.ListRepositoriesPager", - "shortName": "list_repositories" - }, - "description": "Sample for ListRepositories", - "file": "dataform_v1beta1_generated_dataform_list_repositories_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_ListRepositories_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_list_repositories_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.list_workflow_invocations", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.ListWorkflowInvocations", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "ListWorkflowInvocations" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.ListWorkflowInvocationsAsyncPager", - "shortName": "list_workflow_invocations" - }, - "description": "Sample for ListWorkflowInvocations", - "file": "dataform_v1beta1_generated_dataform_list_workflow_invocations_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_async", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_list_workflow_invocations_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.list_workflow_invocations", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.ListWorkflowInvocations", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "ListWorkflowInvocations" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.ListWorkflowInvocationsRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.ListWorkflowInvocationsPager", - "shortName": "list_workflow_invocations" - }, - "description": "Sample for ListWorkflowInvocations", - "file": "dataform_v1beta1_generated_dataform_list_workflow_invocations_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_list_workflow_invocations_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.list_workspaces", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.ListWorkspaces", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "ListWorkspaces" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.ListWorkspacesRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.ListWorkspacesAsyncPager", - "shortName": "list_workspaces" - }, - "description": "Sample for ListWorkspaces", - "file": "dataform_v1beta1_generated_dataform_list_workspaces_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_ListWorkspaces_async", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_list_workspaces_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.list_workspaces", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.ListWorkspaces", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "ListWorkspaces" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.ListWorkspacesRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.ListWorkspacesPager", - "shortName": "list_workspaces" - }, - "description": "Sample for ListWorkspaces", - "file": "dataform_v1beta1_generated_dataform_list_workspaces_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_ListWorkspaces_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_list_workspaces_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.make_directory", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.MakeDirectory", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "MakeDirectory" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.MakeDirectoryRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.MakeDirectoryResponse", - "shortName": "make_directory" - }, - "description": "Sample for MakeDirectory", - "file": "dataform_v1beta1_generated_dataform_make_directory_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_MakeDirectory_async", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 49, - "start": 47, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_make_directory_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.make_directory", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.MakeDirectory", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "MakeDirectory" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.MakeDirectoryRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.MakeDirectoryResponse", - "shortName": "make_directory" - }, - "description": "Sample for MakeDirectory", - "file": "dataform_v1beta1_generated_dataform_make_directory_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_MakeDirectory_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 49, - "start": 47, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_make_directory_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.move_directory", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.MoveDirectory", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "MoveDirectory" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.MoveDirectoryRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.MoveDirectoryResponse", - "shortName": "move_directory" - }, - "description": "Sample for MoveDirectory", - "file": "dataform_v1beta1_generated_dataform_move_directory_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_MoveDirectory_async", - "segments": [ - { - "end": 53, - "start": 27, - "type": "FULL" - }, - { - "end": 53, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 47, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 50, - "start": 48, - "type": "REQUEST_EXECUTION" - }, - { - "end": 54, - "start": 51, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_move_directory_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.move_directory", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.MoveDirectory", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "MoveDirectory" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.MoveDirectoryRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.MoveDirectoryResponse", - "shortName": "move_directory" - }, - "description": "Sample for MoveDirectory", - "file": "dataform_v1beta1_generated_dataform_move_directory_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_MoveDirectory_sync", - "segments": [ - { - "end": 53, - "start": 27, - "type": "FULL" - }, - { - "end": 53, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 47, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 50, - "start": 48, - "type": "REQUEST_EXECUTION" - }, - { - "end": 54, - "start": 51, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_move_directory_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.move_file", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.MoveFile", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "MoveFile" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.MoveFileRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.MoveFileResponse", - "shortName": "move_file" - }, - "description": "Sample for MoveFile", - "file": "dataform_v1beta1_generated_dataform_move_file_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_MoveFile_async", - "segments": [ - { - "end": 53, - "start": 27, - "type": "FULL" - }, - { - "end": 53, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 47, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 50, - "start": 48, - "type": "REQUEST_EXECUTION" - }, - { - "end": 54, - "start": 51, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_move_file_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.move_file", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.MoveFile", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "MoveFile" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.MoveFileRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.MoveFileResponse", - "shortName": "move_file" - }, - "description": "Sample for MoveFile", - "file": "dataform_v1beta1_generated_dataform_move_file_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_MoveFile_sync", - "segments": [ - { - "end": 53, - "start": 27, - "type": "FULL" - }, - { - "end": 53, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 47, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 50, - "start": 48, - "type": "REQUEST_EXECUTION" - }, - { - "end": 54, - "start": 51, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_move_file_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.pull_git_commits", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.PullGitCommits", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "PullGitCommits" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.PullGitCommitsRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "pull_git_commits" - }, - "description": "Sample for PullGitCommits", - "file": "dataform_v1beta1_generated_dataform_pull_git_commits_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_PullGitCommits_async", - "segments": [ - { - "end": 54, - "start": 27, - "type": "FULL" - }, - { - "end": 54, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 50, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 51, - "type": "REQUEST_EXECUTION" - }, - { - "end": 55, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_pull_git_commits_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.pull_git_commits", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.PullGitCommits", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "PullGitCommits" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.PullGitCommitsRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "pull_git_commits" - }, - "description": "Sample for PullGitCommits", - "file": "dataform_v1beta1_generated_dataform_pull_git_commits_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_PullGitCommits_sync", - "segments": [ - { - "end": 54, - "start": 27, - "type": "FULL" - }, - { - "end": 54, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 50, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 51, - "type": "REQUEST_EXECUTION" - }, - { - "end": 55, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_pull_git_commits_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.push_git_commits", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.PushGitCommits", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "PushGitCommits" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.PushGitCommitsRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "push_git_commits" - }, - "description": "Sample for PushGitCommits", - "file": "dataform_v1beta1_generated_dataform_push_git_commits_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_PushGitCommits_async", - "segments": [ - { - "end": 49, - "start": 27, - "type": "FULL" - }, - { - "end": 49, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_push_git_commits_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.push_git_commits", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.PushGitCommits", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "PushGitCommits" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.PushGitCommitsRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "push_git_commits" - }, - "description": "Sample for PushGitCommits", - "file": "dataform_v1beta1_generated_dataform_push_git_commits_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_PushGitCommits_sync", - "segments": [ - { - "end": 49, - "start": 27, - "type": "FULL" - }, - { - "end": 49, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_push_git_commits_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.query_compilation_result_actions", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryCompilationResultActions", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "QueryCompilationResultActions" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.QueryCompilationResultActionsAsyncPager", - "shortName": "query_compilation_result_actions" - }, - "description": "Sample for QueryCompilationResultActions", - "file": "dataform_v1beta1_generated_dataform_query_compilation_result_actions_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_async", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_query_compilation_result_actions_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.query_compilation_result_actions", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryCompilationResultActions", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "QueryCompilationResultActions" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.QueryCompilationResultActionsRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.QueryCompilationResultActionsPager", - "shortName": "query_compilation_result_actions" - }, - "description": "Sample for QueryCompilationResultActions", - "file": "dataform_v1beta1_generated_dataform_query_compilation_result_actions_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_query_compilation_result_actions_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.query_directory_contents", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryDirectoryContents", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "QueryDirectoryContents" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.QueryDirectoryContentsRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.QueryDirectoryContentsAsyncPager", - "shortName": "query_directory_contents" - }, - "description": "Sample for QueryDirectoryContents", - "file": "dataform_v1beta1_generated_dataform_query_directory_contents_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_QueryDirectoryContents_async", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_query_directory_contents_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.query_directory_contents", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryDirectoryContents", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "QueryDirectoryContents" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.QueryDirectoryContentsRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.QueryDirectoryContentsPager", - "shortName": "query_directory_contents" - }, - "description": "Sample for QueryDirectoryContents", - "file": "dataform_v1beta1_generated_dataform_query_directory_contents_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_QueryDirectoryContents_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_query_directory_contents_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.query_workflow_invocation_actions", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryWorkflowInvocationActions", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "QueryWorkflowInvocationActions" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.QueryWorkflowInvocationActionsAsyncPager", - "shortName": "query_workflow_invocation_actions" - }, - "description": "Sample for QueryWorkflowInvocationActions", - "file": "dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_async", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.query_workflow_invocation_actions", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryWorkflowInvocationActions", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "QueryWorkflowInvocationActions" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.QueryWorkflowInvocationActionsRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.services.dataform.pagers.QueryWorkflowInvocationActionsPager", - "shortName": "query_workflow_invocation_actions" - }, - "description": "Sample for QueryWorkflowInvocationActions", - "file": "dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_query_workflow_invocation_actions_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.read_file", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.ReadFile", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "ReadFile" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.ReadFileRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.ReadFileResponse", - "shortName": "read_file" - }, - "description": "Sample for ReadFile", - "file": "dataform_v1beta1_generated_dataform_read_file_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_ReadFile_async", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 49, - "start": 47, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_read_file_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.read_file", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.ReadFile", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "ReadFile" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.ReadFileRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.ReadFileResponse", - "shortName": "read_file" - }, - "description": "Sample for ReadFile", - "file": "dataform_v1beta1_generated_dataform_read_file_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_ReadFile_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 49, - "start": 47, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_read_file_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.remove_directory", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.RemoveDirectory", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "RemoveDirectory" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.RemoveDirectoryRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "remove_directory" - }, - "description": "Sample for RemoveDirectory", - "file": "dataform_v1beta1_generated_dataform_remove_directory_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_RemoveDirectory_async", - "segments": [ - { - "end": 50, - "start": 27, - "type": "FULL" - }, - { - "end": 50, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 47, - "type": "REQUEST_EXECUTION" - }, - { - "end": 51, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_remove_directory_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.remove_directory", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.RemoveDirectory", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "RemoveDirectory" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.RemoveDirectoryRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "remove_directory" - }, - "description": "Sample for RemoveDirectory", - "file": "dataform_v1beta1_generated_dataform_remove_directory_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_RemoveDirectory_sync", - "segments": [ - { - "end": 50, - "start": 27, - "type": "FULL" - }, - { - "end": 50, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 47, - "type": "REQUEST_EXECUTION" - }, - { - "end": 51, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_remove_directory_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.remove_file", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.RemoveFile", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "RemoveFile" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.RemoveFileRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "remove_file" - }, - "description": "Sample for RemoveFile", - "file": "dataform_v1beta1_generated_dataform_remove_file_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_RemoveFile_async", - "segments": [ - { - "end": 50, - "start": 27, - "type": "FULL" - }, - { - "end": 50, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 47, - "type": "REQUEST_EXECUTION" - }, - { - "end": 51, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_remove_file_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.remove_file", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.RemoveFile", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "RemoveFile" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.RemoveFileRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "remove_file" - }, - "description": "Sample for RemoveFile", - "file": "dataform_v1beta1_generated_dataform_remove_file_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_RemoveFile_sync", - "segments": [ - { - "end": 50, - "start": 27, - "type": "FULL" - }, - { - "end": 50, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 47, - "type": "REQUEST_EXECUTION" - }, - { - "end": 51, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_remove_file_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.reset_workspace_changes", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.ResetWorkspaceChanges", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "ResetWorkspaceChanges" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.ResetWorkspaceChangesRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "reset_workspace_changes" - }, - "description": "Sample for ResetWorkspaceChanges", - "file": "dataform_v1beta1_generated_dataform_reset_workspace_changes_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_async", - "segments": [ - { - "end": 49, - "start": 27, - "type": "FULL" - }, - { - "end": 49, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_reset_workspace_changes_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.reset_workspace_changes", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.ResetWorkspaceChanges", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "ResetWorkspaceChanges" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.ResetWorkspaceChangesRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "shortName": "reset_workspace_changes" - }, - "description": "Sample for ResetWorkspaceChanges", - "file": "dataform_v1beta1_generated_dataform_reset_workspace_changes_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_sync", - "segments": [ - { - "end": 49, - "start": 27, - "type": "FULL" - }, - { - "end": 49, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_reset_workspace_changes_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.update_repository", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.UpdateRepository", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "UpdateRepository" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.UpdateRepositoryRequest" - }, - { - "name": "repository", - "type": "google.cloud.dataform_v1beta1.types.Repository" - }, - { - "name": "update_mask", - "type": "google.protobuf.field_mask_pb2.FieldMask" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.Repository", - "shortName": "update_repository" - }, - "description": "Sample for UpdateRepository", - "file": "dataform_v1beta1_generated_dataform_update_repository_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_UpdateRepository_async", - "segments": [ - { - "end": 50, - "start": 27, - "type": "FULL" - }, - { - "end": 50, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 44, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 47, - "start": 45, - "type": "REQUEST_EXECUTION" - }, - { - "end": 51, - "start": 48, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_update_repository_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.update_repository", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.UpdateRepository", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "UpdateRepository" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.UpdateRepositoryRequest" - }, - { - "name": "repository", - "type": "google.cloud.dataform_v1beta1.types.Repository" - }, - { - "name": "update_mask", - "type": "google.protobuf.field_mask_pb2.FieldMask" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.Repository", - "shortName": "update_repository" - }, - "description": "Sample for UpdateRepository", - "file": "dataform_v1beta1_generated_dataform_update_repository_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_UpdateRepository_sync", - "segments": [ - { - "end": 50, - "start": 27, - "type": "FULL" - }, - { - "end": 50, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 44, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 47, - "start": 45, - "type": "REQUEST_EXECUTION" - }, - { - "end": 51, - "start": 48, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_update_repository_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient", - "shortName": "DataformAsyncClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformAsyncClient.write_file", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.WriteFile", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "WriteFile" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.WriteFileRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.WriteFileResponse", - "shortName": "write_file" - }, - "description": "Sample for WriteFile", - "file": "dataform_v1beta1_generated_dataform_write_file_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_WriteFile_async", - "segments": [ - { - "end": 53, - "start": 27, - "type": "FULL" - }, - { - "end": 53, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 47, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 50, - "start": 48, - "type": "REQUEST_EXECUTION" - }, - { - "end": 54, - "start": 51, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_write_file_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.dataform_v1beta1.DataformClient", - "shortName": "DataformClient" - }, - "fullName": "google.cloud.dataform_v1beta1.DataformClient.write_file", - "method": { - "fullName": "google.cloud.dataform.v1beta1.Dataform.WriteFile", - "service": { - "fullName": "google.cloud.dataform.v1beta1.Dataform", - "shortName": "Dataform" - }, - "shortName": "WriteFile" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.dataform_v1beta1.types.WriteFileRequest" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.dataform_v1beta1.types.WriteFileResponse", - "shortName": "write_file" - }, - "description": "Sample for WriteFile", - "file": "dataform_v1beta1_generated_dataform_write_file_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "dataform_v1beta1_generated_Dataform_WriteFile_sync", - "segments": [ - { - "end": 53, - "start": 27, - "type": "FULL" - }, - { - "end": 53, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 47, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 50, - "start": 48, - "type": "REQUEST_EXECUTION" - }, - { - "end": 54, - "start": 51, - "type": "RESPONSE_HANDLING" - } - ], - "title": "dataform_v1beta1_generated_dataform_write_file_sync.py" - } - ] -} diff --git a/owl-bot-staging/v1beta1/scripts/fixup_dataform_v1beta1_keywords.py b/owl-bot-staging/v1beta1/scripts/fixup_dataform_v1beta1_keywords.py deleted file mode 100644 index 4e14973..0000000 --- a/owl-bot-staging/v1beta1/scripts/fixup_dataform_v1beta1_keywords.py +++ /dev/null @@ -1,211 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding: utf-8 -*- -# 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. -# -import argparse -import os -import libcst as cst -import pathlib -import sys -from typing import (Any, Callable, Dict, List, Sequence, Tuple) - - -def partition( - predicate: Callable[[Any], bool], - iterator: Sequence[Any] -) -> Tuple[List[Any], List[Any]]: - """A stable, out-of-place partition.""" - results = ([], []) - - for i in iterator: - results[int(predicate(i))].append(i) - - # Returns trueList, falseList - return results[1], results[0] - - -class dataformCallTransformer(cst.CSTTransformer): - CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') - METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'cancel_workflow_invocation': ('name', ), - 'commit_workspace_changes': ('name', 'author', 'commit_message', 'paths', ), - 'create_compilation_result': ('parent', 'compilation_result', ), - 'create_repository': ('parent', 'repository', 'repository_id', ), - 'create_workflow_invocation': ('parent', 'workflow_invocation', ), - 'create_workspace': ('parent', 'workspace', 'workspace_id', ), - 'delete_repository': ('name', 'force', ), - 'delete_workflow_invocation': ('name', ), - 'delete_workspace': ('name', ), - 'fetch_file_diff': ('workspace', 'path', ), - 'fetch_file_git_statuses': ('name', ), - 'fetch_git_ahead_behind': ('name', 'remote_branch', ), - 'fetch_remote_branches': ('name', ), - 'get_compilation_result': ('name', ), - 'get_repository': ('name', ), - 'get_workflow_invocation': ('name', ), - 'get_workspace': ('name', ), - 'install_npm_packages': ('workspace', ), - 'list_compilation_results': ('parent', 'page_size', 'page_token', ), - 'list_repositories': ('parent', 'page_size', 'page_token', 'order_by', 'filter', ), - 'list_workflow_invocations': ('parent', 'page_size', 'page_token', ), - 'list_workspaces': ('parent', 'page_size', 'page_token', 'order_by', 'filter', ), - 'make_directory': ('workspace', 'path', ), - 'move_directory': ('workspace', 'path', 'new_path', ), - 'move_file': ('workspace', 'path', 'new_path', ), - 'pull_git_commits': ('name', 'author', 'remote_branch', ), - 'push_git_commits': ('name', 'remote_branch', ), - 'query_compilation_result_actions': ('name', 'page_size', 'page_token', 'filter', ), - 'query_directory_contents': ('workspace', 'path', 'page_size', 'page_token', ), - 'query_workflow_invocation_actions': ('name', 'page_size', 'page_token', ), - 'read_file': ('workspace', 'path', ), - 'remove_directory': ('workspace', 'path', ), - 'remove_file': ('workspace', 'path', ), - 'reset_workspace_changes': ('name', 'paths', 'clean', ), - 'update_repository': ('repository', 'update_mask', ), - 'write_file': ('workspace', 'path', 'contents', ), - } - - def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: - try: - key = original.func.attr.value - kword_params = self.METHOD_TO_PARAMS[key] - except (AttributeError, KeyError): - # Either not a method from the API or too convoluted to be sure. - return updated - - # If the existing code is valid, keyword args come after positional args. - # Therefore, all positional args must map to the first parameters. - args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) - if any(k.keyword.value == "request" for k in kwargs): - # We've already fixed this file, don't fix it again. - return updated - - kwargs, ctrl_kwargs = partition( - lambda a: a.keyword.value not in self.CTRL_PARAMS, - kwargs - ) - - args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] - ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) - for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) - - request_arg = cst.Arg( - value=cst.Dict([ - cst.DictElement( - cst.SimpleString("'{}'".format(name)), -cst.Element(value=arg.value) - ) - # Note: the args + kwargs looks silly, but keep in mind that - # the control parameters had to be stripped out, and that - # those could have been passed positionally or by keyword. - for name, arg in zip(kword_params, args + kwargs)]), - keyword=cst.Name("request") - ) - - return updated.with_changes( - args=[request_arg] + ctrl_kwargs - ) - - -def fix_files( - in_dir: pathlib.Path, - out_dir: pathlib.Path, - *, - transformer=dataformCallTransformer(), -): - """Duplicate the input dir to the output dir, fixing file method calls. - - Preconditions: - * in_dir is a real directory - * out_dir is a real, empty directory - """ - pyfile_gen = ( - pathlib.Path(os.path.join(root, f)) - for root, _, files in os.walk(in_dir) - for f in files if os.path.splitext(f)[1] == ".py" - ) - - for fpath in pyfile_gen: - with open(fpath, 'r') as f: - src = f.read() - - # Parse the code and insert method call fixes. - tree = cst.parse_module(src) - updated = tree.visit(transformer) - - # Create the path and directory structure for the new file. - updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) - updated_path.parent.mkdir(parents=True, exist_ok=True) - - # Generate the updated source file at the corresponding path. - with open(updated_path, 'w') as f: - f.write(updated.code) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser( - description="""Fix up source that uses the dataform client library. - -The existing sources are NOT overwritten but are copied to output_dir with changes made. - -Note: This tool operates at a best-effort level at converting positional - parameters in client method calls to keyword based parameters. - Cases where it WILL FAIL include - A) * or ** expansion in a method call. - B) Calls via function or method alias (includes free function calls) - C) Indirect or dispatched calls (e.g. the method is looked up dynamically) - - These all constitute false negatives. The tool will also detect false - positives when an API method shares a name with another method. -""") - parser.add_argument( - '-d', - '--input-directory', - required=True, - dest='input_dir', - help='the input directory to walk for python files to fix up', - ) - parser.add_argument( - '-o', - '--output-directory', - required=True, - dest='output_dir', - help='the directory to output files fixed via un-flattening', - ) - args = parser.parse_args() - input_dir = pathlib.Path(args.input_dir) - output_dir = pathlib.Path(args.output_dir) - if not input_dir.is_dir(): - print( - f"input directory '{input_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if not output_dir.is_dir(): - print( - f"output directory '{output_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if os.listdir(output_dir): - print( - f"output directory '{output_dir}' is not empty", - file=sys.stderr, - ) - sys.exit(-1) - - fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/v1beta1/setup.py b/owl-bot-staging/v1beta1/setup.py deleted file mode 100644 index cd0952f..0000000 --- a/owl-bot-staging/v1beta1/setup.py +++ /dev/null @@ -1,59 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -import io -import os -import setuptools # type: ignore - -version = '0.1.0' - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, 'README.rst') -with io.open(readme_filename, encoding='utf-8') as readme_file: - readme = readme_file.read() - -setuptools.setup( - name='google-cloud-dataform', - author="Google LLC", - author_email="googleapis-packages@google.com", - url="https://github.com/googleapis/python-google-cloud-dataform", - version=version, - long_description=readme, - packages=setuptools.PEP420PackageFinder.find(), - namespace_packages=('google', 'google.cloud'), - platforms='Posix; MacOS X; Windows', - include_package_data=True, - install_requires=( - 'google-api-core[grpc] >= 2.10.0, < 3.0.0dev', - 'libcst >= 0.2.5', - 'googleapis-common-protos >= 1.55.0, <2.0.0dev', - 'proto-plus >= 1.19.7', - 'grpc-google-iam-v1 >= 0.12.4, < 0.13dev', - ), - python_requires='>=3.7', - classifiers=[ - 'Development Status :: 3 - Alpha', - 'Intended Audience :: Developers', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Topic :: Internet', - 'Topic :: Software Development :: Libraries :: Python Modules', - ], - zip_safe=False, -) diff --git a/owl-bot-staging/v1beta1/tests/__init__.py b/owl-bot-staging/v1beta1/tests/__init__.py deleted file mode 100644 index 231bc12..0000000 --- a/owl-bot-staging/v1beta1/tests/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# 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. -# diff --git a/owl-bot-staging/v1beta1/tests/unit/__init__.py b/owl-bot-staging/v1beta1/tests/unit/__init__.py deleted file mode 100644 index 231bc12..0000000 --- a/owl-bot-staging/v1beta1/tests/unit/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# 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. -# diff --git a/owl-bot-staging/v1beta1/tests/unit/gapic/__init__.py b/owl-bot-staging/v1beta1/tests/unit/gapic/__init__.py deleted file mode 100644 index 231bc12..0000000 --- a/owl-bot-staging/v1beta1/tests/unit/gapic/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# 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. -# diff --git a/owl-bot-staging/v1beta1/tests/unit/gapic/dataform_v1beta1/__init__.py b/owl-bot-staging/v1beta1/tests/unit/gapic/dataform_v1beta1/__init__.py deleted file mode 100644 index 231bc12..0000000 --- a/owl-bot-staging/v1beta1/tests/unit/gapic/dataform_v1beta1/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# 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. -# diff --git a/owl-bot-staging/v1beta1/tests/unit/gapic/dataform_v1beta1/test_dataform.py b/owl-bot-staging/v1beta1/tests/unit/gapic/dataform_v1beta1/test_dataform.py deleted file mode 100644 index 05c0f9c..0000000 --- a/owl-bot-staging/v1beta1/tests/unit/gapic/dataform_v1beta1/test_dataform.py +++ /dev/null @@ -1,9611 +0,0 @@ -# -*- coding: utf-8 -*- -# 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. -# -import os -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - -import grpc -from grpc.experimental import aio -import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule -from proto.marshal.rules import wrappers - -from google.api_core import client_options -from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import path_template -from google.auth import credentials as ga_credentials -from google.auth.exceptions import MutualTLSChannelError -from google.cloud.dataform_v1beta1.services.dataform import DataformAsyncClient -from google.cloud.dataform_v1beta1.services.dataform import DataformClient -from google.cloud.dataform_v1beta1.services.dataform import pagers -from google.cloud.dataform_v1beta1.services.dataform import transports -from google.cloud.dataform_v1beta1.types import dataform -from google.cloud.location import locations_pb2 -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import options_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.oauth2 import service_account -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.type import interval_pb2 # type: ignore -import google.auth - - -def client_cert_source_callback(): - return b"cert bytes", b"key bytes" - - -# If default endpoint is localhost, then default mtls endpoint will be the same. -# This method modifies the default endpoint so the client can produce a different -# mtls endpoint for endpoint testing purposes. -def modify_default_endpoint(client): - return "foo.googleapis.com" if ("localhost" in client.DEFAULT_ENDPOINT) else client.DEFAULT_ENDPOINT - - -def test__get_default_mtls_endpoint(): - api_endpoint = "example.googleapis.com" - api_mtls_endpoint = "example.mtls.googleapis.com" - sandbox_endpoint = "example.sandbox.googleapis.com" - sandbox_mtls_endpoint = "example.mtls.sandbox.googleapis.com" - non_googleapi = "api.example.com" - - assert DataformClient._get_default_mtls_endpoint(None) is None - assert DataformClient._get_default_mtls_endpoint(api_endpoint) == api_mtls_endpoint - assert DataformClient._get_default_mtls_endpoint(api_mtls_endpoint) == api_mtls_endpoint - assert DataformClient._get_default_mtls_endpoint(sandbox_endpoint) == sandbox_mtls_endpoint - assert DataformClient._get_default_mtls_endpoint(sandbox_mtls_endpoint) == sandbox_mtls_endpoint - assert DataformClient._get_default_mtls_endpoint(non_googleapi) == non_googleapi - - -@pytest.mark.parametrize("client_class,transport_name", [ - (DataformClient, "grpc"), - (DataformAsyncClient, "grpc_asyncio"), -]) -def test_dataform_client_from_service_account_info(client_class, transport_name): - creds = ga_credentials.AnonymousCredentials() - with mock.patch.object(service_account.Credentials, 'from_service_account_info') as factory: - factory.return_value = creds - info = {"valid": True} - client = client_class.from_service_account_info(info, transport=transport_name) - assert client.transport._credentials == creds - assert isinstance(client, client_class) - - assert client.transport._host == ( - 'dataform.googleapis.com:443' - ) - - -@pytest.mark.parametrize("transport_class,transport_name", [ - (transports.DataformGrpcTransport, "grpc"), - (transports.DataformGrpcAsyncIOTransport, "grpc_asyncio"), -]) -def test_dataform_client_service_account_always_use_jwt(transport_class, transport_name): - with mock.patch.object(service_account.Credentials, 'with_always_use_jwt_access', create=True) as use_jwt: - creds = service_account.Credentials(None, None, None) - transport = transport_class(credentials=creds, always_use_jwt_access=True) - use_jwt.assert_called_once_with(True) - - with mock.patch.object(service_account.Credentials, 'with_always_use_jwt_access', create=True) as use_jwt: - creds = service_account.Credentials(None, None, None) - transport = transport_class(credentials=creds, always_use_jwt_access=False) - use_jwt.assert_not_called() - - -@pytest.mark.parametrize("client_class,transport_name", [ - (DataformClient, "grpc"), - (DataformAsyncClient, "grpc_asyncio"), -]) -def test_dataform_client_from_service_account_file(client_class, transport_name): - creds = ga_credentials.AnonymousCredentials() - with mock.patch.object(service_account.Credentials, 'from_service_account_file') as factory: - factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json", transport=transport_name) - assert client.transport._credentials == creds - assert isinstance(client, client_class) - - client = client_class.from_service_account_json("dummy/file/path.json", transport=transport_name) - assert client.transport._credentials == creds - assert isinstance(client, client_class) - - assert client.transport._host == ( - 'dataform.googleapis.com:443' - ) - - -def test_dataform_client_get_transport_class(): - transport = DataformClient.get_transport_class() - available_transports = [ - transports.DataformGrpcTransport, - ] - assert transport in available_transports - - transport = DataformClient.get_transport_class("grpc") - assert transport == transports.DataformGrpcTransport - - -@pytest.mark.parametrize("client_class,transport_class,transport_name", [ - (DataformClient, transports.DataformGrpcTransport, "grpc"), - (DataformAsyncClient, transports.DataformGrpcAsyncIOTransport, "grpc_asyncio"), -]) -@mock.patch.object(DataformClient, "DEFAULT_ENDPOINT", modify_default_endpoint(DataformClient)) -@mock.patch.object(DataformAsyncClient, "DEFAULT_ENDPOINT", modify_default_endpoint(DataformAsyncClient)) -def test_dataform_client_client_options(client_class, transport_class, transport_name): - # Check that if channel is provided we won't create a new one. - with mock.patch.object(DataformClient, 'get_transport_class') as gtc: - transport = transport_class( - credentials=ga_credentials.AnonymousCredentials() - ) - client = client_class(transport=transport) - gtc.assert_not_called() - - # Check that if channel is provided via str we will create a new one. - with mock.patch.object(DataformClient, 'get_transport_class') as gtc: - client = client_class(transport=transport_name) - gtc.assert_called() - - # Check the case api_endpoint is provided. - options = client_options.ClientOptions(api_endpoint="squid.clam.whelk") - with mock.patch.object(transport_class, '__init__') as patched: - patched.return_value = None - client = client_class(transport=transport_name, client_options=options) - patched.assert_called_once_with( - credentials=None, - credentials_file=None, - host="squid.clam.whelk", - scopes=None, - client_cert_source_for_mtls=None, - quota_project_id=None, - client_info=transports.base.DEFAULT_CLIENT_INFO, - always_use_jwt_access=True, - api_audience=None, - ) - - # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is - # "never". - with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - with mock.patch.object(transport_class, '__init__') as patched: - patched.return_value = None - client = client_class(transport=transport_name) - patched.assert_called_once_with( - credentials=None, - credentials_file=None, - host=client.DEFAULT_ENDPOINT, - scopes=None, - client_cert_source_for_mtls=None, - quota_project_id=None, - client_info=transports.base.DEFAULT_CLIENT_INFO, - always_use_jwt_access=True, - api_audience=None, - ) - - # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is - # "always". - with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - with mock.patch.object(transport_class, '__init__') as patched: - patched.return_value = None - client = client_class(transport=transport_name) - patched.assert_called_once_with( - credentials=None, - credentials_file=None, - host=client.DEFAULT_MTLS_ENDPOINT, - scopes=None, - client_cert_source_for_mtls=None, - quota_project_id=None, - client_info=transports.base.DEFAULT_CLIENT_INFO, - always_use_jwt_access=True, - api_audience=None, - ) - - # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has - # unsupported value. - with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): - with pytest.raises(MutualTLSChannelError): - client = client_class(transport=transport_name) - - # Check the case GOOGLE_API_USE_CLIENT_CERTIFICATE has unsupported value. - with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"}): - with pytest.raises(ValueError): - client = client_class(transport=transport_name) - - # Check the case quota_project_id is provided - options = client_options.ClientOptions(quota_project_id="octopus") - with mock.patch.object(transport_class, '__init__') as patched: - patched.return_value = None - client = client_class(client_options=options, transport=transport_name) - patched.assert_called_once_with( - credentials=None, - credentials_file=None, - host=client.DEFAULT_ENDPOINT, - scopes=None, - client_cert_source_for_mtls=None, - quota_project_id="octopus", - client_info=transports.base.DEFAULT_CLIENT_INFO, - always_use_jwt_access=True, - api_audience=None, - ) - # Check the case api_endpoint is provided - options = client_options.ClientOptions(api_audience="https://language.googleapis.com") - with mock.patch.object(transport_class, '__init__') as patched: - patched.return_value = None - client = client_class(client_options=options, transport=transport_name) - patched.assert_called_once_with( - credentials=None, - credentials_file=None, - host=client.DEFAULT_ENDPOINT, - scopes=None, - client_cert_source_for_mtls=None, - quota_project_id=None, - client_info=transports.base.DEFAULT_CLIENT_INFO, - always_use_jwt_access=True, - api_audience="https://language.googleapis.com" - ) - -@pytest.mark.parametrize("client_class,transport_class,transport_name,use_client_cert_env", [ - (DataformClient, transports.DataformGrpcTransport, "grpc", "true"), - (DataformAsyncClient, transports.DataformGrpcAsyncIOTransport, "grpc_asyncio", "true"), - (DataformClient, transports.DataformGrpcTransport, "grpc", "false"), - (DataformAsyncClient, transports.DataformGrpcAsyncIOTransport, "grpc_asyncio", "false"), -]) -@mock.patch.object(DataformClient, "DEFAULT_ENDPOINT", modify_default_endpoint(DataformClient)) -@mock.patch.object(DataformAsyncClient, "DEFAULT_ENDPOINT", modify_default_endpoint(DataformAsyncClient)) -@mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}) -def test_dataform_client_mtls_env_auto(client_class, transport_class, transport_name, use_client_cert_env): - # This tests the endpoint autoswitch behavior. Endpoint is autoswitched to the default - # mtls endpoint, if GOOGLE_API_USE_CLIENT_CERTIFICATE is "true" and client cert exists. - - # Check the case client_cert_source is provided. Whether client cert is used depends on - # GOOGLE_API_USE_CLIENT_CERTIFICATE value. - with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env}): - options = client_options.ClientOptions(client_cert_source=client_cert_source_callback) - with mock.patch.object(transport_class, '__init__') as patched: - patched.return_value = None - client = client_class(client_options=options, transport=transport_name) - - if use_client_cert_env == "false": - expected_client_cert_source = None - expected_host = client.DEFAULT_ENDPOINT - else: - expected_client_cert_source = client_cert_source_callback - expected_host = client.DEFAULT_MTLS_ENDPOINT - - patched.assert_called_once_with( - credentials=None, - credentials_file=None, - host=expected_host, - scopes=None, - client_cert_source_for_mtls=expected_client_cert_source, - quota_project_id=None, - client_info=transports.base.DEFAULT_CLIENT_INFO, - always_use_jwt_access=True, - api_audience=None, - ) - - # Check the case ADC client cert is provided. Whether client cert is used depends on - # GOOGLE_API_USE_CLIENT_CERTIFICATE value. - with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env}): - with mock.patch.object(transport_class, '__init__') as patched: - with mock.patch('google.auth.transport.mtls.has_default_client_cert_source', return_value=True): - with mock.patch('google.auth.transport.mtls.default_client_cert_source', return_value=client_cert_source_callback): - if use_client_cert_env == "false": - expected_host = client.DEFAULT_ENDPOINT - expected_client_cert_source = None - else: - expected_host = client.DEFAULT_MTLS_ENDPOINT - expected_client_cert_source = client_cert_source_callback - - patched.return_value = None - client = client_class(transport=transport_name) - patched.assert_called_once_with( - credentials=None, - credentials_file=None, - host=expected_host, - scopes=None, - client_cert_source_for_mtls=expected_client_cert_source, - quota_project_id=None, - client_info=transports.base.DEFAULT_CLIENT_INFO, - always_use_jwt_access=True, - api_audience=None, - ) - - # Check the case client_cert_source and ADC client cert are not provided. - with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env}): - with mock.patch.object(transport_class, '__init__') as patched: - with mock.patch("google.auth.transport.mtls.has_default_client_cert_source", return_value=False): - patched.return_value = None - client = client_class(transport=transport_name) - patched.assert_called_once_with( - credentials=None, - credentials_file=None, - host=client.DEFAULT_ENDPOINT, - scopes=None, - client_cert_source_for_mtls=None, - quota_project_id=None, - client_info=transports.base.DEFAULT_CLIENT_INFO, - always_use_jwt_access=True, - api_audience=None, - ) - - -@pytest.mark.parametrize("client_class", [ - DataformClient, DataformAsyncClient -]) -@mock.patch.object(DataformClient, "DEFAULT_ENDPOINT", modify_default_endpoint(DataformClient)) -@mock.patch.object(DataformAsyncClient, "DEFAULT_ENDPOINT", modify_default_endpoint(DataformAsyncClient)) -def test_dataform_client_get_mtls_endpoint_and_cert_source(client_class): - mock_client_cert_source = mock.Mock() - - # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "true". - with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): - mock_api_endpoint = "foo" - options = client_options.ClientOptions(client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint) - api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source(options) - assert api_endpoint == mock_api_endpoint - assert cert_source == mock_client_cert_source - - # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "false". - with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}): - mock_client_cert_source = mock.Mock() - mock_api_endpoint = "foo" - options = client_options.ClientOptions(client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint) - api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source(options) - assert api_endpoint == mock_api_endpoint - assert cert_source is None - - # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "never". - with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() - assert api_endpoint == client_class.DEFAULT_ENDPOINT - assert cert_source is None - - # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "always". - with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() - assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT - assert cert_source is None - - # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert doesn't exist. - with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): - with mock.patch('google.auth.transport.mtls.has_default_client_cert_source', return_value=False): - api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() - assert api_endpoint == client_class.DEFAULT_ENDPOINT - assert cert_source is None - - # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert exists. - with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): - with mock.patch('google.auth.transport.mtls.has_default_client_cert_source', return_value=True): - with mock.patch('google.auth.transport.mtls.default_client_cert_source', return_value=mock_client_cert_source): - api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() - assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT - assert cert_source == mock_client_cert_source - - -@pytest.mark.parametrize("client_class,transport_class,transport_name", [ - (DataformClient, transports.DataformGrpcTransport, "grpc"), - (DataformAsyncClient, transports.DataformGrpcAsyncIOTransport, "grpc_asyncio"), -]) -def test_dataform_client_client_options_scopes(client_class, transport_class, transport_name): - # Check the case scopes are provided. - options = client_options.ClientOptions( - scopes=["1", "2"], - ) - with mock.patch.object(transport_class, '__init__') as patched: - patched.return_value = None - client = client_class(client_options=options, transport=transport_name) - patched.assert_called_once_with( - credentials=None, - credentials_file=None, - host=client.DEFAULT_ENDPOINT, - scopes=["1", "2"], - client_cert_source_for_mtls=None, - quota_project_id=None, - client_info=transports.base.DEFAULT_CLIENT_INFO, - always_use_jwt_access=True, - api_audience=None, - ) - -@pytest.mark.parametrize("client_class,transport_class,transport_name,grpc_helpers", [ - (DataformClient, transports.DataformGrpcTransport, "grpc", grpc_helpers), - (DataformAsyncClient, transports.DataformGrpcAsyncIOTransport, "grpc_asyncio", grpc_helpers_async), -]) -def test_dataform_client_client_options_credentials_file(client_class, transport_class, transport_name, grpc_helpers): - # Check the case credentials file is provided. - options = client_options.ClientOptions( - credentials_file="credentials.json" - ) - - with mock.patch.object(transport_class, '__init__') as patched: - patched.return_value = None - client = client_class(client_options=options, transport=transport_name) - patched.assert_called_once_with( - credentials=None, - credentials_file="credentials.json", - host=client.DEFAULT_ENDPOINT, - scopes=None, - client_cert_source_for_mtls=None, - quota_project_id=None, - client_info=transports.base.DEFAULT_CLIENT_INFO, - always_use_jwt_access=True, - api_audience=None, - ) - -def test_dataform_client_client_options_from_dict(): - with mock.patch('google.cloud.dataform_v1beta1.services.dataform.transports.DataformGrpcTransport.__init__') as grpc_transport: - grpc_transport.return_value = None - client = DataformClient( - client_options={'api_endpoint': 'squid.clam.whelk'} - ) - grpc_transport.assert_called_once_with( - credentials=None, - credentials_file=None, - host="squid.clam.whelk", - scopes=None, - client_cert_source_for_mtls=None, - quota_project_id=None, - client_info=transports.base.DEFAULT_CLIENT_INFO, - always_use_jwt_access=True, - api_audience=None, - ) - - -@pytest.mark.parametrize("client_class,transport_class,transport_name,grpc_helpers", [ - (DataformClient, transports.DataformGrpcTransport, "grpc", grpc_helpers), - (DataformAsyncClient, transports.DataformGrpcAsyncIOTransport, "grpc_asyncio", grpc_helpers_async), -]) -def test_dataform_client_create_channel_credentials_file(client_class, transport_class, transport_name, grpc_helpers): - # Check the case credentials file is provided. - options = client_options.ClientOptions( - credentials_file="credentials.json" - ) - - with mock.patch.object(transport_class, '__init__') as patched: - patched.return_value = None - client = client_class(client_options=options, transport=transport_name) - patched.assert_called_once_with( - credentials=None, - credentials_file="credentials.json", - host=client.DEFAULT_ENDPOINT, - scopes=None, - client_cert_source_for_mtls=None, - quota_project_id=None, - client_info=transports.base.DEFAULT_CLIENT_INFO, - always_use_jwt_access=True, - api_audience=None, - ) - - # test that the credentials from file are saved and used as the credentials. - with mock.patch.object( - google.auth, "load_credentials_from_file", autospec=True - ) as load_creds, mock.patch.object( - google.auth, "default", autospec=True - ) as adc, mock.patch.object( - grpc_helpers, "create_channel" - ) as create_channel: - creds = ga_credentials.AnonymousCredentials() - file_creds = ga_credentials.AnonymousCredentials() - load_creds.return_value = (file_creds, None) - adc.return_value = (creds, None) - client = client_class(client_options=options, transport=transport_name) - create_channel.assert_called_with( - "dataform.googleapis.com:443", - credentials=file_creds, - credentials_file=None, - quota_project_id=None, - default_scopes=( - 'https://www.googleapis.com/auth/cloud-platform', -), - scopes=None, - default_host="dataform.googleapis.com", - ssl_credentials=None, - options=[ - ("grpc.max_send_message_length", -1), - ("grpc.max_receive_message_length", -1), - ], - ) - - -@pytest.mark.parametrize("request_type", [ - dataform.ListRepositoriesRequest, - dict, -]) -def test_list_repositories(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_repositories), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.ListRepositoriesResponse( - next_page_token='next_page_token_value', - unreachable=['unreachable_value'], - ) - response = client.list_repositories(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.ListRepositoriesRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, pagers.ListRepositoriesPager) - assert response.next_page_token == 'next_page_token_value' - assert response.unreachable == ['unreachable_value'] - - -def test_list_repositories_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_repositories), - '__call__') as call: - client.list_repositories() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.ListRepositoriesRequest() - -@pytest.mark.asyncio -async def test_list_repositories_async(transport: str = 'grpc_asyncio', request_type=dataform.ListRepositoriesRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_repositories), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListRepositoriesResponse( - next_page_token='next_page_token_value', - unreachable=['unreachable_value'], - )) - response = await client.list_repositories(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.ListRepositoriesRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, pagers.ListRepositoriesAsyncPager) - assert response.next_page_token == 'next_page_token_value' - assert response.unreachable == ['unreachable_value'] - - -@pytest.mark.asyncio -async def test_list_repositories_async_from_dict(): - await test_list_repositories_async(request_type=dict) - - -def test_list_repositories_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.ListRepositoriesRequest() - - request.parent = 'parent_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_repositories), - '__call__') as call: - call.return_value = dataform.ListRepositoriesResponse() - client.list_repositories(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'parent=parent_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_list_repositories_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.ListRepositoriesRequest() - - request.parent = 'parent_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_repositories), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListRepositoriesResponse()) - await client.list_repositories(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'parent=parent_value', - ) in kw['metadata'] - - -def test_list_repositories_flattened(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_repositories), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.ListRepositoriesResponse() - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - client.list_repositories( - parent='parent_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - arg = args[0].parent - mock_val = 'parent_value' - assert arg == mock_val - - -def test_list_repositories_flattened_error(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - client.list_repositories( - dataform.ListRepositoriesRequest(), - parent='parent_value', - ) - -@pytest.mark.asyncio -async def test_list_repositories_flattened_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_repositories), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.ListRepositoriesResponse() - - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListRepositoriesResponse()) - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - response = await client.list_repositories( - parent='parent_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - arg = args[0].parent - mock_val = 'parent_value' - assert arg == mock_val - -@pytest.mark.asyncio -async def test_list_repositories_flattened_error_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - await client.list_repositories( - dataform.ListRepositoriesRequest(), - parent='parent_value', - ) - - -def test_list_repositories_pager(transport_name: str = "grpc"): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials, - transport=transport_name, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_repositories), - '__call__') as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.ListRepositoriesResponse( - repositories=[ - dataform.Repository(), - dataform.Repository(), - dataform.Repository(), - ], - next_page_token='abc', - ), - dataform.ListRepositoriesResponse( - repositories=[], - next_page_token='def', - ), - dataform.ListRepositoriesResponse( - repositories=[ - dataform.Repository(), - ], - next_page_token='ghi', - ), - dataform.ListRepositoriesResponse( - repositories=[ - dataform.Repository(), - dataform.Repository(), - ], - ), - RuntimeError, - ) - - metadata = () - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ('parent', ''), - )), - ) - pager = client.list_repositories(request={}) - - assert pager._metadata == metadata - - results = list(pager) - assert len(results) == 6 - assert all(isinstance(i, dataform.Repository) - for i in results) -def test_list_repositories_pages(transport_name: str = "grpc"): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials, - transport=transport_name, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_repositories), - '__call__') as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.ListRepositoriesResponse( - repositories=[ - dataform.Repository(), - dataform.Repository(), - dataform.Repository(), - ], - next_page_token='abc', - ), - dataform.ListRepositoriesResponse( - repositories=[], - next_page_token='def', - ), - dataform.ListRepositoriesResponse( - repositories=[ - dataform.Repository(), - ], - next_page_token='ghi', - ), - dataform.ListRepositoriesResponse( - repositories=[ - dataform.Repository(), - dataform.Repository(), - ], - ), - RuntimeError, - ) - pages = list(client.list_repositories(request={}).pages) - for page_, token in zip(pages, ['abc','def','ghi', '']): - assert page_.raw_page.next_page_token == token - -@pytest.mark.asyncio -async def test_list_repositories_async_pager(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_repositories), - '__call__', new_callable=mock.AsyncMock) as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.ListRepositoriesResponse( - repositories=[ - dataform.Repository(), - dataform.Repository(), - dataform.Repository(), - ], - next_page_token='abc', - ), - dataform.ListRepositoriesResponse( - repositories=[], - next_page_token='def', - ), - dataform.ListRepositoriesResponse( - repositories=[ - dataform.Repository(), - ], - next_page_token='ghi', - ), - dataform.ListRepositoriesResponse( - repositories=[ - dataform.Repository(), - dataform.Repository(), - ], - ), - RuntimeError, - ) - async_pager = await client.list_repositories(request={},) - assert async_pager.next_page_token == 'abc' - responses = [] - async for response in async_pager: # pragma: no branch - responses.append(response) - - assert len(responses) == 6 - assert all(isinstance(i, dataform.Repository) - for i in responses) - - -@pytest.mark.asyncio -async def test_list_repositories_async_pages(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_repositories), - '__call__', new_callable=mock.AsyncMock) as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.ListRepositoriesResponse( - repositories=[ - dataform.Repository(), - dataform.Repository(), - dataform.Repository(), - ], - next_page_token='abc', - ), - dataform.ListRepositoriesResponse( - repositories=[], - next_page_token='def', - ), - dataform.ListRepositoriesResponse( - repositories=[ - dataform.Repository(), - ], - next_page_token='ghi', - ), - dataform.ListRepositoriesResponse( - repositories=[ - dataform.Repository(), - dataform.Repository(), - ], - ), - RuntimeError, - ) - pages = [] - async for page_ in (await client.list_repositories(request={})).pages: # pragma: no branch - pages.append(page_) - for page_, token in zip(pages, ['abc','def','ghi', '']): - assert page_.raw_page.next_page_token == token - -@pytest.mark.parametrize("request_type", [ - dataform.GetRepositoryRequest, - dict, -]) -def test_get_repository(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_repository), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.Repository( - name='name_value', - ) - response = client.get_repository(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.GetRepositoryRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.Repository) - assert response.name == 'name_value' - - -def test_get_repository_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_repository), - '__call__') as call: - client.get_repository() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.GetRepositoryRequest() - -@pytest.mark.asyncio -async def test_get_repository_async(transport: str = 'grpc_asyncio', request_type=dataform.GetRepositoryRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_repository), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.Repository( - name='name_value', - )) - response = await client.get_repository(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.GetRepositoryRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.Repository) - assert response.name == 'name_value' - - -@pytest.mark.asyncio -async def test_get_repository_async_from_dict(): - await test_get_repository_async(request_type=dict) - - -def test_get_repository_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.GetRepositoryRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_repository), - '__call__') as call: - call.return_value = dataform.Repository() - client.get_repository(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_get_repository_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.GetRepositoryRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_repository), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Repository()) - await client.get_repository(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -def test_get_repository_flattened(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_repository), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.Repository() - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - client.get_repository( - name='name_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - arg = args[0].name - mock_val = 'name_value' - assert arg == mock_val - - -def test_get_repository_flattened_error(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - client.get_repository( - dataform.GetRepositoryRequest(), - name='name_value', - ) - -@pytest.mark.asyncio -async def test_get_repository_flattened_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_repository), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.Repository() - - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Repository()) - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - response = await client.get_repository( - name='name_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - arg = args[0].name - mock_val = 'name_value' - assert arg == mock_val - -@pytest.mark.asyncio -async def test_get_repository_flattened_error_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - await client.get_repository( - dataform.GetRepositoryRequest(), - name='name_value', - ) - - -@pytest.mark.parametrize("request_type", [ - dataform.CreateRepositoryRequest, - dict, -]) -def test_create_repository(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_repository), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.Repository( - name='name_value', - ) - response = client.create_repository(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.CreateRepositoryRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.Repository) - assert response.name == 'name_value' - - -def test_create_repository_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_repository), - '__call__') as call: - client.create_repository() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.CreateRepositoryRequest() - -@pytest.mark.asyncio -async def test_create_repository_async(transport: str = 'grpc_asyncio', request_type=dataform.CreateRepositoryRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_repository), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.Repository( - name='name_value', - )) - response = await client.create_repository(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.CreateRepositoryRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.Repository) - assert response.name == 'name_value' - - -@pytest.mark.asyncio -async def test_create_repository_async_from_dict(): - await test_create_repository_async(request_type=dict) - - -def test_create_repository_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.CreateRepositoryRequest() - - request.parent = 'parent_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_repository), - '__call__') as call: - call.return_value = dataform.Repository() - client.create_repository(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'parent=parent_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_create_repository_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.CreateRepositoryRequest() - - request.parent = 'parent_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_repository), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Repository()) - await client.create_repository(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'parent=parent_value', - ) in kw['metadata'] - - -def test_create_repository_flattened(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_repository), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.Repository() - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - client.create_repository( - parent='parent_value', - repository=dataform.Repository(name='name_value'), - repository_id='repository_id_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - arg = args[0].parent - mock_val = 'parent_value' - assert arg == mock_val - arg = args[0].repository - mock_val = dataform.Repository(name='name_value') - assert arg == mock_val - arg = args[0].repository_id - mock_val = 'repository_id_value' - assert arg == mock_val - - -def test_create_repository_flattened_error(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - client.create_repository( - dataform.CreateRepositoryRequest(), - parent='parent_value', - repository=dataform.Repository(name='name_value'), - repository_id='repository_id_value', - ) - -@pytest.mark.asyncio -async def test_create_repository_flattened_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_repository), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.Repository() - - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Repository()) - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - response = await client.create_repository( - parent='parent_value', - repository=dataform.Repository(name='name_value'), - repository_id='repository_id_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - arg = args[0].parent - mock_val = 'parent_value' - assert arg == mock_val - arg = args[0].repository - mock_val = dataform.Repository(name='name_value') - assert arg == mock_val - arg = args[0].repository_id - mock_val = 'repository_id_value' - assert arg == mock_val - -@pytest.mark.asyncio -async def test_create_repository_flattened_error_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - await client.create_repository( - dataform.CreateRepositoryRequest(), - parent='parent_value', - repository=dataform.Repository(name='name_value'), - repository_id='repository_id_value', - ) - - -@pytest.mark.parametrize("request_type", [ - dataform.UpdateRepositoryRequest, - dict, -]) -def test_update_repository(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_repository), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.Repository( - name='name_value', - ) - response = client.update_repository(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.UpdateRepositoryRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.Repository) - assert response.name == 'name_value' - - -def test_update_repository_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_repository), - '__call__') as call: - client.update_repository() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.UpdateRepositoryRequest() - -@pytest.mark.asyncio -async def test_update_repository_async(transport: str = 'grpc_asyncio', request_type=dataform.UpdateRepositoryRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_repository), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.Repository( - name='name_value', - )) - response = await client.update_repository(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.UpdateRepositoryRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.Repository) - assert response.name == 'name_value' - - -@pytest.mark.asyncio -async def test_update_repository_async_from_dict(): - await test_update_repository_async(request_type=dict) - - -def test_update_repository_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.UpdateRepositoryRequest() - - request.repository.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_repository), - '__call__') as call: - call.return_value = dataform.Repository() - client.update_repository(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'repository.name=name_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_update_repository_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.UpdateRepositoryRequest() - - request.repository.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_repository), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Repository()) - await client.update_repository(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'repository.name=name_value', - ) in kw['metadata'] - - -def test_update_repository_flattened(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_repository), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.Repository() - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - client.update_repository( - repository=dataform.Repository(name='name_value'), - update_mask=field_mask_pb2.FieldMask(paths=['paths_value']), - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - arg = args[0].repository - mock_val = dataform.Repository(name='name_value') - assert arg == mock_val - arg = args[0].update_mask - mock_val = field_mask_pb2.FieldMask(paths=['paths_value']) - assert arg == mock_val - - -def test_update_repository_flattened_error(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - client.update_repository( - dataform.UpdateRepositoryRequest(), - repository=dataform.Repository(name='name_value'), - update_mask=field_mask_pb2.FieldMask(paths=['paths_value']), - ) - -@pytest.mark.asyncio -async def test_update_repository_flattened_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.update_repository), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.Repository() - - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Repository()) - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - response = await client.update_repository( - repository=dataform.Repository(name='name_value'), - update_mask=field_mask_pb2.FieldMask(paths=['paths_value']), - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - arg = args[0].repository - mock_val = dataform.Repository(name='name_value') - assert arg == mock_val - arg = args[0].update_mask - mock_val = field_mask_pb2.FieldMask(paths=['paths_value']) - assert arg == mock_val - -@pytest.mark.asyncio -async def test_update_repository_flattened_error_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - await client.update_repository( - dataform.UpdateRepositoryRequest(), - repository=dataform.Repository(name='name_value'), - update_mask=field_mask_pb2.FieldMask(paths=['paths_value']), - ) - - -@pytest.mark.parametrize("request_type", [ - dataform.DeleteRepositoryRequest, - dict, -]) -def test_delete_repository(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_repository), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = None - response = client.delete_repository(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.DeleteRepositoryRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -def test_delete_repository_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_repository), - '__call__') as call: - client.delete_repository() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.DeleteRepositoryRequest() - -@pytest.mark.asyncio -async def test_delete_repository_async(transport: str = 'grpc_asyncio', request_type=dataform.DeleteRepositoryRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_repository), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - response = await client.delete_repository(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.DeleteRepositoryRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -@pytest.mark.asyncio -async def test_delete_repository_async_from_dict(): - await test_delete_repository_async(request_type=dict) - - -def test_delete_repository_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.DeleteRepositoryRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_repository), - '__call__') as call: - call.return_value = None - client.delete_repository(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_delete_repository_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.DeleteRepositoryRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_repository), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_repository(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -def test_delete_repository_flattened(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_repository), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = None - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - client.delete_repository( - name='name_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - arg = args[0].name - mock_val = 'name_value' - assert arg == mock_val - - -def test_delete_repository_flattened_error(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - client.delete_repository( - dataform.DeleteRepositoryRequest(), - name='name_value', - ) - -@pytest.mark.asyncio -async def test_delete_repository_flattened_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_repository), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = None - - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - response = await client.delete_repository( - name='name_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - arg = args[0].name - mock_val = 'name_value' - assert arg == mock_val - -@pytest.mark.asyncio -async def test_delete_repository_flattened_error_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - await client.delete_repository( - dataform.DeleteRepositoryRequest(), - name='name_value', - ) - - -@pytest.mark.parametrize("request_type", [ - dataform.FetchRemoteBranchesRequest, - dict, -]) -def test_fetch_remote_branches(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_remote_branches), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.FetchRemoteBranchesResponse( - branches=['branches_value'], - ) - response = client.fetch_remote_branches(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.FetchRemoteBranchesRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.FetchRemoteBranchesResponse) - assert response.branches == ['branches_value'] - - -def test_fetch_remote_branches_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_remote_branches), - '__call__') as call: - client.fetch_remote_branches() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.FetchRemoteBranchesRequest() - -@pytest.mark.asyncio -async def test_fetch_remote_branches_async(transport: str = 'grpc_asyncio', request_type=dataform.FetchRemoteBranchesRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_remote_branches), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.FetchRemoteBranchesResponse( - branches=['branches_value'], - )) - response = await client.fetch_remote_branches(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.FetchRemoteBranchesRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.FetchRemoteBranchesResponse) - assert response.branches == ['branches_value'] - - -@pytest.mark.asyncio -async def test_fetch_remote_branches_async_from_dict(): - await test_fetch_remote_branches_async(request_type=dict) - - -def test_fetch_remote_branches_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.FetchRemoteBranchesRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_remote_branches), - '__call__') as call: - call.return_value = dataform.FetchRemoteBranchesResponse() - client.fetch_remote_branches(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_fetch_remote_branches_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.FetchRemoteBranchesRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_remote_branches), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.FetchRemoteBranchesResponse()) - await client.fetch_remote_branches(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.parametrize("request_type", [ - dataform.ListWorkspacesRequest, - dict, -]) -def test_list_workspaces(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workspaces), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.ListWorkspacesResponse( - next_page_token='next_page_token_value', - unreachable=['unreachable_value'], - ) - response = client.list_workspaces(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.ListWorkspacesRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, pagers.ListWorkspacesPager) - assert response.next_page_token == 'next_page_token_value' - assert response.unreachable == ['unreachable_value'] - - -def test_list_workspaces_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workspaces), - '__call__') as call: - client.list_workspaces() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.ListWorkspacesRequest() - -@pytest.mark.asyncio -async def test_list_workspaces_async(transport: str = 'grpc_asyncio', request_type=dataform.ListWorkspacesRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workspaces), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListWorkspacesResponse( - next_page_token='next_page_token_value', - unreachable=['unreachable_value'], - )) - response = await client.list_workspaces(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.ListWorkspacesRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, pagers.ListWorkspacesAsyncPager) - assert response.next_page_token == 'next_page_token_value' - assert response.unreachable == ['unreachable_value'] - - -@pytest.mark.asyncio -async def test_list_workspaces_async_from_dict(): - await test_list_workspaces_async(request_type=dict) - - -def test_list_workspaces_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.ListWorkspacesRequest() - - request.parent = 'parent_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workspaces), - '__call__') as call: - call.return_value = dataform.ListWorkspacesResponse() - client.list_workspaces(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'parent=parent_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_list_workspaces_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.ListWorkspacesRequest() - - request.parent = 'parent_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workspaces), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListWorkspacesResponse()) - await client.list_workspaces(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'parent=parent_value', - ) in kw['metadata'] - - -def test_list_workspaces_flattened(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workspaces), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.ListWorkspacesResponse() - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - client.list_workspaces( - parent='parent_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - arg = args[0].parent - mock_val = 'parent_value' - assert arg == mock_val - - -def test_list_workspaces_flattened_error(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - client.list_workspaces( - dataform.ListWorkspacesRequest(), - parent='parent_value', - ) - -@pytest.mark.asyncio -async def test_list_workspaces_flattened_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workspaces), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.ListWorkspacesResponse() - - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListWorkspacesResponse()) - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - response = await client.list_workspaces( - parent='parent_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - arg = args[0].parent - mock_val = 'parent_value' - assert arg == mock_val - -@pytest.mark.asyncio -async def test_list_workspaces_flattened_error_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - await client.list_workspaces( - dataform.ListWorkspacesRequest(), - parent='parent_value', - ) - - -def test_list_workspaces_pager(transport_name: str = "grpc"): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials, - transport=transport_name, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workspaces), - '__call__') as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.ListWorkspacesResponse( - workspaces=[ - dataform.Workspace(), - dataform.Workspace(), - dataform.Workspace(), - ], - next_page_token='abc', - ), - dataform.ListWorkspacesResponse( - workspaces=[], - next_page_token='def', - ), - dataform.ListWorkspacesResponse( - workspaces=[ - dataform.Workspace(), - ], - next_page_token='ghi', - ), - dataform.ListWorkspacesResponse( - workspaces=[ - dataform.Workspace(), - dataform.Workspace(), - ], - ), - RuntimeError, - ) - - metadata = () - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ('parent', ''), - )), - ) - pager = client.list_workspaces(request={}) - - assert pager._metadata == metadata - - results = list(pager) - assert len(results) == 6 - assert all(isinstance(i, dataform.Workspace) - for i in results) -def test_list_workspaces_pages(transport_name: str = "grpc"): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials, - transport=transport_name, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workspaces), - '__call__') as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.ListWorkspacesResponse( - workspaces=[ - dataform.Workspace(), - dataform.Workspace(), - dataform.Workspace(), - ], - next_page_token='abc', - ), - dataform.ListWorkspacesResponse( - workspaces=[], - next_page_token='def', - ), - dataform.ListWorkspacesResponse( - workspaces=[ - dataform.Workspace(), - ], - next_page_token='ghi', - ), - dataform.ListWorkspacesResponse( - workspaces=[ - dataform.Workspace(), - dataform.Workspace(), - ], - ), - RuntimeError, - ) - pages = list(client.list_workspaces(request={}).pages) - for page_, token in zip(pages, ['abc','def','ghi', '']): - assert page_.raw_page.next_page_token == token - -@pytest.mark.asyncio -async def test_list_workspaces_async_pager(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workspaces), - '__call__', new_callable=mock.AsyncMock) as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.ListWorkspacesResponse( - workspaces=[ - dataform.Workspace(), - dataform.Workspace(), - dataform.Workspace(), - ], - next_page_token='abc', - ), - dataform.ListWorkspacesResponse( - workspaces=[], - next_page_token='def', - ), - dataform.ListWorkspacesResponse( - workspaces=[ - dataform.Workspace(), - ], - next_page_token='ghi', - ), - dataform.ListWorkspacesResponse( - workspaces=[ - dataform.Workspace(), - dataform.Workspace(), - ], - ), - RuntimeError, - ) - async_pager = await client.list_workspaces(request={},) - assert async_pager.next_page_token == 'abc' - responses = [] - async for response in async_pager: # pragma: no branch - responses.append(response) - - assert len(responses) == 6 - assert all(isinstance(i, dataform.Workspace) - for i in responses) - - -@pytest.mark.asyncio -async def test_list_workspaces_async_pages(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workspaces), - '__call__', new_callable=mock.AsyncMock) as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.ListWorkspacesResponse( - workspaces=[ - dataform.Workspace(), - dataform.Workspace(), - dataform.Workspace(), - ], - next_page_token='abc', - ), - dataform.ListWorkspacesResponse( - workspaces=[], - next_page_token='def', - ), - dataform.ListWorkspacesResponse( - workspaces=[ - dataform.Workspace(), - ], - next_page_token='ghi', - ), - dataform.ListWorkspacesResponse( - workspaces=[ - dataform.Workspace(), - dataform.Workspace(), - ], - ), - RuntimeError, - ) - pages = [] - async for page_ in (await client.list_workspaces(request={})).pages: # pragma: no branch - pages.append(page_) - for page_, token in zip(pages, ['abc','def','ghi', '']): - assert page_.raw_page.next_page_token == token - -@pytest.mark.parametrize("request_type", [ - dataform.GetWorkspaceRequest, - dict, -]) -def test_get_workspace(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_workspace), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.Workspace( - name='name_value', - ) - response = client.get_workspace(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.GetWorkspaceRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.Workspace) - assert response.name == 'name_value' - - -def test_get_workspace_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_workspace), - '__call__') as call: - client.get_workspace() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.GetWorkspaceRequest() - -@pytest.mark.asyncio -async def test_get_workspace_async(transport: str = 'grpc_asyncio', request_type=dataform.GetWorkspaceRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_workspace), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.Workspace( - name='name_value', - )) - response = await client.get_workspace(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.GetWorkspaceRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.Workspace) - assert response.name == 'name_value' - - -@pytest.mark.asyncio -async def test_get_workspace_async_from_dict(): - await test_get_workspace_async(request_type=dict) - - -def test_get_workspace_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.GetWorkspaceRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_workspace), - '__call__') as call: - call.return_value = dataform.Workspace() - client.get_workspace(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_get_workspace_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.GetWorkspaceRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_workspace), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Workspace()) - await client.get_workspace(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -def test_get_workspace_flattened(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_workspace), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.Workspace() - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - client.get_workspace( - name='name_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - arg = args[0].name - mock_val = 'name_value' - assert arg == mock_val - - -def test_get_workspace_flattened_error(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - client.get_workspace( - dataform.GetWorkspaceRequest(), - name='name_value', - ) - -@pytest.mark.asyncio -async def test_get_workspace_flattened_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_workspace), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.Workspace() - - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Workspace()) - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - response = await client.get_workspace( - name='name_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - arg = args[0].name - mock_val = 'name_value' - assert arg == mock_val - -@pytest.mark.asyncio -async def test_get_workspace_flattened_error_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - await client.get_workspace( - dataform.GetWorkspaceRequest(), - name='name_value', - ) - - -@pytest.mark.parametrize("request_type", [ - dataform.CreateWorkspaceRequest, - dict, -]) -def test_create_workspace(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_workspace), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.Workspace( - name='name_value', - ) - response = client.create_workspace(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.CreateWorkspaceRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.Workspace) - assert response.name == 'name_value' - - -def test_create_workspace_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_workspace), - '__call__') as call: - client.create_workspace() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.CreateWorkspaceRequest() - -@pytest.mark.asyncio -async def test_create_workspace_async(transport: str = 'grpc_asyncio', request_type=dataform.CreateWorkspaceRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_workspace), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.Workspace( - name='name_value', - )) - response = await client.create_workspace(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.CreateWorkspaceRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.Workspace) - assert response.name == 'name_value' - - -@pytest.mark.asyncio -async def test_create_workspace_async_from_dict(): - await test_create_workspace_async(request_type=dict) - - -def test_create_workspace_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.CreateWorkspaceRequest() - - request.parent = 'parent_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_workspace), - '__call__') as call: - call.return_value = dataform.Workspace() - client.create_workspace(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'parent=parent_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_create_workspace_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.CreateWorkspaceRequest() - - request.parent = 'parent_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_workspace), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Workspace()) - await client.create_workspace(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'parent=parent_value', - ) in kw['metadata'] - - -def test_create_workspace_flattened(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_workspace), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.Workspace() - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - client.create_workspace( - parent='parent_value', - workspace=dataform.Workspace(name='name_value'), - workspace_id='workspace_id_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - arg = args[0].parent - mock_val = 'parent_value' - assert arg == mock_val - arg = args[0].workspace - mock_val = dataform.Workspace(name='name_value') - assert arg == mock_val - arg = args[0].workspace_id - mock_val = 'workspace_id_value' - assert arg == mock_val - - -def test_create_workspace_flattened_error(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - client.create_workspace( - dataform.CreateWorkspaceRequest(), - parent='parent_value', - workspace=dataform.Workspace(name='name_value'), - workspace_id='workspace_id_value', - ) - -@pytest.mark.asyncio -async def test_create_workspace_flattened_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_workspace), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.Workspace() - - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.Workspace()) - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - response = await client.create_workspace( - parent='parent_value', - workspace=dataform.Workspace(name='name_value'), - workspace_id='workspace_id_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - arg = args[0].parent - mock_val = 'parent_value' - assert arg == mock_val - arg = args[0].workspace - mock_val = dataform.Workspace(name='name_value') - assert arg == mock_val - arg = args[0].workspace_id - mock_val = 'workspace_id_value' - assert arg == mock_val - -@pytest.mark.asyncio -async def test_create_workspace_flattened_error_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - await client.create_workspace( - dataform.CreateWorkspaceRequest(), - parent='parent_value', - workspace=dataform.Workspace(name='name_value'), - workspace_id='workspace_id_value', - ) - - -@pytest.mark.parametrize("request_type", [ - dataform.DeleteWorkspaceRequest, - dict, -]) -def test_delete_workspace(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_workspace), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = None - response = client.delete_workspace(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.DeleteWorkspaceRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -def test_delete_workspace_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_workspace), - '__call__') as call: - client.delete_workspace() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.DeleteWorkspaceRequest() - -@pytest.mark.asyncio -async def test_delete_workspace_async(transport: str = 'grpc_asyncio', request_type=dataform.DeleteWorkspaceRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_workspace), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - response = await client.delete_workspace(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.DeleteWorkspaceRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -@pytest.mark.asyncio -async def test_delete_workspace_async_from_dict(): - await test_delete_workspace_async(request_type=dict) - - -def test_delete_workspace_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.DeleteWorkspaceRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_workspace), - '__call__') as call: - call.return_value = None - client.delete_workspace(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_delete_workspace_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.DeleteWorkspaceRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_workspace), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_workspace(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -def test_delete_workspace_flattened(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_workspace), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = None - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - client.delete_workspace( - name='name_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - arg = args[0].name - mock_val = 'name_value' - assert arg == mock_val - - -def test_delete_workspace_flattened_error(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - client.delete_workspace( - dataform.DeleteWorkspaceRequest(), - name='name_value', - ) - -@pytest.mark.asyncio -async def test_delete_workspace_flattened_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_workspace), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = None - - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - response = await client.delete_workspace( - name='name_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - arg = args[0].name - mock_val = 'name_value' - assert arg == mock_val - -@pytest.mark.asyncio -async def test_delete_workspace_flattened_error_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - await client.delete_workspace( - dataform.DeleteWorkspaceRequest(), - name='name_value', - ) - - -@pytest.mark.parametrize("request_type", [ - dataform.InstallNpmPackagesRequest, - dict, -]) -def test_install_npm_packages(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.install_npm_packages), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.InstallNpmPackagesResponse( - ) - response = client.install_npm_packages(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.InstallNpmPackagesRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.InstallNpmPackagesResponse) - - -def test_install_npm_packages_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.install_npm_packages), - '__call__') as call: - client.install_npm_packages() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.InstallNpmPackagesRequest() - -@pytest.mark.asyncio -async def test_install_npm_packages_async(transport: str = 'grpc_asyncio', request_type=dataform.InstallNpmPackagesRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.install_npm_packages), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.InstallNpmPackagesResponse( - )) - response = await client.install_npm_packages(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.InstallNpmPackagesRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.InstallNpmPackagesResponse) - - -@pytest.mark.asyncio -async def test_install_npm_packages_async_from_dict(): - await test_install_npm_packages_async(request_type=dict) - - -def test_install_npm_packages_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.InstallNpmPackagesRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.install_npm_packages), - '__call__') as call: - call.return_value = dataform.InstallNpmPackagesResponse() - client.install_npm_packages(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_install_npm_packages_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.InstallNpmPackagesRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.install_npm_packages), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.InstallNpmPackagesResponse()) - await client.install_npm_packages(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -@pytest.mark.parametrize("request_type", [ - dataform.PullGitCommitsRequest, - dict, -]) -def test_pull_git_commits(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.pull_git_commits), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = None - response = client.pull_git_commits(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.PullGitCommitsRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -def test_pull_git_commits_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.pull_git_commits), - '__call__') as call: - client.pull_git_commits() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.PullGitCommitsRequest() - -@pytest.mark.asyncio -async def test_pull_git_commits_async(transport: str = 'grpc_asyncio', request_type=dataform.PullGitCommitsRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.pull_git_commits), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - response = await client.pull_git_commits(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.PullGitCommitsRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -@pytest.mark.asyncio -async def test_pull_git_commits_async_from_dict(): - await test_pull_git_commits_async(request_type=dict) - - -def test_pull_git_commits_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.PullGitCommitsRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.pull_git_commits), - '__call__') as call: - call.return_value = None - client.pull_git_commits(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_pull_git_commits_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.PullGitCommitsRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.pull_git_commits), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.pull_git_commits(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.parametrize("request_type", [ - dataform.PushGitCommitsRequest, - dict, -]) -def test_push_git_commits(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.push_git_commits), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = None - response = client.push_git_commits(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.PushGitCommitsRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -def test_push_git_commits_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.push_git_commits), - '__call__') as call: - client.push_git_commits() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.PushGitCommitsRequest() - -@pytest.mark.asyncio -async def test_push_git_commits_async(transport: str = 'grpc_asyncio', request_type=dataform.PushGitCommitsRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.push_git_commits), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - response = await client.push_git_commits(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.PushGitCommitsRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -@pytest.mark.asyncio -async def test_push_git_commits_async_from_dict(): - await test_push_git_commits_async(request_type=dict) - - -def test_push_git_commits_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.PushGitCommitsRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.push_git_commits), - '__call__') as call: - call.return_value = None - client.push_git_commits(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_push_git_commits_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.PushGitCommitsRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.push_git_commits), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.push_git_commits(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.parametrize("request_type", [ - dataform.FetchFileGitStatusesRequest, - dict, -]) -def test_fetch_file_git_statuses(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_file_git_statuses), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.FetchFileGitStatusesResponse( - ) - response = client.fetch_file_git_statuses(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.FetchFileGitStatusesRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.FetchFileGitStatusesResponse) - - -def test_fetch_file_git_statuses_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_file_git_statuses), - '__call__') as call: - client.fetch_file_git_statuses() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.FetchFileGitStatusesRequest() - -@pytest.mark.asyncio -async def test_fetch_file_git_statuses_async(transport: str = 'grpc_asyncio', request_type=dataform.FetchFileGitStatusesRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_file_git_statuses), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.FetchFileGitStatusesResponse( - )) - response = await client.fetch_file_git_statuses(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.FetchFileGitStatusesRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.FetchFileGitStatusesResponse) - - -@pytest.mark.asyncio -async def test_fetch_file_git_statuses_async_from_dict(): - await test_fetch_file_git_statuses_async(request_type=dict) - - -def test_fetch_file_git_statuses_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.FetchFileGitStatusesRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_file_git_statuses), - '__call__') as call: - call.return_value = dataform.FetchFileGitStatusesResponse() - client.fetch_file_git_statuses(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_fetch_file_git_statuses_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.FetchFileGitStatusesRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_file_git_statuses), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.FetchFileGitStatusesResponse()) - await client.fetch_file_git_statuses(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.parametrize("request_type", [ - dataform.FetchGitAheadBehindRequest, - dict, -]) -def test_fetch_git_ahead_behind(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_git_ahead_behind), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.FetchGitAheadBehindResponse( - commits_ahead=1358, - commits_behind=1477, - ) - response = client.fetch_git_ahead_behind(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.FetchGitAheadBehindRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.FetchGitAheadBehindResponse) - assert response.commits_ahead == 1358 - assert response.commits_behind == 1477 - - -def test_fetch_git_ahead_behind_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_git_ahead_behind), - '__call__') as call: - client.fetch_git_ahead_behind() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.FetchGitAheadBehindRequest() - -@pytest.mark.asyncio -async def test_fetch_git_ahead_behind_async(transport: str = 'grpc_asyncio', request_type=dataform.FetchGitAheadBehindRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_git_ahead_behind), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.FetchGitAheadBehindResponse( - commits_ahead=1358, - commits_behind=1477, - )) - response = await client.fetch_git_ahead_behind(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.FetchGitAheadBehindRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.FetchGitAheadBehindResponse) - assert response.commits_ahead == 1358 - assert response.commits_behind == 1477 - - -@pytest.mark.asyncio -async def test_fetch_git_ahead_behind_async_from_dict(): - await test_fetch_git_ahead_behind_async(request_type=dict) - - -def test_fetch_git_ahead_behind_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.FetchGitAheadBehindRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_git_ahead_behind), - '__call__') as call: - call.return_value = dataform.FetchGitAheadBehindResponse() - client.fetch_git_ahead_behind(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_fetch_git_ahead_behind_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.FetchGitAheadBehindRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_git_ahead_behind), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.FetchGitAheadBehindResponse()) - await client.fetch_git_ahead_behind(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.parametrize("request_type", [ - dataform.CommitWorkspaceChangesRequest, - dict, -]) -def test_commit_workspace_changes(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.commit_workspace_changes), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = None - response = client.commit_workspace_changes(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.CommitWorkspaceChangesRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -def test_commit_workspace_changes_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.commit_workspace_changes), - '__call__') as call: - client.commit_workspace_changes() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.CommitWorkspaceChangesRequest() - -@pytest.mark.asyncio -async def test_commit_workspace_changes_async(transport: str = 'grpc_asyncio', request_type=dataform.CommitWorkspaceChangesRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.commit_workspace_changes), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - response = await client.commit_workspace_changes(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.CommitWorkspaceChangesRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -@pytest.mark.asyncio -async def test_commit_workspace_changes_async_from_dict(): - await test_commit_workspace_changes_async(request_type=dict) - - -def test_commit_workspace_changes_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.CommitWorkspaceChangesRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.commit_workspace_changes), - '__call__') as call: - call.return_value = None - client.commit_workspace_changes(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_commit_workspace_changes_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.CommitWorkspaceChangesRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.commit_workspace_changes), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.commit_workspace_changes(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.parametrize("request_type", [ - dataform.ResetWorkspaceChangesRequest, - dict, -]) -def test_reset_workspace_changes(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.reset_workspace_changes), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = None - response = client.reset_workspace_changes(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.ResetWorkspaceChangesRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -def test_reset_workspace_changes_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.reset_workspace_changes), - '__call__') as call: - client.reset_workspace_changes() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.ResetWorkspaceChangesRequest() - -@pytest.mark.asyncio -async def test_reset_workspace_changes_async(transport: str = 'grpc_asyncio', request_type=dataform.ResetWorkspaceChangesRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.reset_workspace_changes), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - response = await client.reset_workspace_changes(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.ResetWorkspaceChangesRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -@pytest.mark.asyncio -async def test_reset_workspace_changes_async_from_dict(): - await test_reset_workspace_changes_async(request_type=dict) - - -def test_reset_workspace_changes_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.ResetWorkspaceChangesRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.reset_workspace_changes), - '__call__') as call: - call.return_value = None - client.reset_workspace_changes(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_reset_workspace_changes_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.ResetWorkspaceChangesRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.reset_workspace_changes), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.reset_workspace_changes(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.parametrize("request_type", [ - dataform.FetchFileDiffRequest, - dict, -]) -def test_fetch_file_diff(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_file_diff), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.FetchFileDiffResponse( - formatted_diff='formatted_diff_value', - ) - response = client.fetch_file_diff(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.FetchFileDiffRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.FetchFileDiffResponse) - assert response.formatted_diff == 'formatted_diff_value' - - -def test_fetch_file_diff_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_file_diff), - '__call__') as call: - client.fetch_file_diff() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.FetchFileDiffRequest() - -@pytest.mark.asyncio -async def test_fetch_file_diff_async(transport: str = 'grpc_asyncio', request_type=dataform.FetchFileDiffRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_file_diff), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.FetchFileDiffResponse( - formatted_diff='formatted_diff_value', - )) - response = await client.fetch_file_diff(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.FetchFileDiffRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.FetchFileDiffResponse) - assert response.formatted_diff == 'formatted_diff_value' - - -@pytest.mark.asyncio -async def test_fetch_file_diff_async_from_dict(): - await test_fetch_file_diff_async(request_type=dict) - - -def test_fetch_file_diff_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.FetchFileDiffRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_file_diff), - '__call__') as call: - call.return_value = dataform.FetchFileDiffResponse() - client.fetch_file_diff(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_fetch_file_diff_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.FetchFileDiffRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.fetch_file_diff), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.FetchFileDiffResponse()) - await client.fetch_file_diff(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -@pytest.mark.parametrize("request_type", [ - dataform.QueryDirectoryContentsRequest, - dict, -]) -def test_query_directory_contents(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_directory_contents), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.QueryDirectoryContentsResponse( - next_page_token='next_page_token_value', - ) - response = client.query_directory_contents(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.QueryDirectoryContentsRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, pagers.QueryDirectoryContentsPager) - assert response.next_page_token == 'next_page_token_value' - - -def test_query_directory_contents_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_directory_contents), - '__call__') as call: - client.query_directory_contents() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.QueryDirectoryContentsRequest() - -@pytest.mark.asyncio -async def test_query_directory_contents_async(transport: str = 'grpc_asyncio', request_type=dataform.QueryDirectoryContentsRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_directory_contents), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.QueryDirectoryContentsResponse( - next_page_token='next_page_token_value', - )) - response = await client.query_directory_contents(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.QueryDirectoryContentsRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, pagers.QueryDirectoryContentsAsyncPager) - assert response.next_page_token == 'next_page_token_value' - - -@pytest.mark.asyncio -async def test_query_directory_contents_async_from_dict(): - await test_query_directory_contents_async(request_type=dict) - - -def test_query_directory_contents_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.QueryDirectoryContentsRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_directory_contents), - '__call__') as call: - call.return_value = dataform.QueryDirectoryContentsResponse() - client.query_directory_contents(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_query_directory_contents_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.QueryDirectoryContentsRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_directory_contents), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.QueryDirectoryContentsResponse()) - await client.query_directory_contents(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -def test_query_directory_contents_pager(transport_name: str = "grpc"): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials, - transport=transport_name, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_directory_contents), - '__call__') as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.QueryDirectoryContentsResponse( - directory_entries=[ - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - ], - next_page_token='abc', - ), - dataform.QueryDirectoryContentsResponse( - directory_entries=[], - next_page_token='def', - ), - dataform.QueryDirectoryContentsResponse( - directory_entries=[ - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - ], - next_page_token='ghi', - ), - dataform.QueryDirectoryContentsResponse( - directory_entries=[ - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - ], - ), - RuntimeError, - ) - - metadata = () - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ('workspace', ''), - )), - ) - pager = client.query_directory_contents(request={}) - - assert pager._metadata == metadata - - results = list(pager) - assert len(results) == 6 - assert all(isinstance(i, dataform.QueryDirectoryContentsResponse.DirectoryEntry) - for i in results) -def test_query_directory_contents_pages(transport_name: str = "grpc"): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials, - transport=transport_name, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_directory_contents), - '__call__') as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.QueryDirectoryContentsResponse( - directory_entries=[ - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - ], - next_page_token='abc', - ), - dataform.QueryDirectoryContentsResponse( - directory_entries=[], - next_page_token='def', - ), - dataform.QueryDirectoryContentsResponse( - directory_entries=[ - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - ], - next_page_token='ghi', - ), - dataform.QueryDirectoryContentsResponse( - directory_entries=[ - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - ], - ), - RuntimeError, - ) - pages = list(client.query_directory_contents(request={}).pages) - for page_, token in zip(pages, ['abc','def','ghi', '']): - assert page_.raw_page.next_page_token == token - -@pytest.mark.asyncio -async def test_query_directory_contents_async_pager(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_directory_contents), - '__call__', new_callable=mock.AsyncMock) as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.QueryDirectoryContentsResponse( - directory_entries=[ - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - ], - next_page_token='abc', - ), - dataform.QueryDirectoryContentsResponse( - directory_entries=[], - next_page_token='def', - ), - dataform.QueryDirectoryContentsResponse( - directory_entries=[ - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - ], - next_page_token='ghi', - ), - dataform.QueryDirectoryContentsResponse( - directory_entries=[ - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - ], - ), - RuntimeError, - ) - async_pager = await client.query_directory_contents(request={},) - assert async_pager.next_page_token == 'abc' - responses = [] - async for response in async_pager: # pragma: no branch - responses.append(response) - - assert len(responses) == 6 - assert all(isinstance(i, dataform.QueryDirectoryContentsResponse.DirectoryEntry) - for i in responses) - - -@pytest.mark.asyncio -async def test_query_directory_contents_async_pages(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_directory_contents), - '__call__', new_callable=mock.AsyncMock) as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.QueryDirectoryContentsResponse( - directory_entries=[ - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - ], - next_page_token='abc', - ), - dataform.QueryDirectoryContentsResponse( - directory_entries=[], - next_page_token='def', - ), - dataform.QueryDirectoryContentsResponse( - directory_entries=[ - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - ], - next_page_token='ghi', - ), - dataform.QueryDirectoryContentsResponse( - directory_entries=[ - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - dataform.QueryDirectoryContentsResponse.DirectoryEntry(), - ], - ), - RuntimeError, - ) - pages = [] - async for page_ in (await client.query_directory_contents(request={})).pages: # pragma: no branch - pages.append(page_) - for page_, token in zip(pages, ['abc','def','ghi', '']): - assert page_.raw_page.next_page_token == token - -@pytest.mark.parametrize("request_type", [ - dataform.MakeDirectoryRequest, - dict, -]) -def test_make_directory(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.make_directory), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.MakeDirectoryResponse( - ) - response = client.make_directory(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.MakeDirectoryRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.MakeDirectoryResponse) - - -def test_make_directory_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.make_directory), - '__call__') as call: - client.make_directory() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.MakeDirectoryRequest() - -@pytest.mark.asyncio -async def test_make_directory_async(transport: str = 'grpc_asyncio', request_type=dataform.MakeDirectoryRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.make_directory), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.MakeDirectoryResponse( - )) - response = await client.make_directory(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.MakeDirectoryRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.MakeDirectoryResponse) - - -@pytest.mark.asyncio -async def test_make_directory_async_from_dict(): - await test_make_directory_async(request_type=dict) - - -def test_make_directory_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.MakeDirectoryRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.make_directory), - '__call__') as call: - call.return_value = dataform.MakeDirectoryResponse() - client.make_directory(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_make_directory_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.MakeDirectoryRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.make_directory), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.MakeDirectoryResponse()) - await client.make_directory(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -@pytest.mark.parametrize("request_type", [ - dataform.RemoveDirectoryRequest, - dict, -]) -def test_remove_directory(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.remove_directory), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = None - response = client.remove_directory(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.RemoveDirectoryRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -def test_remove_directory_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.remove_directory), - '__call__') as call: - client.remove_directory() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.RemoveDirectoryRequest() - -@pytest.mark.asyncio -async def test_remove_directory_async(transport: str = 'grpc_asyncio', request_type=dataform.RemoveDirectoryRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.remove_directory), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - response = await client.remove_directory(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.RemoveDirectoryRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -@pytest.mark.asyncio -async def test_remove_directory_async_from_dict(): - await test_remove_directory_async(request_type=dict) - - -def test_remove_directory_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.RemoveDirectoryRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.remove_directory), - '__call__') as call: - call.return_value = None - client.remove_directory(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_remove_directory_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.RemoveDirectoryRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.remove_directory), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.remove_directory(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -@pytest.mark.parametrize("request_type", [ - dataform.MoveDirectoryRequest, - dict, -]) -def test_move_directory(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.move_directory), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.MoveDirectoryResponse( - ) - response = client.move_directory(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.MoveDirectoryRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.MoveDirectoryResponse) - - -def test_move_directory_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.move_directory), - '__call__') as call: - client.move_directory() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.MoveDirectoryRequest() - -@pytest.mark.asyncio -async def test_move_directory_async(transport: str = 'grpc_asyncio', request_type=dataform.MoveDirectoryRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.move_directory), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.MoveDirectoryResponse( - )) - response = await client.move_directory(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.MoveDirectoryRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.MoveDirectoryResponse) - - -@pytest.mark.asyncio -async def test_move_directory_async_from_dict(): - await test_move_directory_async(request_type=dict) - - -def test_move_directory_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.MoveDirectoryRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.move_directory), - '__call__') as call: - call.return_value = dataform.MoveDirectoryResponse() - client.move_directory(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_move_directory_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.MoveDirectoryRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.move_directory), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.MoveDirectoryResponse()) - await client.move_directory(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -@pytest.mark.parametrize("request_type", [ - dataform.ReadFileRequest, - dict, -]) -def test_read_file(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.read_file), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.ReadFileResponse( - file_contents=b'file_contents_blob', - ) - response = client.read_file(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.ReadFileRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.ReadFileResponse) - assert response.file_contents == b'file_contents_blob' - - -def test_read_file_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.read_file), - '__call__') as call: - client.read_file() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.ReadFileRequest() - -@pytest.mark.asyncio -async def test_read_file_async(transport: str = 'grpc_asyncio', request_type=dataform.ReadFileRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.read_file), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.ReadFileResponse( - file_contents=b'file_contents_blob', - )) - response = await client.read_file(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.ReadFileRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.ReadFileResponse) - assert response.file_contents == b'file_contents_blob' - - -@pytest.mark.asyncio -async def test_read_file_async_from_dict(): - await test_read_file_async(request_type=dict) - - -def test_read_file_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.ReadFileRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.read_file), - '__call__') as call: - call.return_value = dataform.ReadFileResponse() - client.read_file(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_read_file_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.ReadFileRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.read_file), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.ReadFileResponse()) - await client.read_file(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -@pytest.mark.parametrize("request_type", [ - dataform.RemoveFileRequest, - dict, -]) -def test_remove_file(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.remove_file), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = None - response = client.remove_file(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.RemoveFileRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -def test_remove_file_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.remove_file), - '__call__') as call: - client.remove_file() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.RemoveFileRequest() - -@pytest.mark.asyncio -async def test_remove_file_async(transport: str = 'grpc_asyncio', request_type=dataform.RemoveFileRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.remove_file), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - response = await client.remove_file(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.RemoveFileRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -@pytest.mark.asyncio -async def test_remove_file_async_from_dict(): - await test_remove_file_async(request_type=dict) - - -def test_remove_file_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.RemoveFileRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.remove_file), - '__call__') as call: - call.return_value = None - client.remove_file(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_remove_file_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.RemoveFileRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.remove_file), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.remove_file(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -@pytest.mark.parametrize("request_type", [ - dataform.MoveFileRequest, - dict, -]) -def test_move_file(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.move_file), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.MoveFileResponse( - ) - response = client.move_file(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.MoveFileRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.MoveFileResponse) - - -def test_move_file_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.move_file), - '__call__') as call: - client.move_file() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.MoveFileRequest() - -@pytest.mark.asyncio -async def test_move_file_async(transport: str = 'grpc_asyncio', request_type=dataform.MoveFileRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.move_file), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.MoveFileResponse( - )) - response = await client.move_file(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.MoveFileRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.MoveFileResponse) - - -@pytest.mark.asyncio -async def test_move_file_async_from_dict(): - await test_move_file_async(request_type=dict) - - -def test_move_file_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.MoveFileRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.move_file), - '__call__') as call: - call.return_value = dataform.MoveFileResponse() - client.move_file(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_move_file_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.MoveFileRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.move_file), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.MoveFileResponse()) - await client.move_file(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -@pytest.mark.parametrize("request_type", [ - dataform.WriteFileRequest, - dict, -]) -def test_write_file(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.write_file), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.WriteFileResponse( - ) - response = client.write_file(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.WriteFileRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.WriteFileResponse) - - -def test_write_file_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.write_file), - '__call__') as call: - client.write_file() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.WriteFileRequest() - -@pytest.mark.asyncio -async def test_write_file_async(transport: str = 'grpc_asyncio', request_type=dataform.WriteFileRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.write_file), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.WriteFileResponse( - )) - response = await client.write_file(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.WriteFileRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.WriteFileResponse) - - -@pytest.mark.asyncio -async def test_write_file_async_from_dict(): - await test_write_file_async(request_type=dict) - - -def test_write_file_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.WriteFileRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.write_file), - '__call__') as call: - call.return_value = dataform.WriteFileResponse() - client.write_file(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_write_file_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.WriteFileRequest() - - request.workspace = 'workspace_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.write_file), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.WriteFileResponse()) - await client.write_file(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'workspace=workspace_value', - ) in kw['metadata'] - - -@pytest.mark.parametrize("request_type", [ - dataform.ListCompilationResultsRequest, - dict, -]) -def test_list_compilation_results(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_compilation_results), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.ListCompilationResultsResponse( - next_page_token='next_page_token_value', - unreachable=['unreachable_value'], - ) - response = client.list_compilation_results(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.ListCompilationResultsRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, pagers.ListCompilationResultsPager) - assert response.next_page_token == 'next_page_token_value' - assert response.unreachable == ['unreachable_value'] - - -def test_list_compilation_results_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_compilation_results), - '__call__') as call: - client.list_compilation_results() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.ListCompilationResultsRequest() - -@pytest.mark.asyncio -async def test_list_compilation_results_async(transport: str = 'grpc_asyncio', request_type=dataform.ListCompilationResultsRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_compilation_results), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListCompilationResultsResponse( - next_page_token='next_page_token_value', - unreachable=['unreachable_value'], - )) - response = await client.list_compilation_results(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.ListCompilationResultsRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, pagers.ListCompilationResultsAsyncPager) - assert response.next_page_token == 'next_page_token_value' - assert response.unreachable == ['unreachable_value'] - - -@pytest.mark.asyncio -async def test_list_compilation_results_async_from_dict(): - await test_list_compilation_results_async(request_type=dict) - - -def test_list_compilation_results_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.ListCompilationResultsRequest() - - request.parent = 'parent_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_compilation_results), - '__call__') as call: - call.return_value = dataform.ListCompilationResultsResponse() - client.list_compilation_results(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'parent=parent_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_list_compilation_results_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.ListCompilationResultsRequest() - - request.parent = 'parent_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_compilation_results), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListCompilationResultsResponse()) - await client.list_compilation_results(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'parent=parent_value', - ) in kw['metadata'] - - -def test_list_compilation_results_flattened(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_compilation_results), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.ListCompilationResultsResponse() - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - client.list_compilation_results( - parent='parent_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - arg = args[0].parent - mock_val = 'parent_value' - assert arg == mock_val - - -def test_list_compilation_results_flattened_error(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - client.list_compilation_results( - dataform.ListCompilationResultsRequest(), - parent='parent_value', - ) - -@pytest.mark.asyncio -async def test_list_compilation_results_flattened_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_compilation_results), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.ListCompilationResultsResponse() - - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListCompilationResultsResponse()) - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - response = await client.list_compilation_results( - parent='parent_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - arg = args[0].parent - mock_val = 'parent_value' - assert arg == mock_val - -@pytest.mark.asyncio -async def test_list_compilation_results_flattened_error_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - await client.list_compilation_results( - dataform.ListCompilationResultsRequest(), - parent='parent_value', - ) - - -def test_list_compilation_results_pager(transport_name: str = "grpc"): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials, - transport=transport_name, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_compilation_results), - '__call__') as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.ListCompilationResultsResponse( - compilation_results=[ - dataform.CompilationResult(), - dataform.CompilationResult(), - dataform.CompilationResult(), - ], - next_page_token='abc', - ), - dataform.ListCompilationResultsResponse( - compilation_results=[], - next_page_token='def', - ), - dataform.ListCompilationResultsResponse( - compilation_results=[ - dataform.CompilationResult(), - ], - next_page_token='ghi', - ), - dataform.ListCompilationResultsResponse( - compilation_results=[ - dataform.CompilationResult(), - dataform.CompilationResult(), - ], - ), - RuntimeError, - ) - - metadata = () - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ('parent', ''), - )), - ) - pager = client.list_compilation_results(request={}) - - assert pager._metadata == metadata - - results = list(pager) - assert len(results) == 6 - assert all(isinstance(i, dataform.CompilationResult) - for i in results) -def test_list_compilation_results_pages(transport_name: str = "grpc"): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials, - transport=transport_name, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_compilation_results), - '__call__') as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.ListCompilationResultsResponse( - compilation_results=[ - dataform.CompilationResult(), - dataform.CompilationResult(), - dataform.CompilationResult(), - ], - next_page_token='abc', - ), - dataform.ListCompilationResultsResponse( - compilation_results=[], - next_page_token='def', - ), - dataform.ListCompilationResultsResponse( - compilation_results=[ - dataform.CompilationResult(), - ], - next_page_token='ghi', - ), - dataform.ListCompilationResultsResponse( - compilation_results=[ - dataform.CompilationResult(), - dataform.CompilationResult(), - ], - ), - RuntimeError, - ) - pages = list(client.list_compilation_results(request={}).pages) - for page_, token in zip(pages, ['abc','def','ghi', '']): - assert page_.raw_page.next_page_token == token - -@pytest.mark.asyncio -async def test_list_compilation_results_async_pager(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_compilation_results), - '__call__', new_callable=mock.AsyncMock) as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.ListCompilationResultsResponse( - compilation_results=[ - dataform.CompilationResult(), - dataform.CompilationResult(), - dataform.CompilationResult(), - ], - next_page_token='abc', - ), - dataform.ListCompilationResultsResponse( - compilation_results=[], - next_page_token='def', - ), - dataform.ListCompilationResultsResponse( - compilation_results=[ - dataform.CompilationResult(), - ], - next_page_token='ghi', - ), - dataform.ListCompilationResultsResponse( - compilation_results=[ - dataform.CompilationResult(), - dataform.CompilationResult(), - ], - ), - RuntimeError, - ) - async_pager = await client.list_compilation_results(request={},) - assert async_pager.next_page_token == 'abc' - responses = [] - async for response in async_pager: # pragma: no branch - responses.append(response) - - assert len(responses) == 6 - assert all(isinstance(i, dataform.CompilationResult) - for i in responses) - - -@pytest.mark.asyncio -async def test_list_compilation_results_async_pages(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_compilation_results), - '__call__', new_callable=mock.AsyncMock) as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.ListCompilationResultsResponse( - compilation_results=[ - dataform.CompilationResult(), - dataform.CompilationResult(), - dataform.CompilationResult(), - ], - next_page_token='abc', - ), - dataform.ListCompilationResultsResponse( - compilation_results=[], - next_page_token='def', - ), - dataform.ListCompilationResultsResponse( - compilation_results=[ - dataform.CompilationResult(), - ], - next_page_token='ghi', - ), - dataform.ListCompilationResultsResponse( - compilation_results=[ - dataform.CompilationResult(), - dataform.CompilationResult(), - ], - ), - RuntimeError, - ) - pages = [] - async for page_ in (await client.list_compilation_results(request={})).pages: # pragma: no branch - pages.append(page_) - for page_, token in zip(pages, ['abc','def','ghi', '']): - assert page_.raw_page.next_page_token == token - -@pytest.mark.parametrize("request_type", [ - dataform.GetCompilationResultRequest, - dict, -]) -def test_get_compilation_result(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_compilation_result), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.CompilationResult( - name='name_value', - dataform_core_version='dataform_core_version_value', - git_commitish='git_commitish_value', - ) - response = client.get_compilation_result(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.GetCompilationResultRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.CompilationResult) - assert response.name == 'name_value' - assert response.dataform_core_version == 'dataform_core_version_value' - - -def test_get_compilation_result_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_compilation_result), - '__call__') as call: - client.get_compilation_result() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.GetCompilationResultRequest() - -@pytest.mark.asyncio -async def test_get_compilation_result_async(transport: str = 'grpc_asyncio', request_type=dataform.GetCompilationResultRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_compilation_result), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.CompilationResult( - name='name_value', - dataform_core_version='dataform_core_version_value', - )) - response = await client.get_compilation_result(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.GetCompilationResultRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.CompilationResult) - assert response.name == 'name_value' - assert response.dataform_core_version == 'dataform_core_version_value' - - -@pytest.mark.asyncio -async def test_get_compilation_result_async_from_dict(): - await test_get_compilation_result_async(request_type=dict) - - -def test_get_compilation_result_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.GetCompilationResultRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_compilation_result), - '__call__') as call: - call.return_value = dataform.CompilationResult() - client.get_compilation_result(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_get_compilation_result_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.GetCompilationResultRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_compilation_result), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.CompilationResult()) - await client.get_compilation_result(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -def test_get_compilation_result_flattened(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_compilation_result), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.CompilationResult() - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - client.get_compilation_result( - name='name_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - arg = args[0].name - mock_val = 'name_value' - assert arg == mock_val - - -def test_get_compilation_result_flattened_error(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - client.get_compilation_result( - dataform.GetCompilationResultRequest(), - name='name_value', - ) - -@pytest.mark.asyncio -async def test_get_compilation_result_flattened_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_compilation_result), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.CompilationResult() - - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.CompilationResult()) - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - response = await client.get_compilation_result( - name='name_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - arg = args[0].name - mock_val = 'name_value' - assert arg == mock_val - -@pytest.mark.asyncio -async def test_get_compilation_result_flattened_error_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - await client.get_compilation_result( - dataform.GetCompilationResultRequest(), - name='name_value', - ) - - -@pytest.mark.parametrize("request_type", [ - dataform.CreateCompilationResultRequest, - dict, -]) -def test_create_compilation_result(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_compilation_result), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.CompilationResult( - name='name_value', - dataform_core_version='dataform_core_version_value', - git_commitish='git_commitish_value', - ) - response = client.create_compilation_result(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.CreateCompilationResultRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.CompilationResult) - assert response.name == 'name_value' - assert response.dataform_core_version == 'dataform_core_version_value' - - -def test_create_compilation_result_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_compilation_result), - '__call__') as call: - client.create_compilation_result() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.CreateCompilationResultRequest() - -@pytest.mark.asyncio -async def test_create_compilation_result_async(transport: str = 'grpc_asyncio', request_type=dataform.CreateCompilationResultRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_compilation_result), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.CompilationResult( - name='name_value', - dataform_core_version='dataform_core_version_value', - )) - response = await client.create_compilation_result(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.CreateCompilationResultRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.CompilationResult) - assert response.name == 'name_value' - assert response.dataform_core_version == 'dataform_core_version_value' - - -@pytest.mark.asyncio -async def test_create_compilation_result_async_from_dict(): - await test_create_compilation_result_async(request_type=dict) - - -def test_create_compilation_result_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.CreateCompilationResultRequest() - - request.parent = 'parent_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_compilation_result), - '__call__') as call: - call.return_value = dataform.CompilationResult() - client.create_compilation_result(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'parent=parent_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_create_compilation_result_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.CreateCompilationResultRequest() - - request.parent = 'parent_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_compilation_result), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.CompilationResult()) - await client.create_compilation_result(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'parent=parent_value', - ) in kw['metadata'] - - -def test_create_compilation_result_flattened(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_compilation_result), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.CompilationResult() - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - client.create_compilation_result( - parent='parent_value', - compilation_result=dataform.CompilationResult(name='name_value'), - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - arg = args[0].parent - mock_val = 'parent_value' - assert arg == mock_val - arg = args[0].compilation_result - mock_val = dataform.CompilationResult(name='name_value') - assert arg == mock_val - - -def test_create_compilation_result_flattened_error(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - client.create_compilation_result( - dataform.CreateCompilationResultRequest(), - parent='parent_value', - compilation_result=dataform.CompilationResult(name='name_value'), - ) - -@pytest.mark.asyncio -async def test_create_compilation_result_flattened_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_compilation_result), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.CompilationResult() - - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.CompilationResult()) - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - response = await client.create_compilation_result( - parent='parent_value', - compilation_result=dataform.CompilationResult(name='name_value'), - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - arg = args[0].parent - mock_val = 'parent_value' - assert arg == mock_val - arg = args[0].compilation_result - mock_val = dataform.CompilationResult(name='name_value') - assert arg == mock_val - -@pytest.mark.asyncio -async def test_create_compilation_result_flattened_error_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - await client.create_compilation_result( - dataform.CreateCompilationResultRequest(), - parent='parent_value', - compilation_result=dataform.CompilationResult(name='name_value'), - ) - - -@pytest.mark.parametrize("request_type", [ - dataform.QueryCompilationResultActionsRequest, - dict, -]) -def test_query_compilation_result_actions(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_compilation_result_actions), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.QueryCompilationResultActionsResponse( - next_page_token='next_page_token_value', - ) - response = client.query_compilation_result_actions(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.QueryCompilationResultActionsRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, pagers.QueryCompilationResultActionsPager) - assert response.next_page_token == 'next_page_token_value' - - -def test_query_compilation_result_actions_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_compilation_result_actions), - '__call__') as call: - client.query_compilation_result_actions() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.QueryCompilationResultActionsRequest() - -@pytest.mark.asyncio -async def test_query_compilation_result_actions_async(transport: str = 'grpc_asyncio', request_type=dataform.QueryCompilationResultActionsRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_compilation_result_actions), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.QueryCompilationResultActionsResponse( - next_page_token='next_page_token_value', - )) - response = await client.query_compilation_result_actions(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.QueryCompilationResultActionsRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, pagers.QueryCompilationResultActionsAsyncPager) - assert response.next_page_token == 'next_page_token_value' - - -@pytest.mark.asyncio -async def test_query_compilation_result_actions_async_from_dict(): - await test_query_compilation_result_actions_async(request_type=dict) - - -def test_query_compilation_result_actions_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.QueryCompilationResultActionsRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_compilation_result_actions), - '__call__') as call: - call.return_value = dataform.QueryCompilationResultActionsResponse() - client.query_compilation_result_actions(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_query_compilation_result_actions_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.QueryCompilationResultActionsRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_compilation_result_actions), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.QueryCompilationResultActionsResponse()) - await client.query_compilation_result_actions(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -def test_query_compilation_result_actions_pager(transport_name: str = "grpc"): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials, - transport=transport_name, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_compilation_result_actions), - '__call__') as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.QueryCompilationResultActionsResponse( - compilation_result_actions=[ - dataform.CompilationResultAction(), - dataform.CompilationResultAction(), - dataform.CompilationResultAction(), - ], - next_page_token='abc', - ), - dataform.QueryCompilationResultActionsResponse( - compilation_result_actions=[], - next_page_token='def', - ), - dataform.QueryCompilationResultActionsResponse( - compilation_result_actions=[ - dataform.CompilationResultAction(), - ], - next_page_token='ghi', - ), - dataform.QueryCompilationResultActionsResponse( - compilation_result_actions=[ - dataform.CompilationResultAction(), - dataform.CompilationResultAction(), - ], - ), - RuntimeError, - ) - - metadata = () - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ('name', ''), - )), - ) - pager = client.query_compilation_result_actions(request={}) - - assert pager._metadata == metadata - - results = list(pager) - assert len(results) == 6 - assert all(isinstance(i, dataform.CompilationResultAction) - for i in results) -def test_query_compilation_result_actions_pages(transport_name: str = "grpc"): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials, - transport=transport_name, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_compilation_result_actions), - '__call__') as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.QueryCompilationResultActionsResponse( - compilation_result_actions=[ - dataform.CompilationResultAction(), - dataform.CompilationResultAction(), - dataform.CompilationResultAction(), - ], - next_page_token='abc', - ), - dataform.QueryCompilationResultActionsResponse( - compilation_result_actions=[], - next_page_token='def', - ), - dataform.QueryCompilationResultActionsResponse( - compilation_result_actions=[ - dataform.CompilationResultAction(), - ], - next_page_token='ghi', - ), - dataform.QueryCompilationResultActionsResponse( - compilation_result_actions=[ - dataform.CompilationResultAction(), - dataform.CompilationResultAction(), - ], - ), - RuntimeError, - ) - pages = list(client.query_compilation_result_actions(request={}).pages) - for page_, token in zip(pages, ['abc','def','ghi', '']): - assert page_.raw_page.next_page_token == token - -@pytest.mark.asyncio -async def test_query_compilation_result_actions_async_pager(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_compilation_result_actions), - '__call__', new_callable=mock.AsyncMock) as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.QueryCompilationResultActionsResponse( - compilation_result_actions=[ - dataform.CompilationResultAction(), - dataform.CompilationResultAction(), - dataform.CompilationResultAction(), - ], - next_page_token='abc', - ), - dataform.QueryCompilationResultActionsResponse( - compilation_result_actions=[], - next_page_token='def', - ), - dataform.QueryCompilationResultActionsResponse( - compilation_result_actions=[ - dataform.CompilationResultAction(), - ], - next_page_token='ghi', - ), - dataform.QueryCompilationResultActionsResponse( - compilation_result_actions=[ - dataform.CompilationResultAction(), - dataform.CompilationResultAction(), - ], - ), - RuntimeError, - ) - async_pager = await client.query_compilation_result_actions(request={},) - assert async_pager.next_page_token == 'abc' - responses = [] - async for response in async_pager: # pragma: no branch - responses.append(response) - - assert len(responses) == 6 - assert all(isinstance(i, dataform.CompilationResultAction) - for i in responses) - - -@pytest.mark.asyncio -async def test_query_compilation_result_actions_async_pages(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_compilation_result_actions), - '__call__', new_callable=mock.AsyncMock) as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.QueryCompilationResultActionsResponse( - compilation_result_actions=[ - dataform.CompilationResultAction(), - dataform.CompilationResultAction(), - dataform.CompilationResultAction(), - ], - next_page_token='abc', - ), - dataform.QueryCompilationResultActionsResponse( - compilation_result_actions=[], - next_page_token='def', - ), - dataform.QueryCompilationResultActionsResponse( - compilation_result_actions=[ - dataform.CompilationResultAction(), - ], - next_page_token='ghi', - ), - dataform.QueryCompilationResultActionsResponse( - compilation_result_actions=[ - dataform.CompilationResultAction(), - dataform.CompilationResultAction(), - ], - ), - RuntimeError, - ) - pages = [] - async for page_ in (await client.query_compilation_result_actions(request={})).pages: # pragma: no branch - pages.append(page_) - for page_, token in zip(pages, ['abc','def','ghi', '']): - assert page_.raw_page.next_page_token == token - -@pytest.mark.parametrize("request_type", [ - dataform.ListWorkflowInvocationsRequest, - dict, -]) -def test_list_workflow_invocations(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workflow_invocations), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.ListWorkflowInvocationsResponse( - next_page_token='next_page_token_value', - unreachable=['unreachable_value'], - ) - response = client.list_workflow_invocations(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.ListWorkflowInvocationsRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, pagers.ListWorkflowInvocationsPager) - assert response.next_page_token == 'next_page_token_value' - assert response.unreachable == ['unreachable_value'] - - -def test_list_workflow_invocations_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workflow_invocations), - '__call__') as call: - client.list_workflow_invocations() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.ListWorkflowInvocationsRequest() - -@pytest.mark.asyncio -async def test_list_workflow_invocations_async(transport: str = 'grpc_asyncio', request_type=dataform.ListWorkflowInvocationsRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workflow_invocations), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListWorkflowInvocationsResponse( - next_page_token='next_page_token_value', - unreachable=['unreachable_value'], - )) - response = await client.list_workflow_invocations(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.ListWorkflowInvocationsRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, pagers.ListWorkflowInvocationsAsyncPager) - assert response.next_page_token == 'next_page_token_value' - assert response.unreachable == ['unreachable_value'] - - -@pytest.mark.asyncio -async def test_list_workflow_invocations_async_from_dict(): - await test_list_workflow_invocations_async(request_type=dict) - - -def test_list_workflow_invocations_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.ListWorkflowInvocationsRequest() - - request.parent = 'parent_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workflow_invocations), - '__call__') as call: - call.return_value = dataform.ListWorkflowInvocationsResponse() - client.list_workflow_invocations(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'parent=parent_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_list_workflow_invocations_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.ListWorkflowInvocationsRequest() - - request.parent = 'parent_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workflow_invocations), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListWorkflowInvocationsResponse()) - await client.list_workflow_invocations(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'parent=parent_value', - ) in kw['metadata'] - - -def test_list_workflow_invocations_flattened(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workflow_invocations), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.ListWorkflowInvocationsResponse() - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - client.list_workflow_invocations( - parent='parent_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - arg = args[0].parent - mock_val = 'parent_value' - assert arg == mock_val - - -def test_list_workflow_invocations_flattened_error(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - client.list_workflow_invocations( - dataform.ListWorkflowInvocationsRequest(), - parent='parent_value', - ) - -@pytest.mark.asyncio -async def test_list_workflow_invocations_flattened_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workflow_invocations), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.ListWorkflowInvocationsResponse() - - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.ListWorkflowInvocationsResponse()) - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - response = await client.list_workflow_invocations( - parent='parent_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - arg = args[0].parent - mock_val = 'parent_value' - assert arg == mock_val - -@pytest.mark.asyncio -async def test_list_workflow_invocations_flattened_error_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - await client.list_workflow_invocations( - dataform.ListWorkflowInvocationsRequest(), - parent='parent_value', - ) - - -def test_list_workflow_invocations_pager(transport_name: str = "grpc"): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials, - transport=transport_name, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workflow_invocations), - '__call__') as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.ListWorkflowInvocationsResponse( - workflow_invocations=[ - dataform.WorkflowInvocation(), - dataform.WorkflowInvocation(), - dataform.WorkflowInvocation(), - ], - next_page_token='abc', - ), - dataform.ListWorkflowInvocationsResponse( - workflow_invocations=[], - next_page_token='def', - ), - dataform.ListWorkflowInvocationsResponse( - workflow_invocations=[ - dataform.WorkflowInvocation(), - ], - next_page_token='ghi', - ), - dataform.ListWorkflowInvocationsResponse( - workflow_invocations=[ - dataform.WorkflowInvocation(), - dataform.WorkflowInvocation(), - ], - ), - RuntimeError, - ) - - metadata = () - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ('parent', ''), - )), - ) - pager = client.list_workflow_invocations(request={}) - - assert pager._metadata == metadata - - results = list(pager) - assert len(results) == 6 - assert all(isinstance(i, dataform.WorkflowInvocation) - for i in results) -def test_list_workflow_invocations_pages(transport_name: str = "grpc"): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials, - transport=transport_name, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workflow_invocations), - '__call__') as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.ListWorkflowInvocationsResponse( - workflow_invocations=[ - dataform.WorkflowInvocation(), - dataform.WorkflowInvocation(), - dataform.WorkflowInvocation(), - ], - next_page_token='abc', - ), - dataform.ListWorkflowInvocationsResponse( - workflow_invocations=[], - next_page_token='def', - ), - dataform.ListWorkflowInvocationsResponse( - workflow_invocations=[ - dataform.WorkflowInvocation(), - ], - next_page_token='ghi', - ), - dataform.ListWorkflowInvocationsResponse( - workflow_invocations=[ - dataform.WorkflowInvocation(), - dataform.WorkflowInvocation(), - ], - ), - RuntimeError, - ) - pages = list(client.list_workflow_invocations(request={}).pages) - for page_, token in zip(pages, ['abc','def','ghi', '']): - assert page_.raw_page.next_page_token == token - -@pytest.mark.asyncio -async def test_list_workflow_invocations_async_pager(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workflow_invocations), - '__call__', new_callable=mock.AsyncMock) as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.ListWorkflowInvocationsResponse( - workflow_invocations=[ - dataform.WorkflowInvocation(), - dataform.WorkflowInvocation(), - dataform.WorkflowInvocation(), - ], - next_page_token='abc', - ), - dataform.ListWorkflowInvocationsResponse( - workflow_invocations=[], - next_page_token='def', - ), - dataform.ListWorkflowInvocationsResponse( - workflow_invocations=[ - dataform.WorkflowInvocation(), - ], - next_page_token='ghi', - ), - dataform.ListWorkflowInvocationsResponse( - workflow_invocations=[ - dataform.WorkflowInvocation(), - dataform.WorkflowInvocation(), - ], - ), - RuntimeError, - ) - async_pager = await client.list_workflow_invocations(request={},) - assert async_pager.next_page_token == 'abc' - responses = [] - async for response in async_pager: # pragma: no branch - responses.append(response) - - assert len(responses) == 6 - assert all(isinstance(i, dataform.WorkflowInvocation) - for i in responses) - - -@pytest.mark.asyncio -async def test_list_workflow_invocations_async_pages(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.list_workflow_invocations), - '__call__', new_callable=mock.AsyncMock) as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.ListWorkflowInvocationsResponse( - workflow_invocations=[ - dataform.WorkflowInvocation(), - dataform.WorkflowInvocation(), - dataform.WorkflowInvocation(), - ], - next_page_token='abc', - ), - dataform.ListWorkflowInvocationsResponse( - workflow_invocations=[], - next_page_token='def', - ), - dataform.ListWorkflowInvocationsResponse( - workflow_invocations=[ - dataform.WorkflowInvocation(), - ], - next_page_token='ghi', - ), - dataform.ListWorkflowInvocationsResponse( - workflow_invocations=[ - dataform.WorkflowInvocation(), - dataform.WorkflowInvocation(), - ], - ), - RuntimeError, - ) - pages = [] - async for page_ in (await client.list_workflow_invocations(request={})).pages: # pragma: no branch - pages.append(page_) - for page_, token in zip(pages, ['abc','def','ghi', '']): - assert page_.raw_page.next_page_token == token - -@pytest.mark.parametrize("request_type", [ - dataform.GetWorkflowInvocationRequest, - dict, -]) -def test_get_workflow_invocation(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_workflow_invocation), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.WorkflowInvocation( - name='name_value', - compilation_result='compilation_result_value', - state=dataform.WorkflowInvocation.State.RUNNING, - ) - response = client.get_workflow_invocation(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.GetWorkflowInvocationRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.WorkflowInvocation) - assert response.name == 'name_value' - assert response.compilation_result == 'compilation_result_value' - assert response.state == dataform.WorkflowInvocation.State.RUNNING - - -def test_get_workflow_invocation_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_workflow_invocation), - '__call__') as call: - client.get_workflow_invocation() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.GetWorkflowInvocationRequest() - -@pytest.mark.asyncio -async def test_get_workflow_invocation_async(transport: str = 'grpc_asyncio', request_type=dataform.GetWorkflowInvocationRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_workflow_invocation), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.WorkflowInvocation( - name='name_value', - compilation_result='compilation_result_value', - state=dataform.WorkflowInvocation.State.RUNNING, - )) - response = await client.get_workflow_invocation(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.GetWorkflowInvocationRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.WorkflowInvocation) - assert response.name == 'name_value' - assert response.compilation_result == 'compilation_result_value' - assert response.state == dataform.WorkflowInvocation.State.RUNNING - - -@pytest.mark.asyncio -async def test_get_workflow_invocation_async_from_dict(): - await test_get_workflow_invocation_async(request_type=dict) - - -def test_get_workflow_invocation_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.GetWorkflowInvocationRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_workflow_invocation), - '__call__') as call: - call.return_value = dataform.WorkflowInvocation() - client.get_workflow_invocation(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_get_workflow_invocation_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.GetWorkflowInvocationRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_workflow_invocation), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.WorkflowInvocation()) - await client.get_workflow_invocation(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -def test_get_workflow_invocation_flattened(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_workflow_invocation), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.WorkflowInvocation() - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - client.get_workflow_invocation( - name='name_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - arg = args[0].name - mock_val = 'name_value' - assert arg == mock_val - - -def test_get_workflow_invocation_flattened_error(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - client.get_workflow_invocation( - dataform.GetWorkflowInvocationRequest(), - name='name_value', - ) - -@pytest.mark.asyncio -async def test_get_workflow_invocation_flattened_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_workflow_invocation), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.WorkflowInvocation() - - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.WorkflowInvocation()) - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - response = await client.get_workflow_invocation( - name='name_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - arg = args[0].name - mock_val = 'name_value' - assert arg == mock_val - -@pytest.mark.asyncio -async def test_get_workflow_invocation_flattened_error_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - await client.get_workflow_invocation( - dataform.GetWorkflowInvocationRequest(), - name='name_value', - ) - - -@pytest.mark.parametrize("request_type", [ - dataform.CreateWorkflowInvocationRequest, - dict, -]) -def test_create_workflow_invocation(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_workflow_invocation), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.WorkflowInvocation( - name='name_value', - compilation_result='compilation_result_value', - state=dataform.WorkflowInvocation.State.RUNNING, - ) - response = client.create_workflow_invocation(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.CreateWorkflowInvocationRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.WorkflowInvocation) - assert response.name == 'name_value' - assert response.compilation_result == 'compilation_result_value' - assert response.state == dataform.WorkflowInvocation.State.RUNNING - - -def test_create_workflow_invocation_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_workflow_invocation), - '__call__') as call: - client.create_workflow_invocation() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.CreateWorkflowInvocationRequest() - -@pytest.mark.asyncio -async def test_create_workflow_invocation_async(transport: str = 'grpc_asyncio', request_type=dataform.CreateWorkflowInvocationRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_workflow_invocation), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.WorkflowInvocation( - name='name_value', - compilation_result='compilation_result_value', - state=dataform.WorkflowInvocation.State.RUNNING, - )) - response = await client.create_workflow_invocation(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.CreateWorkflowInvocationRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, dataform.WorkflowInvocation) - assert response.name == 'name_value' - assert response.compilation_result == 'compilation_result_value' - assert response.state == dataform.WorkflowInvocation.State.RUNNING - - -@pytest.mark.asyncio -async def test_create_workflow_invocation_async_from_dict(): - await test_create_workflow_invocation_async(request_type=dict) - - -def test_create_workflow_invocation_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.CreateWorkflowInvocationRequest() - - request.parent = 'parent_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_workflow_invocation), - '__call__') as call: - call.return_value = dataform.WorkflowInvocation() - client.create_workflow_invocation(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'parent=parent_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_create_workflow_invocation_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.CreateWorkflowInvocationRequest() - - request.parent = 'parent_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_workflow_invocation), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.WorkflowInvocation()) - await client.create_workflow_invocation(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'parent=parent_value', - ) in kw['metadata'] - - -def test_create_workflow_invocation_flattened(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_workflow_invocation), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.WorkflowInvocation() - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - client.create_workflow_invocation( - parent='parent_value', - workflow_invocation=dataform.WorkflowInvocation(name='name_value'), - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - arg = args[0].parent - mock_val = 'parent_value' - assert arg == mock_val - arg = args[0].workflow_invocation - mock_val = dataform.WorkflowInvocation(name='name_value') - assert arg == mock_val - - -def test_create_workflow_invocation_flattened_error(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - client.create_workflow_invocation( - dataform.CreateWorkflowInvocationRequest(), - parent='parent_value', - workflow_invocation=dataform.WorkflowInvocation(name='name_value'), - ) - -@pytest.mark.asyncio -async def test_create_workflow_invocation_flattened_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.create_workflow_invocation), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.WorkflowInvocation() - - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.WorkflowInvocation()) - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - response = await client.create_workflow_invocation( - parent='parent_value', - workflow_invocation=dataform.WorkflowInvocation(name='name_value'), - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - arg = args[0].parent - mock_val = 'parent_value' - assert arg == mock_val - arg = args[0].workflow_invocation - mock_val = dataform.WorkflowInvocation(name='name_value') - assert arg == mock_val - -@pytest.mark.asyncio -async def test_create_workflow_invocation_flattened_error_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - await client.create_workflow_invocation( - dataform.CreateWorkflowInvocationRequest(), - parent='parent_value', - workflow_invocation=dataform.WorkflowInvocation(name='name_value'), - ) - - -@pytest.mark.parametrize("request_type", [ - dataform.DeleteWorkflowInvocationRequest, - dict, -]) -def test_delete_workflow_invocation(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_workflow_invocation), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = None - response = client.delete_workflow_invocation(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.DeleteWorkflowInvocationRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -def test_delete_workflow_invocation_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_workflow_invocation), - '__call__') as call: - client.delete_workflow_invocation() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.DeleteWorkflowInvocationRequest() - -@pytest.mark.asyncio -async def test_delete_workflow_invocation_async(transport: str = 'grpc_asyncio', request_type=dataform.DeleteWorkflowInvocationRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_workflow_invocation), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - response = await client.delete_workflow_invocation(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.DeleteWorkflowInvocationRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -@pytest.mark.asyncio -async def test_delete_workflow_invocation_async_from_dict(): - await test_delete_workflow_invocation_async(request_type=dict) - - -def test_delete_workflow_invocation_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.DeleteWorkflowInvocationRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_workflow_invocation), - '__call__') as call: - call.return_value = None - client.delete_workflow_invocation(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_delete_workflow_invocation_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.DeleteWorkflowInvocationRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_workflow_invocation), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_workflow_invocation(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -def test_delete_workflow_invocation_flattened(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_workflow_invocation), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = None - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - client.delete_workflow_invocation( - name='name_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - arg = args[0].name - mock_val = 'name_value' - assert arg == mock_val - - -def test_delete_workflow_invocation_flattened_error(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - client.delete_workflow_invocation( - dataform.DeleteWorkflowInvocationRequest(), - name='name_value', - ) - -@pytest.mark.asyncio -async def test_delete_workflow_invocation_flattened_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.delete_workflow_invocation), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = None - - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - # Call the method with a truthy value for each flattened field, - # using the keyword arguments to the method. - response = await client.delete_workflow_invocation( - name='name_value', - ) - - # Establish that the underlying call was made with the expected - # request object values. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - arg = args[0].name - mock_val = 'name_value' - assert arg == mock_val - -@pytest.mark.asyncio -async def test_delete_workflow_invocation_flattened_error_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Attempting to call a method with both a request object and flattened - # fields is an error. - with pytest.raises(ValueError): - await client.delete_workflow_invocation( - dataform.DeleteWorkflowInvocationRequest(), - name='name_value', - ) - - -@pytest.mark.parametrize("request_type", [ - dataform.CancelWorkflowInvocationRequest, - dict, -]) -def test_cancel_workflow_invocation(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.cancel_workflow_invocation), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = None - response = client.cancel_workflow_invocation(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.CancelWorkflowInvocationRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -def test_cancel_workflow_invocation_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.cancel_workflow_invocation), - '__call__') as call: - client.cancel_workflow_invocation() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.CancelWorkflowInvocationRequest() - -@pytest.mark.asyncio -async def test_cancel_workflow_invocation_async(transport: str = 'grpc_asyncio', request_type=dataform.CancelWorkflowInvocationRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.cancel_workflow_invocation), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - response = await client.cancel_workflow_invocation(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.CancelWorkflowInvocationRequest() - - # Establish that the response is the type that we expect. - assert response is None - - -@pytest.mark.asyncio -async def test_cancel_workflow_invocation_async_from_dict(): - await test_cancel_workflow_invocation_async(request_type=dict) - - -def test_cancel_workflow_invocation_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.CancelWorkflowInvocationRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.cancel_workflow_invocation), - '__call__') as call: - call.return_value = None - client.cancel_workflow_invocation(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_cancel_workflow_invocation_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.CancelWorkflowInvocationRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.cancel_workflow_invocation), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.cancel_workflow_invocation(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.parametrize("request_type", [ - dataform.QueryWorkflowInvocationActionsRequest, - dict, -]) -def test_query_workflow_invocation_actions(request_type, transport: str = 'grpc'): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_workflow_invocation_actions), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value = dataform.QueryWorkflowInvocationActionsResponse( - next_page_token='next_page_token_value', - ) - response = client.query_workflow_invocation_actions(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.QueryWorkflowInvocationActionsRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, pagers.QueryWorkflowInvocationActionsPager) - assert response.next_page_token == 'next_page_token_value' - - -def test_query_workflow_invocation_actions_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport='grpc', - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_workflow_invocation_actions), - '__call__') as call: - client.query_workflow_invocation_actions() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.QueryWorkflowInvocationActionsRequest() - -@pytest.mark.asyncio -async def test_query_workflow_invocation_actions_async(transport: str = 'grpc_asyncio', request_type=dataform.QueryWorkflowInvocationActionsRequest): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_workflow_invocation_actions), - '__call__') as call: - # Designate an appropriate return value for the call. - call.return_value =grpc_helpers_async.FakeUnaryUnaryCall(dataform.QueryWorkflowInvocationActionsResponse( - next_page_token='next_page_token_value', - )) - response = await client.query_workflow_invocation_actions(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == dataform.QueryWorkflowInvocationActionsRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, pagers.QueryWorkflowInvocationActionsAsyncPager) - assert response.next_page_token == 'next_page_token_value' - - -@pytest.mark.asyncio -async def test_query_workflow_invocation_actions_async_from_dict(): - await test_query_workflow_invocation_actions_async(request_type=dict) - - -def test_query_workflow_invocation_actions_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.QueryWorkflowInvocationActionsRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_workflow_invocation_actions), - '__call__') as call: - call.return_value = dataform.QueryWorkflowInvocationActionsResponse() - client.query_workflow_invocation_actions(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -@pytest.mark.asyncio -async def test_query_workflow_invocation_actions_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = dataform.QueryWorkflowInvocationActionsRequest() - - request.name = 'name_value' - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_workflow_invocation_actions), - '__call__') as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(dataform.QueryWorkflowInvocationActionsResponse()) - await client.query_workflow_invocation_actions(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - 'x-goog-request-params', - 'name=name_value', - ) in kw['metadata'] - - -def test_query_workflow_invocation_actions_pager(transport_name: str = "grpc"): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials, - transport=transport_name, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_workflow_invocation_actions), - '__call__') as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.QueryWorkflowInvocationActionsResponse( - workflow_invocation_actions=[ - dataform.WorkflowInvocationAction(), - dataform.WorkflowInvocationAction(), - dataform.WorkflowInvocationAction(), - ], - next_page_token='abc', - ), - dataform.QueryWorkflowInvocationActionsResponse( - workflow_invocation_actions=[], - next_page_token='def', - ), - dataform.QueryWorkflowInvocationActionsResponse( - workflow_invocation_actions=[ - dataform.WorkflowInvocationAction(), - ], - next_page_token='ghi', - ), - dataform.QueryWorkflowInvocationActionsResponse( - workflow_invocation_actions=[ - dataform.WorkflowInvocationAction(), - dataform.WorkflowInvocationAction(), - ], - ), - RuntimeError, - ) - - metadata = () - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata(( - ('name', ''), - )), - ) - pager = client.query_workflow_invocation_actions(request={}) - - assert pager._metadata == metadata - - results = list(pager) - assert len(results) == 6 - assert all(isinstance(i, dataform.WorkflowInvocationAction) - for i in results) -def test_query_workflow_invocation_actions_pages(transport_name: str = "grpc"): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials, - transport=transport_name, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_workflow_invocation_actions), - '__call__') as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.QueryWorkflowInvocationActionsResponse( - workflow_invocation_actions=[ - dataform.WorkflowInvocationAction(), - dataform.WorkflowInvocationAction(), - dataform.WorkflowInvocationAction(), - ], - next_page_token='abc', - ), - dataform.QueryWorkflowInvocationActionsResponse( - workflow_invocation_actions=[], - next_page_token='def', - ), - dataform.QueryWorkflowInvocationActionsResponse( - workflow_invocation_actions=[ - dataform.WorkflowInvocationAction(), - ], - next_page_token='ghi', - ), - dataform.QueryWorkflowInvocationActionsResponse( - workflow_invocation_actions=[ - dataform.WorkflowInvocationAction(), - dataform.WorkflowInvocationAction(), - ], - ), - RuntimeError, - ) - pages = list(client.query_workflow_invocation_actions(request={}).pages) - for page_, token in zip(pages, ['abc','def','ghi', '']): - assert page_.raw_page.next_page_token == token - -@pytest.mark.asyncio -async def test_query_workflow_invocation_actions_async_pager(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_workflow_invocation_actions), - '__call__', new_callable=mock.AsyncMock) as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.QueryWorkflowInvocationActionsResponse( - workflow_invocation_actions=[ - dataform.WorkflowInvocationAction(), - dataform.WorkflowInvocationAction(), - dataform.WorkflowInvocationAction(), - ], - next_page_token='abc', - ), - dataform.QueryWorkflowInvocationActionsResponse( - workflow_invocation_actions=[], - next_page_token='def', - ), - dataform.QueryWorkflowInvocationActionsResponse( - workflow_invocation_actions=[ - dataform.WorkflowInvocationAction(), - ], - next_page_token='ghi', - ), - dataform.QueryWorkflowInvocationActionsResponse( - workflow_invocation_actions=[ - dataform.WorkflowInvocationAction(), - dataform.WorkflowInvocationAction(), - ], - ), - RuntimeError, - ) - async_pager = await client.query_workflow_invocation_actions(request={},) - assert async_pager.next_page_token == 'abc' - responses = [] - async for response in async_pager: # pragma: no branch - responses.append(response) - - assert len(responses) == 6 - assert all(isinstance(i, dataform.WorkflowInvocationAction) - for i in responses) - - -@pytest.mark.asyncio -async def test_query_workflow_invocation_actions_async_pages(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials, - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.query_workflow_invocation_actions), - '__call__', new_callable=mock.AsyncMock) as call: - # Set the response to a series of pages. - call.side_effect = ( - dataform.QueryWorkflowInvocationActionsResponse( - workflow_invocation_actions=[ - dataform.WorkflowInvocationAction(), - dataform.WorkflowInvocationAction(), - dataform.WorkflowInvocationAction(), - ], - next_page_token='abc', - ), - dataform.QueryWorkflowInvocationActionsResponse( - workflow_invocation_actions=[], - next_page_token='def', - ), - dataform.QueryWorkflowInvocationActionsResponse( - workflow_invocation_actions=[ - dataform.WorkflowInvocationAction(), - ], - next_page_token='ghi', - ), - dataform.QueryWorkflowInvocationActionsResponse( - workflow_invocation_actions=[ - dataform.WorkflowInvocationAction(), - dataform.WorkflowInvocationAction(), - ], - ), - RuntimeError, - ) - pages = [] - async for page_ in (await client.query_workflow_invocation_actions(request={})).pages: # pragma: no branch - pages.append(page_) - for page_, token in zip(pages, ['abc','def','ghi', '']): - assert page_.raw_page.next_page_token == token - - -def test_credentials_transport_error(): - # It is an error to provide credentials and a transport instance. - transport = transports.DataformGrpcTransport( - credentials=ga_credentials.AnonymousCredentials(), - ) - with pytest.raises(ValueError): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # It is an error to provide a credentials file and a transport instance. - transport = transports.DataformGrpcTransport( - credentials=ga_credentials.AnonymousCredentials(), - ) - with pytest.raises(ValueError): - client = DataformClient( - client_options={"credentials_file": "credentials.json"}, - transport=transport, - ) - - # It is an error to provide an api_key and a transport instance. - transport = transports.DataformGrpcTransport( - credentials=ga_credentials.AnonymousCredentials(), - ) - options = client_options.ClientOptions() - options.api_key = "api_key" - with pytest.raises(ValueError): - client = DataformClient( - client_options=options, - transport=transport, - ) - - # It is an error to provide an api_key and a credential. - options = mock.Mock() - options.api_key = "api_key" - with pytest.raises(ValueError): - client = DataformClient( - client_options=options, - credentials=ga_credentials.AnonymousCredentials() - ) - - # It is an error to provide scopes and a transport instance. - transport = transports.DataformGrpcTransport( - credentials=ga_credentials.AnonymousCredentials(), - ) - with pytest.raises(ValueError): - client = DataformClient( - client_options={"scopes": ["1", "2"]}, - transport=transport, - ) - - -def test_transport_instance(): - # A client may be instantiated with a custom transport instance. - transport = transports.DataformGrpcTransport( - credentials=ga_credentials.AnonymousCredentials(), - ) - client = DataformClient(transport=transport) - assert client.transport is transport - -def test_transport_get_channel(): - # A client may be instantiated with a custom transport instance. - transport = transports.DataformGrpcTransport( - credentials=ga_credentials.AnonymousCredentials(), - ) - channel = transport.grpc_channel - assert channel - - transport = transports.DataformGrpcAsyncIOTransport( - credentials=ga_credentials.AnonymousCredentials(), - ) - channel = transport.grpc_channel - assert channel - -@pytest.mark.parametrize("transport_class", [ - transports.DataformGrpcTransport, - transports.DataformGrpcAsyncIOTransport, -]) -def test_transport_adc(transport_class): - # Test default credentials are used if not provided. - with mock.patch.object(google.auth, 'default') as adc: - adc.return_value = (ga_credentials.AnonymousCredentials(), None) - transport_class() - adc.assert_called_once() - -@pytest.mark.parametrize("transport_name", [ - "grpc", -]) -def test_transport_kind(transport_name): - transport = DataformClient.get_transport_class(transport_name)( - credentials=ga_credentials.AnonymousCredentials(), - ) - assert transport.kind == transport_name - -def test_transport_grpc_default(): - # A client should use the gRPC transport by default. - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - assert isinstance( - client.transport, - transports.DataformGrpcTransport, - ) - -def test_dataform_base_transport_error(): - # Passing both a credentials object and credentials_file should raise an error - with pytest.raises(core_exceptions.DuplicateCredentialArgs): - transport = transports.DataformTransport( - credentials=ga_credentials.AnonymousCredentials(), - credentials_file="credentials.json" - ) - - -def test_dataform_base_transport(): - # Instantiate the base transport. - with mock.patch('google.cloud.dataform_v1beta1.services.dataform.transports.DataformTransport.__init__') as Transport: - Transport.return_value = None - transport = transports.DataformTransport( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Every method on the transport should just blindly - # raise NotImplementedError. - methods = ( - 'list_repositories', - 'get_repository', - 'create_repository', - 'update_repository', - 'delete_repository', - 'fetch_remote_branches', - 'list_workspaces', - 'get_workspace', - 'create_workspace', - 'delete_workspace', - 'install_npm_packages', - 'pull_git_commits', - 'push_git_commits', - 'fetch_file_git_statuses', - 'fetch_git_ahead_behind', - 'commit_workspace_changes', - 'reset_workspace_changes', - 'fetch_file_diff', - 'query_directory_contents', - 'make_directory', - 'remove_directory', - 'move_directory', - 'read_file', - 'remove_file', - 'move_file', - 'write_file', - 'list_compilation_results', - 'get_compilation_result', - 'create_compilation_result', - 'query_compilation_result_actions', - 'list_workflow_invocations', - 'get_workflow_invocation', - 'create_workflow_invocation', - 'delete_workflow_invocation', - 'cancel_workflow_invocation', - 'query_workflow_invocation_actions', - 'get_location', - 'list_locations', - ) - for method in methods: - with pytest.raises(NotImplementedError): - getattr(transport, method)(request=object()) - - with pytest.raises(NotImplementedError): - transport.close() - - # Catch all for all remaining methods and properties - remainder = [ - 'kind', - ] - for r in remainder: - with pytest.raises(NotImplementedError): - getattr(transport, r)() - - -def test_dataform_base_transport_with_credentials_file(): - # Instantiate the base transport with a credentials file - with mock.patch.object(google.auth, 'load_credentials_from_file', autospec=True) as load_creds, mock.patch('google.cloud.dataform_v1beta1.services.dataform.transports.DataformTransport._prep_wrapped_messages') as Transport: - Transport.return_value = None - load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) - transport = transports.DataformTransport( - credentials_file="credentials.json", - quota_project_id="octopus", - ) - load_creds.assert_called_once_with("credentials.json", - scopes=None, - default_scopes=( - 'https://www.googleapis.com/auth/cloud-platform', -), - quota_project_id="octopus", - ) - - -def test_dataform_base_transport_with_adc(): - # Test the default credentials are used if credentials and credentials_file are None. - with mock.patch.object(google.auth, 'default', autospec=True) as adc, mock.patch('google.cloud.dataform_v1beta1.services.dataform.transports.DataformTransport._prep_wrapped_messages') as Transport: - Transport.return_value = None - adc.return_value = (ga_credentials.AnonymousCredentials(), None) - transport = transports.DataformTransport() - adc.assert_called_once() - - -def test_dataform_auth_adc(): - # If no credentials are provided, we should use ADC credentials. - with mock.patch.object(google.auth, 'default', autospec=True) as adc: - adc.return_value = (ga_credentials.AnonymousCredentials(), None) - DataformClient() - adc.assert_called_once_with( - scopes=None, - default_scopes=( - 'https://www.googleapis.com/auth/cloud-platform', -), - quota_project_id=None, - ) - - -@pytest.mark.parametrize( - "transport_class", - [ - transports.DataformGrpcTransport, - transports.DataformGrpcAsyncIOTransport, - ], -) -def test_dataform_transport_auth_adc(transport_class): - # If credentials and host are not provided, the transport class should use - # ADC credentials. - with mock.patch.object(google.auth, 'default', autospec=True) as adc: - adc.return_value = (ga_credentials.AnonymousCredentials(), None) - transport_class(quota_project_id="octopus", scopes=["1", "2"]) - adc.assert_called_once_with( - scopes=["1", "2"], - default_scopes=( 'https://www.googleapis.com/auth/cloud-platform',), - quota_project_id="octopus", - ) - - -@pytest.mark.parametrize( - "transport_class", - [ - transports.DataformGrpcTransport, - transports.DataformGrpcAsyncIOTransport, - ], -) -def test_dataform_transport_auth_gdch_credentials(transport_class): - host = 'https://language.com' - api_audience_tests = [None, 'https://language2.com'] - api_audience_expect = [host, 'https://language2.com'] - for t, e in zip(api_audience_tests, api_audience_expect): - with mock.patch.object(google.auth, 'default', autospec=True) as adc: - gdch_mock = mock.MagicMock() - type(gdch_mock).with_gdch_audience = mock.PropertyMock(return_value=gdch_mock) - adc.return_value = (gdch_mock, None) - transport_class(host=host, api_audience=t) - gdch_mock.with_gdch_audience.assert_called_once_with( - e - ) - - -@pytest.mark.parametrize( - "transport_class,grpc_helpers", - [ - (transports.DataformGrpcTransport, grpc_helpers), - (transports.DataformGrpcAsyncIOTransport, grpc_helpers_async) - ], -) -def test_dataform_transport_create_channel(transport_class, grpc_helpers): - # If credentials and host are not provided, the transport class should use - # ADC credentials. - with mock.patch.object(google.auth, "default", autospec=True) as adc, mock.patch.object( - grpc_helpers, "create_channel", autospec=True - ) as create_channel: - creds = ga_credentials.AnonymousCredentials() - adc.return_value = (creds, None) - transport_class( - quota_project_id="octopus", - scopes=["1", "2"] - ) - - create_channel.assert_called_with( - "dataform.googleapis.com:443", - credentials=creds, - credentials_file=None, - quota_project_id="octopus", - default_scopes=( - 'https://www.googleapis.com/auth/cloud-platform', -), - scopes=["1", "2"], - default_host="dataform.googleapis.com", - ssl_credentials=None, - options=[ - ("grpc.max_send_message_length", -1), - ("grpc.max_receive_message_length", -1), - ], - ) - - -@pytest.mark.parametrize("transport_class", [transports.DataformGrpcTransport, transports.DataformGrpcAsyncIOTransport]) -def test_dataform_grpc_transport_client_cert_source_for_mtls( - transport_class -): - cred = ga_credentials.AnonymousCredentials() - - # Check ssl_channel_credentials is used if provided. - with mock.patch.object(transport_class, "create_channel") as mock_create_channel: - mock_ssl_channel_creds = mock.Mock() - transport_class( - host="squid.clam.whelk", - credentials=cred, - ssl_channel_credentials=mock_ssl_channel_creds - ) - mock_create_channel.assert_called_once_with( - "squid.clam.whelk:443", - credentials=cred, - credentials_file=None, - scopes=None, - ssl_credentials=mock_ssl_channel_creds, - quota_project_id=None, - options=[ - ("grpc.max_send_message_length", -1), - ("grpc.max_receive_message_length", -1), - ], - ) - - # Check if ssl_channel_credentials is not provided, then client_cert_source_for_mtls - # is used. - with mock.patch.object(transport_class, "create_channel", return_value=mock.Mock()): - with mock.patch("grpc.ssl_channel_credentials") as mock_ssl_cred: - transport_class( - credentials=cred, - client_cert_source_for_mtls=client_cert_source_callback - ) - expected_cert, expected_key = client_cert_source_callback() - mock_ssl_cred.assert_called_once_with( - certificate_chain=expected_cert, - private_key=expected_key - ) - - -@pytest.mark.parametrize("transport_name", [ - "grpc", - "grpc_asyncio", -]) -def test_dataform_host_no_port(transport_name): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - client_options=client_options.ClientOptions(api_endpoint='dataform.googleapis.com'), - transport=transport_name, - ) - assert client.transport._host == ( - 'dataform.googleapis.com:443' - ) - -@pytest.mark.parametrize("transport_name", [ - "grpc", - "grpc_asyncio", -]) -def test_dataform_host_with_port(transport_name): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - client_options=client_options.ClientOptions(api_endpoint='dataform.googleapis.com:8000'), - transport=transport_name, - ) - assert client.transport._host == ( - 'dataform.googleapis.com:8000' - ) - -def test_dataform_grpc_transport_channel(): - channel = grpc.secure_channel('http://localhost/', grpc.local_channel_credentials()) - - # Check that channel is used if provided. - transport = transports.DataformGrpcTransport( - host="squid.clam.whelk", - channel=channel, - ) - assert transport.grpc_channel == channel - assert transport._host == "squid.clam.whelk:443" - assert transport._ssl_channel_credentials == None - - -def test_dataform_grpc_asyncio_transport_channel(): - channel = aio.secure_channel('http://localhost/', grpc.local_channel_credentials()) - - # Check that channel is used if provided. - transport = transports.DataformGrpcAsyncIOTransport( - host="squid.clam.whelk", - channel=channel, - ) - assert transport.grpc_channel == channel - assert transport._host == "squid.clam.whelk:443" - assert transport._ssl_channel_credentials == None - - -# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are -# removed from grpc/grpc_asyncio transport constructor. -@pytest.mark.parametrize("transport_class", [transports.DataformGrpcTransport, transports.DataformGrpcAsyncIOTransport]) -def test_dataform_transport_channel_mtls_with_client_cert_source( - transport_class -): - with mock.patch("grpc.ssl_channel_credentials", autospec=True) as grpc_ssl_channel_cred: - with mock.patch.object(transport_class, "create_channel") as grpc_create_channel: - mock_ssl_cred = mock.Mock() - grpc_ssl_channel_cred.return_value = mock_ssl_cred - - mock_grpc_channel = mock.Mock() - grpc_create_channel.return_value = mock_grpc_channel - - cred = ga_credentials.AnonymousCredentials() - with pytest.warns(DeprecationWarning): - with mock.patch.object(google.auth, 'default') as adc: - adc.return_value = (cred, None) - transport = transport_class( - host="squid.clam.whelk", - api_mtls_endpoint="mtls.squid.clam.whelk", - client_cert_source=client_cert_source_callback, - ) - adc.assert_called_once() - - grpc_ssl_channel_cred.assert_called_once_with( - certificate_chain=b"cert bytes", private_key=b"key bytes" - ) - grpc_create_channel.assert_called_once_with( - "mtls.squid.clam.whelk:443", - credentials=cred, - credentials_file=None, - scopes=None, - ssl_credentials=mock_ssl_cred, - quota_project_id=None, - options=[ - ("grpc.max_send_message_length", -1), - ("grpc.max_receive_message_length", -1), - ], - ) - assert transport.grpc_channel == mock_grpc_channel - assert transport._ssl_channel_credentials == mock_ssl_cred - - -# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are -# removed from grpc/grpc_asyncio transport constructor. -@pytest.mark.parametrize("transport_class", [transports.DataformGrpcTransport, transports.DataformGrpcAsyncIOTransport]) -def test_dataform_transport_channel_mtls_with_adc( - transport_class -): - mock_ssl_cred = mock.Mock() - with mock.patch.multiple( - "google.auth.transport.grpc.SslCredentials", - __init__=mock.Mock(return_value=None), - ssl_credentials=mock.PropertyMock(return_value=mock_ssl_cred), - ): - with mock.patch.object(transport_class, "create_channel") as grpc_create_channel: - mock_grpc_channel = mock.Mock() - grpc_create_channel.return_value = mock_grpc_channel - mock_cred = mock.Mock() - - with pytest.warns(DeprecationWarning): - transport = transport_class( - host="squid.clam.whelk", - credentials=mock_cred, - api_mtls_endpoint="mtls.squid.clam.whelk", - client_cert_source=None, - ) - - grpc_create_channel.assert_called_once_with( - "mtls.squid.clam.whelk:443", - credentials=mock_cred, - credentials_file=None, - scopes=None, - ssl_credentials=mock_ssl_cred, - quota_project_id=None, - options=[ - ("grpc.max_send_message_length", -1), - ("grpc.max_receive_message_length", -1), - ], - ) - assert transport.grpc_channel == mock_grpc_channel - - -def test_compilation_result_path(): - project = "squid" - location = "clam" - repository = "whelk" - compilation_result = "octopus" - expected = "projects/{project}/locations/{location}/repositories/{repository}/compilationResults/{compilation_result}".format(project=project, location=location, repository=repository, compilation_result=compilation_result, ) - actual = DataformClient.compilation_result_path(project, location, repository, compilation_result) - assert expected == actual - - -def test_parse_compilation_result_path(): - expected = { - "project": "oyster", - "location": "nudibranch", - "repository": "cuttlefish", - "compilation_result": "mussel", - } - path = DataformClient.compilation_result_path(**expected) - - # Check that the path construction is reversible. - actual = DataformClient.parse_compilation_result_path(path) - assert expected == actual - -def test_repository_path(): - project = "winkle" - location = "nautilus" - repository = "scallop" - expected = "projects/{project}/locations/{location}/repositories/{repository}".format(project=project, location=location, repository=repository, ) - actual = DataformClient.repository_path(project, location, repository) - assert expected == actual - - -def test_parse_repository_path(): - expected = { - "project": "abalone", - "location": "squid", - "repository": "clam", - } - path = DataformClient.repository_path(**expected) - - # Check that the path construction is reversible. - actual = DataformClient.parse_repository_path(path) - assert expected == actual - -def test_secret_version_path(): - project = "whelk" - secret = "octopus" - version = "oyster" - expected = "projects/{project}/secrets/{secret}/versions/{version}".format(project=project, secret=secret, version=version, ) - actual = DataformClient.secret_version_path(project, secret, version) - assert expected == actual - - -def test_parse_secret_version_path(): - expected = { - "project": "nudibranch", - "secret": "cuttlefish", - "version": "mussel", - } - path = DataformClient.secret_version_path(**expected) - - # Check that the path construction is reversible. - actual = DataformClient.parse_secret_version_path(path) - assert expected == actual - -def test_workflow_invocation_path(): - project = "winkle" - location = "nautilus" - repository = "scallop" - workflow_invocation = "abalone" - expected = "projects/{project}/locations/{location}/repositories/{repository}/workflowInvocations/{workflow_invocation}".format(project=project, location=location, repository=repository, workflow_invocation=workflow_invocation, ) - actual = DataformClient.workflow_invocation_path(project, location, repository, workflow_invocation) - assert expected == actual - - -def test_parse_workflow_invocation_path(): - expected = { - "project": "squid", - "location": "clam", - "repository": "whelk", - "workflow_invocation": "octopus", - } - path = DataformClient.workflow_invocation_path(**expected) - - # Check that the path construction is reversible. - actual = DataformClient.parse_workflow_invocation_path(path) - assert expected == actual - -def test_workspace_path(): - project = "oyster" - location = "nudibranch" - repository = "cuttlefish" - workspace = "mussel" - expected = "projects/{project}/locations/{location}/repositories/{repository}/workspaces/{workspace}".format(project=project, location=location, repository=repository, workspace=workspace, ) - actual = DataformClient.workspace_path(project, location, repository, workspace) - assert expected == actual - - -def test_parse_workspace_path(): - expected = { - "project": "winkle", - "location": "nautilus", - "repository": "scallop", - "workspace": "abalone", - } - path = DataformClient.workspace_path(**expected) - - # Check that the path construction is reversible. - actual = DataformClient.parse_workspace_path(path) - assert expected == actual - -def test_common_billing_account_path(): - billing_account = "squid" - expected = "billingAccounts/{billing_account}".format(billing_account=billing_account, ) - actual = DataformClient.common_billing_account_path(billing_account) - assert expected == actual - - -def test_parse_common_billing_account_path(): - expected = { - "billing_account": "clam", - } - path = DataformClient.common_billing_account_path(**expected) - - # Check that the path construction is reversible. - actual = DataformClient.parse_common_billing_account_path(path) - assert expected == actual - -def test_common_folder_path(): - folder = "whelk" - expected = "folders/{folder}".format(folder=folder, ) - actual = DataformClient.common_folder_path(folder) - assert expected == actual - - -def test_parse_common_folder_path(): - expected = { - "folder": "octopus", - } - path = DataformClient.common_folder_path(**expected) - - # Check that the path construction is reversible. - actual = DataformClient.parse_common_folder_path(path) - assert expected == actual - -def test_common_organization_path(): - organization = "oyster" - expected = "organizations/{organization}".format(organization=organization, ) - actual = DataformClient.common_organization_path(organization) - assert expected == actual - - -def test_parse_common_organization_path(): - expected = { - "organization": "nudibranch", - } - path = DataformClient.common_organization_path(**expected) - - # Check that the path construction is reversible. - actual = DataformClient.parse_common_organization_path(path) - assert expected == actual - -def test_common_project_path(): - project = "cuttlefish" - expected = "projects/{project}".format(project=project, ) - actual = DataformClient.common_project_path(project) - assert expected == actual - - -def test_parse_common_project_path(): - expected = { - "project": "mussel", - } - path = DataformClient.common_project_path(**expected) - - # Check that the path construction is reversible. - actual = DataformClient.parse_common_project_path(path) - assert expected == actual - -def test_common_location_path(): - project = "winkle" - location = "nautilus" - expected = "projects/{project}/locations/{location}".format(project=project, location=location, ) - actual = DataformClient.common_location_path(project, location) - assert expected == actual - - -def test_parse_common_location_path(): - expected = { - "project": "scallop", - "location": "abalone", - } - path = DataformClient.common_location_path(**expected) - - # Check that the path construction is reversible. - actual = DataformClient.parse_common_location_path(path) - assert expected == actual - - -def test_client_with_default_client_info(): - client_info = gapic_v1.client_info.ClientInfo() - - with mock.patch.object(transports.DataformTransport, '_prep_wrapped_messages') as prep: - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - client_info=client_info, - ) - prep.assert_called_once_with(client_info) - - with mock.patch.object(transports.DataformTransport, '_prep_wrapped_messages') as prep: - transport_class = DataformClient.get_transport_class() - transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), - client_info=client_info, - ) - prep.assert_called_once_with(client_info) - -@pytest.mark.asyncio -async def test_transport_close_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport="grpc_asyncio", - ) - with mock.patch.object(type(getattr(client.transport, "grpc_channel")), "close") as close: - async with client: - close.assert_not_called() - close.assert_called_once() - - -def test_list_locations(transport: str = "grpc"): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = locations_pb2.ListLocationsRequest() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object(type(client.transport.list_locations), "__call__") as call: - # Designate an appropriate return value for the call. - call.return_value = locations_pb2.ListLocationsResponse() - response = client.list_locations(request) - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the response is the type that we expect. - assert isinstance(response, locations_pb2.ListLocationsResponse) -@pytest.mark.asyncio -async def test_list_locations_async(transport: str = "grpc"): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = locations_pb2.ListLocationsRequest() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object(type(client.transport.list_locations), "__call__") as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - locations_pb2.ListLocationsResponse() - ) - response = await client.list_locations(request) - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the response is the type that we expect. - assert isinstance(response, locations_pb2.ListLocationsResponse) - -def test_list_locations_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = locations_pb2.ListLocationsRequest() - request.name = "locations" - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object(type(client.transport.list_locations), "__call__") as call: - call.return_value = locations_pb2.ListLocationsResponse() - - client.list_locations(request) - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=locations",) in kw["metadata"] -@pytest.mark.asyncio -async def test_list_locations_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = locations_pb2.ListLocationsRequest() - request.name = "locations" - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object(type(client.transport.list_locations), "__call__") as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - locations_pb2.ListLocationsResponse() - ) - await client.list_locations(request) - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=locations",) in kw["metadata"] - -def test_list_locations_from_dict(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object(type(client.transport.list_locations), "__call__") as call: - # Designate an appropriate return value for the call. - call.return_value = locations_pb2.ListLocationsResponse() - - response = client.list_locations( - request={ - "name": "locations", - } - ) - call.assert_called() -@pytest.mark.asyncio -async def test_list_locations_from_dict_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object(type(client.transport.list_locations), "__call__") as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - locations_pb2.ListLocationsResponse() - ) - response = await client.list_locations( - request={ - "name": "locations", - } - ) - call.assert_called() - - -def test_get_location(transport: str = "grpc"): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = locations_pb2.GetLocationRequest() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object(type(client.transport.get_location), "__call__") as call: - # Designate an appropriate return value for the call. - call.return_value = locations_pb2.Location() - response = client.get_location(request) - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the response is the type that we expect. - assert isinstance(response, locations_pb2.Location) -@pytest.mark.asyncio -async def test_get_location_async(transport: str = "grpc_asyncio"): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = locations_pb2.GetLocationRequest() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object(type(client.transport.get_location), "__call__") as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - locations_pb2.Location() - ) - response = await client.get_location(request) - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the response is the type that we expect. - assert isinstance(response, locations_pb2.Location) - -def test_get_location_field_headers(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials()) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = locations_pb2.GetLocationRequest() - request.name = "locations/abc" - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object(type(client.transport.get_location), "__call__") as call: - call.return_value = locations_pb2.Location() - - client.get_location(request) - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=locations/abc",) in kw["metadata"] -@pytest.mark.asyncio -async def test_get_location_field_headers_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials() - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = locations_pb2.GetLocationRequest() - request.name = "locations/abc" - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object(type(client.transport.get_location), "__call__") as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - locations_pb2.Location() - ) - await client.get_location(request) - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=locations/abc",) in kw["metadata"] - -def test_get_location_from_dict(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object(type(client.transport.list_locations), "__call__") as call: - # Designate an appropriate return value for the call. - call.return_value = locations_pb2.Location() - - response = client.get_location( - request={ - "name": "locations/abc", - } - ) - call.assert_called() -@pytest.mark.asyncio -async def test_get_location_from_dict_async(): - client = DataformAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object(type(client.transport.list_locations), "__call__") as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - locations_pb2.Location() - ) - response = await client.get_location( - request={ - "name": "locations", - } - ) - call.assert_called() - - -def test_transport_close(): - transports = { - "grpc": "_grpc_channel", - } - - for transport, close_name in transports.items(): - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport - ) - with mock.patch.object(type(getattr(client.transport, close_name)), "close") as close: - with client: - close.assert_not_called() - close.assert_called_once() - -def test_client_ctx(): - transports = [ - 'grpc', - ] - for transport in transports: - client = DataformClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport - ) - # Test client calls underlying transport. - with mock.patch.object(type(client.transport), "close") as close: - close.assert_not_called() - with client: - pass - close.assert_called() - -@pytest.mark.parametrize("client_class,transport_class", [ - (DataformClient, transports.DataformGrpcTransport), - (DataformAsyncClient, transports.DataformGrpcAsyncIOTransport), -]) -def test_api_key_credentials(client_class, transport_class): - with mock.patch.object( - google.auth._default, "get_api_key_credentials", create=True - ) as get_api_key_credentials: - mock_cred = mock.Mock() - get_api_key_credentials.return_value = mock_cred - options = client_options.ClientOptions() - options.api_key = "api_key" - with mock.patch.object(transport_class, "__init__") as patched: - patched.return_value = None - client = client_class(client_options=options) - patched.assert_called_once_with( - credentials=mock_cred, - credentials_file=None, - host=client.DEFAULT_ENDPOINT, - scopes=None, - client_cert_source_for_mtls=None, - quota_project_id=None, - client_info=transports.base.DEFAULT_CLIENT_INFO, - always_use_jwt_access=True, - api_audience=None, - ) diff --git a/tests/unit/gapic/dataform_v1beta1/test_dataform.py b/tests/unit/gapic/dataform_v1beta1/test_dataform.py index 6e29c64..742b833 100644 --- a/tests/unit/gapic/dataform_v1beta1/test_dataform.py +++ b/tests/unit/gapic/dataform_v1beta1/test_dataform.py @@ -27,7 +27,7 @@ import math import pytest from proto.marshal.rules.dates import DurationRule, TimestampRule - +from proto.marshal.rules import wrappers from google.api_core import client_options from google.api_core import exceptions as core_exceptions