1- {% extends ' _base.py.j2' %}
1+ {% extends " _base.py.j2" %}
22
33{% block content %}
44
@@ -51,7 +51,8 @@ class {{ service.async_client_name }}:
5151
5252 @classmethod
5353 def from_service_account_info(cls, info: dict, *args, **kwargs):
54- """Creates an instance of this client using the provided credentials info.
54+ """Creates an instance of this client using the provided credentials
55+ info.
5556
5657 Args:
5758 info (dict): The service account private key info.
@@ -66,7 +67,7 @@ class {{ service.async_client_name }}:
6667 @classmethod
6768 def from_service_account_file(cls, filename: str, *args, **kwargs):
6869 """Creates an instance of this client using the provided credentials
69- file.
70+ file.
7071
7172 Args:
7273 filename (str): The path to the service account private key json
@@ -83,7 +84,7 @@ class {{ service.async_client_name }}:
8384
8485 @property
8586 def transport(self) -> {{ service.name }}Transport:
86- """Return the transport used by the client instance.
87+ """Returns the transport used by the client instance.
8788
8889 Returns:
8990 {{ service.name }}Transport: The transport used by the client instance.
@@ -95,11 +96,11 @@ class {{ service.async_client_name }}:
9596
9697 def __init__(self, *,
9798 credentials: ga_credentials.Credentials = None,
98- transport: Union[str, {{ service.name }}Transport] = ' grpc_asyncio' ,
99+ transport: Union[str, {{ service.name }}Transport] = " grpc_asyncio" ,
99100 client_options: ClientOptions = None,
100101 client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
101102 ) -> None:
102- """Instantiate the {{ (service.client_name|snake_case).replace('_', ' ' ) }}.
103+ """Instantiates the {{ (service.client_name|snake_case).replace("_", " " ) }}.
103104
104105 Args:
105106 credentials (Optional[google.auth.credentials.Credentials]): The
@@ -165,7 +166,7 @@ class {{ service.async_client_name }}:
165166 Args:
166167 {% if not method .client_streaming %}
167168 request (:class:`{{ method.input.ident.sphinx }}`):
168- The request object.{{ ' ' }}
169+ The request object.{{ " " }}
169170 {{- method.input.meta.doc|wrap(width=72, offset=36, indent=16) }}
170171 {% for key , field in method .flattened_fields .items () %}
171172 {{ field.name }} (:class:`{{ field.ident.sphinx }}`):
@@ -176,7 +177,7 @@ class {{ service.async_client_name }}:
176177 {% endfor %}
177178 {% else %}
178179 requests (AsyncIterator[`{{ method.input.ident.sphinx }}`]):
179- The request object AsyncIterator.{{ ' ' }}
180+ The request object AsyncIterator.{{ " " }}
180181 {{- method.input.meta.doc|wrap(width=72, offset=36, indent=16) }}
181182 {% endif %}
182183 retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -200,10 +201,10 @@ class {{ service.async_client_name }}:
200201 {% if method .flattened_fields %}
201202 # Sanity check: If we got a request object, we should *not* have
202203 # gotten any keyword arguments that map to the request.
203- has_flattened_params = any([{{ method.flattened_fields.values()|join(', ' , attribute=' name' ) }}])
204+ has_flattened_params = any([{{ method.flattened_fields.values()|join(", " , attribute=" name" ) }}])
204205 if request is not None and has_flattened_params:
205- raise ValueError(' If the `request` argument is set, then none of '
206- ' the individual field arguments should be set.' )
206+ raise ValueError(" If the `request` argument is set, then none of "
207+ " the individual field arguments should be set." )
207208
208209 {% endif %}
209210 {% if method .input .ident .package != method .ident .package %} {# request lives in a different package, so there is no proto wrapper #}
@@ -251,7 +252,7 @@ class {{ service.async_client_name }}:
251252 {% if method .retry .max_backoff %} maximum={{ method.retry.max_backoff }},{% endif %}
252253 {% if method .retry .backoff_multiplier %} multiplier={{ method.retry.backoff_multiplier }},{% endif %}
253254 predicate=retries.if_exception_type(
254- {% for ex in method .retry .retryable_exceptions |sort (attribute =' __name__' ) %}
255+ {% for ex in method .retry .retryable_exceptions |sort (attribute =" __name__" ) %}
255256 core_exceptions.{{ ex.__name__ }},
256257 {% endfor %}
257258 ),
@@ -269,7 +270,7 @@ class {{ service.async_client_name }}:
269270 gapic_v1.routing_header.to_grpc_metadata((
270271 {% for field_header in method .field_headers %}
271272 {% if not method .client_streaming %}
272- (' {{ field_header }}' , request.{{ field_header }}),
273+ (" {{ field_header }}" , request.{{ field_header }}),
273274 {% endif %}
274275 {% endfor %}
275276 )),
@@ -313,7 +314,7 @@ class {{ service.async_client_name }}:
313314 # Done; return the response.
314315 return response
315316 {% endif %}
316- {{ '\n' }}
317+ {{ "\n" }}
317318 {% endfor %}
318319
319320
@@ -326,8 +327,10 @@ class {{ service.async_client_name }}:
326327 timeout: float = None,
327328 metadata: Sequence[Tuple[str, str]] = (),
328329 ) -> policy_pb2.Policy:
329- r"""Sets the IAM access control policy on the specified
330- function. Replaces any existing policy.
330+ r"""Sets the IAM access control policy on the specified function.
331+
332+ Replaces any existing policy.
333+
331334 Args:
332335 request (:class:`~.policy_pb2.SetIamPolicyRequest`):
333336 The request object. Request message for `SetIamPolicy`
@@ -433,8 +436,10 @@ class {{ service.async_client_name }}:
433436 metadata: Sequence[Tuple[str, str]] = (),
434437 ) -> policy_pb2.Policy:
435438 r"""Gets the IAM access control policy for a function.
439+
436440 Returns an empty policy if the function exists and does
437441 not have a policy set.
442+
438443 Args:
439444 request (:class:`~.iam_policy_pb2.GetIamPolicyRequest`):
440445 The request object. Request message for `GetIamPolicy`
@@ -540,8 +545,11 @@ class {{ service.async_client_name }}:
540545 metadata: Sequence[Tuple[str, str]] = (),
541546 ) -> iam_policy_pb2.TestIamPermissionsResponse:
542547 r"""Tests the specified permissions against the IAM access control
543- policy for a function. If the function does not exist, this will
548+ policy for a function.
549+
550+ If the function does not exist, this will
544551 return an empty set of permissions, not a NOT_FOUND error.
552+
545553 Args:
546554 request (:class:`~.iam_policy_pb2.TestIamPermissionsRequest`):
547555 The request object. Request message for
@@ -586,14 +594,14 @@ class {{ service.async_client_name }}:
586594try:
587595 DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
588596 gapic_version=pkg_resources.get_distribution(
589- ' {{ api.naming.warehouse_package_name }}' ,
597+ " {{ api.naming.warehouse_package_name }}" ,
590598 ).version,
591599 )
592600except pkg_resources.DistributionNotFound:
593601 DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
594602
595603
596604__all__ = (
597- ' {{ service.async_client_name }}' ,
605+ " {{ service.async_client_name }}" ,
598606)
599607{% endblock %}
0 commit comments