Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit 25c47a8

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#320)
* 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: googleapis/googleapis@fea4387 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 <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent 5072864 commit 25c47a8

File tree

12 files changed

+198
-195
lines changed

12 files changed

+198
-195
lines changed

.coveragerc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,3 @@ exclude_lines =
1010
pragma: NO COVER
1111
# Ignore debug-only repr
1212
def __repr__
13-
# Ignore pkg_resources exceptions.
14-
# This is added at the module level as a safeguard for if someone
15-
# generates the code and tries to run it without pip installing. This
16-
# makes it virtually impossible to test properly.
17-
except pkg_resources.DistributionNotFound
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
__version__ = "2.13.0" # {x-release-please-version}

google/cloud/container_v1/services/cluster_manager/async_client.py

Lines changed: 38 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
from google.api_core.client_options import ClientOptions
3636
from google.auth import credentials as ga_credentials # type: ignore
3737
from google.oauth2 import service_account # type: ignore
38-
import pkg_resources
38+
39+
from google.cloud.container_v1 import gapic_version as package_version
3940

4041
try:
4142
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -224,7 +225,7 @@ async def list_clusters(
224225
zone: Optional[str] = None,
225226
parent: Optional[str] = None,
226227
retry: OptionalRetry = gapic_v1.method.DEFAULT,
227-
timeout: Optional[float] = None,
228+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
228229
metadata: Sequence[Tuple[str, str]] = (),
229230
) -> cluster_service.ListClustersResponse:
230231
r"""Lists all clusters owned by a project in either the
@@ -364,7 +365,7 @@ async def get_cluster(
364365
cluster_id: Optional[str] = None,
365366
name: Optional[str] = None,
366367
retry: OptionalRetry = gapic_v1.method.DEFAULT,
367-
timeout: Optional[float] = None,
368+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
368369
metadata: Sequence[Tuple[str, str]] = (),
369370
) -> cluster_service.Cluster:
370371
r"""Gets the details of a specific cluster.
@@ -511,7 +512,7 @@ async def create_cluster(
511512
cluster: Optional[cluster_service.Cluster] = None,
512513
parent: Optional[str] = None,
513514
retry: OptionalRetry = gapic_v1.method.DEFAULT,
514-
timeout: Optional[float] = None,
515+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
515516
metadata: Sequence[Tuple[str, str]] = (),
516517
) -> cluster_service.Operation:
517518
r"""Creates a cluster, consisting of the specified number and type
@@ -663,7 +664,7 @@ async def update_cluster(
663664
update: Optional[cluster_service.ClusterUpdate] = None,
664665
name: Optional[str] = None,
665666
retry: OptionalRetry = gapic_v1.method.DEFAULT,
666-
timeout: Optional[float] = None,
667+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
667668
metadata: Sequence[Tuple[str, str]] = (),
668669
) -> cluster_service.Operation:
669670
r"""Updates the settings of a specific cluster.
@@ -809,7 +810,7 @@ async def update_node_pool(
809810
request: Optional[Union[cluster_service.UpdateNodePoolRequest, dict]] = None,
810811
*,
811812
retry: OptionalRetry = gapic_v1.method.DEFAULT,
812-
timeout: Optional[float] = None,
813+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
813814
metadata: Sequence[Tuple[str, str]] = (),
814815
) -> cluster_service.Operation:
815816
r"""Updates the version and/or image type for the
@@ -895,7 +896,7 @@ async def set_node_pool_autoscaling(
895896
] = None,
896897
*,
897898
retry: OptionalRetry = gapic_v1.method.DEFAULT,
898-
timeout: Optional[float] = None,
899+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
899900
metadata: Sequence[Tuple[str, str]] = (),
900901
) -> cluster_service.Operation:
901902
r"""Sets the autoscaling settings for the specified node
@@ -982,7 +983,7 @@ async def set_logging_service(
982983
logging_service: Optional[str] = None,
983984
name: Optional[str] = None,
984985
retry: OptionalRetry = gapic_v1.method.DEFAULT,
985-
timeout: Optional[float] = None,
986+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
986987
metadata: Sequence[Tuple[str, str]] = (),
987988
) -> cluster_service.Operation:
988989
r"""Sets the logging service for a specific cluster.
@@ -1150,7 +1151,7 @@ async def set_monitoring_service(
11501151
monitoring_service: Optional[str] = None,
11511152
name: Optional[str] = None,
11521153
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1153-
timeout: Optional[float] = None,
1154+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11541155
metadata: Sequence[Tuple[str, str]] = (),
11551156
) -> cluster_service.Operation:
11561157
r"""Sets the monitoring service for a specific cluster.
@@ -1318,7 +1319,7 @@ async def set_addons_config(
13181319
addons_config: Optional[cluster_service.AddonsConfig] = None,
13191320
name: Optional[str] = None,
13201321
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1321-
timeout: Optional[float] = None,
1322+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13221323
metadata: Sequence[Tuple[str, str]] = (),
13231324
) -> cluster_service.Operation:
13241325
r"""Sets the addons for a specific cluster.
@@ -1470,7 +1471,7 @@ async def set_locations(
14701471
locations: Optional[MutableSequence[str]] = None,
14711472
name: Optional[str] = None,
14721473
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1473-
timeout: Optional[float] = None,
1474+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
14741475
metadata: Sequence[Tuple[str, str]] = (),
14751476
) -> cluster_service.Operation:
14761477
r"""Sets the locations for a specific cluster. Deprecated. Use
@@ -1635,7 +1636,7 @@ async def update_master(
16351636
master_version: Optional[str] = None,
16361637
name: Optional[str] = None,
16371638
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1638-
timeout: Optional[float] = None,
1639+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
16391640
metadata: Sequence[Tuple[str, str]] = (),
16401641
) -> cluster_service.Operation:
16411642
r"""Updates the master for a specific cluster.
@@ -1794,7 +1795,7 @@ async def set_master_auth(
17941795
request: Optional[Union[cluster_service.SetMasterAuthRequest, dict]] = None,
17951796
*,
17961797
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1797-
timeout: Optional[float] = None,
1798+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
17981799
metadata: Sequence[Tuple[str, str]] = (),
17991800
) -> cluster_service.Operation:
18001801
r"""Sets master auth materials. Currently supports
@@ -1883,7 +1884,7 @@ async def delete_cluster(
18831884
cluster_id: Optional[str] = None,
18841885
name: Optional[str] = None,
18851886
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1886-
timeout: Optional[float] = None,
1887+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
18871888
metadata: Sequence[Tuple[str, str]] = (),
18881889
) -> cluster_service.Operation:
18891890
r"""Deletes the cluster, including the Kubernetes
@@ -2041,7 +2042,7 @@ async def list_operations(
20412042
project_id: Optional[str] = None,
20422043
zone: Optional[str] = None,
20432044
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2044-
timeout: Optional[float] = None,
2045+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
20452046
metadata: Sequence[Tuple[str, str]] = (),
20462047
) -> cluster_service.ListOperationsResponse:
20472048
r"""Lists all operations in a project in a specific zone
@@ -2171,7 +2172,7 @@ async def get_operation(
21712172
operation_id: Optional[str] = None,
21722173
name: Optional[str] = None,
21732174
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2174-
timeout: Optional[float] = None,
2175+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
21752176
metadata: Sequence[Tuple[str, str]] = (),
21762177
) -> cluster_service.Operation:
21772178
r"""Gets the specified operation.
@@ -2321,7 +2322,7 @@ async def cancel_operation(
23212322
operation_id: Optional[str] = None,
23222323
name: Optional[str] = None,
23232324
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2324-
timeout: Optional[float] = None,
2325+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
23252326
metadata: Sequence[Tuple[str, str]] = (),
23262327
) -> None:
23272328
r"""Cancels the specified operation.
@@ -2446,7 +2447,7 @@ async def get_server_config(
24462447
zone: Optional[str] = None,
24472448
name: Optional[str] = None,
24482449
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2449-
timeout: Optional[float] = None,
2450+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
24502451
metadata: Sequence[Tuple[str, str]] = (),
24512452
) -> cluster_service.ServerConfig:
24522453
r"""Returns configuration info about the Google
@@ -2580,7 +2581,7 @@ async def get_json_web_keys(
25802581
request: Optional[Union[cluster_service.GetJSONWebKeysRequest, dict]] = None,
25812582
*,
25822583
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2583-
timeout: Optional[float] = None,
2584+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
25842585
metadata: Sequence[Tuple[str, str]] = (),
25852586
) -> cluster_service.GetJSONWebKeysResponse:
25862587
r"""Gets the public component of the cluster signing keys
@@ -2670,7 +2671,7 @@ async def list_node_pools(
26702671
cluster_id: Optional[str] = None,
26712672
parent: Optional[str] = None,
26722673
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2673-
timeout: Optional[float] = None,
2674+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
26742675
metadata: Sequence[Tuple[str, str]] = (),
26752676
) -> cluster_service.ListNodePoolsResponse:
26762677
r"""Lists the node pools for a cluster.
@@ -2819,7 +2820,7 @@ async def get_node_pool(
28192820
node_pool_id: Optional[str] = None,
28202821
name: Optional[str] = None,
28212822
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2822-
timeout: Optional[float] = None,
2823+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
28232824
metadata: Sequence[Tuple[str, str]] = (),
28242825
) -> cluster_service.NodePool:
28252826
r"""Retrieves the requested node pool.
@@ -2986,7 +2987,7 @@ async def create_node_pool(
29862987
node_pool: Optional[cluster_service.NodePool] = None,
29872988
parent: Optional[str] = None,
29882989
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2989-
timeout: Optional[float] = None,
2990+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
29902991
metadata: Sequence[Tuple[str, str]] = (),
29912992
) -> cluster_service.Operation:
29922993
r"""Creates a node pool for a cluster.
@@ -3134,7 +3135,7 @@ async def delete_node_pool(
31343135
node_pool_id: Optional[str] = None,
31353136
name: Optional[str] = None,
31363137
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3137-
timeout: Optional[float] = None,
3138+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
31383139
metadata: Sequence[Tuple[str, str]] = (),
31393140
) -> cluster_service.Operation:
31403141
r"""Deletes a node pool from a cluster.
@@ -3293,7 +3294,7 @@ async def complete_node_pool_upgrade(
32933294
] = None,
32943295
*,
32953296
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3296-
timeout: Optional[float] = None,
3297+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
32973298
metadata: Sequence[Tuple[str, str]] = (),
32983299
) -> None:
32993300
r"""CompleteNodePoolUpgrade will signal an on-going node
@@ -3368,7 +3369,7 @@ async def rollback_node_pool_upgrade(
33683369
node_pool_id: Optional[str] = None,
33693370
name: Optional[str] = None,
33703371
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3371-
timeout: Optional[float] = None,
3372+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
33723373
metadata: Sequence[Tuple[str, str]] = (),
33733374
) -> cluster_service.Operation:
33743375
r"""Rolls back a previously Aborted or Failed NodePool
@@ -3523,7 +3524,7 @@ async def set_node_pool_management(
35233524
] = None,
35243525
*,
35253526
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3526-
timeout: Optional[float] = None,
3527+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
35273528
metadata: Sequence[Tuple[str, str]] = (),
35283529
) -> cluster_service.Operation:
35293530
r"""Sets the NodeManagement options for a node pool.
@@ -3604,7 +3605,7 @@ async def set_labels(
36043605
request: Optional[Union[cluster_service.SetLabelsRequest, dict]] = None,
36053606
*,
36063607
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3607-
timeout: Optional[float] = None,
3608+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
36083609
metadata: Sequence[Tuple[str, str]] = (),
36093610
) -> cluster_service.Operation:
36103611
r"""Sets labels on a cluster.
@@ -3693,7 +3694,7 @@ async def set_legacy_abac(
36933694
enabled: Optional[bool] = None,
36943695
name: Optional[str] = None,
36953696
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3696-
timeout: Optional[float] = None,
3697+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
36973698
metadata: Sequence[Tuple[str, str]] = (),
36983699
) -> cluster_service.Operation:
36993700
r"""Enables or disables the ABAC authorization mechanism
@@ -3845,7 +3846,7 @@ async def start_ip_rotation(
38453846
cluster_id: Optional[str] = None,
38463847
name: Optional[str] = None,
38473848
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3848-
timeout: Optional[float] = None,
3849+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
38493850
metadata: Sequence[Tuple[str, str]] = (),
38503851
) -> cluster_service.Operation:
38513852
r"""Starts master IP rotation.
@@ -3988,7 +3989,7 @@ async def complete_ip_rotation(
39883989
cluster_id: Optional[str] = None,
39893990
name: Optional[str] = None,
39903991
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3991-
timeout: Optional[float] = None,
3992+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
39923993
metadata: Sequence[Tuple[str, str]] = (),
39933994
) -> cluster_service.Operation:
39943995
r"""Completes master IP rotation.
@@ -4124,7 +4125,7 @@ async def set_node_pool_size(
41244125
request: Optional[Union[cluster_service.SetNodePoolSizeRequest, dict]] = None,
41254126
*,
41264127
retry: OptionalRetry = gapic_v1.method.DEFAULT,
4127-
timeout: Optional[float] = None,
4128+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
41284129
metadata: Sequence[Tuple[str, str]] = (),
41294130
) -> cluster_service.Operation:
41304131
r"""Sets the size for a specific node pool. The new size will be
@@ -4214,7 +4215,7 @@ async def set_network_policy(
42144215
network_policy: Optional[cluster_service.NetworkPolicy] = None,
42154216
name: Optional[str] = None,
42164217
retry: OptionalRetry = gapic_v1.method.DEFAULT,
4217-
timeout: Optional[float] = None,
4218+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
42184219
metadata: Sequence[Tuple[str, str]] = (),
42194220
) -> cluster_service.Operation:
42204221
r"""Enables or disables Network Policy for a cluster.
@@ -4366,7 +4367,7 @@ async def set_maintenance_policy(
43664367
maintenance_policy: Optional[cluster_service.MaintenancePolicy] = None,
43674368
name: Optional[str] = None,
43684369
retry: OptionalRetry = gapic_v1.method.DEFAULT,
4369-
timeout: Optional[float] = None,
4370+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
43704371
metadata: Sequence[Tuple[str, str]] = (),
43714372
) -> cluster_service.Operation:
43724373
r"""Sets the maintenance policy for a cluster.
@@ -4515,7 +4516,7 @@ async def list_usable_subnetworks(
45154516
] = None,
45164517
*,
45174518
retry: OptionalRetry = gapic_v1.method.DEFAULT,
4518-
timeout: Optional[float] = None,
4519+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
45194520
metadata: Sequence[Tuple[str, str]] = (),
45204521
) -> pagers.ListUsableSubnetworksAsyncPager:
45214522
r"""Lists subnetworks that are usable for creating
@@ -4613,14 +4614,9 @@ async def __aexit__(self, exc_type, exc, tb):
46134614
await self.transport.close()
46144615

46154616

4616-
try:
4617-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
4618-
gapic_version=pkg_resources.get_distribution(
4619-
"google-cloud-container",
4620-
).version,
4621-
)
4622-
except pkg_resources.DistributionNotFound:
4623-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
4617+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
4618+
gapic_version=package_version.__version__
4619+
)
46244620

46254621

46264622
__all__ = ("ClusterManagerAsyncClient",)

0 commit comments

Comments
 (0)