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

Commit

Permalink
chore: use gapic-generator-python 0.51.2 (#113)
Browse files Browse the repository at this point in the history
* chore: use gapic-generator-python 0.51.2

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

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Sep 24, 2021
1 parent 56e81b6 commit 508cf67
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 42 deletions.
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 @@ -364,7 +364,7 @@ def __init__(

def list_functions(
self,
request: functions.ListFunctionsRequest = None,
request: Union[functions.ListFunctionsRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
Expand All @@ -374,7 +374,7 @@ def list_functions(
requested project.
Args:
request (google.cloud.functions_v1.types.ListFunctionsRequest):
request (Union[google.cloud.functions_v1.types.ListFunctionsRequest, dict]):
The request object. Request for the `ListFunctions`
method.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
Expand Down Expand Up @@ -423,7 +423,7 @@ def list_functions(

def get_function(
self,
request: functions.GetFunctionRequest = None,
request: Union[functions.GetFunctionRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -434,7 +434,7 @@ def get_function(
requested project.
Args:
request (google.cloud.functions_v1.types.GetFunctionRequest):
request (Union[google.cloud.functions_v1.types.GetFunctionRequest, dict]):
The request object. Request for the `GetFunction`
method.
name (str):
Expand Down Expand Up @@ -497,7 +497,7 @@ def get_function(

def create_function(
self,
request: functions.CreateFunctionRequest = None,
request: Union[functions.CreateFunctionRequest, dict] = None,
*,
location: str = None,
function: functions.CloudFunction = None,
Expand All @@ -510,7 +510,7 @@ def create_function(
operation will return ``ALREADY_EXISTS`` error.
Args:
request (google.cloud.functions_v1.types.CreateFunctionRequest):
request (Union[google.cloud.functions_v1.types.CreateFunctionRequest, dict]):
The request object. Request for the `CreateFunction`
method.
location (str):
Expand Down Expand Up @@ -590,7 +590,7 @@ def create_function(

def update_function(
self,
request: functions.UpdateFunctionRequest = None,
request: Union[functions.UpdateFunctionRequest, dict] = None,
*,
function: functions.CloudFunction = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -600,7 +600,7 @@ def update_function(
r"""Updates existing function.
Args:
request (google.cloud.functions_v1.types.UpdateFunctionRequest):
request (Union[google.cloud.functions_v1.types.UpdateFunctionRequest, dict]):
The request object. Request for the `UpdateFunction`
method.
function (google.cloud.functions_v1.types.CloudFunction):
Expand Down Expand Up @@ -674,7 +674,7 @@ def update_function(

def delete_function(
self,
request: functions.DeleteFunctionRequest = None,
request: Union[functions.DeleteFunctionRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -687,7 +687,7 @@ def delete_function(
function.
Args:
request (google.cloud.functions_v1.types.DeleteFunctionRequest):
request (Union[google.cloud.functions_v1.types.DeleteFunctionRequest, dict]):
The request object. Request for the `DeleteFunction`
method.
name (str):
Expand Down Expand Up @@ -769,7 +769,7 @@ def delete_function(

def call_function(
self,
request: functions.CallFunctionRequest = None,
request: Union[functions.CallFunctionRequest, dict] = None,
*,
name: str = None,
data: str = None,
Expand All @@ -783,7 +783,7 @@ def call_function(
Limits <https://cloud.google.com/functions/quotas#rate_limits>`__.
Args:
request (google.cloud.functions_v1.types.CallFunctionRequest):
request (Union[google.cloud.functions_v1.types.CallFunctionRequest, dict]):
The request object. Request for the `CallFunction`
method.
name (str):
Expand Down Expand Up @@ -851,7 +851,7 @@ def call_function(

def generate_upload_url(
self,
request: functions.GenerateUploadUrlRequest = None,
request: Union[functions.GenerateUploadUrlRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
Expand Down Expand Up @@ -887,7 +887,7 @@ def generate_upload_url(
- ``Authorization: Bearer YOUR_TOKEN``
Args:
request (google.cloud.functions_v1.types.GenerateUploadUrlRequest):
request (Union[google.cloud.functions_v1.types.GenerateUploadUrlRequest, dict]):
The request object. Request of `GenerateSourceUploadUrl`
method.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
Expand Down Expand Up @@ -926,7 +926,7 @@ def generate_upload_url(

def generate_download_url(
self,
request: functions.GenerateDownloadUrlRequest = None,
request: Union[functions.GenerateDownloadUrlRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
Expand All @@ -941,7 +941,7 @@ def generate_download_url(
control/signed-urls
Args:
request (google.cloud.functions_v1.types.GenerateDownloadUrlRequest):
request (Union[google.cloud.functions_v1.types.GenerateDownloadUrlRequest, dict]):
The request object. Request of `GenerateDownloadUrl`
method.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
Expand Down Expand Up @@ -980,7 +980,7 @@ def generate_download_url(

def set_iam_policy(
self,
request: iam_policy_pb2.SetIamPolicyRequest = None,
request: Union[iam_policy_pb2.SetIamPolicyRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
Expand All @@ -990,7 +990,7 @@ def set_iam_policy(
function. Replaces any existing policy.
Args:
request (google.iam.v1.iam_policy_pb2.SetIamPolicyRequest):
request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]):
The request object. Request message for `SetIamPolicy`
method.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
Expand Down Expand Up @@ -1085,7 +1085,7 @@ def set_iam_policy(

def get_iam_policy(
self,
request: iam_policy_pb2.GetIamPolicyRequest = None,
request: Union[iam_policy_pb2.GetIamPolicyRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
Expand All @@ -1096,7 +1096,7 @@ def get_iam_policy(
not have a policy set.
Args:
request (google.iam.v1.iam_policy_pb2.GetIamPolicyRequest):
request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]):
The request object. Request message for `GetIamPolicy`
method.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
Expand Down Expand Up @@ -1191,7 +1191,7 @@ def get_iam_policy(

def test_iam_permissions(
self,
request: iam_policy_pb2.TestIamPermissionsRequest = None,
request: Union[iam_policy_pb2.TestIamPermissionsRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
Expand All @@ -1202,7 +1202,7 @@ def test_iam_permissions(
return an empty set of permissions, not a NOT_FOUND error.
Args:
request (google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest):
request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]):
The request object. Request message for
`TestIamPermissions` method.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
Expand Down
Expand Up @@ -119,7 +119,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
Expand Up @@ -85,16 +85,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
Expand Up @@ -132,16 +132,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_functions_v1_keywords.py
Expand Up @@ -39,17 +39,17 @@ def partition(
class functionsCallTransformer(cst.CSTTransformer):
CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata')
METHOD_TO_PARAMS: Dict[str, Tuple[str]] = {
'call_function': ('name', 'data', ),
'create_function': ('location', 'function', ),
'delete_function': ('name', ),
'generate_download_url': ('name', 'version_id', ),
'generate_upload_url': ('parent', ),
'get_function': ('name', ),
'get_iam_policy': ('resource', 'options', ),
'list_functions': ('parent', 'page_size', 'page_token', ),
'set_iam_policy': ('resource', 'policy', ),
'test_iam_permissions': ('resource', 'permissions', ),
'update_function': ('function', 'update_mask', ),
'call_function': ('name', 'data', ),
'create_function': ('location', 'function', ),
'delete_function': ('name', ),
'generate_download_url': ('name', 'version_id', ),
'generate_upload_url': ('parent', ),
'get_function': ('name', ),
'get_iam_policy': ('resource', 'options', ),
'list_functions': ('parent', 'page_size', 'page_token', ),
'set_iam_policy': ('resource', 'policy', ),
'test_iam_permissions': ('resource', 'permissions', ),
'update_function': ('function', 'update_mask', ),
}

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 508cf67

Please sign in to comment.