From 25c47a8433050c1cfcdf033dff16b3dcaedb1a9b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 7 Dec 2022 10:50:14 -0500 Subject: [PATCH] fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#320) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(deps): Require google-api-core >=1.34.0, >=2.11.0 fix: Drop usage of pkg_resources fix: Fix timeout default values docs(samples): Snippetgen should call await on the operation coroutine before calling result PiperOrigin-RevId: 493260409 Source-Link: https://github.com/googleapis/googleapis/commit/fea43879f83a8d0dacc9353b3f75f8f46d37162f Source-Link: https://github.com/googleapis/googleapis-gen/commit/387b7344c7529ee44be84e613b19a820508c612b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add gapic_version.py Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- .coveragerc | 5 -- google/cloud/container_v1/gapic_version.py | 16 ++++ .../services/cluster_manager/async_client.py | 80 +++++++++--------- .../services/cluster_manager/client.py | 80 +++++++++--------- .../cluster_manager/transports/base.py | 13 +-- .../cloud/container_v1beta1/gapic_version.py | 16 ++++ .../services/cluster_manager/async_client.py | 82 +++++++++---------- .../services/cluster_manager/client.py | 82 +++++++++---------- .../cluster_manager/transports/base.py | 13 +-- release-please-config.json | 2 + setup.py | 2 +- testing/constraints-3.7.txt | 2 +- 12 files changed, 198 insertions(+), 195 deletions(-) create mode 100644 google/cloud/container_v1/gapic_version.py create mode 100644 google/cloud/container_v1beta1/gapic_version.py diff --git a/.coveragerc b/.coveragerc index 827eb6ba..d1af5fa4 100644 --- a/.coveragerc +++ b/.coveragerc @@ -10,8 +10,3 @@ exclude_lines = pragma: NO COVER # Ignore debug-only repr def __repr__ - # Ignore pkg_resources exceptions. - # This is added at the module level as a safeguard for if someone - # generates the code and tries to run it without pip installing. This - # makes it virtually impossible to test properly. - except pkg_resources.DistributionNotFound diff --git a/google/cloud/container_v1/gapic_version.py b/google/cloud/container_v1/gapic_version.py new file mode 100644 index 00000000..a3c92559 --- /dev/null +++ b/google/cloud/container_v1/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "2.13.0" # {x-release-please-version} diff --git a/google/cloud/container_v1/services/cluster_manager/async_client.py b/google/cloud/container_v1/services/cluster_manager/async_client.py index 96402641..55c87752 100644 --- a/google/cloud/container_v1/services/cluster_manager/async_client.py +++ b/google/cloud/container_v1/services/cluster_manager/async_client.py @@ -35,7 +35,8 @@ 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 + +from google.cloud.container_v1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -224,7 +225,7 @@ async def list_clusters( zone: Optional[str] = None, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.ListClustersResponse: r"""Lists all clusters owned by a project in either the @@ -364,7 +365,7 @@ async def get_cluster( cluster_id: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Cluster: r"""Gets the details of a specific cluster. @@ -511,7 +512,7 @@ async def create_cluster( cluster: Optional[cluster_service.Cluster] = None, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Creates a cluster, consisting of the specified number and type @@ -663,7 +664,7 @@ async def update_cluster( update: Optional[cluster_service.ClusterUpdate] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Updates the settings of a specific cluster. @@ -809,7 +810,7 @@ async def update_node_pool( request: Optional[Union[cluster_service.UpdateNodePoolRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Updates the version and/or image type for the @@ -895,7 +896,7 @@ async def set_node_pool_autoscaling( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the autoscaling settings for the specified node @@ -982,7 +983,7 @@ async def set_logging_service( logging_service: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the logging service for a specific cluster. @@ -1150,7 +1151,7 @@ async def set_monitoring_service( monitoring_service: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the monitoring service for a specific cluster. @@ -1318,7 +1319,7 @@ async def set_addons_config( addons_config: Optional[cluster_service.AddonsConfig] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the addons for a specific cluster. @@ -1470,7 +1471,7 @@ async def set_locations( locations: Optional[MutableSequence[str]] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the locations for a specific cluster. Deprecated. Use @@ -1635,7 +1636,7 @@ async def update_master( master_version: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Updates the master for a specific cluster. @@ -1794,7 +1795,7 @@ async def set_master_auth( request: Optional[Union[cluster_service.SetMasterAuthRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets master auth materials. Currently supports @@ -1883,7 +1884,7 @@ async def delete_cluster( cluster_id: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Deletes the cluster, including the Kubernetes @@ -2041,7 +2042,7 @@ async def list_operations( project_id: Optional[str] = None, zone: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.ListOperationsResponse: r"""Lists all operations in a project in a specific zone @@ -2171,7 +2172,7 @@ async def get_operation( operation_id: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Gets the specified operation. @@ -2321,7 +2322,7 @@ async def cancel_operation( operation_id: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Cancels the specified operation. @@ -2446,7 +2447,7 @@ async def get_server_config( zone: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.ServerConfig: r"""Returns configuration info about the Google @@ -2580,7 +2581,7 @@ async def get_json_web_keys( request: Optional[Union[cluster_service.GetJSONWebKeysRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.GetJSONWebKeysResponse: r"""Gets the public component of the cluster signing keys @@ -2670,7 +2671,7 @@ async def list_node_pools( cluster_id: Optional[str] = None, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.ListNodePoolsResponse: r"""Lists the node pools for a cluster. @@ -2819,7 +2820,7 @@ async def get_node_pool( node_pool_id: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.NodePool: r"""Retrieves the requested node pool. @@ -2986,7 +2987,7 @@ async def create_node_pool( node_pool: Optional[cluster_service.NodePool] = None, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Creates a node pool for a cluster. @@ -3134,7 +3135,7 @@ async def delete_node_pool( node_pool_id: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Deletes a node pool from a cluster. @@ -3293,7 +3294,7 @@ async def complete_node_pool_upgrade( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""CompleteNodePoolUpgrade will signal an on-going node @@ -3368,7 +3369,7 @@ async def rollback_node_pool_upgrade( node_pool_id: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Rolls back a previously Aborted or Failed NodePool @@ -3523,7 +3524,7 @@ async def set_node_pool_management( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the NodeManagement options for a node pool. @@ -3604,7 +3605,7 @@ async def set_labels( request: Optional[Union[cluster_service.SetLabelsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets labels on a cluster. @@ -3693,7 +3694,7 @@ async def set_legacy_abac( enabled: Optional[bool] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Enables or disables the ABAC authorization mechanism @@ -3845,7 +3846,7 @@ async def start_ip_rotation( cluster_id: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Starts master IP rotation. @@ -3988,7 +3989,7 @@ async def complete_ip_rotation( cluster_id: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Completes master IP rotation. @@ -4124,7 +4125,7 @@ async def set_node_pool_size( request: Optional[Union[cluster_service.SetNodePoolSizeRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the size for a specific node pool. The new size will be @@ -4214,7 +4215,7 @@ async def set_network_policy( network_policy: Optional[cluster_service.NetworkPolicy] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Enables or disables Network Policy for a cluster. @@ -4366,7 +4367,7 @@ async def set_maintenance_policy( maintenance_policy: Optional[cluster_service.MaintenancePolicy] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the maintenance policy for a cluster. @@ -4515,7 +4516,7 @@ async def list_usable_subnetworks( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListUsableSubnetworksAsyncPager: r"""Lists subnetworks that are usable for creating @@ -4613,14 +4614,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-container", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ClusterManagerAsyncClient",) diff --git a/google/cloud/container_v1/services/cluster_manager/client.py b/google/cloud/container_v1/services/cluster_manager/client.py index bb233426..6d5e6274 100644 --- a/google/cloud/container_v1/services/cluster_manager/client.py +++ b/google/cloud/container_v1/services/cluster_manager/client.py @@ -39,7 +39,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.container_v1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -446,7 +447,7 @@ def list_clusters( zone: Optional[str] = None, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.ListClustersResponse: r"""Lists all clusters owned by a project in either the @@ -576,7 +577,7 @@ def get_cluster( cluster_id: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Cluster: r"""Gets the details of a specific cluster. @@ -713,7 +714,7 @@ def create_cluster( cluster: Optional[cluster_service.Cluster] = None, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Creates a cluster, consisting of the specified number and type @@ -865,7 +866,7 @@ def update_cluster( update: Optional[cluster_service.ClusterUpdate] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Updates the settings of a specific cluster. @@ -1011,7 +1012,7 @@ def update_node_pool( request: Optional[Union[cluster_service.UpdateNodePoolRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Updates the version and/or image type for the @@ -1098,7 +1099,7 @@ def set_node_pool_autoscaling( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the autoscaling settings for the specified node @@ -1188,7 +1189,7 @@ def set_logging_service( logging_service: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the logging service for a specific cluster. @@ -1356,7 +1357,7 @@ def set_monitoring_service( monitoring_service: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the monitoring service for a specific cluster. @@ -1524,7 +1525,7 @@ def set_addons_config( addons_config: Optional[cluster_service.AddonsConfig] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the addons for a specific cluster. @@ -1676,7 +1677,7 @@ def set_locations( locations: Optional[MutableSequence[str]] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the locations for a specific cluster. Deprecated. Use @@ -1841,7 +1842,7 @@ def update_master( master_version: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Updates the master for a specific cluster. @@ -2000,7 +2001,7 @@ def set_master_auth( request: Optional[Union[cluster_service.SetMasterAuthRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets master auth materials. Currently supports @@ -2090,7 +2091,7 @@ def delete_cluster( cluster_id: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Deletes the cluster, including the Kubernetes @@ -2238,7 +2239,7 @@ def list_operations( project_id: Optional[str] = None, zone: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.ListOperationsResponse: r"""Lists all operations in a project in a specific zone @@ -2358,7 +2359,7 @@ def get_operation( operation_id: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Gets the specified operation. @@ -2498,7 +2499,7 @@ def cancel_operation( operation_id: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Cancels the specified operation. @@ -2623,7 +2624,7 @@ def get_server_config( zone: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.ServerConfig: r"""Returns configuration info about the Google @@ -2747,7 +2748,7 @@ def get_json_web_keys( request: Optional[Union[cluster_service.GetJSONWebKeysRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.GetJSONWebKeysResponse: r"""Gets the public component of the cluster signing keys @@ -2838,7 +2839,7 @@ def list_node_pools( cluster_id: Optional[str] = None, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.ListNodePoolsResponse: r"""Lists the node pools for a cluster. @@ -2977,7 +2978,7 @@ def get_node_pool( node_pool_id: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.NodePool: r"""Retrieves the requested node pool. @@ -3134,7 +3135,7 @@ def create_node_pool( node_pool: Optional[cluster_service.NodePool] = None, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Creates a node pool for a cluster. @@ -3282,7 +3283,7 @@ def delete_node_pool( node_pool_id: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Deletes a node pool from a cluster. @@ -3431,7 +3432,7 @@ def complete_node_pool_upgrade( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""CompleteNodePoolUpgrade will signal an on-going node @@ -3509,7 +3510,7 @@ def rollback_node_pool_upgrade( node_pool_id: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Rolls back a previously Aborted or Failed NodePool @@ -3666,7 +3667,7 @@ def set_node_pool_management( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the NodeManagement options for a node pool. @@ -3748,7 +3749,7 @@ def set_labels( request: Optional[Union[cluster_service.SetLabelsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets labels on a cluster. @@ -3838,7 +3839,7 @@ def set_legacy_abac( enabled: Optional[bool] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Enables or disables the ABAC authorization mechanism @@ -3990,7 +3991,7 @@ def start_ip_rotation( cluster_id: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Starts master IP rotation. @@ -4133,7 +4134,7 @@ def complete_ip_rotation( cluster_id: Optional[str] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Completes master IP rotation. @@ -4269,7 +4270,7 @@ def set_node_pool_size( request: Optional[Union[cluster_service.SetNodePoolSizeRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the size for a specific node pool. The new size will be @@ -4360,7 +4361,7 @@ def set_network_policy( network_policy: Optional[cluster_service.NetworkPolicy] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Enables or disables Network Policy for a cluster. @@ -4512,7 +4513,7 @@ def set_maintenance_policy( maintenance_policy: Optional[cluster_service.MaintenancePolicy] = None, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the maintenance policy for a cluster. @@ -4661,7 +4662,7 @@ def list_usable_subnetworks( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListUsableSubnetworksPager: r"""Lists subnetworks that are usable for creating @@ -4767,14 +4768,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-container", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ClusterManagerClient",) diff --git a/google/cloud/container_v1/services/cluster_manager/transports/base.py b/google/cloud/container_v1/services/cluster_manager/transports/base.py index 9ea536a0..2c4a4aee 100644 --- a/google/cloud/container_v1/services/cluster_manager/transports/base.py +++ b/google/cloud/container_v1/services/cluster_manager/transports/base.py @@ -24,18 +24,13 @@ from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.container_v1 import gapic_version as package_version from google.cloud.container_v1.types import cluster_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-container", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class ClusterManagerTransport(abc.ABC): diff --git a/google/cloud/container_v1beta1/gapic_version.py b/google/cloud/container_v1beta1/gapic_version.py new file mode 100644 index 00000000..a3c92559 --- /dev/null +++ b/google/cloud/container_v1beta1/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "2.13.0" # {x-release-please-version} diff --git a/google/cloud/container_v1beta1/services/cluster_manager/async_client.py b/google/cloud/container_v1beta1/services/cluster_manager/async_client.py index d0284751..760e7065 100644 --- a/google/cloud/container_v1beta1/services/cluster_manager/async_client.py +++ b/google/cloud/container_v1beta1/services/cluster_manager/async_client.py @@ -35,7 +35,8 @@ 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 + +from google.cloud.container_v1beta1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -223,7 +224,7 @@ async def list_clusters( project_id: Optional[str] = None, zone: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.ListClustersResponse: r"""Lists all clusters owned by a project in either the @@ -354,7 +355,7 @@ async def get_cluster( zone: Optional[str] = None, cluster_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Cluster: r"""Gets the details for a specific cluster. @@ -494,7 +495,7 @@ async def create_cluster( zone: Optional[str] = None, cluster: Optional[cluster_service.Cluster] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Creates a cluster, consisting of the specified number and type @@ -638,7 +639,7 @@ async def update_cluster( cluster_id: Optional[str] = None, update: Optional[cluster_service.ClusterUpdate] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Updates the settings for a specific cluster. @@ -778,7 +779,7 @@ async def update_node_pool( request: Optional[Union[cluster_service.UpdateNodePoolRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Updates the version and/or image type of a specific @@ -868,7 +869,7 @@ async def set_node_pool_autoscaling( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the autoscaling settings of a specific node @@ -958,7 +959,7 @@ async def set_logging_service( cluster_id: Optional[str] = None, logging_service: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the logging service for a specific cluster. @@ -1117,7 +1118,7 @@ async def set_monitoring_service( cluster_id: Optional[str] = None, monitoring_service: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the monitoring service for a specific cluster. @@ -1276,7 +1277,7 @@ async def set_addons_config( cluster_id: Optional[str] = None, addons_config: Optional[cluster_service.AddonsConfig] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the addons for a specific cluster. @@ -1421,7 +1422,7 @@ async def set_locations( cluster_id: Optional[str] = None, locations: Optional[MutableSequence[str]] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the locations for a specific cluster. Deprecated. Use @@ -1579,7 +1580,7 @@ async def update_master( cluster_id: Optional[str] = None, master_version: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Updates the master for a specific cluster. @@ -1732,7 +1733,7 @@ async def set_master_auth( request: Optional[Union[cluster_service.SetMasterAuthRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets master auth materials. Currently supports @@ -1823,7 +1824,7 @@ async def delete_cluster( zone: Optional[str] = None, cluster_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Deletes the cluster, including the Kubernetes @@ -1975,7 +1976,7 @@ async def list_operations( project_id: Optional[str] = None, zone: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.ListOperationsResponse: r"""Lists all operations in a project in the specified @@ -2107,7 +2108,7 @@ async def get_operation( zone: Optional[str] = None, operation_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Gets the specified operation. @@ -2250,7 +2251,7 @@ async def cancel_operation( zone: Optional[str] = None, operation_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Cancels the specified operation. @@ -2368,7 +2369,7 @@ async def get_server_config( project_id: Optional[str] = None, zone: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.ServerConfig: r"""Returns configuration info about the Google @@ -2499,7 +2500,7 @@ async def list_node_pools( zone: Optional[str] = None, cluster_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.ListNodePoolsResponse: r"""Lists the node pools for a cluster. @@ -2637,7 +2638,7 @@ async def get_json_web_keys( request: Optional[Union[cluster_service.GetJSONWebKeysRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.GetJSONWebKeysResponse: r"""Gets the public component of the cluster signing keys @@ -2727,7 +2728,7 @@ async def get_node_pool( cluster_id: Optional[str] = None, node_pool_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.NodePool: r"""Retrieves the requested node pool. @@ -2922,7 +2923,7 @@ async def create_node_pool( cluster_id: Optional[str] = None, node_pool: Optional[cluster_service.NodePool] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Creates a node pool for a cluster. @@ -3063,7 +3064,7 @@ async def delete_node_pool( cluster_id: Optional[str] = None, node_pool_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Deletes a node pool from a cluster. @@ -3217,7 +3218,7 @@ async def complete_node_pool_upgrade( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""CompleteNodePoolUpgrade will signal an on-going node @@ -3291,7 +3292,7 @@ async def rollback_node_pool_upgrade( cluster_id: Optional[str] = None, node_pool_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Rolls back a previously Aborted or Failed NodePool @@ -3445,7 +3446,7 @@ async def set_node_pool_management( node_pool_id: Optional[str] = None, management: Optional[cluster_service.NodeManagement] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the NodeManagement options for a node pool. @@ -3604,7 +3605,7 @@ async def set_labels( resource_labels: Optional[MutableMapping[str, str]] = None, label_fingerprint: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets labels on a cluster. @@ -3768,7 +3769,7 @@ async def set_legacy_abac( cluster_id: Optional[str] = None, enabled: Optional[bool] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Enables or disables the ABAC authorization mechanism @@ -3913,7 +3914,7 @@ async def start_ip_rotation( zone: Optional[str] = None, cluster_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Starts master IP rotation. @@ -4049,7 +4050,7 @@ async def complete_ip_rotation( zone: Optional[str] = None, cluster_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Completes master IP rotation. @@ -4179,7 +4180,7 @@ async def set_node_pool_size( request: Optional[Union[cluster_service.SetNodePoolSizeRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""SetNodePoolSizeRequest sets the size of a node pool. The new @@ -4272,7 +4273,7 @@ async def set_network_policy( cluster_id: Optional[str] = None, network_policy: Optional[cluster_service.NetworkPolicy] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Enables or disables Network Policy for a cluster. @@ -4417,7 +4418,7 @@ async def set_maintenance_policy( cluster_id: Optional[str] = None, maintenance_policy: Optional[cluster_service.MaintenancePolicy] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the maintenance policy for a cluster. @@ -4555,7 +4556,7 @@ async def list_usable_subnetworks( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListUsableSubnetworksAsyncPager: r"""Lists subnetworks that can be used for creating @@ -4684,7 +4685,7 @@ async def list_locations( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.ListLocationsResponse: r"""Fetches locations that offer Google Kubernetes @@ -4799,14 +4800,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-container", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ClusterManagerAsyncClient",) diff --git a/google/cloud/container_v1beta1/services/cluster_manager/client.py b/google/cloud/container_v1beta1/services/cluster_manager/client.py index 32765e0a..e2f03357 100644 --- a/google/cloud/container_v1beta1/services/cluster_manager/client.py +++ b/google/cloud/container_v1beta1/services/cluster_manager/client.py @@ -39,7 +39,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.container_v1beta1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -445,7 +446,7 @@ def list_clusters( project_id: Optional[str] = None, zone: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.ListClustersResponse: r"""Lists all clusters owned by a project in either the @@ -566,7 +567,7 @@ def get_cluster( zone: Optional[str] = None, cluster_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Cluster: r"""Gets the details for a specific cluster. @@ -696,7 +697,7 @@ def create_cluster( zone: Optional[str] = None, cluster: Optional[cluster_service.Cluster] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Creates a cluster, consisting of the specified number and type @@ -840,7 +841,7 @@ def update_cluster( cluster_id: Optional[str] = None, update: Optional[cluster_service.ClusterUpdate] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Updates the settings for a specific cluster. @@ -980,7 +981,7 @@ def update_node_pool( request: Optional[Union[cluster_service.UpdateNodePoolRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Updates the version and/or image type of a specific @@ -1071,7 +1072,7 @@ def set_node_pool_autoscaling( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the autoscaling settings of a specific node @@ -1164,7 +1165,7 @@ def set_logging_service( cluster_id: Optional[str] = None, logging_service: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the logging service for a specific cluster. @@ -1323,7 +1324,7 @@ def set_monitoring_service( cluster_id: Optional[str] = None, monitoring_service: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the monitoring service for a specific cluster. @@ -1482,7 +1483,7 @@ def set_addons_config( cluster_id: Optional[str] = None, addons_config: Optional[cluster_service.AddonsConfig] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the addons for a specific cluster. @@ -1627,7 +1628,7 @@ def set_locations( cluster_id: Optional[str] = None, locations: Optional[MutableSequence[str]] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the locations for a specific cluster. Deprecated. Use @@ -1785,7 +1786,7 @@ def update_master( cluster_id: Optional[str] = None, master_version: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Updates the master for a specific cluster. @@ -1938,7 +1939,7 @@ def set_master_auth( request: Optional[Union[cluster_service.SetMasterAuthRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets master auth materials. Currently supports @@ -2030,7 +2031,7 @@ def delete_cluster( zone: Optional[str] = None, cluster_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Deletes the cluster, including the Kubernetes @@ -2172,7 +2173,7 @@ def list_operations( project_id: Optional[str] = None, zone: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.ListOperationsResponse: r"""Lists all operations in a project in the specified @@ -2294,7 +2295,7 @@ def get_operation( zone: Optional[str] = None, operation_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Gets the specified operation. @@ -2427,7 +2428,7 @@ def cancel_operation( zone: Optional[str] = None, operation_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Cancels the specified operation. @@ -2545,7 +2546,7 @@ def get_server_config( project_id: Optional[str] = None, zone: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.ServerConfig: r"""Returns configuration info about the Google @@ -2666,7 +2667,7 @@ def list_node_pools( zone: Optional[str] = None, cluster_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.ListNodePoolsResponse: r"""Lists the node pools for a cluster. @@ -2794,7 +2795,7 @@ def get_json_web_keys( request: Optional[Union[cluster_service.GetJSONWebKeysRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.GetJSONWebKeysResponse: r"""Gets the public component of the cluster signing keys @@ -2885,7 +2886,7 @@ def get_node_pool( cluster_id: Optional[str] = None, node_pool_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.NodePool: r"""Retrieves the requested node pool. @@ -3070,7 +3071,7 @@ def create_node_pool( cluster_id: Optional[str] = None, node_pool: Optional[cluster_service.NodePool] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Creates a node pool for a cluster. @@ -3211,7 +3212,7 @@ def delete_node_pool( cluster_id: Optional[str] = None, node_pool_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Deletes a node pool from a cluster. @@ -3355,7 +3356,7 @@ def complete_node_pool_upgrade( ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""CompleteNodePoolUpgrade will signal an on-going node @@ -3432,7 +3433,7 @@ def rollback_node_pool_upgrade( cluster_id: Optional[str] = None, node_pool_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Rolls back a previously Aborted or Failed NodePool @@ -3588,7 +3589,7 @@ def set_node_pool_management( node_pool_id: Optional[str] = None, management: Optional[cluster_service.NodeManagement] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the NodeManagement options for a node pool. @@ -3747,7 +3748,7 @@ def set_labels( resource_labels: Optional[MutableMapping[str, str]] = None, label_fingerprint: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets labels on a cluster. @@ -3910,7 +3911,7 @@ def set_legacy_abac( cluster_id: Optional[str] = None, enabled: Optional[bool] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Enables or disables the ABAC authorization mechanism @@ -4055,7 +4056,7 @@ def start_ip_rotation( zone: Optional[str] = None, cluster_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Starts master IP rotation. @@ -4191,7 +4192,7 @@ def complete_ip_rotation( zone: Optional[str] = None, cluster_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Completes master IP rotation. @@ -4321,7 +4322,7 @@ def set_node_pool_size( request: Optional[Union[cluster_service.SetNodePoolSizeRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""SetNodePoolSizeRequest sets the size of a node pool. The new @@ -4415,7 +4416,7 @@ def set_network_policy( cluster_id: Optional[str] = None, network_policy: Optional[cluster_service.NetworkPolicy] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Enables or disables Network Policy for a cluster. @@ -4560,7 +4561,7 @@ def set_maintenance_policy( cluster_id: Optional[str] = None, maintenance_policy: Optional[cluster_service.MaintenancePolicy] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.Operation: r"""Sets the maintenance policy for a cluster. @@ -4698,7 +4699,7 @@ def list_usable_subnetworks( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListUsableSubnetworksPager: r"""Lists subnetworks that can be used for creating @@ -4817,7 +4818,7 @@ def list_locations( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> cluster_service.ListLocationsResponse: r"""Fetches locations that offer Google Kubernetes @@ -4929,14 +4930,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-container", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ClusterManagerClient",) diff --git a/google/cloud/container_v1beta1/services/cluster_manager/transports/base.py b/google/cloud/container_v1beta1/services/cluster_manager/transports/base.py index 29b04471..2b3b65c2 100644 --- a/google/cloud/container_v1beta1/services/cluster_manager/transports/base.py +++ b/google/cloud/container_v1beta1/services/cluster_manager/transports/base.py @@ -24,18 +24,13 @@ from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.container_v1beta1 import gapic_version as package_version from google.cloud.container_v1beta1.types import cluster_service -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-container", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class ClusterManagerTransport(abc.ABC): diff --git a/release-please-config.json b/release-please-config.json index f6730a22..d6c76f20 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -4,6 +4,8 @@ ".": { "release-type": "python", "extra-files": [ + "google/cloud/container_v1/gapic_version.py", + "google/cloud/container_v1beta1/gapic_version.py", "google/cloud/container/gapic_version.py", { "type": "json", diff --git a/setup.py b/setup.py index af50b7c6..2b3fa71a 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 1.33.2, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*", + "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", "proto-plus >= 1.22.0, <2.0.0dev", "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", ] diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt index 6f3158cc..6c44adfe 100644 --- a/testing/constraints-3.7.txt +++ b/testing/constraints-3.7.txt @@ -4,6 +4,6 @@ # Pin the version to the lower bound. # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 -google-api-core==1.33.2 +google-api-core==1.34.0 proto-plus==1.22.0 protobuf==3.19.5