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 (#123)
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: https://github.com/googleapis/googleapis-gen/commit/63a1db7a38d74b9639592f521ed1daaf7299ad9a
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjNhMWRiN2EzOGQ3NGI5NjM5NTkyZjUyMWVkMWRhYWY3Mjk5YWQ5YSJ9
  • Loading branch information
gcf-owl-bot[bot] authored Sep 24, 2021
1 parent 00d3db2 commit 7d49e68
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 36 deletions.
Original file line number Diff line number Diff line change
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 @@ -378,7 +378,7 @@ def __init__(

def create_assessment(
self,
request: recaptchaenterprise.CreateAssessmentRequest = None,
request: Union[recaptchaenterprise.CreateAssessmentRequest, dict] = None,
*,
parent: str = None,
assessment: recaptchaenterprise.Assessment = None,
Expand All @@ -390,7 +390,7 @@ def create_assessment(
legitimate.
Args:
request (google.cloud.recaptchaenterprise_v1.types.CreateAssessmentRequest):
request (Union[google.cloud.recaptchaenterprise_v1.types.CreateAssessmentRequest, dict]):
The request object. The create assessment request
message.
parent (str):
Expand Down Expand Up @@ -457,7 +457,7 @@ def create_assessment(

def annotate_assessment(
self,
request: recaptchaenterprise.AnnotateAssessmentRequest = None,
request: Union[recaptchaenterprise.AnnotateAssessmentRequest, dict] = None,
*,
name: str = None,
annotation: recaptchaenterprise.AnnotateAssessmentRequest.Annotation = None,
Expand All @@ -470,7 +470,7 @@ def annotate_assessment(
to be authentic or fraudulent.
Args:
request (google.cloud.recaptchaenterprise_v1.types.AnnotateAssessmentRequest):
request (Union[google.cloud.recaptchaenterprise_v1.types.AnnotateAssessmentRequest, dict]):
The request object. The request message to annotate an
Assessment.
name (str):
Expand Down Expand Up @@ -544,7 +544,7 @@ def annotate_assessment(

def create_key(
self,
request: recaptchaenterprise.CreateKeyRequest = None,
request: Union[recaptchaenterprise.CreateKeyRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
Expand All @@ -553,7 +553,7 @@ def create_key(
r"""Creates a new reCAPTCHA Enterprise key.
Args:
request (google.cloud.recaptchaenterprise_v1.types.CreateKeyRequest):
request (Union[google.cloud.recaptchaenterprise_v1.types.CreateKeyRequest, dict]):
The request object. The create key request message.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
Expand Down Expand Up @@ -594,7 +594,7 @@ def create_key(

def list_keys(
self,
request: recaptchaenterprise.ListKeysRequest = None,
request: Union[recaptchaenterprise.ListKeysRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
Expand All @@ -604,7 +604,7 @@ def list_keys(
project.
Args:
request (google.cloud.recaptchaenterprise_v1.types.ListKeysRequest):
request (Union[google.cloud.recaptchaenterprise_v1.types.ListKeysRequest, dict]):
The request object. The list keys request message.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
Expand Down Expand Up @@ -653,7 +653,7 @@ def list_keys(

def get_key(
self,
request: recaptchaenterprise.GetKeyRequest = None,
request: Union[recaptchaenterprise.GetKeyRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
Expand All @@ -662,7 +662,7 @@ def get_key(
r"""Returns the specified key.
Args:
request (google.cloud.recaptchaenterprise_v1.types.GetKeyRequest):
request (Union[google.cloud.recaptchaenterprise_v1.types.GetKeyRequest, dict]):
The request object. The get key request message.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
Expand Down Expand Up @@ -703,7 +703,7 @@ def get_key(

def update_key(
self,
request: recaptchaenterprise.UpdateKeyRequest = None,
request: Union[recaptchaenterprise.UpdateKeyRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
Expand All @@ -712,7 +712,7 @@ def update_key(
r"""Updates the specified key.
Args:
request (google.cloud.recaptchaenterprise_v1.types.UpdateKeyRequest):
request (Union[google.cloud.recaptchaenterprise_v1.types.UpdateKeyRequest, dict]):
The request object. The update key request message.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
Expand Down Expand Up @@ -753,7 +753,7 @@ def update_key(

def delete_key(
self,
request: recaptchaenterprise.DeleteKeyRequest = None,
request: Union[recaptchaenterprise.DeleteKeyRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
Expand All @@ -762,7 +762,7 @@ def delete_key(
r"""Deletes the specified key.
Args:
request (google.cloud.recaptchaenterprise_v1.types.DeleteKeyRequest):
request (Union[google.cloud.recaptchaenterprise_v1.types.DeleteKeyRequest, dict]):
The request object. The delete key request message.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
Expand Down Expand Up @@ -795,7 +795,7 @@ def delete_key(

def migrate_key(
self,
request: recaptchaenterprise.MigrateKeyRequest = None,
request: Union[recaptchaenterprise.MigrateKeyRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
Expand All @@ -810,7 +810,7 @@ def migrate_key(
role in the destination project.
Args:
request (google.cloud.recaptchaenterprise_v1.types.MigrateKeyRequest):
request (Union[google.cloud.recaptchaenterprise_v1.types.MigrateKeyRequest, dict]):
The request object. The migrate key request message.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
Expand Down Expand Up @@ -851,7 +851,7 @@ def migrate_key(

def get_metrics(
self,
request: recaptchaenterprise.GetMetricsRequest = None,
request: Union[recaptchaenterprise.GetMetricsRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -862,7 +862,7 @@ def get_metrics(
be used to build dashboards.
Args:
request (google.cloud.recaptchaenterprise_v1.types.GetMetricsRequest):
request (Union[google.cloud.recaptchaenterprise_v1.types.GetMetricsRequest, dict]):
The request object. The get metrics request message.
name (str):
Required. The name of the requested
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,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
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,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
Original file line number Diff line number Diff line change
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
20 changes: 10 additions & 10 deletions scripts/fixup_recaptchaenterprise_v1_keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ def partition(
class recaptchaenterpriseCallTransformer(cst.CSTTransformer):
CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata')
METHOD_TO_PARAMS: Dict[str, Tuple[str]] = {
'annotate_assessment': ('name', 'annotation', 'reasons', ),
'create_assessment': ('parent', 'assessment', ),
'create_key': ('parent', 'key', ),
'delete_key': ('name', ),
'get_key': ('name', ),
'get_metrics': ('name', ),
'list_keys': ('parent', 'page_size', 'page_token', ),
'migrate_key': ('name', ),
'update_key': ('key', 'update_mask', ),
'annotate_assessment': ('name', 'annotation', 'reasons', ),
'create_assessment': ('parent', 'assessment', ),
'create_key': ('parent', 'key', ),
'delete_key': ('name', ),
'get_key': ('name', ),
'get_metrics': ('name', ),
'list_keys': ('parent', 'page_size', 'page_token', ),
'migrate_key': ('name', ),
'update_key': ('key', 'update_mask', ),
}

def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode:
Expand All @@ -66,7 +66,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 7d49e68

Please sign in to comment.