From 96333eeef32e160d2de704b42435caea541db052 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 6 Apr 2022 10:54:14 +0000 Subject: [PATCH 1/9] chore(python): add license header to auto-label.yaml (#58) Source-Link: https://github.com/googleapis/synthtool/commit/eb78c980b52c7c6746d2edb77d9cf7aaa99a2aab Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163 --- .github/.OwlBot.lock.yaml | 4 ++-- .github/auto-label.yaml | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index fa57622..bc893c9 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:1894490910e891a385484514b22eb5133578897eb5b3c380e6d8ad475c6647cd -# created: 2022-04-01T15:48:07.524222836Z + digest: sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163 +# created: 2022-04-06T10:30:21.687684602Z diff --git a/.github/auto-label.yaml b/.github/auto-label.yaml index 09c8d73..41bff0b 100644 --- a/.github/auto-label.yaml +++ b/.github/auto-label.yaml @@ -1,2 +1,15 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. requestsize: enabled: true From 6c5982bf2fcc0d90d6a6951a7dd676e9b7974627 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 12 Apr 2022 23:46:11 +0000 Subject: [PATCH 2/9] chore: Use gapic-generator-python 0.65.0 (#61) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 440970084 Source-Link: https://github.com/googleapis/googleapis/commit/5e0a3d57254ab9857ccac77fc6ffade7b69a2dc7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b0c628a3fade768f225d76992791ea1ba2a881be Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjBjNjI4YTNmYWRlNzY4ZjIyNWQ3Njk5Mjc5MWVhMWJhMmE4ODFiZSJ9 docs: fix type in docstring for map fields --- .../migration_service/async_client.py | 9 +- .../services/migration_service/client.py | 3 +- .../migration_service/transports/base.py | 11 +- .../migration_service/transports/grpc.py | 4 + .../types/migration_entities.py | 2 +- .../migration_service/async_client.py | 13 +- .../services/migration_service/client.py | 3 +- .../migration_service/transports/base.py | 15 +- .../migration_service/transports/grpc.py | 4 + .../types/migration_entities.py | 2 +- .../types/translation_task.py | 4 +- ...service_create_migration_workflow_async.py | 45 ++ ..._service_create_migration_workflow_sync.py | 45 ++ ...service_delete_migration_workflow_async.py | 43 ++ ..._service_delete_migration_workflow_sync.py | 43 ++ ...ion_service_get_migration_subtask_async.py | 45 ++ ...tion_service_get_migration_subtask_sync.py | 45 ++ ...on_service_get_migration_workflow_async.py | 45 ++ ...ion_service_get_migration_workflow_sync.py | 45 ++ ...n_service_list_migration_subtasks_async.py | 46 ++ ...on_service_list_migration_subtasks_sync.py | 46 ++ ..._service_list_migration_workflows_async.py | 46 ++ ...n_service_list_migration_workflows_sync.py | 46 ++ ..._service_start_migration_workflow_async.py | 43 ++ ...n_service_start_migration_workflow_sync.py | 43 ++ ...t_metadata_bigquery migration_v2alpha.json | 619 ++++++++++++++++++ .../test_migration_service.py | 91 ++- .../test_migration_service.py | 91 ++- 28 files changed, 1427 insertions(+), 70 deletions(-) create mode 100644 samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_create_migration_workflow_async.py create mode 100644 samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_create_migration_workflow_sync.py create mode 100644 samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_delete_migration_workflow_async.py create mode 100644 samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_delete_migration_workflow_sync.py create mode 100644 samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_get_migration_subtask_async.py create mode 100644 samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_get_migration_subtask_sync.py create mode 100644 samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_get_migration_workflow_async.py create mode 100644 samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_get_migration_workflow_sync.py create mode 100644 samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_list_migration_subtasks_async.py create mode 100644 samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_list_migration_subtasks_sync.py create mode 100644 samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_list_migration_workflows_async.py create mode 100644 samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_list_migration_workflows_sync.py create mode 100644 samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_start_migration_workflow_async.py create mode 100644 samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_start_migration_workflow_sync.py create mode 100644 samples/generated_samples/snippet_metadata_bigquery migration_v2alpha.json diff --git a/google/cloud/bigquery_migration_v2/services/migration_service/async_client.py b/google/cloud/bigquery_migration_v2/services/migration_service/async_client.py index 54730a6..6ffcb2c 100644 --- a/google/cloud/bigquery_migration_v2/services/migration_service/async_client.py +++ b/google/cloud/bigquery_migration_v2/services/migration_service/async_client.py @@ -16,7 +16,7 @@ from collections import OrderedDict import functools import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core.client_options import ClientOptions @@ -403,7 +403,7 @@ def sample_get_migration_workflow(): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -511,7 +511,7 @@ def sample_list_migration_workflows(): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -644,7 +644,6 @@ async def start_migration_workflow( signaled if the state is anything other than DRAFT or RUNNING. - .. code-block:: python from google.cloud import bigquery_migration_v2 @@ -705,7 +704,7 @@ def sample_start_migration_workflow(): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), diff --git a/google/cloud/bigquery_migration_v2/services/migration_service/client.py b/google/cloud/bigquery_migration_v2/services/migration_service/client.py index b808306..3bd0177 100644 --- a/google/cloud/bigquery_migration_v2/services/migration_service/client.py +++ b/google/cloud/bigquery_migration_v2/services/migration_service/client.py @@ -16,7 +16,7 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib @@ -870,7 +870,6 @@ def start_migration_workflow( signaled if the state is anything other than DRAFT or RUNNING. - .. code-block:: python from google.cloud import bigquery_migration_v2 diff --git a/google/cloud/bigquery_migration_v2/services/migration_service/transports/base.py b/google/cloud/bigquery_migration_v2/services/migration_service/transports/base.py index 4c2a173..f827313 100644 --- a/google/cloud/bigquery_migration_v2/services/migration_service/transports/base.py +++ b/google/cloud/bigquery_migration_v2/services/migration_service/transports/base.py @@ -82,6 +82,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -134,7 +135,7 @@ def _prep_wrapped_messages(self, client_info): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -148,7 +149,7 @@ def _prep_wrapped_messages(self, client_info): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -167,7 +168,7 @@ def _prep_wrapped_messages(self, client_info): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, + core_exceptions.GoogleAPICallError, ), deadline=60.0, ), @@ -273,5 +274,9 @@ def list_migration_subtasks( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("MigrationServiceTransport",) diff --git a/google/cloud/bigquery_migration_v2/services/migration_service/transports/grpc.py b/google/cloud/bigquery_migration_v2/services/migration_service/transports/grpc.py index 1a88446..9a5352f 100644 --- a/google/cloud/bigquery_migration_v2/services/migration_service/transports/grpc.py +++ b/google/cloud/bigquery_migration_v2/services/migration_service/transports/grpc.py @@ -433,5 +433,9 @@ def list_migration_subtasks( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("MigrationServiceGrpcTransport",) diff --git a/google/cloud/bigquery_migration_v2/types/migration_entities.py b/google/cloud/bigquery_migration_v2/types/migration_entities.py index 9225a7e..d54203b 100644 --- a/google/cloud/bigquery_migration_v2/types/migration_entities.py +++ b/google/cloud/bigquery_migration_v2/types/migration_entities.py @@ -46,7 +46,7 @@ class MigrationWorkflow(proto.Message): The display name of the workflow. This can be set to give a workflow a descriptive name. There is no guarantee or enforcement of uniqueness. - tasks (Sequence[google.cloud.bigquery_migration_v2.types.MigrationWorkflow.TasksEntry]): + tasks (Mapping[str, google.cloud.bigquery_migration_v2.types.MigrationTask]): The tasks in a workflow in a named map. The name (i.e. key) has no meaning and is merely a convenient way to address a specific task in a diff --git a/google/cloud/bigquery_migration_v2alpha/services/migration_service/async_client.py b/google/cloud/bigquery_migration_v2alpha/services/migration_service/async_client.py index c7dc00a..9b5d37a 100644 --- a/google/cloud/bigquery_migration_v2alpha/services/migration_service/async_client.py +++ b/google/cloud/bigquery_migration_v2alpha/services/migration_service/async_client.py @@ -16,7 +16,7 @@ from collections import OrderedDict import functools import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core.client_options import ClientOptions @@ -403,7 +403,7 @@ def sample_get_migration_workflow(): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, + core_exceptions.GoogleAPICallError, ), deadline=120.0, ), @@ -511,7 +511,7 @@ def sample_list_migration_workflows(): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, + core_exceptions.GoogleAPICallError, ), deadline=120.0, ), @@ -644,7 +644,6 @@ async def start_migration_workflow( signaled if the state is anything other than DRAFT or RUNNING. - .. code-block:: python from google.cloud import bigquery_migration_v2alpha @@ -705,7 +704,7 @@ def sample_start_migration_workflow(): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, + core_exceptions.GoogleAPICallError, ), deadline=120.0, ), @@ -811,7 +810,7 @@ def sample_get_migration_subtask(): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, + core_exceptions.GoogleAPICallError, ), deadline=120.0, ), @@ -918,7 +917,7 @@ def sample_list_migration_subtasks(): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, + core_exceptions.GoogleAPICallError, ), deadline=120.0, ), diff --git a/google/cloud/bigquery_migration_v2alpha/services/migration_service/client.py b/google/cloud/bigquery_migration_v2alpha/services/migration_service/client.py index 4b84546..f2420fd 100644 --- a/google/cloud/bigquery_migration_v2alpha/services/migration_service/client.py +++ b/google/cloud/bigquery_migration_v2alpha/services/migration_service/client.py @@ -16,7 +16,7 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib @@ -870,7 +870,6 @@ def start_migration_workflow( signaled if the state is anything other than DRAFT or RUNNING. - .. code-block:: python from google.cloud import bigquery_migration_v2alpha diff --git a/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/base.py b/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/base.py index 984bd13..a8c90cb 100644 --- a/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/base.py +++ b/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/base.py @@ -82,6 +82,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -134,7 +135,7 @@ def _prep_wrapped_messages(self, client_info): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, + core_exceptions.GoogleAPICallError, ), deadline=120.0, ), @@ -148,7 +149,7 @@ def _prep_wrapped_messages(self, client_info): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, + core_exceptions.GoogleAPICallError, ), deadline=120.0, ), @@ -167,7 +168,7 @@ def _prep_wrapped_messages(self, client_info): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, + core_exceptions.GoogleAPICallError, ), deadline=120.0, ), @@ -181,7 +182,7 @@ def _prep_wrapped_messages(self, client_info): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, + core_exceptions.GoogleAPICallError, ), deadline=120.0, ), @@ -195,7 +196,7 @@ def _prep_wrapped_messages(self, client_info): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.ServiceUnavailable, + core_exceptions.GoogleAPICallError, ), deadline=120.0, ), @@ -291,5 +292,9 @@ def list_migration_subtasks( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("MigrationServiceTransport",) diff --git a/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/grpc.py b/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/grpc.py index 990cddf..ede98c0 100644 --- a/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/grpc.py +++ b/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/grpc.py @@ -433,5 +433,9 @@ def list_migration_subtasks( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("MigrationServiceGrpcTransport",) diff --git a/google/cloud/bigquery_migration_v2alpha/types/migration_entities.py b/google/cloud/bigquery_migration_v2alpha/types/migration_entities.py index be880f7..47b1a85 100644 --- a/google/cloud/bigquery_migration_v2alpha/types/migration_entities.py +++ b/google/cloud/bigquery_migration_v2alpha/types/migration_entities.py @@ -49,7 +49,7 @@ class MigrationWorkflow(proto.Message): The display name of the workflow. This can be set to give a workflow a descriptive name. There is no guarantee or enforcement of uniqueness. - tasks (Sequence[google.cloud.bigquery_migration_v2alpha.types.MigrationWorkflow.TasksEntry]): + tasks (Mapping[str, google.cloud.bigquery_migration_v2alpha.types.MigrationTask]): The tasks in a workflow in a named map. The name (i.e. key) has no meaning and is merely a convenient way to address a specific task in a diff --git a/google/cloud/bigquery_migration_v2alpha/types/translation_task.py b/google/cloud/bigquery_migration_v2alpha/types/translation_task.py index 5c76b7b..7bf6810 100644 --- a/google/cloud/bigquery_migration_v2alpha/types/translation_task.py +++ b/google/cloud/bigquery_migration_v2alpha/types/translation_task.py @@ -91,7 +91,7 @@ class TranslationTaskDetails(proto.Message): The file encoding type. identifier_settings (google.cloud.bigquery_migration_v2alpha.types.IdentifierSettings): The settings for SQL identifiers. - special_token_map (Sequence[google.cloud.bigquery_migration_v2alpha.types.TranslationTaskDetails.SpecialTokenMapEntry]): + special_token_map (Mapping[str, google.cloud.bigquery_migration_v2alpha.types.TranslationTaskDetails.TokenType]): The map capturing special tokens to be replaced during translation. The key is special token in string. The value is the token data @@ -259,7 +259,7 @@ class BteqOptions(proto.Message): The Cloud Storage location to be used as the default path for files that are not otherwise specified in the file replacement map. - file_replacement_map (Sequence[google.cloud.bigquery_migration_v2alpha.types.BteqOptions.FileReplacementMapEntry]): + file_replacement_map (Mapping[str, str]): Maps the local paths that are used in BTEQ scripts (the keys) to the paths in Cloud Storage that should be used in their stead in the diff --git a/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_create_migration_workflow_async.py b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_create_migration_workflow_async.py new file mode 100644 index 0000000..5fa45d2 --- /dev/null +++ b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_create_migration_workflow_async.py @@ -0,0 +1,45 @@ +# -*- 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 CreateMigrationWorkflow +# 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-bigquery-migration + + +# [START bigquerymigration_v2alpha_generated_MigrationService_CreateMigrationWorkflow_async] +from google.cloud import bigquery_migration_v2alpha + + +async def sample_create_migration_workflow(): + # Create a client + client = bigquery_migration_v2alpha.MigrationServiceAsyncClient() + + # Initialize request argument(s) + request = bigquery_migration_v2alpha.CreateMigrationWorkflowRequest( + parent="parent_value", + ) + + # Make the request + response = await client.create_migration_workflow(request=request) + + # Handle the response + print(response) + +# [END bigquerymigration_v2alpha_generated_MigrationService_CreateMigrationWorkflow_async] diff --git a/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_create_migration_workflow_sync.py b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_create_migration_workflow_sync.py new file mode 100644 index 0000000..e669e6e --- /dev/null +++ b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_create_migration_workflow_sync.py @@ -0,0 +1,45 @@ +# -*- 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 CreateMigrationWorkflow +# 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-bigquery-migration + + +# [START bigquerymigration_v2alpha_generated_MigrationService_CreateMigrationWorkflow_sync] +from google.cloud import bigquery_migration_v2alpha + + +def sample_create_migration_workflow(): + # Create a client + client = bigquery_migration_v2alpha.MigrationServiceClient() + + # Initialize request argument(s) + request = bigquery_migration_v2alpha.CreateMigrationWorkflowRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_migration_workflow(request=request) + + # Handle the response + print(response) + +# [END bigquerymigration_v2alpha_generated_MigrationService_CreateMigrationWorkflow_sync] diff --git a/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_delete_migration_workflow_async.py b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_delete_migration_workflow_async.py new file mode 100644 index 0000000..9754d02 --- /dev/null +++ b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_delete_migration_workflow_async.py @@ -0,0 +1,43 @@ +# -*- 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 DeleteMigrationWorkflow +# 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-bigquery-migration + + +# [START bigquerymigration_v2alpha_generated_MigrationService_DeleteMigrationWorkflow_async] +from google.cloud import bigquery_migration_v2alpha + + +async def sample_delete_migration_workflow(): + # Create a client + client = bigquery_migration_v2alpha.MigrationServiceAsyncClient() + + # Initialize request argument(s) + request = bigquery_migration_v2alpha.DeleteMigrationWorkflowRequest( + name="name_value", + ) + + # Make the request + await client.delete_migration_workflow(request=request) + + +# [END bigquerymigration_v2alpha_generated_MigrationService_DeleteMigrationWorkflow_async] diff --git a/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_delete_migration_workflow_sync.py b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_delete_migration_workflow_sync.py new file mode 100644 index 0000000..cf7a9ac --- /dev/null +++ b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_delete_migration_workflow_sync.py @@ -0,0 +1,43 @@ +# -*- 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 DeleteMigrationWorkflow +# 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-bigquery-migration + + +# [START bigquerymigration_v2alpha_generated_MigrationService_DeleteMigrationWorkflow_sync] +from google.cloud import bigquery_migration_v2alpha + + +def sample_delete_migration_workflow(): + # Create a client + client = bigquery_migration_v2alpha.MigrationServiceClient() + + # Initialize request argument(s) + request = bigquery_migration_v2alpha.DeleteMigrationWorkflowRequest( + name="name_value", + ) + + # Make the request + client.delete_migration_workflow(request=request) + + +# [END bigquerymigration_v2alpha_generated_MigrationService_DeleteMigrationWorkflow_sync] diff --git a/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_get_migration_subtask_async.py b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_get_migration_subtask_async.py new file mode 100644 index 0000000..238c7c4 --- /dev/null +++ b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_get_migration_subtask_async.py @@ -0,0 +1,45 @@ +# -*- 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 GetMigrationSubtask +# 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-bigquery-migration + + +# [START bigquerymigration_v2alpha_generated_MigrationService_GetMigrationSubtask_async] +from google.cloud import bigquery_migration_v2alpha + + +async def sample_get_migration_subtask(): + # Create a client + client = bigquery_migration_v2alpha.MigrationServiceAsyncClient() + + # Initialize request argument(s) + request = bigquery_migration_v2alpha.GetMigrationSubtaskRequest( + name="name_value", + ) + + # Make the request + response = await client.get_migration_subtask(request=request) + + # Handle the response + print(response) + +# [END bigquerymigration_v2alpha_generated_MigrationService_GetMigrationSubtask_async] diff --git a/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_get_migration_subtask_sync.py b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_get_migration_subtask_sync.py new file mode 100644 index 0000000..eb7b23c --- /dev/null +++ b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_get_migration_subtask_sync.py @@ -0,0 +1,45 @@ +# -*- 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 GetMigrationSubtask +# 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-bigquery-migration + + +# [START bigquerymigration_v2alpha_generated_MigrationService_GetMigrationSubtask_sync] +from google.cloud import bigquery_migration_v2alpha + + +def sample_get_migration_subtask(): + # Create a client + client = bigquery_migration_v2alpha.MigrationServiceClient() + + # Initialize request argument(s) + request = bigquery_migration_v2alpha.GetMigrationSubtaskRequest( + name="name_value", + ) + + # Make the request + response = client.get_migration_subtask(request=request) + + # Handle the response + print(response) + +# [END bigquerymigration_v2alpha_generated_MigrationService_GetMigrationSubtask_sync] diff --git a/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_get_migration_workflow_async.py b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_get_migration_workflow_async.py new file mode 100644 index 0000000..45a6473 --- /dev/null +++ b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_get_migration_workflow_async.py @@ -0,0 +1,45 @@ +# -*- 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 GetMigrationWorkflow +# 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-bigquery-migration + + +# [START bigquerymigration_v2alpha_generated_MigrationService_GetMigrationWorkflow_async] +from google.cloud import bigquery_migration_v2alpha + + +async def sample_get_migration_workflow(): + # Create a client + client = bigquery_migration_v2alpha.MigrationServiceAsyncClient() + + # Initialize request argument(s) + request = bigquery_migration_v2alpha.GetMigrationWorkflowRequest( + name="name_value", + ) + + # Make the request + response = await client.get_migration_workflow(request=request) + + # Handle the response + print(response) + +# [END bigquerymigration_v2alpha_generated_MigrationService_GetMigrationWorkflow_async] diff --git a/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_get_migration_workflow_sync.py b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_get_migration_workflow_sync.py new file mode 100644 index 0000000..fad8d73 --- /dev/null +++ b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_get_migration_workflow_sync.py @@ -0,0 +1,45 @@ +# -*- 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 GetMigrationWorkflow +# 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-bigquery-migration + + +# [START bigquerymigration_v2alpha_generated_MigrationService_GetMigrationWorkflow_sync] +from google.cloud import bigquery_migration_v2alpha + + +def sample_get_migration_workflow(): + # Create a client + client = bigquery_migration_v2alpha.MigrationServiceClient() + + # Initialize request argument(s) + request = bigquery_migration_v2alpha.GetMigrationWorkflowRequest( + name="name_value", + ) + + # Make the request + response = client.get_migration_workflow(request=request) + + # Handle the response + print(response) + +# [END bigquerymigration_v2alpha_generated_MigrationService_GetMigrationWorkflow_sync] diff --git a/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_list_migration_subtasks_async.py b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_list_migration_subtasks_async.py new file mode 100644 index 0000000..dc4cda1 --- /dev/null +++ b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_list_migration_subtasks_async.py @@ -0,0 +1,46 @@ +# -*- 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 ListMigrationSubtasks +# 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-bigquery-migration + + +# [START bigquerymigration_v2alpha_generated_MigrationService_ListMigrationSubtasks_async] +from google.cloud import bigquery_migration_v2alpha + + +async def sample_list_migration_subtasks(): + # Create a client + client = bigquery_migration_v2alpha.MigrationServiceAsyncClient() + + # Initialize request argument(s) + request = bigquery_migration_v2alpha.ListMigrationSubtasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_migration_subtasks(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END bigquerymigration_v2alpha_generated_MigrationService_ListMigrationSubtasks_async] diff --git a/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_list_migration_subtasks_sync.py b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_list_migration_subtasks_sync.py new file mode 100644 index 0000000..f3f4bd0 --- /dev/null +++ b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_list_migration_subtasks_sync.py @@ -0,0 +1,46 @@ +# -*- 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 ListMigrationSubtasks +# 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-bigquery-migration + + +# [START bigquerymigration_v2alpha_generated_MigrationService_ListMigrationSubtasks_sync] +from google.cloud import bigquery_migration_v2alpha + + +def sample_list_migration_subtasks(): + # Create a client + client = bigquery_migration_v2alpha.MigrationServiceClient() + + # Initialize request argument(s) + request = bigquery_migration_v2alpha.ListMigrationSubtasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_migration_subtasks(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END bigquerymigration_v2alpha_generated_MigrationService_ListMigrationSubtasks_sync] diff --git a/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_list_migration_workflows_async.py b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_list_migration_workflows_async.py new file mode 100644 index 0000000..868a82f --- /dev/null +++ b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_list_migration_workflows_async.py @@ -0,0 +1,46 @@ +# -*- 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 ListMigrationWorkflows +# 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-bigquery-migration + + +# [START bigquerymigration_v2alpha_generated_MigrationService_ListMigrationWorkflows_async] +from google.cloud import bigquery_migration_v2alpha + + +async def sample_list_migration_workflows(): + # Create a client + client = bigquery_migration_v2alpha.MigrationServiceAsyncClient() + + # Initialize request argument(s) + request = bigquery_migration_v2alpha.ListMigrationWorkflowsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_migration_workflows(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END bigquerymigration_v2alpha_generated_MigrationService_ListMigrationWorkflows_async] diff --git a/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_list_migration_workflows_sync.py b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_list_migration_workflows_sync.py new file mode 100644 index 0000000..c48711f --- /dev/null +++ b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_list_migration_workflows_sync.py @@ -0,0 +1,46 @@ +# -*- 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 ListMigrationWorkflows +# 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-bigquery-migration + + +# [START bigquerymigration_v2alpha_generated_MigrationService_ListMigrationWorkflows_sync] +from google.cloud import bigquery_migration_v2alpha + + +def sample_list_migration_workflows(): + # Create a client + client = bigquery_migration_v2alpha.MigrationServiceClient() + + # Initialize request argument(s) + request = bigquery_migration_v2alpha.ListMigrationWorkflowsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_migration_workflows(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END bigquerymigration_v2alpha_generated_MigrationService_ListMigrationWorkflows_sync] diff --git a/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_start_migration_workflow_async.py b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_start_migration_workflow_async.py new file mode 100644 index 0000000..670e67a --- /dev/null +++ b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_start_migration_workflow_async.py @@ -0,0 +1,43 @@ +# -*- 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 StartMigrationWorkflow +# 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-bigquery-migration + + +# [START bigquerymigration_v2alpha_generated_MigrationService_StartMigrationWorkflow_async] +from google.cloud import bigquery_migration_v2alpha + + +async def sample_start_migration_workflow(): + # Create a client + client = bigquery_migration_v2alpha.MigrationServiceAsyncClient() + + # Initialize request argument(s) + request = bigquery_migration_v2alpha.StartMigrationWorkflowRequest( + name="name_value", + ) + + # Make the request + await client.start_migration_workflow(request=request) + + +# [END bigquerymigration_v2alpha_generated_MigrationService_StartMigrationWorkflow_async] diff --git a/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_start_migration_workflow_sync.py b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_start_migration_workflow_sync.py new file mode 100644 index 0000000..6f8ad6b --- /dev/null +++ b/samples/generated_samples/bigquerymigration_v2alpha_generated_migration_service_start_migration_workflow_sync.py @@ -0,0 +1,43 @@ +# -*- 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 StartMigrationWorkflow +# 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-bigquery-migration + + +# [START bigquerymigration_v2alpha_generated_MigrationService_StartMigrationWorkflow_sync] +from google.cloud import bigquery_migration_v2alpha + + +def sample_start_migration_workflow(): + # Create a client + client = bigquery_migration_v2alpha.MigrationServiceClient() + + # Initialize request argument(s) + request = bigquery_migration_v2alpha.StartMigrationWorkflowRequest( + name="name_value", + ) + + # Make the request + client.start_migration_workflow(request=request) + + +# [END bigquerymigration_v2alpha_generated_MigrationService_StartMigrationWorkflow_sync] diff --git a/samples/generated_samples/snippet_metadata_bigquery migration_v2alpha.json b/samples/generated_samples/snippet_metadata_bigquery migration_v2alpha.json new file mode 100644 index 0000000..17dae71 --- /dev/null +++ b/samples/generated_samples/snippet_metadata_bigquery migration_v2alpha.json @@ -0,0 +1,619 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "MigrationService" + }, + "shortName": "CreateMigrationWorkflow" + } + }, + "file": "bigquerymigration_v2alpha_generated_migration_service_create_migration_workflow_async.py", + "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_CreateMigrationWorkflow_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "MigrationService" + }, + "shortName": "CreateMigrationWorkflow" + } + }, + "file": "bigquerymigration_v2alpha_generated_migration_service_create_migration_workflow_sync.py", + "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_CreateMigrationWorkflow_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "MigrationService" + }, + "shortName": "DeleteMigrationWorkflow" + } + }, + "file": "bigquerymigration_v2alpha_generated_migration_service_delete_migration_workflow_async.py", + "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_DeleteMigrationWorkflow_async", + "segments": [ + { + "end": 42, + "start": 27, + "type": "FULL" + }, + { + "end": 42, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "MigrationService" + }, + "shortName": "DeleteMigrationWorkflow" + } + }, + "file": "bigquerymigration_v2alpha_generated_migration_service_delete_migration_workflow_sync.py", + "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_DeleteMigrationWorkflow_sync", + "segments": [ + { + "end": 42, + "start": 27, + "type": "FULL" + }, + { + "end": 42, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "MigrationService" + }, + "shortName": "GetMigrationSubtask" + } + }, + "file": "bigquerymigration_v2alpha_generated_migration_service_get_migration_subtask_async.py", + "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_GetMigrationSubtask_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "MigrationService" + }, + "shortName": "GetMigrationSubtask" + } + }, + "file": "bigquerymigration_v2alpha_generated_migration_service_get_migration_subtask_sync.py", + "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_GetMigrationSubtask_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "MigrationService" + }, + "shortName": "GetMigrationWorkflow" + } + }, + "file": "bigquerymigration_v2alpha_generated_migration_service_get_migration_workflow_async.py", + "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_GetMigrationWorkflow_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "MigrationService" + }, + "shortName": "GetMigrationWorkflow" + } + }, + "file": "bigquerymigration_v2alpha_generated_migration_service_get_migration_workflow_sync.py", + "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_GetMigrationWorkflow_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "MigrationService" + }, + "shortName": "ListMigrationSubtasks" + } + }, + "file": "bigquerymigration_v2alpha_generated_migration_service_list_migration_subtasks_async.py", + "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_ListMigrationSubtasks_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "MigrationService" + }, + "shortName": "ListMigrationSubtasks" + } + }, + "file": "bigquerymigration_v2alpha_generated_migration_service_list_migration_subtasks_sync.py", + "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_ListMigrationSubtasks_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "MigrationService" + }, + "shortName": "ListMigrationWorkflows" + } + }, + "file": "bigquerymigration_v2alpha_generated_migration_service_list_migration_workflows_async.py", + "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_ListMigrationWorkflows_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "MigrationService" + }, + "shortName": "ListMigrationWorkflows" + } + }, + "file": "bigquerymigration_v2alpha_generated_migration_service_list_migration_workflows_sync.py", + "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_ListMigrationWorkflows_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "MigrationService" + }, + "shortName": "StartMigrationWorkflow" + } + }, + "file": "bigquerymigration_v2alpha_generated_migration_service_start_migration_workflow_async.py", + "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_StartMigrationWorkflow_async", + "segments": [ + { + "end": 42, + "start": 27, + "type": "FULL" + }, + { + "end": 42, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "MigrationService" + }, + "shortName": "StartMigrationWorkflow" + } + }, + "file": "bigquerymigration_v2alpha_generated_migration_service_start_migration_workflow_sync.py", + "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_StartMigrationWorkflow_sync", + "segments": [ + { + "end": 42, + "start": 27, + "type": "FULL" + }, + { + "end": 42, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 43, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} diff --git a/tests/unit/gapic/bigquery_migration_v2/test_migration_service.py b/tests/unit/gapic/bigquery_migration_v2/test_migration_service.py index 08dc9c1..aa2fe5f 100644 --- a/tests/unit/gapic/bigquery_migration_v2/test_migration_service.py +++ b/tests/unit/gapic/bigquery_migration_v2/test_migration_service.py @@ -97,24 +97,26 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - MigrationServiceClient, - MigrationServiceAsyncClient, + (MigrationServiceClient, "grpc"), + (MigrationServiceAsyncClient, "grpc_asyncio"), ], ) -def test_migration_service_client_from_service_account_info(client_class): +def test_migration_service_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) + 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 == "bigquerymigration.googleapis.com:443" + assert client.transport._host == ("bigquerymigration.googleapis.com:443") @pytest.mark.parametrize( @@ -143,27 +145,33 @@ def test_migration_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - MigrationServiceClient, - MigrationServiceAsyncClient, + (MigrationServiceClient, "grpc"), + (MigrationServiceAsyncClient, "grpc_asyncio"), ], ) -def test_migration_service_client_from_service_account_file(client_class): +def test_migration_service_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") + 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") + 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 == "bigquerymigration.googleapis.com:443" + assert client.transport._host == ("bigquerymigration.googleapis.com:443") def test_migration_service_client_get_transport_class(): @@ -1570,7 +1578,7 @@ async def test_list_migration_workflows_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -1620,7 +1628,9 @@ async def test_list_migration_workflows_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_migration_workflows(request={})).pages: + async for page_ in ( + await client.list_migration_workflows(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 @@ -2746,7 +2756,7 @@ async def test_list_migration_subtasks_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -2796,7 +2806,9 @@ async def test_list_migration_subtasks_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_migration_subtasks(request={})).pages: + async for page_ in ( + await client.list_migration_subtasks(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 @@ -2893,6 +2905,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = MigrationServiceClient.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 = MigrationServiceClient( @@ -2941,6 +2966,14 @@ def test_migration_service_base_transport(): 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_migration_service_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -3086,24 +3119,40 @@ def test_migration_service_grpc_transport_client_cert_source_for_mtls(transport_ ) -def test_migration_service_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_migration_service_host_no_port(transport_name): client = MigrationServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="bigquerymigration.googleapis.com" ), + transport=transport_name, ) - assert client.transport._host == "bigquerymigration.googleapis.com:443" + assert client.transport._host == ("bigquerymigration.googleapis.com:443") -def test_migration_service_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_migration_service_host_with_port(transport_name): client = MigrationServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="bigquerymigration.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "bigquerymigration.googleapis.com:8000" + assert client.transport._host == ("bigquerymigration.googleapis.com:8000") def test_migration_service_grpc_transport_channel(): diff --git a/tests/unit/gapic/bigquery_migration_v2alpha/test_migration_service.py b/tests/unit/gapic/bigquery_migration_v2alpha/test_migration_service.py index 598f95d..6d26b71 100644 --- a/tests/unit/gapic/bigquery_migration_v2alpha/test_migration_service.py +++ b/tests/unit/gapic/bigquery_migration_v2alpha/test_migration_service.py @@ -101,24 +101,26 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - MigrationServiceClient, - MigrationServiceAsyncClient, + (MigrationServiceClient, "grpc"), + (MigrationServiceAsyncClient, "grpc_asyncio"), ], ) -def test_migration_service_client_from_service_account_info(client_class): +def test_migration_service_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) + 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 == "bigquerymigration.googleapis.com:443" + assert client.transport._host == ("bigquerymigration.googleapis.com:443") @pytest.mark.parametrize( @@ -147,27 +149,33 @@ def test_migration_service_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - MigrationServiceClient, - MigrationServiceAsyncClient, + (MigrationServiceClient, "grpc"), + (MigrationServiceAsyncClient, "grpc_asyncio"), ], ) -def test_migration_service_client_from_service_account_file(client_class): +def test_migration_service_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") + 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") + 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 == "bigquerymigration.googleapis.com:443" + assert client.transport._host == ("bigquerymigration.googleapis.com:443") def test_migration_service_client_get_transport_class(): @@ -1574,7 +1582,7 @@ async def test_list_migration_workflows_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -1624,7 +1632,9 @@ async def test_list_migration_workflows_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_migration_workflows(request={})).pages: + async for page_ in ( + await client.list_migration_workflows(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 @@ -2750,7 +2760,7 @@ async def test_list_migration_subtasks_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -2800,7 +2810,9 @@ async def test_list_migration_subtasks_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_migration_subtasks(request={})).pages: + async for page_ in ( + await client.list_migration_subtasks(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 @@ -2897,6 +2909,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = MigrationServiceClient.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 = MigrationServiceClient( @@ -2945,6 +2970,14 @@ def test_migration_service_base_transport(): 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_migration_service_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -3090,24 +3123,40 @@ def test_migration_service_grpc_transport_client_cert_source_for_mtls(transport_ ) -def test_migration_service_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_migration_service_host_no_port(transport_name): client = MigrationServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="bigquerymigration.googleapis.com" ), + transport=transport_name, ) - assert client.transport._host == "bigquerymigration.googleapis.com:443" + assert client.transport._host == ("bigquerymigration.googleapis.com:443") -def test_migration_service_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_migration_service_host_with_port(transport_name): client = MigrationServiceClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="bigquerymigration.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "bigquerymigration.googleapis.com:8000" + assert client.transport._host == ("bigquerymigration.googleapis.com:8000") def test_migration_service_grpc_transport_channel(): From c6eb874b0f5381dc5898668a5f9e9d2e0f0d27df Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 13 Apr 2022 20:28:34 -0400 Subject: [PATCH 3/9] chore: use gapic-generator-python 0.65.1 (#63) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-python 0.65.1 PiperOrigin-RevId: 441524537 Source-Link: https://github.com/googleapis/googleapis/commit/2a273915b3f70fe86c9d2a75470a0b83e48d0abf Source-Link: https://github.com/googleapis/googleapis-gen/commit/ab6756a48c89b5bcb9fb73443cb8e55d574f4643 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWI2NzU2YTQ4Yzg5YjViY2I5ZmI3MzQ0M2NiOGU1NWQ1NzRmNDY0MyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../migration_service/async_client.py | 6 +- .../migration_service/transports/base.py | 6 +- .../migration_service/async_client.py | 10 +- .../migration_service/transports/base.py | 10 +- ...nippet_metadata_bigquery migration_v2.json | 574 +++++++++++++++++- ...t_metadata_bigquery migration_v2alpha.json | 574 +++++++++++++++++- 6 files changed, 1108 insertions(+), 72 deletions(-) diff --git a/google/cloud/bigquery_migration_v2/services/migration_service/async_client.py b/google/cloud/bigquery_migration_v2/services/migration_service/async_client.py index 6ffcb2c..e97e904 100644 --- a/google/cloud/bigquery_migration_v2/services/migration_service/async_client.py +++ b/google/cloud/bigquery_migration_v2/services/migration_service/async_client.py @@ -403,7 +403,7 @@ def sample_get_migration_workflow(): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, ), deadline=60.0, ), @@ -511,7 +511,7 @@ def sample_list_migration_workflows(): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, ), deadline=60.0, ), @@ -704,7 +704,7 @@ def sample_start_migration_workflow(): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, ), deadline=60.0, ), diff --git a/google/cloud/bigquery_migration_v2/services/migration_service/transports/base.py b/google/cloud/bigquery_migration_v2/services/migration_service/transports/base.py index f827313..ccbd76c 100644 --- a/google/cloud/bigquery_migration_v2/services/migration_service/transports/base.py +++ b/google/cloud/bigquery_migration_v2/services/migration_service/transports/base.py @@ -135,7 +135,7 @@ def _prep_wrapped_messages(self, client_info): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, ), deadline=60.0, ), @@ -149,7 +149,7 @@ def _prep_wrapped_messages(self, client_info): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, ), deadline=60.0, ), @@ -168,7 +168,7 @@ def _prep_wrapped_messages(self, client_info): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, ), deadline=60.0, ), diff --git a/google/cloud/bigquery_migration_v2alpha/services/migration_service/async_client.py b/google/cloud/bigquery_migration_v2alpha/services/migration_service/async_client.py index 9b5d37a..4d75049 100644 --- a/google/cloud/bigquery_migration_v2alpha/services/migration_service/async_client.py +++ b/google/cloud/bigquery_migration_v2alpha/services/migration_service/async_client.py @@ -403,7 +403,7 @@ def sample_get_migration_workflow(): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, ), deadline=120.0, ), @@ -511,7 +511,7 @@ def sample_list_migration_workflows(): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, ), deadline=120.0, ), @@ -704,7 +704,7 @@ def sample_start_migration_workflow(): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, ), deadline=120.0, ), @@ -810,7 +810,7 @@ def sample_get_migration_subtask(): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, ), deadline=120.0, ), @@ -917,7 +917,7 @@ def sample_list_migration_subtasks(): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, ), deadline=120.0, ), diff --git a/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/base.py b/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/base.py index a8c90cb..d2b00ad 100644 --- a/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/base.py +++ b/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/base.py @@ -135,7 +135,7 @@ def _prep_wrapped_messages(self, client_info): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, ), deadline=120.0, ), @@ -149,7 +149,7 @@ def _prep_wrapped_messages(self, client_info): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, ), deadline=120.0, ), @@ -168,7 +168,7 @@ def _prep_wrapped_messages(self, client_info): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, ), deadline=120.0, ), @@ -182,7 +182,7 @@ def _prep_wrapped_messages(self, client_info): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, ), deadline=120.0, ), @@ -196,7 +196,7 @@ def _prep_wrapped_messages(self, client_info): maximum=10.0, multiplier=1.3, predicate=retries.if_exception_type( - core_exceptions.GoogleAPICallError, + core_exceptions.ServiceUnavailable, ), deadline=120.0, ), diff --git a/samples/generated_samples/snippet_metadata_bigquery migration_v2.json b/samples/generated_samples/snippet_metadata_bigquery migration_v2.json index f7ba68b..5d9f389 100644 --- a/samples/generated_samples/snippet_metadata_bigquery migration_v2.json +++ b/samples/generated_samples/snippet_metadata_bigquery migration_v2.json @@ -1,16 +1,65 @@ { + "clientLibrary": { + "apis": [ + { + "id": "google.cloud.bigquery.migration.v2", + "version": "v2" + } + ], + "language": "PYTHON", + "name": "google-cloud-bigquery-migration" + }, "snippets": [ { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceAsyncClient", + "shortName": "MigrationServiceAsyncClient" + }, + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceAsyncClient.create_migration_workflow", "method": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService.CreateMigrationWorkflow", "service": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService", "shortName": "MigrationService" }, "shortName": "CreateMigrationWorkflow" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2.types.CreateMigrationWorkflowRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "migration_workflow", + "type": "google.cloud.bigquery_migration_v2.types.MigrationWorkflow" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.bigquery_migration_v2.types.MigrationWorkflow", + "shortName": "create_migration_workflow" }, + "description": "Sample for CreateMigrationWorkflow", "file": "bigquerymigration_v2_generated_migration_service_create_migration_workflow_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2_generated_MigrationService_CreateMigrationWorkflow_async", "segments": [ { @@ -43,18 +92,58 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2_generated_migration_service_create_migration_workflow_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceClient", + "shortName": "MigrationServiceClient" + }, + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceClient.create_migration_workflow", "method": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService.CreateMigrationWorkflow", "service": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService", "shortName": "MigrationService" }, "shortName": "CreateMigrationWorkflow" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2.types.CreateMigrationWorkflowRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "migration_workflow", + "type": "google.cloud.bigquery_migration_v2.types.MigrationWorkflow" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.bigquery_migration_v2.types.MigrationWorkflow", + "shortName": "create_migration_workflow" }, + "description": "Sample for CreateMigrationWorkflow", "file": "bigquerymigration_v2_generated_migration_service_create_migration_workflow_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2_generated_MigrationService_CreateMigrationWorkflow_sync", "segments": [ { @@ -87,19 +176,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2_generated_migration_service_create_migration_workflow_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceAsyncClient", + "shortName": "MigrationServiceAsyncClient" + }, + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceAsyncClient.delete_migration_workflow", "method": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService.DeleteMigrationWorkflow", "service": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService", "shortName": "MigrationService" }, "shortName": "DeleteMigrationWorkflow" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2.types.DeleteMigrationWorkflowRequest" + }, + { + "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_migration_workflow" }, + "description": "Sample for DeleteMigrationWorkflow", "file": "bigquerymigration_v2_generated_migration_service_delete_migration_workflow_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2_generated_MigrationService_DeleteMigrationWorkflow_async", "segments": [ { @@ -130,18 +254,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2_generated_migration_service_delete_migration_workflow_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceClient", + "shortName": "MigrationServiceClient" + }, + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceClient.delete_migration_workflow", "method": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService.DeleteMigrationWorkflow", "service": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService", "shortName": "MigrationService" }, "shortName": "DeleteMigrationWorkflow" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2.types.DeleteMigrationWorkflowRequest" + }, + { + "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_migration_workflow" }, + "description": "Sample for DeleteMigrationWorkflow", "file": "bigquerymigration_v2_generated_migration_service_delete_migration_workflow_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2_generated_MigrationService_DeleteMigrationWorkflow_sync", "segments": [ { @@ -172,19 +331,55 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2_generated_migration_service_delete_migration_workflow_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceAsyncClient", + "shortName": "MigrationServiceAsyncClient" + }, + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceAsyncClient.get_migration_subtask", "method": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService.GetMigrationSubtask", "service": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService", "shortName": "MigrationService" }, "shortName": "GetMigrationSubtask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2.types.GetMigrationSubtaskRequest" + }, + { + "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.bigquery_migration_v2.types.MigrationSubtask", + "shortName": "get_migration_subtask" }, + "description": "Sample for GetMigrationSubtask", "file": "bigquerymigration_v2_generated_migration_service_get_migration_subtask_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2_generated_MigrationService_GetMigrationSubtask_async", "segments": [ { @@ -217,18 +412,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2_generated_migration_service_get_migration_subtask_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceClient", + "shortName": "MigrationServiceClient" + }, + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceClient.get_migration_subtask", "method": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService.GetMigrationSubtask", "service": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService", "shortName": "MigrationService" }, "shortName": "GetMigrationSubtask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2.types.GetMigrationSubtaskRequest" + }, + { + "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.bigquery_migration_v2.types.MigrationSubtask", + "shortName": "get_migration_subtask" }, + "description": "Sample for GetMigrationSubtask", "file": "bigquerymigration_v2_generated_migration_service_get_migration_subtask_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2_generated_MigrationService_GetMigrationSubtask_sync", "segments": [ { @@ -261,19 +492,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2_generated_migration_service_get_migration_subtask_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceAsyncClient", + "shortName": "MigrationServiceAsyncClient" + }, + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceAsyncClient.get_migration_workflow", "method": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService.GetMigrationWorkflow", "service": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService", "shortName": "MigrationService" }, "shortName": "GetMigrationWorkflow" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2.types.GetMigrationWorkflowRequest" + }, + { + "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.bigquery_migration_v2.types.MigrationWorkflow", + "shortName": "get_migration_workflow" }, + "description": "Sample for GetMigrationWorkflow", "file": "bigquerymigration_v2_generated_migration_service_get_migration_workflow_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2_generated_MigrationService_GetMigrationWorkflow_async", "segments": [ { @@ -306,18 +573,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2_generated_migration_service_get_migration_workflow_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceClient", + "shortName": "MigrationServiceClient" + }, + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceClient.get_migration_workflow", "method": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService.GetMigrationWorkflow", "service": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService", "shortName": "MigrationService" }, "shortName": "GetMigrationWorkflow" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2.types.GetMigrationWorkflowRequest" + }, + { + "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.bigquery_migration_v2.types.MigrationWorkflow", + "shortName": "get_migration_workflow" }, + "description": "Sample for GetMigrationWorkflow", "file": "bigquerymigration_v2_generated_migration_service_get_migration_workflow_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2_generated_MigrationService_GetMigrationWorkflow_sync", "segments": [ { @@ -350,19 +653,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2_generated_migration_service_get_migration_workflow_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceAsyncClient", + "shortName": "MigrationServiceAsyncClient" + }, + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceAsyncClient.list_migration_subtasks", "method": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService.ListMigrationSubtasks", "service": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService", "shortName": "MigrationService" }, "shortName": "ListMigrationSubtasks" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2.types.ListMigrationSubtasksRequest" + }, + { + "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.bigquery_migration_v2.services.migration_service.pagers.ListMigrationSubtasksAsyncPager", + "shortName": "list_migration_subtasks" }, + "description": "Sample for ListMigrationSubtasks", "file": "bigquerymigration_v2_generated_migration_service_list_migration_subtasks_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2_generated_MigrationService_ListMigrationSubtasks_async", "segments": [ { @@ -395,18 +734,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2_generated_migration_service_list_migration_subtasks_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceClient", + "shortName": "MigrationServiceClient" + }, + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceClient.list_migration_subtasks", "method": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService.ListMigrationSubtasks", "service": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService", "shortName": "MigrationService" }, "shortName": "ListMigrationSubtasks" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2.types.ListMigrationSubtasksRequest" + }, + { + "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.bigquery_migration_v2.services.migration_service.pagers.ListMigrationSubtasksPager", + "shortName": "list_migration_subtasks" }, + "description": "Sample for ListMigrationSubtasks", "file": "bigquerymigration_v2_generated_migration_service_list_migration_subtasks_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2_generated_MigrationService_ListMigrationSubtasks_sync", "segments": [ { @@ -439,19 +814,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2_generated_migration_service_list_migration_subtasks_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceAsyncClient", + "shortName": "MigrationServiceAsyncClient" + }, + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceAsyncClient.list_migration_workflows", "method": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService.ListMigrationWorkflows", "service": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService", "shortName": "MigrationService" }, "shortName": "ListMigrationWorkflows" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2.types.ListMigrationWorkflowsRequest" + }, + { + "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.bigquery_migration_v2.services.migration_service.pagers.ListMigrationWorkflowsAsyncPager", + "shortName": "list_migration_workflows" }, + "description": "Sample for ListMigrationWorkflows", "file": "bigquerymigration_v2_generated_migration_service_list_migration_workflows_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2_generated_MigrationService_ListMigrationWorkflows_async", "segments": [ { @@ -484,18 +895,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2_generated_migration_service_list_migration_workflows_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceClient", + "shortName": "MigrationServiceClient" + }, + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceClient.list_migration_workflows", "method": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService.ListMigrationWorkflows", "service": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService", "shortName": "MigrationService" }, "shortName": "ListMigrationWorkflows" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2.types.ListMigrationWorkflowsRequest" + }, + { + "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.bigquery_migration_v2.services.migration_service.pagers.ListMigrationWorkflowsPager", + "shortName": "list_migration_workflows" }, + "description": "Sample for ListMigrationWorkflows", "file": "bigquerymigration_v2_generated_migration_service_list_migration_workflows_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2_generated_MigrationService_ListMigrationWorkflows_sync", "segments": [ { @@ -528,19 +975,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2_generated_migration_service_list_migration_workflows_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceAsyncClient", + "shortName": "MigrationServiceAsyncClient" + }, + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceAsyncClient.start_migration_workflow", "method": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService.StartMigrationWorkflow", "service": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService", "shortName": "MigrationService" }, "shortName": "StartMigrationWorkflow" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2.types.StartMigrationWorkflowRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "start_migration_workflow" }, + "description": "Sample for StartMigrationWorkflow", "file": "bigquerymigration_v2_generated_migration_service_start_migration_workflow_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2_generated_MigrationService_StartMigrationWorkflow_async", "segments": [ { @@ -571,18 +1053,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2_generated_migration_service_start_migration_workflow_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceClient", + "shortName": "MigrationServiceClient" + }, + "fullName": "google.cloud.bigquery_migration_v2.MigrationServiceClient.start_migration_workflow", "method": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService.StartMigrationWorkflow", "service": { + "fullName": "google.cloud.bigquery.migration.v2.MigrationService", "shortName": "MigrationService" }, "shortName": "StartMigrationWorkflow" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2.types.StartMigrationWorkflowRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "start_migration_workflow" }, + "description": "Sample for StartMigrationWorkflow", "file": "bigquerymigration_v2_generated_migration_service_start_migration_workflow_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2_generated_MigrationService_StartMigrationWorkflow_sync", "segments": [ { @@ -613,7 +1130,8 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2_generated_migration_service_start_migration_workflow_sync.py" } ] } diff --git a/samples/generated_samples/snippet_metadata_bigquery migration_v2alpha.json b/samples/generated_samples/snippet_metadata_bigquery migration_v2alpha.json index 17dae71..287e139 100644 --- a/samples/generated_samples/snippet_metadata_bigquery migration_v2alpha.json +++ b/samples/generated_samples/snippet_metadata_bigquery migration_v2alpha.json @@ -1,16 +1,65 @@ { + "clientLibrary": { + "apis": [ + { + "id": "google.cloud.bigquery.migration.v2alpha", + "version": "v2alpha" + } + ], + "language": "PYTHON", + "name": "google-cloud-bigquery-migration" + }, "snippets": [ { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceAsyncClient", + "shortName": "MigrationServiceAsyncClient" + }, + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceAsyncClient.create_migration_workflow", "method": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService.CreateMigrationWorkflow", "service": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService", "shortName": "MigrationService" }, "shortName": "CreateMigrationWorkflow" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2alpha.types.CreateMigrationWorkflowRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "migration_workflow", + "type": "google.cloud.bigquery_migration_v2alpha.types.MigrationWorkflow" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.bigquery_migration_v2alpha.types.MigrationWorkflow", + "shortName": "create_migration_workflow" }, + "description": "Sample for CreateMigrationWorkflow", "file": "bigquerymigration_v2alpha_generated_migration_service_create_migration_workflow_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_CreateMigrationWorkflow_async", "segments": [ { @@ -43,18 +92,58 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2alpha_generated_migration_service_create_migration_workflow_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceClient", + "shortName": "MigrationServiceClient" + }, + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceClient.create_migration_workflow", "method": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService.CreateMigrationWorkflow", "service": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService", "shortName": "MigrationService" }, "shortName": "CreateMigrationWorkflow" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2alpha.types.CreateMigrationWorkflowRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "migration_workflow", + "type": "google.cloud.bigquery_migration_v2alpha.types.MigrationWorkflow" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.bigquery_migration_v2alpha.types.MigrationWorkflow", + "shortName": "create_migration_workflow" }, + "description": "Sample for CreateMigrationWorkflow", "file": "bigquerymigration_v2alpha_generated_migration_service_create_migration_workflow_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_CreateMigrationWorkflow_sync", "segments": [ { @@ -87,19 +176,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2alpha_generated_migration_service_create_migration_workflow_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceAsyncClient", + "shortName": "MigrationServiceAsyncClient" + }, + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceAsyncClient.delete_migration_workflow", "method": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService.DeleteMigrationWorkflow", "service": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService", "shortName": "MigrationService" }, "shortName": "DeleteMigrationWorkflow" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2alpha.types.DeleteMigrationWorkflowRequest" + }, + { + "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_migration_workflow" }, + "description": "Sample for DeleteMigrationWorkflow", "file": "bigquerymigration_v2alpha_generated_migration_service_delete_migration_workflow_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_DeleteMigrationWorkflow_async", "segments": [ { @@ -130,18 +254,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2alpha_generated_migration_service_delete_migration_workflow_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceClient", + "shortName": "MigrationServiceClient" + }, + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceClient.delete_migration_workflow", "method": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService.DeleteMigrationWorkflow", "service": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService", "shortName": "MigrationService" }, "shortName": "DeleteMigrationWorkflow" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2alpha.types.DeleteMigrationWorkflowRequest" + }, + { + "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_migration_workflow" }, + "description": "Sample for DeleteMigrationWorkflow", "file": "bigquerymigration_v2alpha_generated_migration_service_delete_migration_workflow_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_DeleteMigrationWorkflow_sync", "segments": [ { @@ -172,19 +331,55 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2alpha_generated_migration_service_delete_migration_workflow_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceAsyncClient", + "shortName": "MigrationServiceAsyncClient" + }, + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceAsyncClient.get_migration_subtask", "method": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService.GetMigrationSubtask", "service": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService", "shortName": "MigrationService" }, "shortName": "GetMigrationSubtask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2alpha.types.GetMigrationSubtaskRequest" + }, + { + "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.bigquery_migration_v2alpha.types.MigrationSubtask", + "shortName": "get_migration_subtask" }, + "description": "Sample for GetMigrationSubtask", "file": "bigquerymigration_v2alpha_generated_migration_service_get_migration_subtask_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_GetMigrationSubtask_async", "segments": [ { @@ -217,18 +412,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2alpha_generated_migration_service_get_migration_subtask_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceClient", + "shortName": "MigrationServiceClient" + }, + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceClient.get_migration_subtask", "method": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService.GetMigrationSubtask", "service": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService", "shortName": "MigrationService" }, "shortName": "GetMigrationSubtask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2alpha.types.GetMigrationSubtaskRequest" + }, + { + "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.bigquery_migration_v2alpha.types.MigrationSubtask", + "shortName": "get_migration_subtask" }, + "description": "Sample for GetMigrationSubtask", "file": "bigquerymigration_v2alpha_generated_migration_service_get_migration_subtask_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_GetMigrationSubtask_sync", "segments": [ { @@ -261,19 +492,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2alpha_generated_migration_service_get_migration_subtask_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceAsyncClient", + "shortName": "MigrationServiceAsyncClient" + }, + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceAsyncClient.get_migration_workflow", "method": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService.GetMigrationWorkflow", "service": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService", "shortName": "MigrationService" }, "shortName": "GetMigrationWorkflow" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2alpha.types.GetMigrationWorkflowRequest" + }, + { + "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.bigquery_migration_v2alpha.types.MigrationWorkflow", + "shortName": "get_migration_workflow" }, + "description": "Sample for GetMigrationWorkflow", "file": "bigquerymigration_v2alpha_generated_migration_service_get_migration_workflow_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_GetMigrationWorkflow_async", "segments": [ { @@ -306,18 +573,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2alpha_generated_migration_service_get_migration_workflow_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceClient", + "shortName": "MigrationServiceClient" + }, + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceClient.get_migration_workflow", "method": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService.GetMigrationWorkflow", "service": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService", "shortName": "MigrationService" }, "shortName": "GetMigrationWorkflow" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2alpha.types.GetMigrationWorkflowRequest" + }, + { + "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.bigquery_migration_v2alpha.types.MigrationWorkflow", + "shortName": "get_migration_workflow" }, + "description": "Sample for GetMigrationWorkflow", "file": "bigquerymigration_v2alpha_generated_migration_service_get_migration_workflow_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_GetMigrationWorkflow_sync", "segments": [ { @@ -350,19 +653,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2alpha_generated_migration_service_get_migration_workflow_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceAsyncClient", + "shortName": "MigrationServiceAsyncClient" + }, + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceAsyncClient.list_migration_subtasks", "method": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService.ListMigrationSubtasks", "service": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService", "shortName": "MigrationService" }, "shortName": "ListMigrationSubtasks" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2alpha.types.ListMigrationSubtasksRequest" + }, + { + "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.bigquery_migration_v2alpha.services.migration_service.pagers.ListMigrationSubtasksAsyncPager", + "shortName": "list_migration_subtasks" }, + "description": "Sample for ListMigrationSubtasks", "file": "bigquerymigration_v2alpha_generated_migration_service_list_migration_subtasks_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_ListMigrationSubtasks_async", "segments": [ { @@ -395,18 +734,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2alpha_generated_migration_service_list_migration_subtasks_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceClient", + "shortName": "MigrationServiceClient" + }, + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceClient.list_migration_subtasks", "method": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService.ListMigrationSubtasks", "service": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService", "shortName": "MigrationService" }, "shortName": "ListMigrationSubtasks" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2alpha.types.ListMigrationSubtasksRequest" + }, + { + "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.bigquery_migration_v2alpha.services.migration_service.pagers.ListMigrationSubtasksPager", + "shortName": "list_migration_subtasks" }, + "description": "Sample for ListMigrationSubtasks", "file": "bigquerymigration_v2alpha_generated_migration_service_list_migration_subtasks_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_ListMigrationSubtasks_sync", "segments": [ { @@ -439,19 +814,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2alpha_generated_migration_service_list_migration_subtasks_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceAsyncClient", + "shortName": "MigrationServiceAsyncClient" + }, + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceAsyncClient.list_migration_workflows", "method": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService.ListMigrationWorkflows", "service": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService", "shortName": "MigrationService" }, "shortName": "ListMigrationWorkflows" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2alpha.types.ListMigrationWorkflowsRequest" + }, + { + "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.bigquery_migration_v2alpha.services.migration_service.pagers.ListMigrationWorkflowsAsyncPager", + "shortName": "list_migration_workflows" }, + "description": "Sample for ListMigrationWorkflows", "file": "bigquerymigration_v2alpha_generated_migration_service_list_migration_workflows_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_ListMigrationWorkflows_async", "segments": [ { @@ -484,18 +895,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2alpha_generated_migration_service_list_migration_workflows_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceClient", + "shortName": "MigrationServiceClient" + }, + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceClient.list_migration_workflows", "method": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService.ListMigrationWorkflows", "service": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService", "shortName": "MigrationService" }, "shortName": "ListMigrationWorkflows" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2alpha.types.ListMigrationWorkflowsRequest" + }, + { + "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.bigquery_migration_v2alpha.services.migration_service.pagers.ListMigrationWorkflowsPager", + "shortName": "list_migration_workflows" }, + "description": "Sample for ListMigrationWorkflows", "file": "bigquerymigration_v2alpha_generated_migration_service_list_migration_workflows_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_ListMigrationWorkflows_sync", "segments": [ { @@ -528,19 +975,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2alpha_generated_migration_service_list_migration_workflows_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceAsyncClient", + "shortName": "MigrationServiceAsyncClient" + }, + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceAsyncClient.start_migration_workflow", "method": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService.StartMigrationWorkflow", "service": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService", "shortName": "MigrationService" }, "shortName": "StartMigrationWorkflow" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2alpha.types.StartMigrationWorkflowRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "start_migration_workflow" }, + "description": "Sample for StartMigrationWorkflow", "file": "bigquerymigration_v2alpha_generated_migration_service_start_migration_workflow_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_StartMigrationWorkflow_async", "segments": [ { @@ -571,18 +1053,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2alpha_generated_migration_service_start_migration_workflow_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceClient", + "shortName": "MigrationServiceClient" + }, + "fullName": "google.cloud.bigquery_migration_v2alpha.MigrationServiceClient.start_migration_workflow", "method": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService.StartMigrationWorkflow", "service": { + "fullName": "google.cloud.bigquery.migration.v2alpha.MigrationService", "shortName": "MigrationService" }, "shortName": "StartMigrationWorkflow" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigquery_migration_v2alpha.types.StartMigrationWorkflowRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "start_migration_workflow" }, + "description": "Sample for StartMigrationWorkflow", "file": "bigquerymigration_v2alpha_generated_migration_service_start_migration_workflow_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "bigquerymigration_v2alpha_generated_MigrationService_StartMigrationWorkflow_sync", "segments": [ { @@ -613,7 +1130,8 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "bigquerymigration_v2alpha_generated_migration_service_start_migration_workflow_sync.py" } ] } From 523978f790f95192f5cc61105eb8c22a24413f19 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 20:00:49 -0400 Subject: [PATCH 4/9] chore(python): add nox session to sort python imports (#64) Source-Link: https://github.com/googleapis/synthtool/commit/1b71c10e20de7ed3f97f692f99a0e3399b67049f Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 +- docs/conf.py | 2 +- google/cloud/bigquery_migration/__init__.py | 73 ++++++----------- .../cloud/bigquery_migration_v2/__init__.py | 80 ++++++++++--------- .../services/migration_service/__init__.py | 2 +- .../migration_service/async_client.py | 22 ++--- .../services/migration_service/client.py | 20 +++-- .../services/migration_service/pagers.py | 10 ++- .../migration_service/transports/__init__.py | 1 - .../migration_service/transports/base.py | 12 +-- .../migration_service/transports/grpc.py | 17 ++-- .../transports/grpc_asyncio.py | 17 ++-- .../bigquery_migration_v2/types/__init__.py | 19 +---- .../types/migration_entities.py | 11 +-- .../types/migration_error_details.py | 4 +- .../types/migration_metrics.py | 4 +- .../types/migration_service.py | 3 +- .../types/translation_config.py | 1 - .../bigquery_migration_v2alpha/__init__.py | 72 +++++++++-------- .../services/migration_service/__init__.py | 2 +- .../migration_service/async_client.py | 22 ++--- .../services/migration_service/client.py | 20 +++-- .../services/migration_service/pagers.py | 10 ++- .../migration_service/transports/__init__.py | 1 - .../migration_service/transports/base.py | 12 +-- .../migration_service/transports/grpc.py | 17 ++-- .../transports/grpc_asyncio.py | 17 ++-- .../types/__init__.py | 18 +---- .../types/assessment_task.py | 1 - .../types/migration_entities.py | 13 +-- .../types/migration_error_details.py | 4 +- .../types/migration_metrics.py | 4 +- .../types/migration_service.py | 3 +- .../types/translation_task.py | 1 - noxfile.py | 28 ++++++- setup.py | 1 + .../test_migration_service.py | 48 +++++------ .../test_migration_service.py | 52 ++++++------ 38 files changed, 319 insertions(+), 329 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index bc893c9..7c454ab 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163 -# created: 2022-04-06T10:30:21.687684602Z + digest: sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 +# created: 2022-04-20T23:42:53.970438194Z diff --git a/docs/conf.py b/docs/conf.py index 2a7d645..64a60d0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,9 +24,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys import os import shlex +import sys # 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 diff --git a/google/cloud/bigquery_migration/__init__.py b/google/cloud/bigquery_migration/__init__.py index 214c2d8..fee5209 100644 --- a/google/cloud/bigquery_migration/__init__.py +++ b/google/cloud/bigquery_migration/__init__.py @@ -14,81 +14,58 @@ # limitations under the License. # -from google.cloud.bigquery_migration_v2.services.migration_service.client import ( - MigrationServiceClient, -) from google.cloud.bigquery_migration_v2.services.migration_service.async_client import ( MigrationServiceAsyncClient, ) - -from google.cloud.bigquery_migration_v2.types.migration_entities import MigrationSubtask -from google.cloud.bigquery_migration_v2.types.migration_entities import MigrationTask +from google.cloud.bigquery_migration_v2.services.migration_service.client import ( + MigrationServiceClient, +) from google.cloud.bigquery_migration_v2.types.migration_entities import ( + MigrationSubtask, + MigrationTask, MigrationWorkflow, ) -from google.cloud.bigquery_migration_v2.types.migration_error_details import ErrorDetail from google.cloud.bigquery_migration_v2.types.migration_error_details import ( + ErrorDetail, ErrorLocation, -) -from google.cloud.bigquery_migration_v2.types.migration_error_details import ( ResourceErrorDetail, ) -from google.cloud.bigquery_migration_v2.types.migration_metrics import Point -from google.cloud.bigquery_migration_v2.types.migration_metrics import TimeInterval -from google.cloud.bigquery_migration_v2.types.migration_metrics import TimeSeries -from google.cloud.bigquery_migration_v2.types.migration_metrics import TypedValue -from google.cloud.bigquery_migration_v2.types.migration_service import ( - CreateMigrationWorkflowRequest, +from google.cloud.bigquery_migration_v2.types.migration_metrics import ( + Point, + TimeInterval, + TimeSeries, + TypedValue, ) from google.cloud.bigquery_migration_v2.types.migration_service import ( + CreateMigrationWorkflowRequest, DeleteMigrationWorkflowRequest, -) -from google.cloud.bigquery_migration_v2.types.migration_service import ( GetMigrationSubtaskRequest, -) -from google.cloud.bigquery_migration_v2.types.migration_service import ( GetMigrationWorkflowRequest, -) -from google.cloud.bigquery_migration_v2.types.migration_service import ( ListMigrationSubtasksRequest, -) -from google.cloud.bigquery_migration_v2.types.migration_service import ( ListMigrationSubtasksResponse, -) -from google.cloud.bigquery_migration_v2.types.migration_service import ( ListMigrationWorkflowsRequest, -) -from google.cloud.bigquery_migration_v2.types.migration_service import ( ListMigrationWorkflowsResponse, -) -from google.cloud.bigquery_migration_v2.types.migration_service import ( StartMigrationWorkflowRequest, ) from google.cloud.bigquery_migration_v2.types.translation_config import ( AzureSynapseDialect, -) -from google.cloud.bigquery_migration_v2.types.translation_config import BigQueryDialect -from google.cloud.bigquery_migration_v2.types.translation_config import Dialect -from google.cloud.bigquery_migration_v2.types.translation_config import HiveQLDialect -from google.cloud.bigquery_migration_v2.types.translation_config import NameMappingKey -from google.cloud.bigquery_migration_v2.types.translation_config import NameMappingValue -from google.cloud.bigquery_migration_v2.types.translation_config import NetezzaDialect -from google.cloud.bigquery_migration_v2.types.translation_config import ( + BigQueryDialect, + Dialect, + HiveQLDialect, + NameMappingKey, + NameMappingValue, + NetezzaDialect, ObjectNameMapping, -) -from google.cloud.bigquery_migration_v2.types.translation_config import ( ObjectNameMappingList, -) -from google.cloud.bigquery_migration_v2.types.translation_config import OracleDialect -from google.cloud.bigquery_migration_v2.types.translation_config import RedshiftDialect -from google.cloud.bigquery_migration_v2.types.translation_config import SnowflakeDialect -from google.cloud.bigquery_migration_v2.types.translation_config import SourceEnv -from google.cloud.bigquery_migration_v2.types.translation_config import SparkSQLDialect -from google.cloud.bigquery_migration_v2.types.translation_config import TeradataDialect -from google.cloud.bigquery_migration_v2.types.translation_config import ( + OracleDialect, + RedshiftDialect, + SnowflakeDialect, + SourceEnv, + SparkSQLDialect, + TeradataDialect, TranslationConfigDetails, + VerticaDialect, ) -from google.cloud.bigquery_migration_v2.types.translation_config import VerticaDialect __all__ = ( "MigrationServiceClient", diff --git a/google/cloud/bigquery_migration_v2/__init__.py b/google/cloud/bigquery_migration_v2/__init__.py index c503015..3701195 100644 --- a/google/cloud/bigquery_migration_v2/__init__.py +++ b/google/cloud/bigquery_migration_v2/__init__.py @@ -14,45 +14,47 @@ # limitations under the License. # -from .services.migration_service import MigrationServiceClient -from .services.migration_service import MigrationServiceAsyncClient - -from .types.migration_entities import MigrationSubtask -from .types.migration_entities import MigrationTask -from .types.migration_entities import MigrationWorkflow -from .types.migration_error_details import ErrorDetail -from .types.migration_error_details import ErrorLocation -from .types.migration_error_details import ResourceErrorDetail -from .types.migration_metrics import Point -from .types.migration_metrics import TimeInterval -from .types.migration_metrics import TimeSeries -from .types.migration_metrics import TypedValue -from .types.migration_service import CreateMigrationWorkflowRequest -from .types.migration_service import DeleteMigrationWorkflowRequest -from .types.migration_service import GetMigrationSubtaskRequest -from .types.migration_service import GetMigrationWorkflowRequest -from .types.migration_service import ListMigrationSubtasksRequest -from .types.migration_service import ListMigrationSubtasksResponse -from .types.migration_service import ListMigrationWorkflowsRequest -from .types.migration_service import ListMigrationWorkflowsResponse -from .types.migration_service import StartMigrationWorkflowRequest -from .types.translation_config import AzureSynapseDialect -from .types.translation_config import BigQueryDialect -from .types.translation_config import Dialect -from .types.translation_config import HiveQLDialect -from .types.translation_config import NameMappingKey -from .types.translation_config import NameMappingValue -from .types.translation_config import NetezzaDialect -from .types.translation_config import ObjectNameMapping -from .types.translation_config import ObjectNameMappingList -from .types.translation_config import OracleDialect -from .types.translation_config import RedshiftDialect -from .types.translation_config import SnowflakeDialect -from .types.translation_config import SourceEnv -from .types.translation_config import SparkSQLDialect -from .types.translation_config import TeradataDialect -from .types.translation_config import TranslationConfigDetails -from .types.translation_config import VerticaDialect +from .services.migration_service import ( + MigrationServiceAsyncClient, + MigrationServiceClient, +) +from .types.migration_entities import MigrationSubtask, MigrationTask, MigrationWorkflow +from .types.migration_error_details import ( + ErrorDetail, + ErrorLocation, + ResourceErrorDetail, +) +from .types.migration_metrics import Point, TimeInterval, TimeSeries, TypedValue +from .types.migration_service import ( + CreateMigrationWorkflowRequest, + DeleteMigrationWorkflowRequest, + GetMigrationSubtaskRequest, + GetMigrationWorkflowRequest, + ListMigrationSubtasksRequest, + ListMigrationSubtasksResponse, + ListMigrationWorkflowsRequest, + ListMigrationWorkflowsResponse, + StartMigrationWorkflowRequest, +) +from .types.translation_config import ( + AzureSynapseDialect, + BigQueryDialect, + Dialect, + HiveQLDialect, + NameMappingKey, + NameMappingValue, + NetezzaDialect, + ObjectNameMapping, + ObjectNameMappingList, + OracleDialect, + RedshiftDialect, + SnowflakeDialect, + SourceEnv, + SparkSQLDialect, + TeradataDialect, + TranslationConfigDetails, + VerticaDialect, +) __all__ = ( "MigrationServiceAsyncClient", diff --git a/google/cloud/bigquery_migration_v2/services/migration_service/__init__.py b/google/cloud/bigquery_migration_v2/services/migration_service/__init__.py index 36329bb..1b4ccd9 100644 --- a/google/cloud/bigquery_migration_v2/services/migration_service/__init__.py +++ b/google/cloud/bigquery_migration_v2/services/migration_service/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import MigrationServiceClient from .async_client import MigrationServiceAsyncClient +from .client import MigrationServiceClient __all__ = ( "MigrationServiceClient", diff --git a/google/cloud/bigquery_migration_v2/services/migration_service/async_client.py b/google/cloud/bigquery_migration_v2/services/migration_service/async_client.py index e97e904..060627e 100644 --- a/google/cloud/bigquery_migration_v2/services/migration_service/async_client.py +++ b/google/cloud/bigquery_migration_v2/services/migration_service/async_client.py @@ -17,30 +17,34 @@ 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.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore -from google.cloud.bigquery_migration_v2.services.migration_service import pagers -from google.cloud.bigquery_migration_v2.types import migration_entities -from google.cloud.bigquery_migration_v2.types import migration_error_details -from google.cloud.bigquery_migration_v2.types import migration_metrics -from google.cloud.bigquery_migration_v2.types import migration_service from google.protobuf import timestamp_pb2 # type: ignore from google.rpc import error_details_pb2 # type: ignore -from .transports.base import MigrationServiceTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import MigrationServiceGrpcAsyncIOTransport + +from google.cloud.bigquery_migration_v2.services.migration_service import pagers +from google.cloud.bigquery_migration_v2.types import ( + migration_entities, + migration_error_details, + migration_metrics, + migration_service, +) + from .client import MigrationServiceClient +from .transports.base import DEFAULT_CLIENT_INFO, MigrationServiceTransport +from .transports.grpc_asyncio import MigrationServiceGrpcAsyncIOTransport class MigrationServiceAsyncClient: diff --git a/google/cloud/bigquery_migration_v2/services/migration_service/client.py b/google/cloud/bigquery_migration_v2/services/migration_service/client.py index 3bd0177..de6faad 100644 --- a/google/cloud/bigquery_migration_v2/services/migration_service/client.py +++ b/google/cloud/bigquery_migration_v2/services/migration_service/client.py @@ -17,31 +17,35 @@ 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.exceptions import MutualTLSChannelError # 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 +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore -from google.cloud.bigquery_migration_v2.services.migration_service import pagers -from google.cloud.bigquery_migration_v2.types import migration_entities -from google.cloud.bigquery_migration_v2.types import migration_error_details -from google.cloud.bigquery_migration_v2.types import migration_metrics -from google.cloud.bigquery_migration_v2.types import migration_service from google.protobuf import timestamp_pb2 # type: ignore from google.rpc import error_details_pb2 # type: ignore -from .transports.base import MigrationServiceTransport, DEFAULT_CLIENT_INFO + +from google.cloud.bigquery_migration_v2.services.migration_service import pagers +from google.cloud.bigquery_migration_v2.types import ( + migration_entities, + migration_error_details, + migration_metrics, + migration_service, +) + +from .transports.base import DEFAULT_CLIENT_INFO, MigrationServiceTransport from .transports.grpc import MigrationServiceGrpcTransport from .transports.grpc_asyncio import MigrationServiceGrpcAsyncIOTransport diff --git a/google/cloud/bigquery_migration_v2/services/migration_service/pagers.py b/google/cloud/bigquery_migration_v2/services/migration_service/pagers.py index c890f78..cdd5a00 100644 --- a/google/cloud/bigquery_migration_v2/services/migration_service/pagers.py +++ b/google/cloud/bigquery_migration_v2/services/migration_service/pagers.py @@ -18,14 +18,16 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) -from google.cloud.bigquery_migration_v2.types import migration_entities -from google.cloud.bigquery_migration_v2.types import migration_service +from google.cloud.bigquery_migration_v2.types import ( + migration_entities, + migration_service, +) class ListMigrationWorkflowsPager: diff --git a/google/cloud/bigquery_migration_v2/services/migration_service/transports/__init__.py b/google/cloud/bigquery_migration_v2/services/migration_service/transports/__init__.py index 10ee142..3baa428 100644 --- a/google/cloud/bigquery_migration_v2/services/migration_service/transports/__init__.py +++ b/google/cloud/bigquery_migration_v2/services/migration_service/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import MigrationServiceGrpcTransport from .grpc_asyncio import MigrationServiceGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[MigrationServiceTransport]] _transport_registry["grpc"] = MigrationServiceGrpcTransport diff --git a/google/cloud/bigquery_migration_v2/services/migration_service/transports/base.py b/google/cloud/bigquery_migration_v2/services/migration_service/transports/base.py index ccbd76c..fe28c31 100644 --- a/google/cloud/bigquery_migration_v2/services/migration_service/transports/base.py +++ b/google/cloud/bigquery_migration_v2/services/migration_service/transports/base.py @@ -15,19 +15,21 @@ # 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 +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore - -from google.cloud.bigquery_migration_v2.types import migration_entities -from google.cloud.bigquery_migration_v2.types import migration_service from google.protobuf import empty_pb2 # type: ignore +import pkg_resources + +from google.cloud.bigquery_migration_v2.types import ( + migration_entities, + migration_service, +) try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( diff --git a/google/cloud/bigquery_migration_v2/services/migration_service/transports/grpc.py b/google/cloud/bigquery_migration_v2/services/migration_service/transports/grpc.py index 9a5352f..93a4193 100644 --- a/google/cloud/bigquery_migration_v2/services/migration_service/transports/grpc.py +++ b/google/cloud/bigquery_migration_v2/services/migration_service/transports/grpc.py @@ -13,21 +13,22 @@ # 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 +import warnings -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore -from google.cloud.bigquery_migration_v2.types import migration_entities -from google.cloud.bigquery_migration_v2.types import migration_service -from google.protobuf import empty_pb2 # type: ignore -from .base import MigrationServiceTransport, DEFAULT_CLIENT_INFO +from google.cloud.bigquery_migration_v2.types import ( + migration_entities, + migration_service, +) + +from .base import DEFAULT_CLIENT_INFO, MigrationServiceTransport class MigrationServiceGrpcTransport(MigrationServiceTransport): diff --git a/google/cloud/bigquery_migration_v2/services/migration_service/transports/grpc_asyncio.py b/google/cloud/bigquery_migration_v2/services/migration_service/transports/grpc_asyncio.py index 3dafa3e..bc6d578 100644 --- a/google/cloud/bigquery_migration_v2/services/migration_service/transports/grpc_asyncio.py +++ b/google/cloud/bigquery_migration_v2/services/migration_service/transports/grpc_asyncio.py @@ -13,21 +13,22 @@ # 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 +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async +from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore -from google.cloud.bigquery_migration_v2.types import migration_entities -from google.cloud.bigquery_migration_v2.types import migration_service -from google.protobuf import empty_pb2 # type: ignore -from .base import MigrationServiceTransport, DEFAULT_CLIENT_INFO +from google.cloud.bigquery_migration_v2.types import ( + migration_entities, + migration_service, +) + +from .base import DEFAULT_CLIENT_INFO, MigrationServiceTransport from .grpc import MigrationServiceGrpcTransport diff --git a/google/cloud/bigquery_migration_v2/types/__init__.py b/google/cloud/bigquery_migration_v2/types/__init__.py index c22d36d..5a7e5d7 100644 --- a/google/cloud/bigquery_migration_v2/types/__init__.py +++ b/google/cloud/bigquery_migration_v2/types/__init__.py @@ -13,22 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .migration_entities import ( - MigrationSubtask, - MigrationTask, - MigrationWorkflow, -) -from .migration_error_details import ( - ErrorDetail, - ErrorLocation, - ResourceErrorDetail, -) -from .migration_metrics import ( - Point, - TimeInterval, - TimeSeries, - TypedValue, -) +from .migration_entities import MigrationSubtask, MigrationTask, MigrationWorkflow +from .migration_error_details import ErrorDetail, ErrorLocation, ResourceErrorDetail +from .migration_metrics import Point, TimeInterval, TimeSeries, TypedValue from .migration_service import ( CreateMigrationWorkflowRequest, DeleteMigrationWorkflowRequest, diff --git a/google/cloud/bigquery_migration_v2/types/migration_entities.py b/google/cloud/bigquery_migration_v2/types/migration_entities.py index d54203b..aae3940 100644 --- a/google/cloud/bigquery_migration_v2/types/migration_entities.py +++ b/google/cloud/bigquery_migration_v2/types/migration_entities.py @@ -13,14 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - -from google.cloud.bigquery_migration_v2.types import migration_error_details -from google.cloud.bigquery_migration_v2.types import migration_metrics -from google.cloud.bigquery_migration_v2.types import translation_config from google.protobuf import timestamp_pb2 # type: ignore from google.rpc import error_details_pb2 # type: ignore +import proto # type: ignore +from google.cloud.bigquery_migration_v2.types import ( + migration_error_details, + migration_metrics, + translation_config, +) __protobuf__ = proto.module( package="google.cloud.bigquery.migration.v2", diff --git a/google/cloud/bigquery_migration_v2/types/migration_error_details.py b/google/cloud/bigquery_migration_v2/types/migration_error_details.py index e7446b4..3274fd7 100644 --- a/google/cloud/bigquery_migration_v2/types/migration_error_details.py +++ b/google/cloud/bigquery_migration_v2/types/migration_error_details.py @@ -13,10 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - from google.rpc import error_details_pb2 # type: ignore - +import proto # type: ignore __protobuf__ = proto.module( package="google.cloud.bigquery.migration.v2", diff --git a/google/cloud/bigquery_migration_v2/types/migration_metrics.py b/google/cloud/bigquery_migration_v2/types/migration_metrics.py index 6204272..e3d0d16 100644 --- a/google/cloud/bigquery_migration_v2/types/migration_metrics.py +++ b/google/cloud/bigquery_migration_v2/types/migration_metrics.py @@ -13,12 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - from google.api import distribution_pb2 # type: ignore from google.api import metric_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore - +import proto # type: ignore __protobuf__ = proto.module( package="google.cloud.bigquery.migration.v2", diff --git a/google/cloud/bigquery_migration_v2/types/migration_service.py b/google/cloud/bigquery_migration_v2/types/migration_service.py index 28555d6..85c9a67 100644 --- a/google/cloud/bigquery_migration_v2/types/migration_service.py +++ b/google/cloud/bigquery_migration_v2/types/migration_service.py @@ -13,11 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.protobuf import field_mask_pb2 # type: ignore import proto # type: ignore from google.cloud.bigquery_migration_v2.types import migration_entities -from google.protobuf import field_mask_pb2 # type: ignore - __protobuf__ = proto.module( package="google.cloud.bigquery.migration.v2", diff --git a/google/cloud/bigquery_migration_v2/types/translation_config.py b/google/cloud/bigquery_migration_v2/types/translation_config.py index 5e3979b..d200c4a 100644 --- a/google/cloud/bigquery_migration_v2/types/translation_config.py +++ b/google/cloud/bigquery_migration_v2/types/translation_config.py @@ -15,7 +15,6 @@ # import proto # type: ignore - __protobuf__ = proto.module( package="google.cloud.bigquery.migration.v2", manifest={ diff --git a/google/cloud/bigquery_migration_v2alpha/__init__.py b/google/cloud/bigquery_migration_v2alpha/__init__.py index 0680af1..2b5588b 100644 --- a/google/cloud/bigquery_migration_v2alpha/__init__.py +++ b/google/cloud/bigquery_migration_v2alpha/__init__.py @@ -14,38 +14,46 @@ # limitations under the License. # -from .services.migration_service import MigrationServiceClient -from .services.migration_service import MigrationServiceAsyncClient - -from .types.assessment_task import AssessmentOrchestrationResultDetails -from .types.assessment_task import AssessmentTaskDetails -from .types.migration_entities import MigrationSubtask -from .types.migration_entities import MigrationTask -from .types.migration_entities import MigrationTaskOrchestrationResult -from .types.migration_entities import MigrationWorkflow -from .types.migration_error_details import ErrorDetail -from .types.migration_error_details import ErrorLocation -from .types.migration_error_details import ResourceErrorDetail -from .types.migration_metrics import Point -from .types.migration_metrics import TimeInterval -from .types.migration_metrics import TimeSeries -from .types.migration_metrics import TypedValue -from .types.migration_service import CreateMigrationWorkflowRequest -from .types.migration_service import DeleteMigrationWorkflowRequest -from .types.migration_service import GetMigrationSubtaskRequest -from .types.migration_service import GetMigrationWorkflowRequest -from .types.migration_service import ListMigrationSubtasksRequest -from .types.migration_service import ListMigrationSubtasksResponse -from .types.migration_service import ListMigrationWorkflowsRequest -from .types.migration_service import ListMigrationWorkflowsResponse -from .types.migration_service import StartMigrationWorkflowRequest -from .types.translation_task import BteqOptions -from .types.translation_task import DatasetReference -from .types.translation_task import Filter -from .types.translation_task import IdentifierSettings -from .types.translation_task import TeradataOptions -from .types.translation_task import TranslationFileMapping -from .types.translation_task import TranslationTaskDetails +from .services.migration_service import ( + MigrationServiceAsyncClient, + MigrationServiceClient, +) +from .types.assessment_task import ( + AssessmentOrchestrationResultDetails, + AssessmentTaskDetails, +) +from .types.migration_entities import ( + MigrationSubtask, + MigrationTask, + MigrationTaskOrchestrationResult, + MigrationWorkflow, +) +from .types.migration_error_details import ( + ErrorDetail, + ErrorLocation, + ResourceErrorDetail, +) +from .types.migration_metrics import Point, TimeInterval, TimeSeries, TypedValue +from .types.migration_service import ( + CreateMigrationWorkflowRequest, + DeleteMigrationWorkflowRequest, + GetMigrationSubtaskRequest, + GetMigrationWorkflowRequest, + ListMigrationSubtasksRequest, + ListMigrationSubtasksResponse, + ListMigrationWorkflowsRequest, + ListMigrationWorkflowsResponse, + StartMigrationWorkflowRequest, +) +from .types.translation_task import ( + BteqOptions, + DatasetReference, + Filter, + IdentifierSettings, + TeradataOptions, + TranslationFileMapping, + TranslationTaskDetails, +) __all__ = ( "MigrationServiceAsyncClient", diff --git a/google/cloud/bigquery_migration_v2alpha/services/migration_service/__init__.py b/google/cloud/bigquery_migration_v2alpha/services/migration_service/__init__.py index 36329bb..1b4ccd9 100644 --- a/google/cloud/bigquery_migration_v2alpha/services/migration_service/__init__.py +++ b/google/cloud/bigquery_migration_v2alpha/services/migration_service/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import MigrationServiceClient from .async_client import MigrationServiceAsyncClient +from .client import MigrationServiceClient __all__ = ( "MigrationServiceClient", diff --git a/google/cloud/bigquery_migration_v2alpha/services/migration_service/async_client.py b/google/cloud/bigquery_migration_v2alpha/services/migration_service/async_client.py index 4d75049..39a6f61 100644 --- a/google/cloud/bigquery_migration_v2alpha/services/migration_service/async_client.py +++ b/google/cloud/bigquery_migration_v2alpha/services/migration_service/async_client.py @@ -17,30 +17,34 @@ 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.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore -from google.cloud.bigquery_migration_v2alpha.services.migration_service import pagers -from google.cloud.bigquery_migration_v2alpha.types import migration_entities -from google.cloud.bigquery_migration_v2alpha.types import migration_error_details -from google.cloud.bigquery_migration_v2alpha.types import migration_metrics -from google.cloud.bigquery_migration_v2alpha.types import migration_service from google.protobuf import timestamp_pb2 # type: ignore from google.rpc import error_details_pb2 # type: ignore -from .transports.base import MigrationServiceTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import MigrationServiceGrpcAsyncIOTransport + +from google.cloud.bigquery_migration_v2alpha.services.migration_service import pagers +from google.cloud.bigquery_migration_v2alpha.types import ( + migration_entities, + migration_error_details, + migration_metrics, + migration_service, +) + from .client import MigrationServiceClient +from .transports.base import DEFAULT_CLIENT_INFO, MigrationServiceTransport +from .transports.grpc_asyncio import MigrationServiceGrpcAsyncIOTransport class MigrationServiceAsyncClient: diff --git a/google/cloud/bigquery_migration_v2alpha/services/migration_service/client.py b/google/cloud/bigquery_migration_v2alpha/services/migration_service/client.py index f2420fd..1c545c3 100644 --- a/google/cloud/bigquery_migration_v2alpha/services/migration_service/client.py +++ b/google/cloud/bigquery_migration_v2alpha/services/migration_service/client.py @@ -17,31 +17,35 @@ 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.exceptions import MutualTLSChannelError # 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 +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore -from google.cloud.bigquery_migration_v2alpha.services.migration_service import pagers -from google.cloud.bigquery_migration_v2alpha.types import migration_entities -from google.cloud.bigquery_migration_v2alpha.types import migration_error_details -from google.cloud.bigquery_migration_v2alpha.types import migration_metrics -from google.cloud.bigquery_migration_v2alpha.types import migration_service from google.protobuf import timestamp_pb2 # type: ignore from google.rpc import error_details_pb2 # type: ignore -from .transports.base import MigrationServiceTransport, DEFAULT_CLIENT_INFO + +from google.cloud.bigquery_migration_v2alpha.services.migration_service import pagers +from google.cloud.bigquery_migration_v2alpha.types import ( + migration_entities, + migration_error_details, + migration_metrics, + migration_service, +) + +from .transports.base import DEFAULT_CLIENT_INFO, MigrationServiceTransport from .transports.grpc import MigrationServiceGrpcTransport from .transports.grpc_asyncio import MigrationServiceGrpcAsyncIOTransport diff --git a/google/cloud/bigquery_migration_v2alpha/services/migration_service/pagers.py b/google/cloud/bigquery_migration_v2alpha/services/migration_service/pagers.py index 86f159b..312df0a 100644 --- a/google/cloud/bigquery_migration_v2alpha/services/migration_service/pagers.py +++ b/google/cloud/bigquery_migration_v2alpha/services/migration_service/pagers.py @@ -18,14 +18,16 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) -from google.cloud.bigquery_migration_v2alpha.types import migration_entities -from google.cloud.bigquery_migration_v2alpha.types import migration_service +from google.cloud.bigquery_migration_v2alpha.types import ( + migration_entities, + migration_service, +) class ListMigrationWorkflowsPager: diff --git a/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/__init__.py b/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/__init__.py index 10ee142..3baa428 100644 --- a/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/__init__.py +++ b/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import MigrationServiceGrpcTransport from .grpc_asyncio import MigrationServiceGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[MigrationServiceTransport]] _transport_registry["grpc"] = MigrationServiceGrpcTransport diff --git a/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/base.py b/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/base.py index d2b00ad..083f473 100644 --- a/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/base.py +++ b/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/base.py @@ -15,19 +15,21 @@ # 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 +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore - -from google.cloud.bigquery_migration_v2alpha.types import migration_entities -from google.cloud.bigquery_migration_v2alpha.types import migration_service from google.protobuf import empty_pb2 # type: ignore +import pkg_resources + +from google.cloud.bigquery_migration_v2alpha.types import ( + migration_entities, + migration_service, +) try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( diff --git a/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/grpc.py b/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/grpc.py index ede98c0..a295cda 100644 --- a/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/grpc.py +++ b/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/grpc.py @@ -13,21 +13,22 @@ # 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 +import warnings -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore -from google.cloud.bigquery_migration_v2alpha.types import migration_entities -from google.cloud.bigquery_migration_v2alpha.types import migration_service -from google.protobuf import empty_pb2 # type: ignore -from .base import MigrationServiceTransport, DEFAULT_CLIENT_INFO +from google.cloud.bigquery_migration_v2alpha.types import ( + migration_entities, + migration_service, +) + +from .base import DEFAULT_CLIENT_INFO, MigrationServiceTransport class MigrationServiceGrpcTransport(MigrationServiceTransport): diff --git a/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/grpc_asyncio.py b/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/grpc_asyncio.py index 59f2c0c..3b2b936 100644 --- a/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/grpc_asyncio.py +++ b/google/cloud/bigquery_migration_v2alpha/services/migration_service/transports/grpc_asyncio.py @@ -13,21 +13,22 @@ # 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 +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async +from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore -from google.cloud.bigquery_migration_v2alpha.types import migration_entities -from google.cloud.bigquery_migration_v2alpha.types import migration_service -from google.protobuf import empty_pb2 # type: ignore -from .base import MigrationServiceTransport, DEFAULT_CLIENT_INFO +from google.cloud.bigquery_migration_v2alpha.types import ( + migration_entities, + migration_service, +) + +from .base import DEFAULT_CLIENT_INFO, MigrationServiceTransport from .grpc import MigrationServiceGrpcTransport diff --git a/google/cloud/bigquery_migration_v2alpha/types/__init__.py b/google/cloud/bigquery_migration_v2alpha/types/__init__.py index 214cfbb..8d18db5 100644 --- a/google/cloud/bigquery_migration_v2alpha/types/__init__.py +++ b/google/cloud/bigquery_migration_v2alpha/types/__init__.py @@ -13,27 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .assessment_task import ( - AssessmentOrchestrationResultDetails, - AssessmentTaskDetails, -) +from .assessment_task import AssessmentOrchestrationResultDetails, AssessmentTaskDetails from .migration_entities import ( MigrationSubtask, MigrationTask, MigrationTaskOrchestrationResult, MigrationWorkflow, ) -from .migration_error_details import ( - ErrorDetail, - ErrorLocation, - ResourceErrorDetail, -) -from .migration_metrics import ( - Point, - TimeInterval, - TimeSeries, - TypedValue, -) +from .migration_error_details import ErrorDetail, ErrorLocation, ResourceErrorDetail +from .migration_metrics import Point, TimeInterval, TimeSeries, TypedValue from .migration_service import ( CreateMigrationWorkflowRequest, DeleteMigrationWorkflowRequest, diff --git a/google/cloud/bigquery_migration_v2alpha/types/assessment_task.py b/google/cloud/bigquery_migration_v2alpha/types/assessment_task.py index 6865bc7..9688fc7 100644 --- a/google/cloud/bigquery_migration_v2alpha/types/assessment_task.py +++ b/google/cloud/bigquery_migration_v2alpha/types/assessment_task.py @@ -15,7 +15,6 @@ # import proto # type: ignore - __protobuf__ = proto.module( package="google.cloud.bigquery.migration.v2alpha", manifest={ diff --git a/google/cloud/bigquery_migration_v2alpha/types/migration_entities.py b/google/cloud/bigquery_migration_v2alpha/types/migration_entities.py index 47b1a85..47885ef 100644 --- a/google/cloud/bigquery_migration_v2alpha/types/migration_entities.py +++ b/google/cloud/bigquery_migration_v2alpha/types/migration_entities.py @@ -13,16 +13,17 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - -from google.cloud.bigquery_migration_v2alpha.types import assessment_task -from google.cloud.bigquery_migration_v2alpha.types import migration_error_details -from google.cloud.bigquery_migration_v2alpha.types import migration_metrics -from google.cloud.bigquery_migration_v2alpha.types import translation_task from google.protobuf import any_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore from google.rpc import error_details_pb2 # type: ignore +import proto # type: ignore +from google.cloud.bigquery_migration_v2alpha.types import ( + assessment_task, + migration_error_details, + migration_metrics, + translation_task, +) __protobuf__ = proto.module( package="google.cloud.bigquery.migration.v2alpha", diff --git a/google/cloud/bigquery_migration_v2alpha/types/migration_error_details.py b/google/cloud/bigquery_migration_v2alpha/types/migration_error_details.py index 7885bd7..fedccca 100644 --- a/google/cloud/bigquery_migration_v2alpha/types/migration_error_details.py +++ b/google/cloud/bigquery_migration_v2alpha/types/migration_error_details.py @@ -13,10 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - from google.rpc import error_details_pb2 # type: ignore - +import proto # type: ignore __protobuf__ = proto.module( package="google.cloud.bigquery.migration.v2alpha", diff --git a/google/cloud/bigquery_migration_v2alpha/types/migration_metrics.py b/google/cloud/bigquery_migration_v2alpha/types/migration_metrics.py index a3f53be..761250d 100644 --- a/google/cloud/bigquery_migration_v2alpha/types/migration_metrics.py +++ b/google/cloud/bigquery_migration_v2alpha/types/migration_metrics.py @@ -13,12 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - from google.api import distribution_pb2 # type: ignore from google.api import metric_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore - +import proto # type: ignore __protobuf__ = proto.module( package="google.cloud.bigquery.migration.v2alpha", diff --git a/google/cloud/bigquery_migration_v2alpha/types/migration_service.py b/google/cloud/bigquery_migration_v2alpha/types/migration_service.py index 20e9bc3..76bccf8 100644 --- a/google/cloud/bigquery_migration_v2alpha/types/migration_service.py +++ b/google/cloud/bigquery_migration_v2alpha/types/migration_service.py @@ -13,11 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.protobuf import field_mask_pb2 # type: ignore import proto # type: ignore from google.cloud.bigquery_migration_v2alpha.types import migration_entities -from google.protobuf import field_mask_pb2 # type: ignore - __protobuf__ = proto.module( package="google.cloud.bigquery.migration.v2alpha", diff --git a/google/cloud/bigquery_migration_v2alpha/types/translation_task.py b/google/cloud/bigquery_migration_v2alpha/types/translation_task.py index 7bf6810..5c2b58a 100644 --- a/google/cloud/bigquery_migration_v2alpha/types/translation_task.py +++ b/google/cloud/bigquery_migration_v2alpha/types/translation_task.py @@ -15,7 +15,6 @@ # import proto # type: ignore - __protobuf__ = proto.module( package="google.cloud.bigquery.migration.v2alpha", manifest={ diff --git a/noxfile.py b/noxfile.py index 6ee5e8a..7c1742d 100644 --- a/noxfile.py +++ b/noxfile.py @@ -17,6 +17,7 @@ # Generated by synthtool. DO NOT EDIT! from __future__ import absolute_import + import os import pathlib import shutil @@ -25,7 +26,8 @@ import nox BLACK_VERSION = "black==22.3.0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] +ISORT_VERSION = "isort==5.10.1" +LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" @@ -83,7 +85,7 @@ def lint(session): session.run( "black", "--check", - *BLACK_PATHS, + *LINT_PATHS, ) session.run("flake8", "google", "tests") @@ -94,7 +96,27 @@ def blacken(session): session.install(BLACK_VERSION) session.run( "black", - *BLACK_PATHS, + *LINT_PATHS, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def format(session): + """ + Run isort to sort imports. Then run black + to format code to uniform standard. + """ + session.install(BLACK_VERSION, ISORT_VERSION) + # Use the --fss option to sort imports using strict alphabetical order. + # See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections + session.run( + "isort", + "--fss", + *LINT_PATHS, + ) + session.run( + "black", + *LINT_PATHS, ) diff --git a/setup.py b/setup.py index ece9e47..e2d2f55 100644 --- a/setup.py +++ b/setup.py @@ -15,6 +15,7 @@ # import io import os + import setuptools # type: ignore version = "0.4.0" diff --git a/tests/unit/gapic/bigquery_migration_v2/test_migration_service.py b/tests/unit/gapic/bigquery_migration_v2/test_migration_service.py index aa2fe5f..c68e4e8 100644 --- a/tests/unit/gapic/bigquery_migration_v2/test_migration_service.py +++ b/tests/unit/gapic/bigquery_migration_v2/test_migration_service.py @@ -13,42 +13,38 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import mock - -import grpc -from grpc.experimental import aio import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule - +import os +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template 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 +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.bigquery_migration_v2.services.migration_service import ( - MigrationServiceAsyncClient, -) -from google.cloud.bigquery_migration_v2.services.migration_service import ( - MigrationServiceClient, -) -from google.cloud.bigquery_migration_v2.services.migration_service import pagers -from google.cloud.bigquery_migration_v2.services.migration_service import transports -from google.cloud.bigquery_migration_v2.types import migration_entities -from google.cloud.bigquery_migration_v2.types import migration_error_details -from google.cloud.bigquery_migration_v2.types import migration_metrics -from google.cloud.bigquery_migration_v2.types import migration_service -from google.cloud.bigquery_migration_v2.types import translation_config 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.rpc import error_details_pb2 # type: ignore -import google.auth +import grpc +from grpc.experimental import aio +import mock +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.bigquery_migration_v2.services.migration_service import ( + MigrationServiceAsyncClient, + MigrationServiceClient, + pagers, + transports, +) +from google.cloud.bigquery_migration_v2.types import ( + migration_entities, + migration_error_details, + migration_metrics, + migration_service, + translation_config, +) def client_cert_source_callback(): diff --git a/tests/unit/gapic/bigquery_migration_v2alpha/test_migration_service.py b/tests/unit/gapic/bigquery_migration_v2alpha/test_migration_service.py index 6d26b71..bb22bbb 100644 --- a/tests/unit/gapic/bigquery_migration_v2alpha/test_migration_service.py +++ b/tests/unit/gapic/bigquery_migration_v2alpha/test_migration_service.py @@ -13,46 +13,40 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import mock - -import grpc -from grpc.experimental import aio import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule - +import os +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template 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 +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.bigquery_migration_v2alpha.services.migration_service import ( - MigrationServiceAsyncClient, -) -from google.cloud.bigquery_migration_v2alpha.services.migration_service import ( - MigrationServiceClient, -) -from google.cloud.bigquery_migration_v2alpha.services.migration_service import pagers -from google.cloud.bigquery_migration_v2alpha.services.migration_service import ( - transports, -) -from google.cloud.bigquery_migration_v2alpha.types import assessment_task -from google.cloud.bigquery_migration_v2alpha.types import migration_entities -from google.cloud.bigquery_migration_v2alpha.types import migration_error_details -from google.cloud.bigquery_migration_v2alpha.types import migration_metrics -from google.cloud.bigquery_migration_v2alpha.types import migration_service -from google.cloud.bigquery_migration_v2alpha.types import translation_task from google.oauth2 import service_account from google.protobuf import any_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore from google.rpc import error_details_pb2 # type: ignore -import google.auth +import grpc +from grpc.experimental import aio +import mock +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.bigquery_migration_v2alpha.services.migration_service import ( + MigrationServiceAsyncClient, + MigrationServiceClient, + pagers, + transports, +) +from google.cloud.bigquery_migration_v2alpha.types import ( + assessment_task, + migration_entities, + migration_error_details, + migration_metrics, + migration_service, + translation_task, +) def client_cert_source_callback(): From 249e1f4e9aaae571f8c164d3a511efe57bf04546 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 17:22:17 +0000 Subject: [PATCH 5/9] chore(python): use ubuntu 22.04 in docs image (#66) Source-Link: https://github.com/googleapis/synthtool/commit/f15cc72fb401b4861cedebb10af74afe428fb1f8 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd --- .github/.OwlBot.lock.yaml | 4 ++-- .kokoro/docker/docs/Dockerfile | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 7c454ab..64f82d6 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 -# created: 2022-04-20T23:42:53.970438194Z + digest: sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd +# created: 2022-04-21T15:43:16.246106921Z diff --git a/.kokoro/docker/docs/Dockerfile b/.kokoro/docker/docs/Dockerfile index 4e1b1fb..238b87b 100644 --- a/.kokoro/docker/docs/Dockerfile +++ b/.kokoro/docker/docs/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ubuntu:20.04 +from ubuntu:22.04 ENV DEBIAN_FRONTEND noninteractive @@ -60,8 +60,24 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && rm -f /var/cache/apt/archives/*.deb +###################### Install python 3.8.11 + +# Download python 3.8.11 +RUN wget https://www.python.org/ftp/python/3.8.11/Python-3.8.11.tgz + +# Extract files +RUN tar -xvf Python-3.8.11.tgz + +# Install python 3.8.11 +RUN ./Python-3.8.11/configure --enable-optimizations +RUN make altinstall + +###################### Install pip RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3.8 /tmp/get-pip.py \ + && python3 /tmp/get-pip.py \ && rm /tmp/get-pip.py +# Test pip +RUN python3 -m pip + CMD ["python3.8"] From 8eebf88fb84f72c3e4da29f27c8c6ca9c82f256b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 28 Apr 2022 07:21:18 -0400 Subject: [PATCH 6/9] chore: use gapic-generator-python 0.65.2 (#67) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-python 0.65.2 PiperOrigin-RevId: 444333013 Source-Link: https://github.com/googleapis/googleapis/commit/f91b6cf82e929280f6562f6110957c654bd9e2e6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/16eb36095c294e712c74a1bf23550817b42174e5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTZlYjM2MDk1YzI5NGU3MTJjNzRhMWJmMjM1NTA4MTdiNDIxNzRlNSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../migration_service/async_client.py | 42 ++++++------- .../migration_service/async_client.py | 42 ++++++------- .../test_migration_service.py | 60 +++++++++---------- .../test_migration_service.py | 60 +++++++++---------- 4 files changed, 102 insertions(+), 102 deletions(-) diff --git a/google/cloud/bigquery_migration_v2/services/migration_service/async_client.py b/google/cloud/bigquery_migration_v2/services/migration_service/async_client.py index 060627e..e73563d 100644 --- a/google/cloud/bigquery_migration_v2/services/migration_service/async_client.py +++ b/google/cloud/bigquery_migration_v2/services/migration_service/async_client.py @@ -235,9 +235,9 @@ async def create_migration_workflow( from google.cloud import bigquery_migration_v2 - def sample_create_migration_workflow(): + async def sample_create_migration_workflow(): # Create a client - client = bigquery_migration_v2.MigrationServiceClient() + client = bigquery_migration_v2.MigrationServiceAsyncClient() # Initialize request argument(s) request = bigquery_migration_v2.CreateMigrationWorkflowRequest( @@ -245,7 +245,7 @@ def sample_create_migration_workflow(): ) # Make the request - response = client.create_migration_workflow(request=request) + response = await client.create_migration_workflow(request=request) # Handle the response print(response) @@ -341,9 +341,9 @@ async def get_migration_workflow( from google.cloud import bigquery_migration_v2 - def sample_get_migration_workflow(): + async def sample_get_migration_workflow(): # Create a client - client = bigquery_migration_v2.MigrationServiceClient() + client = bigquery_migration_v2.MigrationServiceAsyncClient() # Initialize request argument(s) request = bigquery_migration_v2.GetMigrationWorkflowRequest( @@ -351,7 +351,7 @@ def sample_get_migration_workflow(): ) # Make the request - response = client.get_migration_workflow(request=request) + response = await client.get_migration_workflow(request=request) # Handle the response print(response) @@ -447,9 +447,9 @@ async def list_migration_workflows( from google.cloud import bigquery_migration_v2 - def sample_list_migration_workflows(): + async def sample_list_migration_workflows(): # Create a client - client = bigquery_migration_v2.MigrationServiceClient() + client = bigquery_migration_v2.MigrationServiceAsyncClient() # Initialize request argument(s) request = bigquery_migration_v2.ListMigrationWorkflowsRequest( @@ -460,7 +460,7 @@ def sample_list_migration_workflows(): page_result = client.list_migration_workflows(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -564,9 +564,9 @@ async def delete_migration_workflow( from google.cloud import bigquery_migration_v2 - def sample_delete_migration_workflow(): + async def sample_delete_migration_workflow(): # Create a client - client = bigquery_migration_v2.MigrationServiceClient() + client = bigquery_migration_v2.MigrationServiceAsyncClient() # Initialize request argument(s) request = bigquery_migration_v2.DeleteMigrationWorkflowRequest( @@ -574,7 +574,7 @@ def sample_delete_migration_workflow(): ) # Make the request - client.delete_migration_workflow(request=request) + await client.delete_migration_workflow(request=request) Args: request (Union[google.cloud.bigquery_migration_v2.types.DeleteMigrationWorkflowRequest, dict]): @@ -652,9 +652,9 @@ async def start_migration_workflow( from google.cloud import bigquery_migration_v2 - def sample_start_migration_workflow(): + async def sample_start_migration_workflow(): # Create a client - client = bigquery_migration_v2.MigrationServiceClient() + client = bigquery_migration_v2.MigrationServiceAsyncClient() # Initialize request argument(s) request = bigquery_migration_v2.StartMigrationWorkflowRequest( @@ -662,7 +662,7 @@ def sample_start_migration_workflow(): ) # Make the request - client.start_migration_workflow(request=request) + await client.start_migration_workflow(request=request) Args: request (Union[google.cloud.bigquery_migration_v2.types.StartMigrationWorkflowRequest, dict]): @@ -745,9 +745,9 @@ async def get_migration_subtask( from google.cloud import bigquery_migration_v2 - def sample_get_migration_subtask(): + async def sample_get_migration_subtask(): # Create a client - client = bigquery_migration_v2.MigrationServiceClient() + client = bigquery_migration_v2.MigrationServiceAsyncClient() # Initialize request argument(s) request = bigquery_migration_v2.GetMigrationSubtaskRequest( @@ -755,7 +755,7 @@ def sample_get_migration_subtask(): ) # Make the request - response = client.get_migration_subtask(request=request) + response = await client.get_migration_subtask(request=request) # Handle the response print(response) @@ -845,9 +845,9 @@ async def list_migration_subtasks( from google.cloud import bigquery_migration_v2 - def sample_list_migration_subtasks(): + async def sample_list_migration_subtasks(): # Create a client - client = bigquery_migration_v2.MigrationServiceClient() + client = bigquery_migration_v2.MigrationServiceAsyncClient() # Initialize request argument(s) request = bigquery_migration_v2.ListMigrationSubtasksRequest( @@ -858,7 +858,7 @@ def sample_list_migration_subtasks(): page_result = client.list_migration_subtasks(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/google/cloud/bigquery_migration_v2alpha/services/migration_service/async_client.py b/google/cloud/bigquery_migration_v2alpha/services/migration_service/async_client.py index 39a6f61..2bb9922 100644 --- a/google/cloud/bigquery_migration_v2alpha/services/migration_service/async_client.py +++ b/google/cloud/bigquery_migration_v2alpha/services/migration_service/async_client.py @@ -235,9 +235,9 @@ async def create_migration_workflow( from google.cloud import bigquery_migration_v2alpha - def sample_create_migration_workflow(): + async def sample_create_migration_workflow(): # Create a client - client = bigquery_migration_v2alpha.MigrationServiceClient() + client = bigquery_migration_v2alpha.MigrationServiceAsyncClient() # Initialize request argument(s) request = bigquery_migration_v2alpha.CreateMigrationWorkflowRequest( @@ -245,7 +245,7 @@ def sample_create_migration_workflow(): ) # Make the request - response = client.create_migration_workflow(request=request) + response = await client.create_migration_workflow(request=request) # Handle the response print(response) @@ -341,9 +341,9 @@ async def get_migration_workflow( from google.cloud import bigquery_migration_v2alpha - def sample_get_migration_workflow(): + async def sample_get_migration_workflow(): # Create a client - client = bigquery_migration_v2alpha.MigrationServiceClient() + client = bigquery_migration_v2alpha.MigrationServiceAsyncClient() # Initialize request argument(s) request = bigquery_migration_v2alpha.GetMigrationWorkflowRequest( @@ -351,7 +351,7 @@ def sample_get_migration_workflow(): ) # Make the request - response = client.get_migration_workflow(request=request) + response = await client.get_migration_workflow(request=request) # Handle the response print(response) @@ -447,9 +447,9 @@ async def list_migration_workflows( from google.cloud import bigquery_migration_v2alpha - def sample_list_migration_workflows(): + async def sample_list_migration_workflows(): # Create a client - client = bigquery_migration_v2alpha.MigrationServiceClient() + client = bigquery_migration_v2alpha.MigrationServiceAsyncClient() # Initialize request argument(s) request = bigquery_migration_v2alpha.ListMigrationWorkflowsRequest( @@ -460,7 +460,7 @@ def sample_list_migration_workflows(): page_result = client.list_migration_workflows(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -564,9 +564,9 @@ async def delete_migration_workflow( from google.cloud import bigquery_migration_v2alpha - def sample_delete_migration_workflow(): + async def sample_delete_migration_workflow(): # Create a client - client = bigquery_migration_v2alpha.MigrationServiceClient() + client = bigquery_migration_v2alpha.MigrationServiceAsyncClient() # Initialize request argument(s) request = bigquery_migration_v2alpha.DeleteMigrationWorkflowRequest( @@ -574,7 +574,7 @@ def sample_delete_migration_workflow(): ) # Make the request - client.delete_migration_workflow(request=request) + await client.delete_migration_workflow(request=request) Args: request (Union[google.cloud.bigquery_migration_v2alpha.types.DeleteMigrationWorkflowRequest, dict]): @@ -652,9 +652,9 @@ async def start_migration_workflow( from google.cloud import bigquery_migration_v2alpha - def sample_start_migration_workflow(): + async def sample_start_migration_workflow(): # Create a client - client = bigquery_migration_v2alpha.MigrationServiceClient() + client = bigquery_migration_v2alpha.MigrationServiceAsyncClient() # Initialize request argument(s) request = bigquery_migration_v2alpha.StartMigrationWorkflowRequest( @@ -662,7 +662,7 @@ def sample_start_migration_workflow(): ) # Make the request - client.start_migration_workflow(request=request) + await client.start_migration_workflow(request=request) Args: request (Union[google.cloud.bigquery_migration_v2alpha.types.StartMigrationWorkflowRequest, dict]): @@ -745,9 +745,9 @@ async def get_migration_subtask( from google.cloud import bigquery_migration_v2alpha - def sample_get_migration_subtask(): + async def sample_get_migration_subtask(): # Create a client - client = bigquery_migration_v2alpha.MigrationServiceClient() + client = bigquery_migration_v2alpha.MigrationServiceAsyncClient() # Initialize request argument(s) request = bigquery_migration_v2alpha.GetMigrationSubtaskRequest( @@ -755,7 +755,7 @@ def sample_get_migration_subtask(): ) # Make the request - response = client.get_migration_subtask(request=request) + response = await client.get_migration_subtask(request=request) # Handle the response print(response) @@ -854,9 +854,9 @@ async def list_migration_subtasks( from google.cloud import bigquery_migration_v2alpha - def sample_list_migration_subtasks(): + async def sample_list_migration_subtasks(): # Create a client - client = bigquery_migration_v2alpha.MigrationServiceClient() + client = bigquery_migration_v2alpha.MigrationServiceAsyncClient() # Initialize request argument(s) request = bigquery_migration_v2alpha.ListMigrationSubtasksRequest( @@ -867,7 +867,7 @@ def sample_list_migration_subtasks(): page_result = client.list_migration_subtasks(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/tests/unit/gapic/bigquery_migration_v2/test_migration_service.py b/tests/unit/gapic/bigquery_migration_v2/test_migration_service.py index c68e4e8..33cec52 100644 --- a/tests/unit/gapic/bigquery_migration_v2/test_migration_service.py +++ b/tests/unit/gapic/bigquery_migration_v2/test_migration_service.py @@ -780,7 +780,7 @@ def test_create_migration_workflow_field_headers(): # a field header. Set these to a non-empty value. request = migration_service.CreateMigrationWorkflowRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -798,7 +798,7 @@ def test_create_migration_workflow_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -812,7 +812,7 @@ async def test_create_migration_workflow_field_headers_async(): # a field header. Set these to a non-empty value. request = migration_service.CreateMigrationWorkflowRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -832,7 +832,7 @@ async def test_create_migration_workflow_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1045,7 +1045,7 @@ def test_get_migration_workflow_field_headers(): # a field header. Set these to a non-empty value. request = migration_service.GetMigrationWorkflowRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1063,7 +1063,7 @@ def test_get_migration_workflow_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1077,7 +1077,7 @@ async def test_get_migration_workflow_field_headers_async(): # a field header. Set these to a non-empty value. request = migration_service.GetMigrationWorkflowRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1097,7 +1097,7 @@ async def test_get_migration_workflow_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1292,7 +1292,7 @@ def test_list_migration_workflows_field_headers(): # a field header. Set these to a non-empty value. request = migration_service.ListMigrationWorkflowsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1310,7 +1310,7 @@ def test_list_migration_workflows_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1324,7 +1324,7 @@ async def test_list_migration_workflows_field_headers_async(): # a field header. Set these to a non-empty value. request = migration_service.ListMigrationWorkflowsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1344,7 +1344,7 @@ async def test_list_migration_workflows_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1481,7 +1481,7 @@ def test_list_migration_workflows_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, migration_entities.MigrationWorkflow) for i in results) @@ -1729,7 +1729,7 @@ def test_delete_migration_workflow_field_headers(): # a field header. Set these to a non-empty value. request = migration_service.DeleteMigrationWorkflowRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1747,7 +1747,7 @@ def test_delete_migration_workflow_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1761,7 +1761,7 @@ async def test_delete_migration_workflow_field_headers_async(): # a field header. Set these to a non-empty value. request = migration_service.DeleteMigrationWorkflowRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1779,7 +1779,7 @@ async def test_delete_migration_workflow_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1964,7 +1964,7 @@ def test_start_migration_workflow_field_headers(): # a field header. Set these to a non-empty value. request = migration_service.StartMigrationWorkflowRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1982,7 +1982,7 @@ def test_start_migration_workflow_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1996,7 +1996,7 @@ async def test_start_migration_workflow_field_headers_async(): # a field header. Set these to a non-empty value. request = migration_service.StartMigrationWorkflowRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2014,7 +2014,7 @@ async def test_start_migration_workflow_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2223,7 +2223,7 @@ def test_get_migration_subtask_field_headers(): # a field header. Set these to a non-empty value. request = migration_service.GetMigrationSubtaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2241,7 +2241,7 @@ def test_get_migration_subtask_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2255,7 +2255,7 @@ async def test_get_migration_subtask_field_headers_async(): # a field header. Set these to a non-empty value. request = migration_service.GetMigrationSubtaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2275,7 +2275,7 @@ async def test_get_migration_subtask_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2470,7 +2470,7 @@ def test_list_migration_subtasks_field_headers(): # a field header. Set these to a non-empty value. request = migration_service.ListMigrationSubtasksRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2488,7 +2488,7 @@ def test_list_migration_subtasks_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2502,7 +2502,7 @@ async def test_list_migration_subtasks_field_headers_async(): # a field header. Set these to a non-empty value. request = migration_service.ListMigrationSubtasksRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2522,7 +2522,7 @@ async def test_list_migration_subtasks_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2659,7 +2659,7 @@ def test_list_migration_subtasks_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, migration_entities.MigrationSubtask) for i in results) diff --git a/tests/unit/gapic/bigquery_migration_v2alpha/test_migration_service.py b/tests/unit/gapic/bigquery_migration_v2alpha/test_migration_service.py index bb22bbb..59b17f6 100644 --- a/tests/unit/gapic/bigquery_migration_v2alpha/test_migration_service.py +++ b/tests/unit/gapic/bigquery_migration_v2alpha/test_migration_service.py @@ -782,7 +782,7 @@ def test_create_migration_workflow_field_headers(): # a field header. Set these to a non-empty value. request = migration_service.CreateMigrationWorkflowRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -800,7 +800,7 @@ def test_create_migration_workflow_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -814,7 +814,7 @@ async def test_create_migration_workflow_field_headers_async(): # a field header. Set these to a non-empty value. request = migration_service.CreateMigrationWorkflowRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -834,7 +834,7 @@ async def test_create_migration_workflow_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1047,7 +1047,7 @@ def test_get_migration_workflow_field_headers(): # a field header. Set these to a non-empty value. request = migration_service.GetMigrationWorkflowRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1065,7 +1065,7 @@ def test_get_migration_workflow_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1079,7 +1079,7 @@ async def test_get_migration_workflow_field_headers_async(): # a field header. Set these to a non-empty value. request = migration_service.GetMigrationWorkflowRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1099,7 +1099,7 @@ async def test_get_migration_workflow_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1294,7 +1294,7 @@ def test_list_migration_workflows_field_headers(): # a field header. Set these to a non-empty value. request = migration_service.ListMigrationWorkflowsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1312,7 +1312,7 @@ def test_list_migration_workflows_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1326,7 +1326,7 @@ async def test_list_migration_workflows_field_headers_async(): # a field header. Set these to a non-empty value. request = migration_service.ListMigrationWorkflowsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1346,7 +1346,7 @@ async def test_list_migration_workflows_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1483,7 +1483,7 @@ def test_list_migration_workflows_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, migration_entities.MigrationWorkflow) for i in results) @@ -1731,7 +1731,7 @@ def test_delete_migration_workflow_field_headers(): # a field header. Set these to a non-empty value. request = migration_service.DeleteMigrationWorkflowRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1749,7 +1749,7 @@ def test_delete_migration_workflow_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1763,7 +1763,7 @@ async def test_delete_migration_workflow_field_headers_async(): # a field header. Set these to a non-empty value. request = migration_service.DeleteMigrationWorkflowRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1781,7 +1781,7 @@ async def test_delete_migration_workflow_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1966,7 +1966,7 @@ def test_start_migration_workflow_field_headers(): # a field header. Set these to a non-empty value. request = migration_service.StartMigrationWorkflowRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1984,7 +1984,7 @@ def test_start_migration_workflow_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1998,7 +1998,7 @@ async def test_start_migration_workflow_field_headers_async(): # a field header. Set these to a non-empty value. request = migration_service.StartMigrationWorkflowRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2016,7 +2016,7 @@ async def test_start_migration_workflow_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2225,7 +2225,7 @@ def test_get_migration_subtask_field_headers(): # a field header. Set these to a non-empty value. request = migration_service.GetMigrationSubtaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2243,7 +2243,7 @@ def test_get_migration_subtask_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2257,7 +2257,7 @@ async def test_get_migration_subtask_field_headers_async(): # a field header. Set these to a non-empty value. request = migration_service.GetMigrationSubtaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2277,7 +2277,7 @@ async def test_get_migration_subtask_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2472,7 +2472,7 @@ def test_list_migration_subtasks_field_headers(): # a field header. Set these to a non-empty value. request = migration_service.ListMigrationSubtasksRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2490,7 +2490,7 @@ def test_list_migration_subtasks_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2504,7 +2504,7 @@ async def test_list_migration_subtasks_field_headers_async(): # a field header. Set these to a non-empty value. request = migration_service.ListMigrationSubtasksRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2524,7 +2524,7 @@ async def test_list_migration_subtasks_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2661,7 +2661,7 @@ def test_list_migration_subtasks_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, migration_entities.MigrationSubtask) for i in results) From aa88973e330be7d37681154240ee6db3954dc76e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 5 May 2022 12:20:22 -0400 Subject: [PATCH 7/9] chore: [autoapprove] update readme_gen.py to include autoescape True (#68) Source-Link: https://github.com/googleapis/synthtool/commit/6b4d5a6407d740beb4158b302194a62a4108a8a6 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:f792ee1320e03eda2d13a5281a2989f7ed8a9e50b73ef6da97fac7e1e850b149 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- scripts/readme-gen/readme_gen.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 64f82d6..b631901 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd -# created: 2022-04-21T15:43:16.246106921Z + digest: sha256:f792ee1320e03eda2d13a5281a2989f7ed8a9e50b73ef6da97fac7e1e850b149 +# created: 2022-05-05T15:17:27.599381182Z diff --git a/scripts/readme-gen/readme_gen.py b/scripts/readme-gen/readme_gen.py index d309d6e..91b5967 100644 --- a/scripts/readme-gen/readme_gen.py +++ b/scripts/readme-gen/readme_gen.py @@ -28,7 +28,10 @@ jinja_env = jinja2.Environment( trim_blocks=True, loader=jinja2.FileSystemLoader( - os.path.abspath(os.path.join(os.path.dirname(__file__), 'templates')))) + os.path.abspath(os.path.join(os.path.dirname(__file__), "templates")) + ), + autoescape=True, +) README_TMPL = jinja_env.get_template('README.tmpl.rst') From 3404ccbfec8b6178cbfc4c41c3aa55e9b18a9907 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 5 May 2022 23:56:16 +0000 Subject: [PATCH 8/9] chore(python): auto approve template changes (#70) Source-Link: https://github.com/googleapis/synthtool/commit/453a5d9c9a55d1969240a37d36cec626d20a9024 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32 --- .github/.OwlBot.lock.yaml | 4 ++-- .github/auto-approve.yml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .github/auto-approve.yml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index b631901..757c9dc 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:f792ee1320e03eda2d13a5281a2989f7ed8a9e50b73ef6da97fac7e1e850b149 -# created: 2022-05-05T15:17:27.599381182Z + digest: sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32 +# created: 2022-05-05T22:08:23.383410683Z diff --git a/.github/auto-approve.yml b/.github/auto-approve.yml new file mode 100644 index 0000000..311ebbb --- /dev/null +++ b/.github/auto-approve.yml @@ -0,0 +1,3 @@ +# https://github.com/googleapis/repo-automation-bots/tree/main/packages/auto-approve +processes: + - "OwlBotTemplateChanges" From 40051220274571786aac147357b4d72b9d4be544 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 19 May 2022 09:45:08 -0400 Subject: [PATCH 9/9] chore(main): release 0.4.1 (#62) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7126dc..f00b4e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [0.4.1](https://github.com/googleapis/python-bigquery-migration/compare/v0.4.0...v0.4.1) (2022-05-05) + + +### Documentation + +* fix type in docstring for map fields ([6c5982b](https://github.com/googleapis/python-bigquery-migration/commit/6c5982bf2fcc0d90d6a6951a7dd676e9b7974627)) + ## [0.4.0](https://github.com/googleapis/python-bigquery-migration/compare/v0.3.1...v0.4.0) (2022-04-03) diff --git a/setup.py b/setup.py index e2d2f55..616263c 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ import setuptools # type: ignore -version = "0.4.0" +version = "0.4.1" package_root = os.path.abspath(os.path.dirname(__file__))