Skip to content

Commit cd28aa3

Browse files
authored
docs: fix formatting of request arg in docstring (#1628)
1 parent 39e8ab6 commit cd28aa3

File tree

12 files changed

+63
-78
lines changed

12 files changed

+63
-78
lines changed

packages/gapic-generator/gapic/templates/%namespace/%name_%version/%sub/services/%service/_client_macros.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
{% if not method.client_streaming %}
5151
request (Union[{{ method.input.ident.sphinx }}, dict]):
5252
The request object.{{ " " }}
53-
{{- method.input.meta.doc|wrap(width=72, offset=36, indent=16) }}
53+
{{- method.input.meta.doc|rst(width=72, indent=16, nl=False) }}
5454
{% for key, field in method.flattened_fields.items() %}
5555
{{ field.name }} ({{ field.ident.sphinx }}):
5656
{{ field.meta.doc|rst(width=72, indent=16) }}
@@ -61,7 +61,7 @@
6161
{% else %}
6262
requests (Iterator[{{ method.input.ident.sphinx }}]):
6363
The request object iterator.{{ " " }}
64-
{{- method.input.meta.doc|wrap(width=72, offset=36, indent=16) }}
64+
{{- method.input.meta.doc|rst(width=72, indent=16, nl=False) }}
6565
{% endif %}
6666
retry (google.api_core.retry.Retry): Designation of what errors, if any,
6767
should be retried.

packages/gapic-generator/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ class {{ service.async_client_name }}:
228228
{% if not method.client_streaming %}
229229
request (Optional[Union[{{ method.input.ident.sphinx }}, dict]]):
230230
The request object.{{ " " }}
231-
{{- method.input.meta.doc|wrap(width=72, offset=36, indent=16) }}
231+
{{- method.input.meta.doc|rst(width=72, indent=16, nl=False) }}
232232
{% for key, field in method.flattened_fields.items() %}
233233
{{ field.name }} (:class:`{{ field.ident.sphinx }}`):
234234
{{ field.meta.doc|rst(width=72, indent=16) }}
@@ -239,7 +239,7 @@ class {{ service.async_client_name }}:
239239
{% else %}
240240
requests (AsyncIterator[`{{ method.input.ident.sphinx }}`]):
241241
The request object AsyncIterator.{{ " " }}
242-
{{- method.input.meta.doc|wrap(width=72, offset=36, indent=16) }}
242+
{{- method.input.meta.doc|rst(width=72, indent=16, nl=False) }}
243243
{% endif %}
244244
retry (google.api_core.retry.Retry): Designation of what errors, if any,
245245
should be retried.

packages/gapic-generator/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ class {{service.name}}RestTransport({{service.name}}Transport):
331331
Args:
332332
request (~.{{ method.input.ident }}):
333333
The request object.{{ ' ' }}
334-
{{- method.input.meta.doc|rst(width=72, indent=16) }}
334+
{{- method.input.meta.doc|rst(width=72, indent=16, nl=False) }}
335335
retry (google.api_core.retry.Retry): Designation of what errors, if any,
336336
should be retried.
337337
timeout (float): The timeout for this request.

packages/gapic-generator/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/transports/rest.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,6 @@ def __call__(self,
500500
request (~.asset_service.AnalyzeIamPolicyRequest):
501501
The request object. A request message for
502502
[AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy].
503-
504503
retry (google.api_core.retry.Retry): Designation of what errors, if any,
505504
should be retried.
506505
timeout (float): The timeout for this request.
@@ -581,7 +580,6 @@ def __call__(self,
581580
request (~.asset_service.AnalyzeIamPolicyLongrunningRequest):
582581
The request object. A request message for
583582
[AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning].
584-
585583
retry (google.api_core.retry.Retry): Designation of what errors, if any,
586584
should be retried.
587585
timeout (float): The timeout for this request.

packages/gapic-generator/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/transports/rest.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ def __call__(self,
346346
request (~.eventarc.CreateTriggerRequest):
347347
The request object. The request message for the
348348
CreateTrigger method.
349-
350349
retry (google.api_core.retry.Retry): Designation of what errors, if any,
351350
should be retried.
352351
timeout (float): The timeout for this request.
@@ -434,7 +433,6 @@ def __call__(self,
434433
request (~.eventarc.DeleteTriggerRequest):
435434
The request object. The request message for the
436435
DeleteTrigger method.
437-
438436
retry (google.api_core.retry.Retry): Designation of what errors, if any,
439437
should be retried.
440438
timeout (float): The timeout for this request.
@@ -513,7 +511,6 @@ def __call__(self,
513511
request (~.eventarc.GetTriggerRequest):
514512
The request object. The request message for the
515513
GetTrigger method.
516-
517514
retry (google.api_core.retry.Retry): Designation of what errors, if any,
518515
should be retried.
519516
timeout (float): The timeout for this request.
@@ -593,7 +590,6 @@ def __call__(self,
593590
request (~.eventarc.ListTriggersRequest):
594591
The request object. The request message for the
595592
ListTriggers method.
596-
597593
retry (google.api_core.retry.Retry): Designation of what errors, if any,
598594
should be retried.
599595
timeout (float): The timeout for this request.
@@ -673,7 +669,6 @@ def __call__(self,
673669
request (~.eventarc.UpdateTriggerRequest):
674670
The request object. The request message for the
675671
UpdateTrigger method.
676-
677672
retry (google.api_core.retry.Retry): Designation of what errors, if any,
678673
should be retried.
679674
timeout (float): The timeout for this request.

packages/gapic-generator/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/async_client.py

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ async def sample_list_buckets():
233233
234234
Args:
235235
request (Optional[Union[google.cloud.logging_v2.types.ListBucketsRequest, dict]]):
236-
The request object. The parameters to `ListBuckets`.
236+
The request object. The parameters to ``ListBuckets``.
237237
parent (:class:`str`):
238238
Required. The parent resource whose buckets are to be
239239
listed:
@@ -354,7 +354,7 @@ async def sample_get_bucket():
354354
355355
Args:
356356
request (Optional[Union[google.cloud.logging_v2.types.GetBucketRequest, dict]]):
357-
The request object. The parameters to `GetBucket`.
357+
The request object. The parameters to ``GetBucket``.
358358
retry (google.api_core.retry.Retry): Designation of what errors, if any,
359359
should be retried.
360360
timeout (float): The timeout for this request.
@@ -435,7 +435,7 @@ async def sample_create_bucket():
435435
436436
Args:
437437
request (Optional[Union[google.cloud.logging_v2.types.CreateBucketRequest, dict]]):
438-
The request object. The parameters to `CreateBucket`.
438+
The request object. The parameters to ``CreateBucket``.
439439
retry (google.api_core.retry.Retry): Designation of what errors, if any,
440440
should be retried.
441441
timeout (float): The timeout for this request.
@@ -523,7 +523,7 @@ async def sample_update_bucket():
523523
524524
Args:
525525
request (Optional[Union[google.cloud.logging_v2.types.UpdateBucketRequest, dict]]):
526-
The request object. The parameters to `UpdateBucket`.
526+
The request object. The parameters to ``UpdateBucket``.
527527
retry (google.api_core.retry.Retry): Designation of what errors, if any,
528528
should be retried.
529529
timeout (float): The timeout for this request.
@@ -600,7 +600,7 @@ async def sample_delete_bucket():
600600
601601
Args:
602602
request (Optional[Union[google.cloud.logging_v2.types.DeleteBucketRequest, dict]]):
603-
The request object. The parameters to `DeleteBucket`.
603+
The request object. The parameters to ``DeleteBucket``.
604604
retry (google.api_core.retry.Retry): Designation of what errors, if any,
605605
should be retried.
606606
timeout (float): The timeout for this request.
@@ -669,7 +669,7 @@ async def sample_undelete_bucket():
669669
670670
Args:
671671
request (Optional[Union[google.cloud.logging_v2.types.UndeleteBucketRequest, dict]]):
672-
The request object. The parameters to `UndeleteBucket`.
672+
The request object. The parameters to ``UndeleteBucket``.
673673
retry (google.api_core.retry.Retry): Designation of what errors, if any,
674674
should be retried.
675675
timeout (float): The timeout for this request.
@@ -742,7 +742,7 @@ async def sample_list_views():
742742
743743
Args:
744744
request (Optional[Union[google.cloud.logging_v2.types.ListViewsRequest, dict]]):
745-
The request object. The parameters to `ListViews`.
745+
The request object. The parameters to ``ListViews``.
746746
parent (:class:`str`):
747747
Required. The bucket whose views are to be listed:
748748
@@ -855,7 +855,7 @@ async def sample_get_view():
855855
856856
Args:
857857
request (Optional[Union[google.cloud.logging_v2.types.GetViewRequest, dict]]):
858-
The request object. The parameters to `GetView`.
858+
The request object. The parameters to ``GetView``.
859859
retry (google.api_core.retry.Retry): Designation of what errors, if any,
860860
should be retried.
861861
timeout (float): The timeout for this request.
@@ -937,7 +937,7 @@ async def sample_create_view():
937937
938938
Args:
939939
request (Optional[Union[google.cloud.logging_v2.types.CreateViewRequest, dict]]):
940-
The request object. The parameters to `CreateView`.
940+
The request object. The parameters to ``CreateView``.
941941
retry (google.api_core.retry.Retry): Designation of what errors, if any,
942942
should be retried.
943943
timeout (float): The timeout for this request.
@@ -1018,7 +1018,7 @@ async def sample_update_view():
10181018
10191019
Args:
10201020
request (Optional[Union[google.cloud.logging_v2.types.UpdateViewRequest, dict]]):
1021-
The request object. The parameters to `UpdateView`.
1021+
The request object. The parameters to ``UpdateView``.
10221022
retry (google.api_core.retry.Retry): Designation of what errors, if any,
10231023
should be retried.
10241024
timeout (float): The timeout for this request.
@@ -1095,7 +1095,7 @@ async def sample_delete_view():
10951095
10961096
Args:
10971097
request (Optional[Union[google.cloud.logging_v2.types.DeleteViewRequest, dict]]):
1098-
The request object. The parameters to `DeleteView`.
1098+
The request object. The parameters to ``DeleteView``.
10991099
retry (google.api_core.retry.Retry): Designation of what errors, if any,
11001100
should be retried.
11011101
timeout (float): The timeout for this request.
@@ -1168,7 +1168,7 @@ async def sample_list_sinks():
11681168
11691169
Args:
11701170
request (Optional[Union[google.cloud.logging_v2.types.ListSinksRequest, dict]]):
1171-
The request object. The parameters to `ListSinks`.
1171+
The request object. The parameters to ``ListSinks``.
11721172
parent (:class:`str`):
11731173
Required. The parent resource whose sinks are to be
11741174
listed:
@@ -1294,7 +1294,7 @@ async def sample_get_sink():
12941294
12951295
Args:
12961296
request (Optional[Union[google.cloud.logging_v2.types.GetSinkRequest, dict]]):
1297-
The request object. The parameters to `GetSink`.
1297+
The request object. The parameters to ``GetSink``.
12981298
sink_name (:class:`str`):
12991299
Required. The resource name of the sink:
13001300
@@ -1427,7 +1427,7 @@ async def sample_create_sink():
14271427
14281428
Args:
14291429
request (Optional[Union[google.cloud.logging_v2.types.CreateSinkRequest, dict]]):
1430-
The request object. The parameters to `CreateSink`.
1430+
The request object. The parameters to ``CreateSink``.
14311431
parent (:class:`str`):
14321432
Required. The resource in which to create the sink:
14331433
@@ -1564,7 +1564,7 @@ async def sample_update_sink():
15641564
15651565
Args:
15661566
request (Optional[Union[google.cloud.logging_v2.types.UpdateSinkRequest, dict]]):
1567-
The request object. The parameters to `UpdateSink`.
1567+
The request object. The parameters to ``UpdateSink``.
15681568
sink_name (:class:`str`):
15691569
Required. The full resource name of the sink to update,
15701570
including the parent resource and the sink identifier:
@@ -1717,7 +1717,7 @@ async def sample_delete_sink():
17171717
17181718
Args:
17191719
request (Optional[Union[google.cloud.logging_v2.types.DeleteSinkRequest, dict]]):
1720-
The request object. The parameters to `DeleteSink`.
1720+
The request object. The parameters to ``DeleteSink``.
17211721
sink_name (:class:`str`):
17221722
Required. The full resource name of the sink to delete,
17231723
including the parent resource and the sink identifier:
@@ -1826,7 +1826,7 @@ async def sample_list_exclusions():
18261826
18271827
Args:
18281828
request (Optional[Union[google.cloud.logging_v2.types.ListExclusionsRequest, dict]]):
1829-
The request object. The parameters to `ListExclusions`.
1829+
The request object. The parameters to ``ListExclusions``.
18301830
parent (:class:`str`):
18311831
Required. The parent resource whose exclusions are to be
18321832
listed.
@@ -1952,7 +1952,7 @@ async def sample_get_exclusion():
19521952
19531953
Args:
19541954
request (Optional[Union[google.cloud.logging_v2.types.GetExclusionRequest, dict]]):
1955-
The request object. The parameters to `GetExclusion`.
1955+
The request object. The parameters to ``GetExclusion``.
19561956
name (:class:`str`):
19571957
Required. The resource name of an existing exclusion:
19581958
@@ -2087,7 +2087,7 @@ async def sample_create_exclusion():
20872087
20882088
Args:
20892089
request (Optional[Union[google.cloud.logging_v2.types.CreateExclusionRequest, dict]]):
2090-
The request object. The parameters to `CreateExclusion`.
2090+
The request object. The parameters to ``CreateExclusion``.
20912091
parent (:class:`str`):
20922092
Required. The parent resource in which to create the
20932093
exclusion:
@@ -2224,7 +2224,7 @@ async def sample_update_exclusion():
22242224
22252225
Args:
22262226
request (Optional[Union[google.cloud.logging_v2.types.UpdateExclusionRequest, dict]]):
2227-
The request object. The parameters to `UpdateExclusion`.
2227+
The request object. The parameters to ``UpdateExclusion``.
22282228
name (:class:`str`):
22292229
Required. The resource name of the exclusion to update:
22302230
@@ -2365,7 +2365,7 @@ async def sample_delete_exclusion():
23652365
23662366
Args:
23672367
request (Optional[Union[google.cloud.logging_v2.types.DeleteExclusionRequest, dict]]):
2368-
The request object. The parameters to `DeleteExclusion`.
2368+
The request object. The parameters to ``DeleteExclusion``.
23692369
name (:class:`str`):
23702370
Required. The resource name of an existing exclusion to
23712371
delete:
@@ -2483,8 +2483,9 @@ async def sample_get_cmek_settings():
24832483
request (Optional[Union[google.cloud.logging_v2.types.GetCmekSettingsRequest, dict]]):
24842484
The request object. The parameters to
24852485
[GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings].
2486-
See [Enabling CMEK for Logs
2487-
Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
2486+
2487+
See `Enabling CMEK for Logs
2488+
Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
24882489
for more information.
24892490
retry (google.api_core.retry.Retry): Designation of what errors, if any,
24902491
should be retried.
@@ -2591,8 +2592,9 @@ async def sample_update_cmek_settings():
25912592
request (Optional[Union[google.cloud.logging_v2.types.UpdateCmekSettingsRequest, dict]]):
25922593
The request object. The parameters to
25932594
[UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings].
2594-
See [Enabling CMEK for Logs
2595-
Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
2595+
2596+
See `Enabling CMEK for Logs
2597+
Router <https://cloud.google.com/logging/docs/routing/managed-encryption>`__
25962598
for more information.
25972599
retry (google.api_core.retry.Retry): Designation of what errors, if any,
25982600
should be retried.

0 commit comments

Comments
 (0)