Skip to content

Commit 1f9c8e0

Browse files
sararobcopybara-github
authored andcommitted
fix: Fix name collision on SandboxEnvironment.state by renaming enum to SandboxState
PiperOrigin-RevId: 912527667
1 parent 48f792b commit 1f9c8e0

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

tests/unit/vertexai/genai/replays/test_get_agent_engine_sandbox.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def test_get_sandbox(client):
3838
)
3939
assert isinstance(sandbox, types.SandboxEnvironment)
4040
assert sandbox.name == operation.response.name
41+
assert isinstance(sandbox.state, types.SandboxState)
4142

4243

4344
pytestmark = pytest_helper.setup(

vertexai/_genai/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,7 @@
11791179
from .common import SandboxEnvironmentTemplateWarmPoolConfig
11801180
from .common import SandboxEnvironmentTemplateWarmPoolConfigDict
11811181
from .common import SandboxEnvironmentTemplateWarmPoolConfigOrDict
1182+
from .common import SandboxState
11821183
from .common import SavedQuery
11831184
from .common import SavedQueryDict
11841185
from .common import SavedQueryOrDict
@@ -2641,6 +2642,7 @@
26412642
"Operator",
26422643
"Language",
26432644
"MachineConfig",
2645+
"SandboxState",
26442646
"Protocol",
26452647
"DefaultContainerCategory",
26462648
"PostSnapshotAction",

vertexai/_genai/types/common.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,23 @@ class MachineConfig(_common.CaseInSensitiveEnum):
324324
"""The default value: milligcu 4000, memory 4 Gib"""
325325

326326

327+
class SandboxState(_common.CaseInSensitiveEnum):
328+
"""Output only. The runtime state of the SandboxEnvironment."""
329+
330+
STATE_UNSPECIFIED = "STATE_UNSPECIFIED"
331+
"""The default value. This value is unused."""
332+
STATE_PROVISIONING = "STATE_PROVISIONING"
333+
"""Runtime resources are being allocated for the sandbox environment."""
334+
STATE_RUNNING = "STATE_RUNNING"
335+
"""Sandbox runtime is ready for serving."""
336+
STATE_DEPROVISIONING = "STATE_DEPROVISIONING"
337+
"""Sandbox runtime is halted, performing tear down tasks."""
338+
STATE_TERMINATED = "STATE_TERMINATED"
339+
"""Sandbox has terminated with underlying runtime failure."""
340+
STATE_DELETED = "STATE_DELETED"
341+
"""Sandbox runtime has been deleted."""
342+
343+
327344
class Protocol(_common.CaseInSensitiveEnum):
328345
"""Protocol for port. Defaults to TCP if not specified."""
329346

@@ -12356,7 +12373,7 @@ class SandboxEnvironment(_common.BaseModel):
1235612373
default=None,
1235712374
description="""Optional. The configuration of the SandboxEnvironment.""",
1235812375
)
12359-
state: Optional[State] = Field(
12376+
state: Optional[SandboxState] = Field(
1236012377
default=None,
1236112378
description="""Output only. The runtime state of the SandboxEnvironment.""",
1236212379
)
@@ -12408,7 +12425,7 @@ class SandboxEnvironmentDict(TypedDict, total=False):
1240812425
spec: Optional[SandboxEnvironmentSpecDict]
1240912426
"""Optional. The configuration of the SandboxEnvironment."""
1241012427

12411-
state: Optional[State]
12428+
state: Optional[SandboxState]
1241212429
"""Output only. The runtime state of the SandboxEnvironment."""
1241312430

1241412431
ttl: Optional[str]

0 commit comments

Comments
 (0)