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

Commit

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

fix: add 'dict' annotation type to 'request'

Committer: @busunkim96
PiperOrigin-RevId: 398509016

Source-Link: googleapis/googleapis@b224dfa

Source-Link: googleapis/googleapis-gen@63a1db7
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjNhMWRiN2EzOGQ3NGI5NjM5NTkyZjUyMWVkMWRhYWY3Mjk5YWQ5YSJ9
  • Loading branch information
gcf-owl-bot[bot] committed Sep 24, 2021
1 parent 6339e07 commit 2487395
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 42 deletions.
46 changes: 23 additions & 23 deletions google/cloud/tpu_v1/services/tpu/client.py
Expand Up @@ -17,7 +17,7 @@
from distutils import util
import os
import re
from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union
from typing import Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core import client_options as client_options_lib # type: ignore
Expand Down Expand Up @@ -391,7 +391,7 @@ def __init__(

def list_nodes(
self,
request: cloud_tpu.ListNodesRequest = None,
request: Union[cloud_tpu.ListNodesRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -401,7 +401,7 @@ def list_nodes(
r"""Lists nodes.
Args:
request (google.cloud.tpu_v1.types.ListNodesRequest):
request (Union[google.cloud.tpu_v1.types.ListNodesRequest, dict]):
The request object. Request for
[ListNodes][google.cloud.tpu.v1.Tpu.ListNodes].
parent (str):
Expand Down Expand Up @@ -469,7 +469,7 @@ def list_nodes(

def get_node(
self,
request: cloud_tpu.GetNodeRequest = None,
request: Union[cloud_tpu.GetNodeRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -479,7 +479,7 @@ def get_node(
r"""Gets the details of a node.
Args:
request (google.cloud.tpu_v1.types.GetNodeRequest):
request (Union[google.cloud.tpu_v1.types.GetNodeRequest, dict]):
The request object. Request for
[GetNode][google.cloud.tpu.v1.Tpu.GetNode].
name (str):
Expand Down Expand Up @@ -536,7 +536,7 @@ def get_node(

def create_node(
self,
request: cloud_tpu.CreateNodeRequest = None,
request: Union[cloud_tpu.CreateNodeRequest, dict] = None,
*,
parent: str = None,
node: cloud_tpu.Node = None,
Expand All @@ -548,7 +548,7 @@ def create_node(
r"""Creates a node.
Args:
request (google.cloud.tpu_v1.types.CreateNodeRequest):
request (Union[google.cloud.tpu_v1.types.CreateNodeRequest, dict]):
The request object. Request for
[CreateNode][google.cloud.tpu.v1.Tpu.CreateNode].
parent (str):
Expand Down Expand Up @@ -631,7 +631,7 @@ def create_node(

def delete_node(
self,
request: cloud_tpu.DeleteNodeRequest = None,
request: Union[cloud_tpu.DeleteNodeRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -641,7 +641,7 @@ def delete_node(
r"""Deletes a node.
Args:
request (google.cloud.tpu_v1.types.DeleteNodeRequest):
request (Union[google.cloud.tpu_v1.types.DeleteNodeRequest, dict]):
The request object. Request for
[DeleteNode][google.cloud.tpu.v1.Tpu.DeleteNode].
name (str):
Expand Down Expand Up @@ -710,7 +710,7 @@ def delete_node(

def reimage_node(
self,
request: cloud_tpu.ReimageNodeRequest = None,
request: Union[cloud_tpu.ReimageNodeRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
Expand All @@ -719,7 +719,7 @@ def reimage_node(
r"""Reimages a node's OS.
Args:
request (google.cloud.tpu_v1.types.ReimageNodeRequest):
request (Union[google.cloud.tpu_v1.types.ReimageNodeRequest, dict]):
The request object. Request for
[ReimageNode][google.cloud.tpu.v1.Tpu.ReimageNode].
retry (google.api_core.retry.Retry): Designation of what errors, if any,
Expand Down Expand Up @@ -770,7 +770,7 @@ def reimage_node(

def stop_node(
self,
request: cloud_tpu.StopNodeRequest = None,
request: Union[cloud_tpu.StopNodeRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
Expand All @@ -779,7 +779,7 @@ def stop_node(
r"""Stops a node.
Args:
request (google.cloud.tpu_v1.types.StopNodeRequest):
request (Union[google.cloud.tpu_v1.types.StopNodeRequest, dict]):
The request object. Request for
[StopNode][google.cloud.tpu.v1.Tpu.StopNode].
retry (google.api_core.retry.Retry): Designation of what errors, if any,
Expand Down Expand Up @@ -830,7 +830,7 @@ def stop_node(

def start_node(
self,
request: cloud_tpu.StartNodeRequest = None,
request: Union[cloud_tpu.StartNodeRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
Expand All @@ -839,7 +839,7 @@ def start_node(
r"""Starts a node.
Args:
request (google.cloud.tpu_v1.types.StartNodeRequest):
request (Union[google.cloud.tpu_v1.types.StartNodeRequest, dict]):
The request object. Request for
[StartNode][google.cloud.tpu.v1.Tpu.StartNode].
retry (google.api_core.retry.Retry): Designation of what errors, if any,
Expand Down Expand Up @@ -890,7 +890,7 @@ def start_node(

def list_tensor_flow_versions(
self,
request: cloud_tpu.ListTensorFlowVersionsRequest = None,
request: Union[cloud_tpu.ListTensorFlowVersionsRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -900,7 +900,7 @@ def list_tensor_flow_versions(
r"""List TensorFlow versions supported by this API.
Args:
request (google.cloud.tpu_v1.types.ListTensorFlowVersionsRequest):
request (Union[google.cloud.tpu_v1.types.ListTensorFlowVersionsRequest, dict]):
The request object. Request for
[ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
parent (str):
Expand Down Expand Up @@ -970,7 +970,7 @@ def list_tensor_flow_versions(

def get_tensor_flow_version(
self,
request: cloud_tpu.GetTensorFlowVersionRequest = None,
request: Union[cloud_tpu.GetTensorFlowVersionRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -980,7 +980,7 @@ def get_tensor_flow_version(
r"""Gets TensorFlow Version.
Args:
request (google.cloud.tpu_v1.types.GetTensorFlowVersionRequest):
request (Union[google.cloud.tpu_v1.types.GetTensorFlowVersionRequest, dict]):
The request object. Request for
[GetTensorFlowVersion][google.cloud.tpu.v1.Tpu.GetTensorFlowVersion].
name (str):
Expand Down Expand Up @@ -1039,7 +1039,7 @@ def get_tensor_flow_version(

def list_accelerator_types(
self,
request: cloud_tpu.ListAcceleratorTypesRequest = None,
request: Union[cloud_tpu.ListAcceleratorTypesRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -1049,7 +1049,7 @@ def list_accelerator_types(
r"""Lists accelerator types supported by this API.
Args:
request (google.cloud.tpu_v1.types.ListAcceleratorTypesRequest):
request (Union[google.cloud.tpu_v1.types.ListAcceleratorTypesRequest, dict]):
The request object. Request for
[ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
parent (str):
Expand Down Expand Up @@ -1117,7 +1117,7 @@ def list_accelerator_types(

def get_accelerator_type(
self,
request: cloud_tpu.GetAcceleratorTypeRequest = None,
request: Union[cloud_tpu.GetAcceleratorTypeRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -1127,7 +1127,7 @@ def get_accelerator_type(
r"""Gets AcceleratorType.
Args:
request (google.cloud.tpu_v1.types.GetAcceleratorTypeRequest):
request (Union[google.cloud.tpu_v1.types.GetAcceleratorTypeRequest, dict]):
The request object. Request for
[GetAcceleratorType][google.cloud.tpu.v1.Tpu.GetAcceleratorType].
name (str):
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/tpu_v1/services/tpu/transports/base.py
Expand Up @@ -117,7 +117,7 @@ def __init__(
**scopes_kwargs, quota_project_id=quota_project_id
)

# If the credentials is service account credentials, then always try to use self signed JWT.
# If the credentials are service account credentials, then always try to use self signed JWT.
if (
always_use_jwt_access
and isinstance(credentials, service_account.Credentials)
Expand Down
6 changes: 3 additions & 3 deletions google/cloud/tpu_v1/services/tpu/transports/grpc.py
Expand Up @@ -83,16 +83,16 @@ def __init__(
api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
If provided, it overrides the ``host`` argument and tries to create
a mutual TLS channel with client SSL credentials from
``client_cert_source`` or applicatin default SSL credentials.
``client_cert_source`` or application default SSL credentials.
client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]):
Deprecated. A callback to provide client SSL certificate bytes and
private key bytes, both in PEM format. It is ignored if
``api_mtls_endpoint`` is None.
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
for grpc channel. It is ignored if ``channel`` is provided.
for the grpc channel. It is ignored if ``channel`` is provided.
client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
A callback to provide client certificate bytes and private key bytes,
both in PEM format. It is used to configure mutual TLS channel. It is
both in PEM format. It is used to configure a mutual TLS channel. It is
ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
Expand Down
6 changes: 3 additions & 3 deletions google/cloud/tpu_v1/services/tpu/transports/grpc_asyncio.py
Expand Up @@ -130,16 +130,16 @@ def __init__(
api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
If provided, it overrides the ``host`` argument and tries to create
a mutual TLS channel with client SSL credentials from
``client_cert_source`` or applicatin default SSL credentials.
``client_cert_source`` or application default SSL credentials.
client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]):
Deprecated. A callback to provide client SSL certificate bytes and
private key bytes, both in PEM format. It is ignored if
``api_mtls_endpoint`` is None.
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
for grpc channel. It is ignored if ``channel`` is provided.
for the grpc channel. It is ignored if ``channel`` is provided.
client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
A callback to provide client certificate bytes and private key bytes,
both in PEM format. It is used to configure mutual TLS channel. It is
both in PEM format. It is used to configure a mutual TLS channel. It is
ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
Expand Down
24 changes: 12 additions & 12 deletions scripts/fixup_tpu_v1_keywords.py
Expand Up @@ -39,17 +39,17 @@ def partition(
class tpuCallTransformer(cst.CSTTransformer):
CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata')
METHOD_TO_PARAMS: Dict[str, Tuple[str]] = {
'create_node': ('parent', 'node', 'node_id', ),
'delete_node': ('name', ),
'get_accelerator_type': ('name', ),
'get_node': ('name', ),
'get_tensor_flow_version': ('name', ),
'list_accelerator_types': ('parent', 'page_size', 'page_token', 'filter', 'order_by', ),
'list_nodes': ('parent', 'page_size', 'page_token', ),
'list_tensor_flow_versions': ('parent', 'page_size', 'page_token', 'filter', 'order_by', ),
'reimage_node': ('name', 'tensorflow_version', ),
'start_node': ('name', ),
'stop_node': ('name', ),
'create_node': ('parent', 'node', 'node_id', ),
'delete_node': ('name', ),
'get_accelerator_type': ('name', ),
'get_node': ('name', ),
'get_tensor_flow_version': ('name', ),
'list_accelerator_types': ('parent', 'page_size', 'page_token', 'filter', 'order_by', ),
'list_nodes': ('parent', 'page_size', 'page_token', ),
'list_tensor_flow_versions': ('parent', 'page_size', 'page_token', 'filter', 'order_by', ),
'reimage_node': ('name', 'tensorflow_version', ),
'start_node': ('name', ),
'stop_node': ('name', ),
}

def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode:
Expand All @@ -68,7 +68,7 @@ def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode:
return updated

kwargs, ctrl_kwargs = partition(
lambda a: not a.keyword.value in self.CTRL_PARAMS,
lambda a: a.keyword.value not in self.CTRL_PARAMS,
kwargs
)

Expand Down

0 comments on commit 2487395

Please sign in to comment.