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

Commit 29246d4

Browse files
docs: Add documentation for enums (#238)
* docs: Add documentation for enums fix: Add context manager return types chore: Update gapic-generator-python to v1.8.1 PiperOrigin-RevId: 503210727 Source-Link: googleapis/googleapis@a391fd1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/0080f830dec37c3384157082bce279e37079ea58 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA4MGY4MzBkZWMzN2MzMzg0MTU3MDgyYmNlMjc5ZTM3MDc5ZWE1OCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent adf5bd2 commit 29246d4

File tree

6 files changed

+134
-14
lines changed

6 files changed

+134
-14
lines changed

google/cloud/memcache_v1/services/cloud_memcache/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,7 @@ def sample_reschedule_maintenance():
15291529
# Done; return the response.
15301530
return response
15311531

1532-
def __enter__(self):
1532+
def __enter__(self) -> "CloudMemcacheClient":
15331533
return self
15341534

15351535
def __exit__(self, type, value, traceback):

google/cloud/memcache_v1/types/cloud_memcache.py

Lines changed: 65 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,14 @@
4848

4949

5050
class MemcacheVersion(proto.Enum):
51-
r"""Memcached versions supported by our service."""
51+
r"""Memcached versions supported by our service.
52+
53+
Values:
54+
MEMCACHE_VERSION_UNSPECIFIED (0):
55+
56+
MEMCACHE_1_5 (1):
57+
Memcached 1.5 version.
58+
"""
5259
MEMCACHE_VERSION_UNSPECIFIED = 0
5360
MEMCACHE_1_5 = 1
5461

@@ -138,7 +145,25 @@ class Instance(proto.Message):
138145
"""
139146

140147
class State(proto.Enum):
141-
r"""Different states of a Memcached instance."""
148+
r"""Different states of a Memcached instance.
149+
150+
Values:
151+
STATE_UNSPECIFIED (0):
152+
State not set.
153+
CREATING (1):
154+
Memcached instance is being created.
155+
READY (2):
156+
Memcached instance has been created and ready
157+
to be used.
158+
UPDATING (3):
159+
Memcached instance is updating configuration
160+
such as maintenance policy and schedule.
161+
DELETING (4):
162+
Memcached instance is being deleted.
163+
PERFORMING_MAINTENANCE (5):
164+
Memcached instance is going through
165+
maintenance, e.g. data plane rollout.
166+
"""
142167
STATE_UNSPECIFIED = 0
143168
CREATING = 1
144169
READY = 2
@@ -193,7 +218,20 @@ class Node(proto.Message):
193218
"""
194219

195220
class State(proto.Enum):
196-
r"""Different states of a Memcached node."""
221+
r"""Different states of a Memcached node.
222+
223+
Values:
224+
STATE_UNSPECIFIED (0):
225+
Node state is not set.
226+
CREATING (1):
227+
Node is being created.
228+
READY (2):
229+
Node has been created and ready to be used.
230+
DELETING (3):
231+
Node is being deleted.
232+
UPDATING (4):
233+
Node is being updated.
234+
"""
197235
STATE_UNSPECIFIED = 0
198236
CREATING = 1
199237
READY = 2
@@ -240,7 +278,14 @@ class InstanceMessage(proto.Message):
240278
"""
241279

242280
class Code(proto.Enum):
243-
r""""""
281+
r"""
282+
283+
Values:
284+
CODE_UNSPECIFIED (0):
285+
Message Code not set.
286+
ZONE_DISTRIBUTION_UNBALANCED (1):
287+
Memcached nodes are distributed unevenly.
288+
"""
244289
CODE_UNSPECIFIED = 0
245290
ZONE_DISTRIBUTION_UNBALANCED = 1
246291

@@ -465,7 +510,22 @@ class RescheduleMaintenanceRequest(proto.Message):
465510
"""
466511

467512
class RescheduleType(proto.Enum):
468-
r"""Reschedule options."""
513+
r"""Reschedule options.
514+
515+
Values:
516+
RESCHEDULE_TYPE_UNSPECIFIED (0):
517+
Not set.
518+
IMMEDIATE (1):
519+
If the user wants to schedule the maintenance
520+
to happen now.
521+
NEXT_AVAILABLE_WINDOW (2):
522+
If the user wants to use the existing
523+
maintenance policy to find the next available
524+
window.
525+
SPECIFIC_TIME (3):
526+
If the user wants to reschedule the
527+
maintenance to a specific time.
528+
"""
469529
RESCHEDULE_TYPE_UNSPECIFIED = 0
470530
IMMEDIATE = 1
471531
NEXT_AVAILABLE_WINDOW = 2

google/cloud/memcache_v1beta2/services/cloud_memcache/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,7 @@ def sample_reschedule_maintenance():
16761676
# Done; return the response.
16771677
return response
16781678

1679-
def __enter__(self):
1679+
def __enter__(self) -> "CloudMemcacheClient":
16801680
return self
16811681

16821682
def __exit__(self, type, value, traceback):

google/cloud/memcache_v1beta2/types/cloud_memcache.py

Lines changed: 65 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@
4949

5050

5151
class MemcacheVersion(proto.Enum):
52-
r"""Memcached versions supported by our service."""
52+
r"""Memcached versions supported by our service.
53+
54+
Values:
55+
MEMCACHE_VERSION_UNSPECIFIED (0):
56+
57+
MEMCACHE_1_5 (1):
58+
Memcached 1.5 version.
59+
"""
5360
MEMCACHE_VERSION_UNSPECIFIED = 0
5461
MEMCACHE_1_5 = 1
5562

@@ -143,7 +150,25 @@ class Instance(proto.Message):
143150
"""
144151

145152
class State(proto.Enum):
146-
r"""Different states of a Memcached instance."""
153+
r"""Different states of a Memcached instance.
154+
155+
Values:
156+
STATE_UNSPECIFIED (0):
157+
State not set.
158+
CREATING (1):
159+
Memcached instance is being created.
160+
READY (2):
161+
Memcached instance has been created and ready
162+
to be used.
163+
UPDATING (3):
164+
Memcached instance is updating configuration
165+
such as maintenance policy and schedule.
166+
DELETING (4):
167+
Memcached instance is being deleted.
168+
PERFORMING_MAINTENANCE (5):
169+
Memcached instance is going through
170+
maintenance, e.g. data plane rollout.
171+
"""
147172
STATE_UNSPECIFIED = 0
148173
CREATING = 1
149174
READY = 2
@@ -201,7 +226,20 @@ class Node(proto.Message):
201226
"""
202227

203228
class State(proto.Enum):
204-
r"""Different states of a Memcached node."""
229+
r"""Different states of a Memcached node.
230+
231+
Values:
232+
STATE_UNSPECIFIED (0):
233+
Node state is not set.
234+
CREATING (1):
235+
Node is being created.
236+
READY (2):
237+
Node has been created and ready to be used.
238+
DELETING (3):
239+
Node is being deleted.
240+
UPDATING (4):
241+
Node is being updated.
242+
"""
205243
STATE_UNSPECIFIED = 0
206244
CREATING = 1
207245
READY = 2
@@ -252,7 +290,14 @@ class InstanceMessage(proto.Message):
252290
"""
253291

254292
class Code(proto.Enum):
255-
r""""""
293+
r"""
294+
295+
Values:
296+
CODE_UNSPECIFIED (0):
297+
Message Code not set.
298+
ZONE_DISTRIBUTION_UNBALANCED (1):
299+
Memcached nodes are distributed unevenly.
300+
"""
256301
CODE_UNSPECIFIED = 0
257302
ZONE_DISTRIBUTION_UNBALANCED = 1
258303

@@ -673,7 +718,22 @@ class RescheduleMaintenanceRequest(proto.Message):
673718
"""
674719

675720
class RescheduleType(proto.Enum):
676-
r"""Reschedule options."""
721+
r"""Reschedule options.
722+
723+
Values:
724+
RESCHEDULE_TYPE_UNSPECIFIED (0):
725+
Not set.
726+
IMMEDIATE (1):
727+
If the user wants to schedule the maintenance
728+
to happen now.
729+
NEXT_AVAILABLE_WINDOW (2):
730+
If the user wants to use the existing
731+
maintenance policy to find the next available
732+
window.
733+
SPECIFIC_TIME (3):
734+
If the user wants to reschedule the
735+
maintenance to a specific time.
736+
"""
677737
RESCHEDULE_TYPE_UNSPECIFIED = 0
678738
IMMEDIATE = 1
679739
NEXT_AVAILABLE_WINDOW = 2

samples/generated_samples/snippet_metadata_google.cloud.memcache.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-memcache",
11-
"version": "1.6.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

samples/generated_samples/snippet_metadata_google.cloud.memcache.v1beta2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-memcache",
11-
"version": "1.6.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)