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

Commit

Permalink
chore: use gapic-generator-python 0.53.4 (#164)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

docs: list oneofs in docstring
fix(deps): require google-api-core >= 1.28.0
fix(deps): drop packaging dependency

committer: busunkim96@
PiperOrigin-RevId: 406468269

Source-Link: googleapis/googleapis@83d81b0

Source-Link: googleapis/googleapis-gen@2ff001f
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZmMDAxZmJhY2I5ZTc3ZTcxZDczNGRlNWY5NTVjMDVmZGFlODUyNiJ9
  • Loading branch information
gcf-owl-bot[bot] committed Nov 1, 2021
1 parent c1419c0 commit 838a97b
Show file tree
Hide file tree
Showing 14 changed files with 331 additions and 500 deletions.
196 changes: 99 additions & 97 deletions google/cloud/container_v1/services/cluster_manager/async_client.py

Large diffs are not rendered by default.

66 changes: 34 additions & 32 deletions google/cloud/container_v1/services/cluster_manager/client.py
Expand Up @@ -31,6 +31,8 @@
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]

from google.cloud.container_v1.services.cluster_manager import pagers
from google.cloud.container_v1.types import cluster_service
from .transports.base import ClusterManagerTransport, DEFAULT_CLIENT_INFO
Expand Down Expand Up @@ -339,7 +341,7 @@ def list_clusters(
project_id: str = None,
zone: str = None,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.ListClustersResponse:
Expand Down Expand Up @@ -439,7 +441,7 @@ def get_cluster(
zone: str = None,
cluster_id: str = None,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Cluster:
Expand Down Expand Up @@ -546,7 +548,7 @@ def create_cluster(
zone: str = None,
cluster: cluster_service.Cluster = None,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -668,7 +670,7 @@ def update_cluster(
cluster_id: str = None,
update: cluster_service.ClusterUpdate = None,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -784,7 +786,7 @@ def update_node_pool(
self,
request: Union[cluster_service.UpdateNodePoolRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -837,7 +839,7 @@ def set_node_pool_autoscaling(
self,
request: Union[cluster_service.SetNodePoolAutoscalingRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -897,7 +899,7 @@ def set_logging_service(
cluster_id: str = None,
logging_service: str = None,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -1032,7 +1034,7 @@ def set_monitoring_service(
cluster_id: str = None,
monitoring_service: str = None,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -1169,7 +1171,7 @@ def set_addons_config(
cluster_id: str = None,
addons_config: cluster_service.AddonsConfig = None,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -1291,7 +1293,7 @@ def set_locations(
cluster_id: str = None,
locations: Sequence[str] = None,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -1425,7 +1427,7 @@ def update_master(
cluster_id: str = None,
master_version: str = None,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -1553,7 +1555,7 @@ def set_master_auth(
self,
request: Union[cluster_service.SetMasterAuthRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -1612,7 +1614,7 @@ def delete_cluster(
zone: str = None,
cluster_id: str = None,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -1730,7 +1732,7 @@ def list_operations(
*,
project_id: str = None,
zone: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.ListOperationsResponse:
Expand Down Expand Up @@ -1820,7 +1822,7 @@ def get_operation(
zone: str = None,
operation_id: str = None,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -1930,7 +1932,7 @@ def cancel_operation(
zone: str = None,
operation_id: str = None,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
Expand Down Expand Up @@ -2030,7 +2032,7 @@ def get_server_config(
project_id: str = None,
zone: str = None,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.ServerConfig:
Expand Down Expand Up @@ -2124,7 +2126,7 @@ def get_json_web_keys(
self,
request: Union[cluster_service.GetJSONWebKeysRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.GetJSONWebKeysResponse:
Expand Down Expand Up @@ -2185,7 +2187,7 @@ def list_node_pools(
zone: str = None,
cluster_id: str = None,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.ListNodePoolsResponse:
Expand Down Expand Up @@ -2294,7 +2296,7 @@ def get_node_pool(
cluster_id: str = None,
node_pool_id: str = None,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.NodePool:
Expand Down Expand Up @@ -2421,7 +2423,7 @@ def create_node_pool(
cluster_id: str = None,
node_pool: cluster_service.NodePool = None,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -2539,7 +2541,7 @@ def delete_node_pool(
cluster_id: str = None,
node_pool_id: str = None,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -2661,7 +2663,7 @@ def rollback_node_pool_upgrade(
cluster_id: str = None,
node_pool_id: str = None,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -2786,7 +2788,7 @@ def set_node_pool_management(
self,
request: Union[cluster_service.SetNodePoolManagementRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -2838,7 +2840,7 @@ def set_labels(
self,
request: Union[cluster_service.SetLabelsRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -2897,7 +2899,7 @@ def set_legacy_abac(
cluster_id: str = None,
enabled: bool = None,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -3018,7 +3020,7 @@ def start_ip_rotation(
zone: str = None,
cluster_id: str = None,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -3129,7 +3131,7 @@ def complete_ip_rotation(
zone: str = None,
cluster_id: str = None,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -3235,7 +3237,7 @@ def set_node_pool_size(
self,
request: Union[cluster_service.SetNodePoolSizeRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -3292,7 +3294,7 @@ def set_network_policy(
cluster_id: str = None,
network_policy: cluster_service.NetworkPolicy = None,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -3412,7 +3414,7 @@ def set_maintenance_policy(
cluster_id: str = None,
maintenance_policy: cluster_service.MaintenancePolicy = None,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.Operation:
Expand Down Expand Up @@ -3526,7 +3528,7 @@ def list_usable_subnetworks(
self,
request: Union[cluster_service.ListUsableSubnetworksRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListUsableSubnetworksPager:
Expand Down
Expand Up @@ -15,7 +15,6 @@
#
import abc
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
import packaging.version
import pkg_resources

import google.auth # type: ignore
Expand All @@ -36,15 +35,6 @@
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()

try:
# google.auth.__version__ was added in 1.26.0
_GOOGLE_AUTH_VERSION = google.auth.__version__
except AttributeError:
try: # try pkg_resources if it is available
_GOOGLE_AUTH_VERSION = pkg_resources.get_distribution("google-auth").version
except pkg_resources.DistributionNotFound: # pragma: NO COVER
_GOOGLE_AUTH_VERSION = None


class ClusterManagerTransport(abc.ABC):
"""Abstract transport class for ClusterManager."""
Expand Down Expand Up @@ -94,7 +84,7 @@ def __init__(
host += ":443"
self._host = host

scopes_kwargs = self._get_scopes_kwargs(self._host, scopes)
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
Expand Down Expand Up @@ -127,29 +117,6 @@ def __init__(
# Save the credentials.
self._credentials = credentials

# TODO(busunkim): This method is in the base transport
# to avoid duplicating code across the transport classes. These functions
# should be deleted once the minimum required versions of google-auth is increased.

# TODO: Remove this function once google-auth >= 1.25.0 is required
@classmethod
def _get_scopes_kwargs(
cls, host: str, scopes: Optional[Sequence[str]]
) -> Dict[str, Optional[Sequence[str]]]:
"""Returns scopes kwargs to pass to google-auth methods depending on the google-auth version"""

scopes_kwargs = {}

if _GOOGLE_AUTH_VERSION and (
packaging.version.parse(_GOOGLE_AUTH_VERSION)
>= packaging.version.parse("1.25.0")
):
scopes_kwargs = {"scopes": scopes, "default_scopes": cls.AUTH_SCOPES}
else:
scopes_kwargs = {"scopes": scopes or cls.AUTH_SCOPES}

return scopes_kwargs

def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
Expand Down
Expand Up @@ -20,7 +20,6 @@
from google.api_core import grpc_helpers_async # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
import packaging.version

import grpc # type: ignore
from grpc.experimental import aio # type: ignore
Expand Down

0 comments on commit 838a97b

Please sign in to comment.