diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index f0f3b24b..5fc5daa3 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:f946c75373c2b0040e8e318c5e85d0cf46bc6e61d0a01f3ef94d8de974ac6790 + digest: sha256:8555f0e37e6261408f792bfd6635102d2da5ad73f8f09bcb24f25e6afb5fac97 diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in index cbd7e77f..882178ce 100644 --- a/.kokoro/requirements.in +++ b/.kokoro/requirements.in @@ -1,5 +1,5 @@ gcp-docuploader -gcp-releasetool +gcp-releasetool>=1.10.5 # required for compatibility with cryptography>=39.x importlib-metadata typing-extensions twine diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 05dc4672..fa99c129 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -113,33 +113,28 @@ commonmark==0.9.1 \ --hash=sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60 \ --hash=sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9 # via rich -cryptography==38.0.3 \ - --hash=sha256:068147f32fa662c81aebab95c74679b401b12b57494872886eb5c1139250ec5d \ - --hash=sha256:06fc3cc7b6f6cca87bd56ec80a580c88f1da5306f505876a71c8cfa7050257dd \ - --hash=sha256:25c1d1f19729fb09d42e06b4bf9895212292cb27bb50229f5aa64d039ab29146 \ - --hash=sha256:402852a0aea73833d982cabb6d0c3bb582c15483d29fb7085ef2c42bfa7e38d7 \ - --hash=sha256:4e269dcd9b102c5a3d72be3c45d8ce20377b8076a43cbed6f660a1afe365e436 \ - --hash=sha256:5419a127426084933076132d317911e3c6eb77568a1ce23c3ac1e12d111e61e0 \ - --hash=sha256:554bec92ee7d1e9d10ded2f7e92a5d70c1f74ba9524947c0ba0c850c7b011828 \ - --hash=sha256:5e89468fbd2fcd733b5899333bc54d0d06c80e04cd23d8c6f3e0542358c6060b \ - --hash=sha256:65535bc550b70bd6271984d9863a37741352b4aad6fb1b3344a54e6950249b55 \ - --hash=sha256:6ab9516b85bebe7aa83f309bacc5f44a61eeb90d0b4ec125d2d003ce41932d36 \ - --hash=sha256:6addc3b6d593cd980989261dc1cce38263c76954d758c3c94de51f1e010c9a50 \ - --hash=sha256:728f2694fa743a996d7784a6194da430f197d5c58e2f4e278612b359f455e4a2 \ - --hash=sha256:785e4056b5a8b28f05a533fab69febf5004458e20dad7e2e13a3120d8ecec75a \ - --hash=sha256:78cf5eefac2b52c10398a42765bfa981ce2372cbc0457e6bf9658f41ec3c41d8 \ - --hash=sha256:7f836217000342d448e1c9a342e9163149e45d5b5eca76a30e84503a5a96cab0 \ - --hash=sha256:8d41a46251bf0634e21fac50ffd643216ccecfaf3701a063257fe0b2be1b6548 \ - --hash=sha256:984fe150f350a3c91e84de405fe49e688aa6092b3525f407a18b9646f6612320 \ - --hash=sha256:9b24bcff7853ed18a63cfb0c2b008936a9554af24af2fb146e16d8e1aed75748 \ - --hash=sha256:b1b35d9d3a65542ed2e9d90115dfd16bbc027b3f07ee3304fc83580f26e43249 \ - --hash=sha256:b1b52c9e5f8aa2b802d48bd693190341fae201ea51c7a167d69fc48b60e8a959 \ - --hash=sha256:bbf203f1a814007ce24bd4d51362991d5cb90ba0c177a9c08825f2cc304d871f \ - --hash=sha256:be243c7e2bfcf6cc4cb350c0d5cdf15ca6383bbcb2a8ef51d3c9411a9d4386f0 \ - --hash=sha256:bfbe6ee19615b07a98b1d2287d6a6073f734735b49ee45b11324d85efc4d5cbd \ - --hash=sha256:c46837ea467ed1efea562bbeb543994c2d1f6e800785bd5a2c98bc096f5cb220 \ - --hash=sha256:dfb4f4dd568de1b6af9f4cda334adf7d72cf5bc052516e1b2608b683375dd95c \ - --hash=sha256:ed7b00096790213e09eb11c97cc6e2b757f15f3d2f85833cd2d3ec3fe37c1722 +cryptography==39.0.1 \ + --hash=sha256:0f8da300b5c8af9f98111ffd512910bc792b4c77392a9523624680f7956a99d4 \ + --hash=sha256:35f7c7d015d474f4011e859e93e789c87d21f6f4880ebdc29896a60403328f1f \ + --hash=sha256:5aa67414fcdfa22cf052e640cb5ddc461924a045cacf325cd164e65312d99502 \ + --hash=sha256:5d2d8b87a490bfcd407ed9d49093793d0f75198a35e6eb1a923ce1ee86c62b41 \ + --hash=sha256:6687ef6d0a6497e2b58e7c5b852b53f62142cfa7cd1555795758934da363a965 \ + --hash=sha256:6f8ba7f0328b79f08bdacc3e4e66fb4d7aab0c3584e0bd41328dce5262e26b2e \ + --hash=sha256:706843b48f9a3f9b9911979761c91541e3d90db1ca905fd63fee540a217698bc \ + --hash=sha256:807ce09d4434881ca3a7594733669bd834f5b2c6d5c7e36f8c00f691887042ad \ + --hash=sha256:83e17b26de248c33f3acffb922748151d71827d6021d98c70e6c1a25ddd78505 \ + --hash=sha256:96f1157a7c08b5b189b16b47bc9db2332269d6680a196341bf30046330d15388 \ + --hash=sha256:aec5a6c9864be7df2240c382740fcf3b96928c46604eaa7f3091f58b878c0bb6 \ + --hash=sha256:b0afd054cd42f3d213bf82c629efb1ee5f22eba35bf0eec88ea9ea7304f511a2 \ + --hash=sha256:ced4e447ae29ca194449a3f1ce132ded8fcab06971ef5f618605aacaa612beac \ + --hash=sha256:d1f6198ee6d9148405e49887803907fe8962a23e6c6f83ea7d98f1c0de375695 \ + --hash=sha256:e124352fd3db36a9d4a21c1aa27fd5d051e621845cb87fb851c08f4f75ce8be6 \ + --hash=sha256:e422abdec8b5fa8462aa016786680720d78bdce7a30c652b7fadf83a4ba35336 \ + --hash=sha256:ef8b72fa70b348724ff1218267e7f7375b8de4e8194d1636ee60510aae104cd0 \ + --hash=sha256:f0c64d1bd842ca2633e74a1a28033d139368ad959872533b1bab8c80e8240a0c \ + --hash=sha256:f24077a3b5298a5a06a8e0536e3ea9ec60e4c7ac486755e5fb6e6ea9b3500106 \ + --hash=sha256:fdd188c8a6ef8769f148f88f859884507b954cc64db6b52f66ef199bb9ad660a \ + --hash=sha256:fe913f20024eb2cb2f323e42a64bdf2911bb9738a15dba7d3cce48151034e3a8 # via # gcp-releasetool # secretstorage @@ -159,9 +154,9 @@ gcp-docuploader==0.6.4 \ --hash=sha256:01486419e24633af78fd0167db74a2763974765ee8078ca6eb6964d0ebd388af \ --hash=sha256:70861190c123d907b3b067da896265ead2eeb9263969d6955c9e0bb091b5ccbf # via -r requirements.in -gcp-releasetool==1.10.0 \ - --hash=sha256:72a38ca91b59c24f7e699e9227c90cbe4dd71b789383cb0164b088abae294c83 \ - --hash=sha256:8c7c99320208383d4bb2b808c6880eb7a81424afe7cdba3c8d84b25f4f0e097d +gcp-releasetool==1.10.5 \ + --hash=sha256:174b7b102d704b254f2a26a3eda2c684fd3543320ec239baf771542a2e58e109 \ + --hash=sha256:e29d29927fe2ca493105a82958c6873bb2b90d503acac56be2c229e74de0eec9 # via -r requirements.in google-api-core==2.10.2 \ --hash=sha256:10c06f7739fe57781f87523375e8e1a3a4674bf6392cd6131a3222182b971320 \ diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c9cb869a..e13ee5dc 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.17.3" + ".": "2.17.4" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 99bd95f4..b5f86841 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-cloud-container/#history +## [2.17.4](https://github.com/googleapis/python-container/compare/v2.17.3...v2.17.4) (2023-02-28) + + +### Documentation + +* Minor grammar improvements ([#351](https://github.com/googleapis/python-container/issues/351)) ([2a0eeae](https://github.com/googleapis/python-container/commit/2a0eeae897e7f2312690eed1e52119a6a572c667)) + ## [2.17.3](https://github.com/googleapis/python-container/compare/v2.17.2...v2.17.3) (2023-02-03) diff --git a/google/cloud/container/gapic_version.py b/google/cloud/container/gapic_version.py index 36f3d159..2598d9bc 100644 --- a/google/cloud/container/gapic_version.py +++ b/google/cloud/container/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.17.3" # {x-release-please-version} +__version__ = "2.17.4" # {x-release-please-version} diff --git a/google/cloud/container_v1/gapic_version.py b/google/cloud/container_v1/gapic_version.py index 36f3d159..2598d9bc 100644 --- a/google/cloud/container_v1/gapic_version.py +++ b/google/cloud/container_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.17.3" # {x-release-please-version} +__version__ = "2.17.4" # {x-release-please-version} diff --git a/google/cloud/container_v1/types/cluster_service.py b/google/cloud/container_v1/types/cluster_service.py index 40c36177..6cb637e4 100644 --- a/google/cloud/container_v1/types/cluster_service.py +++ b/google/cloud/container_v1/types/cluster_service.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence from google.protobuf import duration_pb2 # type: ignore @@ -1085,7 +1087,7 @@ class Type(proto.Enum): class NodeTaint(proto.Message): - r"""Kubernetes taint is comprised of three fields: key, value, and + r"""Kubernetes taint is composed of three fields: key, value, and effect. Effect can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. diff --git a/google/cloud/container_v1beta1/gapic_version.py b/google/cloud/container_v1beta1/gapic_version.py index 36f3d159..2598d9bc 100644 --- a/google/cloud/container_v1beta1/gapic_version.py +++ b/google/cloud/container_v1beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.17.3" # {x-release-please-version} +__version__ = "2.17.4" # {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 861a2814..ba69a990 100644 --- a/google/cloud/container_v1beta1/services/cluster_manager/async_client.py +++ b/google/cloud/container_v1beta1/services/cluster_manager/async_client.py @@ -2492,6 +2492,92 @@ async def sample_get_server_config(): # Done; return the response. return response + async def get_json_web_keys( + self, + request: Optional[Union[cluster_service.GetJSONWebKeysRequest, dict]] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + 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 + in JSON Web Key format. + This API is not yet intended for general use, and is not + available for all clusters. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import container_v1beta1 + + async def sample_get_json_web_keys(): + # Create a client + client = container_v1beta1.ClusterManagerAsyncClient() + + # Initialize request argument(s) + request = container_v1beta1.GetJSONWebKeysRequest( + ) + + # Make the request + response = await client.get_json_web_keys(request=request) + + # Handle the response + print(response) + + Args: + request (Optional[Union[google.cloud.container_v1beta1.types.GetJSONWebKeysRequest, dict]]): + The request object. GetJSONWebKeysRequest gets the + public component of the keys used by the cluster to sign + token requests. This will be the jwks_uri for the + discover document returned by getOpenIDConfig. See the + OpenID Connect Discovery 1.0 specification for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.container_v1beta1.types.GetJSONWebKeysResponse: + GetJSONWebKeysResponse is a valid + JSON Web Key Set as specififed in rfc + 7517 + + """ + # Create or coerce a protobuf request object. + request = cluster_service.GetJSONWebKeysRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.get_json_web_keys, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + async def list_node_pools( self, request: Optional[Union[cluster_service.ListNodePoolsRequest, dict]] = None, @@ -2633,92 +2719,6 @@ async def sample_list_node_pools(): # Done; return the response. return response - async def get_json_web_keys( - self, - request: Optional[Union[cluster_service.GetJSONWebKeysRequest, dict]] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - 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 - in JSON Web Key format. - This API is not yet intended for general use, and is not - available for all clusters. - - .. code-block:: python - - # This snippet has been automatically generated and should be regarded as a - # code template only. - # It will require modifications to work: - # - It may require correct/in-range values for request initialization. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import container_v1beta1 - - async def sample_get_json_web_keys(): - # Create a client - client = container_v1beta1.ClusterManagerAsyncClient() - - # Initialize request argument(s) - request = container_v1beta1.GetJSONWebKeysRequest( - ) - - # Make the request - response = await client.get_json_web_keys(request=request) - - # Handle the response - print(response) - - Args: - request (Optional[Union[google.cloud.container_v1beta1.types.GetJSONWebKeysRequest, dict]]): - The request object. GetJSONWebKeysRequest gets the - public component of the keys used by the cluster to sign - token requests. This will be the jwks_uri for the - discover document returned by getOpenIDConfig. See the - OpenID Connect Discovery 1.0 specification for details. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.container_v1beta1.types.GetJSONWebKeysResponse: - GetJSONWebKeysResponse is a valid - JSON Web Key Set as specififed in rfc - 7517 - - """ - # Create or coerce a protobuf request object. - request = cluster_service.GetJSONWebKeysRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = gapic_v1.method_async.wrap_method( - self._client._transport.get_json_web_keys, - default_timeout=None, - client_info=DEFAULT_CLIENT_INFO, - ) - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), - ) - - # Send the request. - response = await rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - async def get_node_pool( self, request: Optional[Union[cluster_service.GetNodePoolRequest, dict]] = None, diff --git a/google/cloud/container_v1beta1/services/cluster_manager/client.py b/google/cloud/container_v1beta1/services/cluster_manager/client.py index 10649aef..f0a8c26e 100644 --- a/google/cloud/container_v1beta1/services/cluster_manager/client.py +++ b/google/cloud/container_v1beta1/services/cluster_manager/client.py @@ -2659,6 +2659,93 @@ def sample_get_server_config(): # Done; return the response. return response + def get_json_web_keys( + self, + request: Optional[Union[cluster_service.GetJSONWebKeysRequest, dict]] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + 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 + in JSON Web Key format. + This API is not yet intended for general use, and is not + available for all clusters. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import container_v1beta1 + + def sample_get_json_web_keys(): + # Create a client + client = container_v1beta1.ClusterManagerClient() + + # Initialize request argument(s) + request = container_v1beta1.GetJSONWebKeysRequest( + ) + + # Make the request + response = client.get_json_web_keys(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.container_v1beta1.types.GetJSONWebKeysRequest, dict]): + The request object. GetJSONWebKeysRequest gets the + public component of the keys used by the cluster to sign + token requests. This will be the jwks_uri for the + discover document returned by getOpenIDConfig. See the + OpenID Connect Discovery 1.0 specification for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.container_v1beta1.types.GetJSONWebKeysResponse: + GetJSONWebKeysResponse is a valid + JSON Web Key Set as specififed in rfc + 7517 + + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a cluster_service.GetJSONWebKeysRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, cluster_service.GetJSONWebKeysRequest): + request = cluster_service.GetJSONWebKeysRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.get_json_web_keys] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + def list_node_pools( self, request: Optional[Union[cluster_service.ListNodePoolsRequest, dict]] = None, @@ -2790,93 +2877,6 @@ def sample_list_node_pools(): # Done; return the response. return response - def get_json_web_keys( - self, - request: Optional[Union[cluster_service.GetJSONWebKeysRequest, dict]] = None, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - 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 - in JSON Web Key format. - This API is not yet intended for general use, and is not - available for all clusters. - - .. code-block:: python - - # This snippet has been automatically generated and should be regarded as a - # code template only. - # It will require modifications to work: - # - It may require correct/in-range values for request initialization. - # - It may require specifying regional endpoints when creating the service - # client as shown in: - # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import container_v1beta1 - - def sample_get_json_web_keys(): - # Create a client - client = container_v1beta1.ClusterManagerClient() - - # Initialize request argument(s) - request = container_v1beta1.GetJSONWebKeysRequest( - ) - - # Make the request - response = client.get_json_web_keys(request=request) - - # Handle the response - print(response) - - Args: - request (Union[google.cloud.container_v1beta1.types.GetJSONWebKeysRequest, dict]): - The request object. GetJSONWebKeysRequest gets the - public component of the keys used by the cluster to sign - token requests. This will be the jwks_uri for the - discover document returned by getOpenIDConfig. See the - OpenID Connect Discovery 1.0 specification for details. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, str]]): Strings which should be - sent along with the request as metadata. - - Returns: - google.cloud.container_v1beta1.types.GetJSONWebKeysResponse: - GetJSONWebKeysResponse is a valid - JSON Web Key Set as specififed in rfc - 7517 - - """ - # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes - # in a cluster_service.GetJSONWebKeysRequest. - # There's no risk of modifying the input as we've already verified - # there are no flattened fields. - if not isinstance(request, cluster_service.GetJSONWebKeysRequest): - request = cluster_service.GetJSONWebKeysRequest(request) - - # Wrap the RPC method; this adds retry and timeout information, - # and friendly error handling. - rpc = self._transport._wrapped_methods[self._transport.get_json_web_keys] - - # Certain fields should be provided within the metadata header; - # add these here. - metadata = tuple(metadata) + ( - gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), - ) - - # Send the request. - response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, - ) - - # Done; return the response. - return response - def get_node_pool( self, request: Optional[Union[cluster_service.GetNodePoolRequest, dict]] = None, 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 2b3b65c2..f705f455 100644 --- a/google/cloud/container_v1beta1/services/cluster_manager/transports/base.py +++ b/google/cloud/container_v1beta1/services/cluster_manager/transports/base.py @@ -268,6 +268,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=20.0, client_info=client_info, ), + self.get_json_web_keys: gapic_v1.method.wrap_method( + self.get_json_web_keys, + default_timeout=None, + client_info=client_info, + ), self.list_node_pools: gapic_v1.method.wrap_method( self.list_node_pools, default_retry=retries.Retry( @@ -283,11 +288,6 @@ def _prep_wrapped_messages(self, client_info): default_timeout=20.0, client_info=client_info, ), - self.get_json_web_keys: gapic_v1.method.wrap_method( - self.get_json_web_keys, - default_timeout=None, - client_info=client_info, - ), self.get_node_pool: gapic_v1.method.wrap_method( self.get_node_pool, default_retry=retries.Retry( @@ -574,25 +574,25 @@ def get_server_config( raise NotImplementedError() @property - def list_node_pools( + def get_json_web_keys( self, ) -> Callable[ - [cluster_service.ListNodePoolsRequest], + [cluster_service.GetJSONWebKeysRequest], Union[ - cluster_service.ListNodePoolsResponse, - Awaitable[cluster_service.ListNodePoolsResponse], + cluster_service.GetJSONWebKeysResponse, + Awaitable[cluster_service.GetJSONWebKeysResponse], ], ]: raise NotImplementedError() @property - def get_json_web_keys( + def list_node_pools( self, ) -> Callable[ - [cluster_service.GetJSONWebKeysRequest], + [cluster_service.ListNodePoolsRequest], Union[ - cluster_service.GetJSONWebKeysResponse, - Awaitable[cluster_service.GetJSONWebKeysResponse], + cluster_service.ListNodePoolsResponse, + Awaitable[cluster_service.ListNodePoolsResponse], ], ]: raise NotImplementedError() diff --git a/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc.py b/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc.py index a6657c5c..992ef6af 100644 --- a/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc.py +++ b/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc.py @@ -715,18 +715,21 @@ def get_server_config( return self._stubs["get_server_config"] @property - def list_node_pools( + def get_json_web_keys( self, ) -> Callable[ - [cluster_service.ListNodePoolsRequest], cluster_service.ListNodePoolsResponse + [cluster_service.GetJSONWebKeysRequest], cluster_service.GetJSONWebKeysResponse ]: - r"""Return a callable for the list node pools method over gRPC. + r"""Return a callable for the get json web keys method over gRPC. - Lists the node pools for a cluster. + Gets the public component of the cluster signing keys + in JSON Web Key format. + This API is not yet intended for general use, and is not + available for all clusters. Returns: - Callable[[~.ListNodePoolsRequest], - ~.ListNodePoolsResponse]: + Callable[[~.GetJSONWebKeysRequest], + ~.GetJSONWebKeysResponse]: A function that, when called, will call the underlying RPC on the server. """ @@ -734,30 +737,27 @@ def list_node_pools( # the request. # gRPC handles serialization and deserialization, so we just need # to pass in the functions for each. - if "list_node_pools" not in self._stubs: - self._stubs["list_node_pools"] = self.grpc_channel.unary_unary( - "/google.container.v1beta1.ClusterManager/ListNodePools", - request_serializer=cluster_service.ListNodePoolsRequest.serialize, - response_deserializer=cluster_service.ListNodePoolsResponse.deserialize, + if "get_json_web_keys" not in self._stubs: + self._stubs["get_json_web_keys"] = self.grpc_channel.unary_unary( + "/google.container.v1beta1.ClusterManager/GetJSONWebKeys", + request_serializer=cluster_service.GetJSONWebKeysRequest.serialize, + response_deserializer=cluster_service.GetJSONWebKeysResponse.deserialize, ) - return self._stubs["list_node_pools"] + return self._stubs["get_json_web_keys"] @property - def get_json_web_keys( + def list_node_pools( self, ) -> Callable[ - [cluster_service.GetJSONWebKeysRequest], cluster_service.GetJSONWebKeysResponse + [cluster_service.ListNodePoolsRequest], cluster_service.ListNodePoolsResponse ]: - r"""Return a callable for the get json web keys method over gRPC. + r"""Return a callable for the list node pools method over gRPC. - Gets the public component of the cluster signing keys - in JSON Web Key format. - This API is not yet intended for general use, and is not - available for all clusters. + Lists the node pools for a cluster. Returns: - Callable[[~.GetJSONWebKeysRequest], - ~.GetJSONWebKeysResponse]: + Callable[[~.ListNodePoolsRequest], + ~.ListNodePoolsResponse]: A function that, when called, will call the underlying RPC on the server. """ @@ -765,13 +765,13 @@ def get_json_web_keys( # the request. # gRPC handles serialization and deserialization, so we just need # to pass in the functions for each. - if "get_json_web_keys" not in self._stubs: - self._stubs["get_json_web_keys"] = self.grpc_channel.unary_unary( - "/google.container.v1beta1.ClusterManager/GetJSONWebKeys", - request_serializer=cluster_service.GetJSONWebKeysRequest.serialize, - response_deserializer=cluster_service.GetJSONWebKeysResponse.deserialize, + if "list_node_pools" not in self._stubs: + self._stubs["list_node_pools"] = self.grpc_channel.unary_unary( + "/google.container.v1beta1.ClusterManager/ListNodePools", + request_serializer=cluster_service.ListNodePoolsRequest.serialize, + response_deserializer=cluster_service.ListNodePoolsResponse.deserialize, ) - return self._stubs["get_json_web_keys"] + return self._stubs["list_node_pools"] @property def get_node_pool( diff --git a/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc_asyncio.py b/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc_asyncio.py index 2a4ce448..7613064d 100644 --- a/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc_asyncio.py +++ b/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc_asyncio.py @@ -742,35 +742,6 @@ def get_server_config( ) return self._stubs["get_server_config"] - @property - def list_node_pools( - self, - ) -> Callable[ - [cluster_service.ListNodePoolsRequest], - Awaitable[cluster_service.ListNodePoolsResponse], - ]: - r"""Return a callable for the list node pools method over gRPC. - - Lists the node pools for a cluster. - - Returns: - Callable[[~.ListNodePoolsRequest], - Awaitable[~.ListNodePoolsResponse]]: - A function that, when called, will call the underlying RPC - on the server. - """ - # Generate a "stub function" on-the-fly which will actually make - # the request. - # gRPC handles serialization and deserialization, so we just need - # to pass in the functions for each. - if "list_node_pools" not in self._stubs: - self._stubs["list_node_pools"] = self.grpc_channel.unary_unary( - "/google.container.v1beta1.ClusterManager/ListNodePools", - request_serializer=cluster_service.ListNodePoolsRequest.serialize, - response_deserializer=cluster_service.ListNodePoolsResponse.deserialize, - ) - return self._stubs["list_node_pools"] - @property def get_json_web_keys( self, @@ -803,6 +774,35 @@ def get_json_web_keys( ) return self._stubs["get_json_web_keys"] + @property + def list_node_pools( + self, + ) -> Callable[ + [cluster_service.ListNodePoolsRequest], + Awaitable[cluster_service.ListNodePoolsResponse], + ]: + r"""Return a callable for the list node pools method over gRPC. + + Lists the node pools for a cluster. + + Returns: + Callable[[~.ListNodePoolsRequest], + Awaitable[~.ListNodePoolsResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "list_node_pools" not in self._stubs: + self._stubs["list_node_pools"] = self.grpc_channel.unary_unary( + "/google.container.v1beta1.ClusterManager/ListNodePools", + request_serializer=cluster_service.ListNodePoolsRequest.serialize, + response_deserializer=cluster_service.ListNodePoolsResponse.deserialize, + ) + return self._stubs["list_node_pools"] + @property def get_node_pool( self, diff --git a/google/cloud/container_v1beta1/types/cluster_service.py b/google/cloud/container_v1beta1/types/cluster_service.py index 90fdc691..51bbfc9b 100644 --- a/google/cloud/container_v1beta1/types/cluster_service.py +++ b/google/cloud/container_v1beta1/types/cluster_service.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence from google.protobuf import duration_pb2 # type: ignore @@ -1174,7 +1176,7 @@ class Type(proto.Enum): class NodeTaint(proto.Message): - r"""Kubernetes taint is comprised of three fields: key, value, and + r"""Kubernetes taint is composed of three fields: key, value, and effect. Effect can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. diff --git a/samples/generated_samples/snippet_metadata_google.container.v1.json b/samples/generated_samples/snippet_metadata_google.container.v1.json index 4b26844f..7f74a032 100644 --- a/samples/generated_samples/snippet_metadata_google.container.v1.json +++ b/samples/generated_samples/snippet_metadata_google.container.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-container", - "version": "2.17.3" + "version": "2.17.4" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.container.v1beta1.json b/samples/generated_samples/snippet_metadata_google.container.v1beta1.json index 9a60665a..bb93ff08 100644 --- a/samples/generated_samples/snippet_metadata_google.container.v1beta1.json +++ b/samples/generated_samples/snippet_metadata_google.container.v1beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-container", - "version": "2.17.3" + "version": "2.17.4" }, "snippets": [ { diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index bb0f79d6..fe79784c 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1,3 +1,3 @@ -google-cloud-container==2.17.2 +google-cloud-container==2.17.3 backoff==2.2.1 pytest==7.2.1 \ No newline at end of file diff --git a/setup.py b/setup.py index f2375cb5..4150022e 100644 --- a/setup.py +++ b/setup.py @@ -55,9 +55,7 @@ if package.startswith("google") ] -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") +namespaces = ["google", "google.cloud"] setuptools.setup( name=name, diff --git a/tests/unit/gapic/container_v1beta1/test_cluster_manager.py b/tests/unit/gapic/container_v1beta1/test_cluster_manager.py index 9b550989..c299d152 100644 --- a/tests/unit/gapic/container_v1beta1/test_cluster_manager.py +++ b/tests/unit/gapic/container_v1beta1/test_cluster_manager.py @@ -5394,6 +5394,160 @@ async def test_get_server_config_flattened_error_async(): ) +@pytest.mark.parametrize( + "request_type", + [ + cluster_service.GetJSONWebKeysRequest, + dict, + ], +) +def test_get_json_web_keys(request_type, transport: str = "grpc"): + client = ClusterManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_json_web_keys), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = cluster_service.GetJSONWebKeysResponse() + response = client.get_json_web_keys(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == cluster_service.GetJSONWebKeysRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, cluster_service.GetJSONWebKeysResponse) + + +def test_get_json_web_keys_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_json_web_keys), "__call__" + ) as call: + client.get_json_web_keys() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cluster_service.GetJSONWebKeysRequest() + + +@pytest.mark.asyncio +async def test_get_json_web_keys_async( + transport: str = "grpc_asyncio", request_type=cluster_service.GetJSONWebKeysRequest +): + client = ClusterManagerAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_json_web_keys), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + cluster_service.GetJSONWebKeysResponse() + ) + response = await client.get_json_web_keys(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == cluster_service.GetJSONWebKeysRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, cluster_service.GetJSONWebKeysResponse) + + +@pytest.mark.asyncio +async def test_get_json_web_keys_async_from_dict(): + await test_get_json_web_keys_async(request_type=dict) + + +def test_get_json_web_keys_field_headers(): + client = ClusterManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = cluster_service.GetJSONWebKeysRequest() + + request.parent = "parent_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_json_web_keys), "__call__" + ) as call: + call.return_value = cluster_service.GetJSONWebKeysResponse() + client.get_json_web_keys(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "parent=parent_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_get_json_web_keys_field_headers_async(): + client = ClusterManagerAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = cluster_service.GetJSONWebKeysRequest() + + request.parent = "parent_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_json_web_keys), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + cluster_service.GetJSONWebKeysResponse() + ) + await client.get_json_web_keys(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "parent=parent_value", + ) in kw["metadata"] + + @pytest.mark.parametrize( "request_type", [ @@ -5640,160 +5794,6 @@ async def test_list_node_pools_flattened_error_async(): ) -@pytest.mark.parametrize( - "request_type", - [ - cluster_service.GetJSONWebKeysRequest, - dict, - ], -) -def test_get_json_web_keys(request_type, transport: str = "grpc"): - client = ClusterManagerClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_json_web_keys), "__call__" - ) as call: - # Designate an appropriate return value for the call. - call.return_value = cluster_service.GetJSONWebKeysResponse() - response = client.get_json_web_keys(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == cluster_service.GetJSONWebKeysRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, cluster_service.GetJSONWebKeysResponse) - - -def test_get_json_web_keys_empty_call(): - # This test is a coverage failsafe to make sure that totally empty calls, - # i.e. request == None and no flattened fields passed, work. - client = ClusterManagerClient( - credentials=ga_credentials.AnonymousCredentials(), - transport="grpc", - ) - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_json_web_keys), "__call__" - ) as call: - client.get_json_web_keys() - call.assert_called() - _, args, _ = call.mock_calls[0] - assert args[0] == cluster_service.GetJSONWebKeysRequest() - - -@pytest.mark.asyncio -async def test_get_json_web_keys_async( - transport: str = "grpc_asyncio", request_type=cluster_service.GetJSONWebKeysRequest -): - client = ClusterManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - transport=transport, - ) - - # Everything is optional in proto3 as far as the runtime is concerned, - # and we are mocking out the actual API, so just send an empty request. - request = request_type() - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_json_web_keys), "__call__" - ) as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - cluster_service.GetJSONWebKeysResponse() - ) - response = await client.get_json_web_keys(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == cluster_service.GetJSONWebKeysRequest() - - # Establish that the response is the type that we expect. - assert isinstance(response, cluster_service.GetJSONWebKeysResponse) - - -@pytest.mark.asyncio -async def test_get_json_web_keys_async_from_dict(): - await test_get_json_web_keys_async(request_type=dict) - - -def test_get_json_web_keys_field_headers(): - client = ClusterManagerClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = cluster_service.GetJSONWebKeysRequest() - - request.parent = "parent_value" - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_json_web_keys), "__call__" - ) as call: - call.return_value = cluster_service.GetJSONWebKeysResponse() - client.get_json_web_keys(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) == 1 - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - "x-goog-request-params", - "parent=parent_value", - ) in kw["metadata"] - - -@pytest.mark.asyncio -async def test_get_json_web_keys_field_headers_async(): - client = ClusterManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), - ) - - # Any value that is part of the HTTP/1.1 URI should be sent as - # a field header. Set these to a non-empty value. - request = cluster_service.GetJSONWebKeysRequest() - - request.parent = "parent_value" - - # Mock the actual call within the gRPC stub, and fake the request. - with mock.patch.object( - type(client.transport.get_json_web_keys), "__call__" - ) as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - cluster_service.GetJSONWebKeysResponse() - ) - await client.get_json_web_keys(request) - - # Establish that the underlying gRPC stub method was called. - assert len(call.mock_calls) - _, args, _ = call.mock_calls[0] - assert args[0] == request - - # Establish that the field header was sent. - _, _, kw = call.mock_calls[0] - assert ( - "x-goog-request-params", - "parent=parent_value", - ) in kw["metadata"] - - @pytest.mark.parametrize( "request_type", [ @@ -10430,8 +10430,8 @@ def test_cluster_manager_base_transport(): "get_operation", "cancel_operation", "get_server_config", - "list_node_pools", "get_json_web_keys", + "list_node_pools", "get_node_pool", "create_node_pool", "delete_node_pool",