Navigation Menu

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

Commit

Permalink
chore: use gapic-generator-python 0.51.2 (#85)
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 42b2a4f commit 5c4dd09
Show file tree
Hide file tree
Showing 9 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 @@ -358,7 +358,7 @@ def __init__(

def create_workload(
self,
request: assuredworkloads.CreateWorkloadRequest = None,
request: Union[assuredworkloads.CreateWorkloadRequest, dict] = None,
*,
parent: str = None,
workload: assuredworkloads.Workload = None,
Expand All @@ -369,7 +369,7 @@ def create_workload(
r"""Creates Assured Workload.
Args:
request (google.cloud.assuredworkloads_v1.types.CreateWorkloadRequest):
request (Union[google.cloud.assuredworkloads_v1.types.CreateWorkloadRequest, dict]):
The request object. Request for creating a workload.
parent (str):
Required. The resource name of the new Workload's
Expand Down Expand Up @@ -447,7 +447,7 @@ def create_workload(

def update_workload(
self,
request: assuredworkloads.UpdateWorkloadRequest = None,
request: Union[assuredworkloads.UpdateWorkloadRequest, dict] = None,
*,
workload: assuredworkloads.Workload = None,
update_mask: field_mask_pb2.FieldMask = None,
Expand All @@ -461,7 +461,7 @@ def update_workload(
workload can be in progress.
Args:
request (google.cloud.assuredworkloads_v1.types.UpdateWorkloadRequest):
request (Union[google.cloud.assuredworkloads_v1.types.UpdateWorkloadRequest, dict]):
The request object. Request for Updating a workload.
workload (google.cloud.assuredworkloads_v1.types.Workload):
Required. The workload to update. The workload’s
Expand Down Expand Up @@ -535,7 +535,7 @@ def update_workload(

def delete_workload(
self,
request: assuredworkloads.DeleteWorkloadRequest = None,
request: Union[assuredworkloads.DeleteWorkloadRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -547,7 +547,7 @@ def delete_workload(
with a FAILED_PRECONDITION error.
Args:
request (google.cloud.assuredworkloads_v1.types.DeleteWorkloadRequest):
request (Union[google.cloud.assuredworkloads_v1.types.DeleteWorkloadRequest, dict]):
The request object. Request for deleting a Workload.
name (str):
Required. The ``name`` field is used to identify the
Expand Down Expand Up @@ -601,7 +601,7 @@ def delete_workload(

def get_workload(
self,
request: assuredworkloads.GetWorkloadRequest = None,
request: Union[assuredworkloads.GetWorkloadRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -611,7 +611,7 @@ def get_workload(
r"""Gets Assured Workload associated with a CRM Node
Args:
request (google.cloud.assuredworkloads_v1.types.GetWorkloadRequest):
request (Union[google.cloud.assuredworkloads_v1.types.GetWorkloadRequest, dict]):
The request object. Request for fetching a workload.
name (str):
Required. The resource name of the Workload to fetch.
Expand Down Expand Up @@ -676,7 +676,7 @@ def get_workload(

def list_workloads(
self,
request: assuredworkloads.ListWorkloadsRequest = None,
request: Union[assuredworkloads.ListWorkloadsRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -686,7 +686,7 @@ def list_workloads(
r"""Lists Assured Workloads under a CRM Node.
Args:
request (google.cloud.assuredworkloads_v1.types.ListWorkloadsRequest):
request (Union[google.cloud.assuredworkloads_v1.types.ListWorkloadsRequest, dict]):
The request object. Request for fetching workloads in an
organization.
parent (str):
Expand Down
Expand Up @@ -120,7 +120,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 @@ -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
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
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 @@ -360,7 +360,7 @@ def __init__(

def create_workload(
self,
request: assuredworkloads_v1beta1.CreateWorkloadRequest = None,
request: Union[assuredworkloads_v1beta1.CreateWorkloadRequest, dict] = None,
*,
parent: str = None,
workload: assuredworkloads_v1beta1.Workload = None,
Expand All @@ -371,7 +371,7 @@ def create_workload(
r"""Creates Assured Workload.
Args:
request (google.cloud.assuredworkloads_v1beta1.types.CreateWorkloadRequest):
request (Union[google.cloud.assuredworkloads_v1beta1.types.CreateWorkloadRequest, dict]):
The request object. Request for creating a workload.
parent (str):
Required. The resource name of the new Workload's
Expand Down Expand Up @@ -449,7 +449,7 @@ def create_workload(

def update_workload(
self,
request: assuredworkloads_v1beta1.UpdateWorkloadRequest = None,
request: Union[assuredworkloads_v1beta1.UpdateWorkloadRequest, dict] = None,
*,
workload: assuredworkloads_v1beta1.Workload = None,
update_mask: field_mask_pb2.FieldMask = None,
Expand All @@ -463,7 +463,7 @@ def update_workload(
workload can be in progress.
Args:
request (google.cloud.assuredworkloads_v1beta1.types.UpdateWorkloadRequest):
request (Union[google.cloud.assuredworkloads_v1beta1.types.UpdateWorkloadRequest, dict]):
The request object. Request for Updating a workload.
workload (google.cloud.assuredworkloads_v1beta1.types.Workload):
Required. The workload to update. The workload’s
Expand Down Expand Up @@ -537,7 +537,7 @@ def update_workload(

def delete_workload(
self,
request: assuredworkloads_v1beta1.DeleteWorkloadRequest = None,
request: Union[assuredworkloads_v1beta1.DeleteWorkloadRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -549,7 +549,7 @@ def delete_workload(
with a FAILED_PRECONDITION error.
Args:
request (google.cloud.assuredworkloads_v1beta1.types.DeleteWorkloadRequest):
request (Union[google.cloud.assuredworkloads_v1beta1.types.DeleteWorkloadRequest, dict]):
The request object. Request for deleting a Workload.
name (str):
Required. The ``name`` field is used to identify the
Expand Down Expand Up @@ -603,7 +603,7 @@ def delete_workload(

def get_workload(
self,
request: assuredworkloads_v1beta1.GetWorkloadRequest = None,
request: Union[assuredworkloads_v1beta1.GetWorkloadRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -613,7 +613,7 @@ def get_workload(
r"""Gets Assured Workload associated with a CRM Node
Args:
request (google.cloud.assuredworkloads_v1beta1.types.GetWorkloadRequest):
request (Union[google.cloud.assuredworkloads_v1beta1.types.GetWorkloadRequest, dict]):
The request object. Request for fetching a workload.
name (str):
Required. The resource name of the Workload to fetch.
Expand Down Expand Up @@ -678,7 +678,7 @@ def get_workload(

def list_workloads(
self,
request: assuredworkloads_v1beta1.ListWorkloadsRequest = None,
request: Union[assuredworkloads_v1beta1.ListWorkloadsRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -688,7 +688,7 @@ def list_workloads(
r"""Lists Assured Workloads under a CRM Node.
Args:
request (google.cloud.assuredworkloads_v1beta1.types.ListWorkloadsRequest):
request (Union[google.cloud.assuredworkloads_v1beta1.types.ListWorkloadsRequest, dict]):
The request object. Request for fetching workloads in an
organization.
parent (str):
Expand Down
Expand Up @@ -120,7 +120,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 @@ -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
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
12 changes: 6 additions & 6 deletions scripts/fixup_assuredworkloads_v1_keywords.py
Expand Up @@ -39,11 +39,11 @@ def partition(
class assuredworkloadsCallTransformer(cst.CSTTransformer):
CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata')
METHOD_TO_PARAMS: Dict[str, Tuple[str]] = {
'create_workload': ('parent', 'workload', 'external_id', ),
'delete_workload': ('name', 'etag', ),
'get_workload': ('name', ),
'list_workloads': ('parent', 'page_size', 'page_token', 'filter', ),
'update_workload': ('workload', 'update_mask', ),
'create_workload': ('parent', 'workload', 'external_id', ),
'delete_workload': ('name', 'etag', ),
'get_workload': ('name', ),
'list_workloads': ('parent', 'page_size', 'page_token', 'filter', ),
'update_workload': ('workload', 'update_mask', ),
}

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

Please sign in to comment.