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

Commit

Permalink
Browse files Browse the repository at this point in the history
chore: use gapic-generator-python 0.51.2 (#132)
- [ ] 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 b1e2c0d commit 4a5ed62
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 33 deletions.
14 changes: 7 additions & 7 deletions google/cloud/trace_v1/services/trace_service/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 @@ -340,7 +340,7 @@ def __init__(

def list_traces(
self,
request: trace.ListTracesRequest = None,
request: Union[trace.ListTracesRequest, dict] = None,
*,
project_id: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
Expand All @@ -351,7 +351,7 @@ def list_traces(
filter conditions.
Args:
request (google.cloud.trace_v1.types.ListTracesRequest):
request (Union[google.cloud.trace_v1.types.ListTracesRequest, dict]):
The request object. The request message for the
`ListTraces` method. All fields are required unless
specified.
Expand Down Expand Up @@ -415,7 +415,7 @@ def list_traces(

def get_trace(
self,
request: trace.GetTraceRequest = None,
request: Union[trace.GetTraceRequest, dict] = None,
*,
project_id: str = None,
trace_id: str = None,
Expand All @@ -426,7 +426,7 @@ def get_trace(
r"""Gets a single trace by its ID.
Args:
request (google.cloud.trace_v1.types.GetTraceRequest):
request (Union[google.cloud.trace_v1.types.GetTraceRequest, dict]):
The request object. The request message for the
`GetTrace` method.
project_id (str):
Expand Down Expand Up @@ -491,7 +491,7 @@ def get_trace(

def patch_traces(
self,
request: trace.PatchTracesRequest = None,
request: Union[trace.PatchTracesRequest, dict] = None,
*,
project_id: str = None,
traces: trace.Traces = None,
Expand All @@ -508,7 +508,7 @@ def patch_traces(
a new trace is created.
Args:
request (google.cloud.trace_v1.types.PatchTracesRequest):
request (Union[google.cloud.trace_v1.types.PatchTracesRequest, dict]):
The request object. The request message for the
`PatchTraces` method.
project_id (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 @@ -86,16 +86,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 @@ -133,16 +133,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
10 changes: 5 additions & 5 deletions google/cloud/trace_v2/services/trace_service/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 @@ -359,7 +359,7 @@ def __init__(

def batch_write_spans(
self,
request: tracing.BatchWriteSpansRequest = None,
request: Union[tracing.BatchWriteSpansRequest, dict] = None,
*,
name: str = None,
spans: Sequence[trace.Span] = None,
Expand All @@ -371,7 +371,7 @@ def batch_write_spans(
update existing spans.
Args:
request (google.cloud.trace_v2.types.BatchWriteSpansRequest):
request (Union[google.cloud.trace_v2.types.BatchWriteSpansRequest, dict]):
The request object. The request message for the
`BatchWriteSpans` method.
name (str):
Expand Down Expand Up @@ -435,7 +435,7 @@ def batch_write_spans(

def create_span(
self,
request: trace.Span = None,
request: Union[trace.Span, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
Expand All @@ -444,7 +444,7 @@ def create_span(
r"""Creates a new span.
Args:
request (google.cloud.trace_v2.types.Span):
request (Union[google.cloud.trace_v2.types.Span, dict]):
The request object. A span represents a single operation
within a trace. Spans can be nested to form a trace
tree. Often, a trace contains a root span that describes
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 @@ -87,16 +87,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 @@ -134,16 +134,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
8 changes: 4 additions & 4 deletions scripts/fixup_trace_v1_keywords.py
Expand Up @@ -39,9 +39,9 @@ def partition(
class traceCallTransformer(cst.CSTTransformer):
CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata')
METHOD_TO_PARAMS: Dict[str, Tuple[str]] = {
'get_trace': ('project_id', 'trace_id', ),
'list_traces': ('project_id', 'view', 'page_size', 'page_token', 'start_time', 'end_time', 'filter', 'order_by', ),
'patch_traces': ('project_id', 'traces', ),
'get_trace': ('project_id', 'trace_id', ),
'list_traces': ('project_id', 'view', 'page_size', 'page_token', 'start_time', 'end_time', 'filter', 'order_by', ),
'patch_traces': ('project_id', 'traces', ),
}

def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode:
Expand All @@ -60,7 +60,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
6 changes: 3 additions & 3 deletions scripts/fixup_trace_v2_keywords.py
Expand Up @@ -39,8 +39,8 @@ def partition(
class traceCallTransformer(cst.CSTTransformer):
CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata')
METHOD_TO_PARAMS: Dict[str, Tuple[str]] = {
'batch_write_spans': ('name', 'spans', ),
'create_span': ('name', 'span_id', 'display_name', 'start_time', 'end_time', 'parent_span_id', 'attributes', 'stack_trace', 'time_events', 'links', 'status', 'same_process_as_parent_span', 'child_span_count', 'span_kind', ),
'batch_write_spans': ('name', 'spans', ),
'create_span': ('name', 'span_id', 'display_name', 'start_time', 'end_time', 'parent_span_id', 'attributes', 'stack_trace', 'time_events', 'links', 'status', 'same_process_as_parent_span', 'child_span_count', 'span_kind', ),
}

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

Please sign in to comment.