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

Commit 287a2a5

Browse files
docs: Add documentation for enums (#151)
* 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 7966d78 commit 287a2a5

File tree

3 files changed

+73
-4
lines changed

3 files changed

+73
-4
lines changed

google/cloud/shell_v1/services/cloud_shell_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ def sample_remove_public_key():
954954
# Done; return the response.
955955
return response
956956

957-
def __enter__(self):
957+
def __enter__(self) -> "CloudShellServiceClient":
958958
return self
959959

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

google/cloud/shell_v1/types/cloudshell.py

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,27 @@ class Environment(proto.Message):
9494
"""
9595

9696
class State(proto.Enum):
97-
r"""Possible execution states for an environment."""
97+
r"""Possible execution states for an environment.
98+
99+
Values:
100+
STATE_UNSPECIFIED (0):
101+
The environment's states is unknown.
102+
SUSPENDED (1):
103+
The environment is not running and can't be
104+
connected to. Starting the environment will
105+
transition it to the PENDING state.
106+
PENDING (2):
107+
The environment is being started but is not
108+
yet ready to accept connections.
109+
RUNNING (3):
110+
The environment is running and ready to
111+
accept connections. It will automatically
112+
transition back to DISABLED after a period of
113+
inactivity or if another environment is started.
114+
DELETING (4):
115+
The environment is being deleted and can't be
116+
connected to.
117+
"""
98118
STATE_UNSPECIFIED = 0
99119
SUSPENDED = 1
100120
PENDING = 2
@@ -277,6 +297,33 @@ class State(proto.Enum):
277297
clients, but may be used to show a progress message to the user.
278298
An environment won't necessarily go through all of these states
279299
when starting. More states are likely to be added in the future.
300+
301+
Values:
302+
STATE_UNSPECIFIED (0):
303+
The environment's start state is unknown.
304+
STARTING (1):
305+
The environment is in the process of being
306+
started, but no additional details are
307+
available.
308+
UNARCHIVING_DISK (2):
309+
Startup is waiting for the user's disk to be
310+
unarchived. This can happen when the user
311+
returns to Cloud Shell after not having used it
312+
for a while, and suggests that startup will take
313+
longer than normal.
314+
AWAITING_COMPUTE_RESOURCES (4):
315+
Startup is waiting for compute resources to
316+
be assigned to the environment. This should
317+
normally happen very quickly, but an environment
318+
might stay in this state for an extended period
319+
of time if the system is experiencing heavy
320+
load.
321+
FINISHED (3):
322+
Startup has completed. If the start operation
323+
was successful, the user should be able to
324+
establish an SSH connection to their
325+
environment. Otherwise, the operation will
326+
contain details of the failure.
280327
"""
281328
STATE_UNSPECIFIED = 0
282329
STARTING = 1
@@ -406,7 +453,29 @@ class CloudShellErrorDetails(proto.Message):
406453
"""
407454

408455
class CloudShellErrorCode(proto.Enum):
409-
r"""Set of possible errors returned from API calls."""
456+
r"""Set of possible errors returned from API calls.
457+
458+
Values:
459+
CLOUD_SHELL_ERROR_CODE_UNSPECIFIED (0):
460+
An unknown error occurred.
461+
IMAGE_UNAVAILABLE (1):
462+
The image used by the Cloud Shell environment
463+
either does not exist or the user does not have
464+
access to it.
465+
CLOUD_SHELL_DISABLED (2):
466+
Cloud Shell has been disabled by an
467+
administrator for the user making the request.
468+
TOS_VIOLATION (4):
469+
Cloud Shell has been permanently disabled due
470+
to a Terms of Service violation by the user.
471+
QUOTA_EXCEEDED (5):
472+
The user has exhausted their weekly Cloud
473+
Shell quota, and Cloud Shell will be disabled
474+
until the quota resets.
475+
ENVIRONMENT_UNAVAILABLE (6):
476+
The Cloud Shell environment is unavailable
477+
and cannot be connected to at the moment.
478+
"""
410479
CLOUD_SHELL_ERROR_CODE_UNSPECIFIED = 0
411480
IMAGE_UNAVAILABLE = 1
412481
CLOUD_SHELL_DISABLED = 2

samples/generated_samples/snippet_metadata_google.cloud.shell.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-shell",
11-
"version": "1.6.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)