Skip to content

Commit 25884f6

Browse files
committed
Fixup docstrings
1 parent 4a1722b commit 25884f6

File tree

4 files changed

+68
-40
lines changed

4 files changed

+68
-40
lines changed

redis/docs/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ Api Reference
55
.. toctree::
66
:maxdepth: 2
77

8+
gapic/v1/api
9+
gapic/v1/types
810
gapic/v1beta1/api
911
gapic/v1beta1/types

redis/google/cloud/redis_v1/gapic/cloud_redis_client.py

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class CloudRedisClient(object):
5656
* Each project has a collection of available locations, named: ``/locations/*``
5757
* Each location has a collection of Redis instances, named: ``/instances/*``
5858
* As such, Redis instances are resources of the form:
59+
5960
``/projects/{project_id}/locations/{location_id}/instances/{instance_id}``
6061
6162
Note that location_id must be refering to a GCP ``region``; for example:
@@ -235,10 +236,7 @@ def list_instances(self,
235236
... pass
236237
237238
Args:
238-
parent (str): Required. The resource name of the instance location using the form:
239-
::
240-
241-
`projects/{project_id}/locations/{location_id}`
239+
parent (str): Required. The resource name of the instance location using the form ``projects/{project_id}/locations/{location_id}``
242240
where ``location_id`` refers to a GCP region
243241
page_size (int): The maximum number of resources contained in the
244242
underlying API response. If page streaming is performed per-
@@ -314,10 +312,7 @@ def get_instance(self,
314312
>>> response = client.get_instance(name)
315313
316314
Args:
317-
name (str): Required. Redis instance resource name using the form:
318-
::
319-
320-
`projects/{project_id}/locations/{location_id}/instances/{instance_id}`
315+
name (str): Required. Redis instance resource name using the form ``projects/{project_id}/locations/{location_id}/instances/{instance_id}```
321316
where ``location_id`` refers to a GCP region
322317
retry (Optional[google.api_core.retry.Retry]): A retry object used
323318
to retry requests. If ``None`` is specified, requests will not
@@ -398,14 +393,10 @@ def create_instance(self,
398393
>>> metadata = response.metadata()
399394
400395
Args:
401-
parent (str): Required. The resource name of the instance location using the form:
402-
::
403-
404-
`projects/{project_id}/locations/{location_id}`
396+
parent (str): Required. The resource name of the instance location using the form ``projects/{project_id}/locations/{location_id}``
405397
where ``location_id`` refers to a GCP region
406398
instance_id (str): Required. The logical name of the Redis instance in the customer project
407399
with the following restrictions:
408-
409400
* Must contain only lowercase letters, numbers, and hyphens.
410401
* Must start with a letter.
411402
* Must be between 1-40 characters.
@@ -498,12 +489,7 @@ def update_instance(self,
498489
Args:
499490
update_mask (Union[dict, ~google.cloud.redis_v1.types.FieldMask]): Required. Mask of fields to update. At least one path must be supplied in
500491
this field. The elements of the repeated paths field may only include these
501-
fields from ``Instance``:
502-
503-
* ``displayName``
504-
* ``labels``
505-
* ``memorySizeGb``
506-
* ``redisConfig``
492+
fields from ``Instance``: ``displayName``, ``labels``, ``memorySizeGb``, and ``redisConfig``.
507493
If a dict is provided, it must be of the same form as the protobuf
508494
message :class:`~google.cloud.redis_v1.types.FieldMask`
509495
instance (Union[dict, ~google.cloud.redis_v1.types.Instance]): Required. Update description.
@@ -581,10 +567,7 @@ def delete_instance(self,
581567
>>> metadata = response.metadata()
582568
583569
Args:
584-
name (str): Required. Redis instance resource name using the form:
585-
::
586-
587-
`projects/{project_id}/locations/{location_id}/instances/{instance_id}`
570+
name (str): Required. Redis instance resource name using the form ``projects/{project_id}/locations/{location_id}/instances/{instance_id}```
588571
where ``location_id`` refers to a GCP region
589572
retry (Optional[google.api_core.retry.Retry]): A retry object used
590573
to retry requests. If ``None`` is specified, requests will not

redis/google/cloud/redis_v1beta1/gapic/cloud_redis_client.py

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class CloudRedisClient(object):
5757
* Each project has a collection of available locations, named: ``/locations/*``
5858
* Each location has a collection of Redis instances, named: ``/instances/*``
5959
* As such, Redis instances are resources of the form:
60+
6061
``/projects/{project_id}/locations/{location_id}/instances/{instance_id}``
6162
6263
Note that location_id must be refering to a GCP ``region``; for example:
@@ -236,10 +237,7 @@ def list_instances(self,
236237
... pass
237238
238239
Args:
239-
parent (str): Required. The resource name of the instance location using the form:
240-
::
241-
242-
`projects/{project_id}/locations/{location_id}`
240+
parent (str): Required. The resource name of the instance location using the form ``projects/{project_id}/locations/{location_id}``
243241
where ``location_id`` refers to a GCP region
244242
page_size (int): The maximum number of resources contained in the
245243
underlying API response. If page streaming is performed per-
@@ -315,10 +313,7 @@ def get_instance(self,
315313
>>> response = client.get_instance(name)
316314
317315
Args:
318-
name (str): Required. Redis instance resource name using the form:
319-
::
320-
321-
`projects/{project_id}/locations/{location_id}/instances/{instance_id}`
316+
name (str): Required. Redis instance resource name using the form ``projects/{project_id}/locations/{location_id}/instances/{instance_id}```
322317
where ``location_id`` refers to a GCP region
323318
retry (Optional[google.api_core.retry.Retry]): A retry object used
324319
to retry requests. If ``None`` is specified, requests will not
@@ -399,14 +394,10 @@ def create_instance(self,
399394
>>> metadata = response.metadata()
400395
401396
Args:
402-
parent (str): Required. The resource name of the instance location using the form:
403-
::
404-
405-
`projects/{project_id}/locations/{location_id}`
397+
parent (str): Required. The resource name of the instance location using the form ``projects/{project_id}/locations/{location_id}``
406398
where ``location_id`` refers to a GCP region
407399
instance_id (str): Required. The logical name of the Redis instance in the customer project
408400
with the following restrictions:
409-
410401
* Must contain only lowercase letters, numbers, and hyphens.
411402
* Must start with a letter.
412403
* Must be between 1-40 characters.
@@ -581,10 +572,7 @@ def delete_instance(self,
581572
>>> metadata = response.metadata()
582573
583574
Args:
584-
name (str): Required. Redis instance resource name using the form:
585-
::
586-
587-
`projects/{project_id}/locations/{location_id}/instances/{instance_id}`
575+
name (str): Required. Redis instance resource name using the form ``projects/{project_id}/locations/{location_id}/instances/{instance_id}```
588576
where ``location_id`` refers to a GCP region
589577
retry (Optional[google.api_core.retry.Retry]): A retry object used
590578
to retry requests. If ``None`` is specified, requests will not

redis/synth.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,61 @@
3737
s.copy(library, excludes=excludes)
3838

3939

40+
# Fix docstrings
41+
s.replace(
42+
'google/cloud/**/cloud_redis_client.py',
43+
r'resources of the form:\n ``',
44+
r'resources of the form:\n\n ``',)
45+
46+
s.replace(
47+
'google/cloud/**/cloud_redis_client.py',
48+
r"""
49+
parent \(str\): Required. The resource name of the instance location using the form:
50+
::
51+
52+
`projects/{project_id}/locations/{location_id}`
53+
where ``location_id`` refers to a GCP region""",
54+
55+
r"""
56+
parent (str): Required. The resource name of the instance location using the form ``projects/{project_id}/locations/{location_id}``
57+
where ``location_id`` refers to a GCP region""",)
58+
59+
60+
s.replace(
61+
'google/cloud/**/cloud_redis_client.py',
62+
r"""
63+
with the following restrictions:
64+
65+
\* Must contain only lowercase letters, numbers, and hyphens\.""",
66+
r"""
67+
with the following restrictions:
68+
* Must contain only lowercase letters, numbers, and hyphens.""")
69+
70+
s.replace(
71+
'google/cloud/**/cloud_redis_client.py',
72+
r"""
73+
name \(str\): Required. Redis instance resource name using the form:
74+
::
75+
76+
`projects/{project_id}/locations/{location_id}/instances/{instance_id}`
77+
where ``location_id`` refers to a GCP region""",
78+
r"""
79+
name (str): Required. Redis instance resource name using the form ``projects/{project_id}/locations/{location_id}/instances/{instance_id}```
80+
where ``location_id`` refers to a GCP region""")
81+
82+
s.replace(
83+
'google/cloud/**/cloud_redis_client.py',
84+
r"""
85+
fields from ``Instance``:
86+
87+
\* ``displayName``
88+
\* ``labels``
89+
\* ``memorySizeGb``
90+
\* ``redisConfig``""",
91+
92+
r"""
93+
fields from ``Instance``: ``displayName``, ``labels``, ``memorySizeGb``, and ``redisConfig``.""",)
94+
4095
# Set Release Status
4196
release_status = 'Development Status :: 3 - Alpha'
4297
s.replace('setup.py',

0 commit comments

Comments
 (0)