From 7127931b6244f158520d228b173f0d8547297d34 Mon Sep 17 00:00:00 2001 From: cdrappier Date: Sat, 21 Mar 2026 21:00:36 +0000 Subject: [PATCH 1/5] feat: add createIfNotExist support + regenerate client from controlplane branch - Add branch variable to Makefile for SDK regeneration from feature branches - Regenerate controlplane client with createIfNotExist query parameter - Update async create() and create_if_not_exists() to pass create_if_not_exist - Update sync create() and create_if_not_exists() with same changes - Add asyncio.sleep(2) / time.sleep(2) delay in 409 handler for race condition ENG-2188 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- Makefile | 5 +- .../core/client/api/drives/create_drive.py | 28 ++-- .../api/drives/create_drive_access_token.py | 8 +- .../core/client/api/drives/get_drive_jwks.py | 8 +- .../core/client/api/drives/update_drive.py | 12 +- .../api/feature_flags/test_feature_flag.py | 23 ++- src/blaxel/core/client/models/__init__.py | 14 ++ src/blaxel/core/client/models/agent.py | 1 + .../core/client/models/agent_runtime.py | 1 + src/blaxel/core/client/models/agent_spec.py | 41 +++++ .../core/client/models/configuration.py | 1 + .../models/create_job_execution_output.py | 1 + .../models/create_job_execution_request.py | 1 + .../core/client/models/custom_domain.py | 1 + .../client/models/custom_domain_metadata.py | 1 + .../core/client/models/custom_domain_spec.py | 1 + ...te_volume_template_version_response_200.py | 1 + src/blaxel/core/client/models/drive.py | 5 +- .../core/client/models/egress_gateway.py | 1 + src/blaxel/core/client/models/egress_ip.py | 1 + src/blaxel/core/client/models/entrypoint.py | 1 + src/blaxel/core/client/models/form.py | 1 + src/blaxel/core/client/models/function.py | 1 + .../core/client/models/function_runtime.py | 1 + .../core/client/models/function_spec.py | 11 ++ .../models/get_drive_jwks_response_200.py | 1 + .../get_workspace_features_response_200.py | 1 + .../client/models/group_workspace_mapping.py | 79 +++++++++ .../models/group_workspace_mapping_role.py | 18 ++ src/blaxel/core/client/models/image.py | 1 + src/blaxel/core/client/models/image_spec.py | 1 + src/blaxel/core/client/models/integration.py | 1 + .../client/models/integration_connection.py | 1 + .../models/integration_connection_spec.py | 1 + .../client/models/integration_endpoint.py | 1 + .../client/models/integration_endpoints.py | 2 + src/blaxel/core/client/models/job.py | 1 + .../core/client/models/job_execution.py | 1 + .../core/client/models/job_execution_spec.py | 1 + .../core/client/models/job_execution_task.py | 1 + src/blaxel/core/client/models/job_runtime.py | 1 + src/blaxel/core/client/models/job_spec.py | 1 + .../core/client/models/location_response.py | 1 + .../core/client/models/mcp_definition.py | 1 + src/blaxel/core/client/models/metadata.py | 1 + src/blaxel/core/client/models/model.py | 1 + src/blaxel/core/client/models/model_spec.py | 1 + src/blaxel/core/client/models/o_auth.py | 1 + .../core/client/models/pending_invitation.py | 9 + .../models/pending_invitation_accept.py | 1 + .../models/pending_invitation_render.py | 10 ++ .../pending_invitation_workspace_details.py | 1 + src/blaxel/core/client/models/policy.py | 1 + src/blaxel/core/client/models/policy_spec.py | 1 + src/blaxel/core/client/models/preview.py | 1 + src/blaxel/core/client/models/preview_spec.py | 1 + .../core/client/models/preview_token.py | 1 + src/blaxel/core/client/models/public_ips.py | 1 + src/blaxel/core/client/models/region.py | 1 + src/blaxel/core/client/models/sandbox.py | 1 + .../core/client/models/sandbox_definition.py | 1 + .../core/client/models/sandbox_error.py | 1 + .../core/client/models/sandbox_lifecycle.py | 11 ++ .../core/client/models/sandbox_network.py | 10 +- .../core/client/models/sandbox_runtime.py | 1 + src/blaxel/core/client/models/sandbox_spec.py | 3 +- src/blaxel/core/client/models/sso_domain.py | 87 ++++++++++ .../core/client/models/sso_domain_metadata.py | 115 +++++++++++++ .../core/client/models/sso_domain_spec.py | 156 ++++++++++++++++++ .../client/models/sso_domain_spec_status.py | 19 +++ src/blaxel/core/client/models/template.py | 1 + .../models/test_feature_flag_response_200.py | 1 + src/blaxel/core/client/models/trigger.py | 1 + .../client/models/trigger_configuration.py | 1 + src/blaxel/core/client/models/volume.py | 1 + .../core/client/models/volume_template.py | 1 + src/blaxel/core/client/models/vpc.py | 1 + src/blaxel/core/client/models/workspace.py | 26 +++ .../core/client/models/workspace_user.py | 26 +++ .../client/models/workspace_user_source.py | 19 +++ src/blaxel/core/sandbox/default/sandbox.py | 10 +- src/blaxel/core/sandbox/sync/sandbox.py | 9 +- 82 files changed, 772 insertions(+), 47 deletions(-) create mode 100644 src/blaxel/core/client/models/group_workspace_mapping.py create mode 100644 src/blaxel/core/client/models/group_workspace_mapping_role.py create mode 100644 src/blaxel/core/client/models/sso_domain.py create mode 100644 src/blaxel/core/client/models/sso_domain_metadata.py create mode 100644 src/blaxel/core/client/models/sso_domain_spec.py create mode 100644 src/blaxel/core/client/models/sso_domain_spec_status.py create mode 100644 src/blaxel/core/client/models/workspace_user_source.py diff --git a/Makefile b/Makefile index 3fba6531..37310cc3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ ARGS:= $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) +branch ?= main # Get git commit hash automatically GIT_COMMIT := $(shell git rev-parse HEAD 2>/dev/null || echo "unknown") @@ -12,7 +13,7 @@ sdk-sandbox: @curl -H "Authorization: token $$(gh auth token)" \ -H "Accept: application/vnd.github.v3.raw" \ -o ./definition.yml \ - https://api.github.com/repos/blaxel-ai/sandbox/contents/sandbox-api/docs/openapi.yml?ref=main + https://api.github.com/repos/blaxel-ai/sandbox/contents/sandbox-api/docs/openapi.yml?ref=$(branch) rm -rf src/blaxel/core/sandbox/client/api src/blaxel/core/sandbox/client/models .venv/bin/openapi-python-client generate \ --path=definition.yml \ @@ -30,7 +31,7 @@ sdk-controlplane: @curl -H "Authorization: token $$(gh auth token)" \ -H "Accept: application/vnd.github.v3.raw" \ -o ./definition.yml \ - https://api.github.com/repos/blaxel-ai/controlplane/contents/api/api/definitions/controlplane.yml?ref=main + https://api.github.com/repos/blaxel-ai/controlplane/contents/api/api/definitions/controlplane.yml?ref=$(branch) rm -rf src/blaxel/core/client/api src/blaxel/core/client/models .venv/bin/openapi-python-client generate \ --path=definition.yml \ diff --git a/src/blaxel/core/client/api/drives/create_drive.py b/src/blaxel/core/client/api/drives/create_drive.py index 99df885d..0ebe3962 100644 --- a/src/blaxel/core/client/api/drives/create_drive.py +++ b/src/blaxel/core/client/api/drives/create_drive.py @@ -62,13 +62,12 @@ def sync_detailed( ) -> Response[Union[Any, Drive]]: """Create a drive - Creates a new drive in the workspace. Drives are backed by SeaweedFS buckets and can be mounted at - runtime to sandboxes. + Creates a new drive in the workspace. Drives can be buckets and can be mounted at runtime to + sandboxes. Args: body (Drive): Drive providing persistent storage that can be attached to agents, - functions, and sandboxes. Drives are backed by SeaweedFS buckets and can be mounted at - runtime via the sbx API. + functions, and sandboxes. Drives can be mounted at runtime via the sbx API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -96,13 +95,12 @@ def sync( ) -> Union[Any, Drive] | None: """Create a drive - Creates a new drive in the workspace. Drives are backed by SeaweedFS buckets and can be mounted at - runtime to sandboxes. + Creates a new drive in the workspace. Drives can be buckets and can be mounted at runtime to + sandboxes. Args: body (Drive): Drive providing persistent storage that can be attached to agents, - functions, and sandboxes. Drives are backed by SeaweedFS buckets and can be mounted at - runtime via the sbx API. + functions, and sandboxes. Drives can be mounted at runtime via the sbx API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -125,13 +123,12 @@ async def asyncio_detailed( ) -> Response[Union[Any, Drive]]: """Create a drive - Creates a new drive in the workspace. Drives are backed by SeaweedFS buckets and can be mounted at - runtime to sandboxes. + Creates a new drive in the workspace. Drives can be buckets and can be mounted at runtime to + sandboxes. Args: body (Drive): Drive providing persistent storage that can be attached to agents, - functions, and sandboxes. Drives are backed by SeaweedFS buckets and can be mounted at - runtime via the sbx API. + functions, and sandboxes. Drives can be mounted at runtime via the sbx API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -157,13 +154,12 @@ async def asyncio( ) -> Union[Any, Drive] | None: """Create a drive - Creates a new drive in the workspace. Drives are backed by SeaweedFS buckets and can be mounted at - runtime to sandboxes. + Creates a new drive in the workspace. Drives can be buckets and can be mounted at runtime to + sandboxes. Args: body (Drive): Drive providing persistent storage that can be attached to agents, - functions, and sandboxes. Drives are backed by SeaweedFS buckets and can be mounted at - runtime via the sbx API. + functions, and sandboxes. Drives can be mounted at runtime via the sbx API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/blaxel/core/client/api/drives/create_drive_access_token.py b/src/blaxel/core/client/api/drives/create_drive_access_token.py index 7498aa82..0c428dc2 100644 --- a/src/blaxel/core/client/api/drives/create_drive_access_token.py +++ b/src/blaxel/core/client/api/drives/create_drive_access_token.py @@ -61,7 +61,7 @@ def sync_detailed( """Create drive access token Issues a short-lived JWT access token scoped to a specific drive. The token can be used as Bearer - authentication for direct S3 operations against the drive's SeaweedFS bucket. + authentication for direct S3 operations against the drive's bucket. Args: drive_name (str): @@ -93,7 +93,7 @@ def sync( """Create drive access token Issues a short-lived JWT access token scoped to a specific drive. The token can be used as Bearer - authentication for direct S3 operations against the drive's SeaweedFS bucket. + authentication for direct S3 operations against the drive's bucket. Args: drive_name (str): @@ -120,7 +120,7 @@ async def asyncio_detailed( """Create drive access token Issues a short-lived JWT access token scoped to a specific drive. The token can be used as Bearer - authentication for direct S3 operations against the drive's SeaweedFS bucket. + authentication for direct S3 operations against the drive's bucket. Args: drive_name (str): @@ -150,7 +150,7 @@ async def asyncio( """Create drive access token Issues a short-lived JWT access token scoped to a specific drive. The token can be used as Bearer - authentication for direct S3 operations against the drive's SeaweedFS bucket. + authentication for direct S3 operations against the drive's bucket. Args: drive_name (str): diff --git a/src/blaxel/core/client/api/drives/get_drive_jwks.py b/src/blaxel/core/client/api/drives/get_drive_jwks.py index 6cbda76d..acfa3f1e 100644 --- a/src/blaxel/core/client/api/drives/get_drive_jwks.py +++ b/src/blaxel/core/client/api/drives/get_drive_jwks.py @@ -47,7 +47,7 @@ def sync_detailed( """Get drive token JWKS Returns the JSON Web Key Set containing the Ed25519 public key used to verify drive access tokens. - SeaweedFS or other S3-compatible storage can use this endpoint to validate Bearer tokens. + Other S3-compatible storage can use this endpoint to validate Bearer tokens. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -73,7 +73,7 @@ def sync( """Get drive token JWKS Returns the JSON Web Key Set containing the Ed25519 public key used to verify drive access tokens. - SeaweedFS or other S3-compatible storage can use this endpoint to validate Bearer tokens. + Other S3-compatible storage can use this endpoint to validate Bearer tokens. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -95,7 +95,7 @@ async def asyncio_detailed( """Get drive token JWKS Returns the JSON Web Key Set containing the Ed25519 public key used to verify drive access tokens. - SeaweedFS or other S3-compatible storage can use this endpoint to validate Bearer tokens. + Other S3-compatible storage can use this endpoint to validate Bearer tokens. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -119,7 +119,7 @@ async def asyncio( """Get drive token JWKS Returns the JSON Web Key Set containing the Ed25519 public key used to verify drive access tokens. - SeaweedFS or other S3-compatible storage can use this endpoint to validate Bearer tokens. + Other S3-compatible storage can use this endpoint to validate Bearer tokens. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/blaxel/core/client/api/drives/update_drive.py b/src/blaxel/core/client/api/drives/update_drive.py index 6a67cfd9..fdf7e80d 100644 --- a/src/blaxel/core/client/api/drives/update_drive.py +++ b/src/blaxel/core/client/api/drives/update_drive.py @@ -73,8 +73,7 @@ def sync_detailed( Args: drive_name (str): body (Drive): Drive providing persistent storage that can be attached to agents, - functions, and sandboxes. Drives are backed by SeaweedFS buckets and can be mounted at - runtime via the sbx API. + functions, and sandboxes. Drives can be mounted at runtime via the sbx API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -110,8 +109,7 @@ def sync( Args: drive_name (str): body (Drive): Drive providing persistent storage that can be attached to agents, - functions, and sandboxes. Drives are backed by SeaweedFS buckets and can be mounted at - runtime via the sbx API. + functions, and sandboxes. Drives can be mounted at runtime via the sbx API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -142,8 +140,7 @@ async def asyncio_detailed( Args: drive_name (str): body (Drive): Drive providing persistent storage that can be attached to agents, - functions, and sandboxes. Drives are backed by SeaweedFS buckets and can be mounted at - runtime via the sbx API. + functions, and sandboxes. Drives can be mounted at runtime via the sbx API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,8 +174,7 @@ async def asyncio( Args: drive_name (str): body (Drive): Drive providing persistent storage that can be attached to agents, - functions, and sandboxes. Drives are backed by SeaweedFS buckets and can be mounted at - runtime via the sbx API. + functions, and sandboxes. Drives can be mounted at runtime via the sbx API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/blaxel/core/client/api/feature_flags/test_feature_flag.py b/src/blaxel/core/client/api/feature_flags/test_feature_flag.py index 24d31fbf..81ebcef6 100644 --- a/src/blaxel/core/client/api/feature_flags/test_feature_flag.py +++ b/src/blaxel/core/client/api/feature_flags/test_feature_flag.py @@ -7,15 +7,24 @@ from ...client import Client from ...models.error import Error from ...models.test_feature_flag_response_200 import TestFeatureFlagResponse200 -from ...types import Response +from ...types import UNSET, Response, Unset def _get_kwargs( feature_key: str, + *, + account: Union[Unset, str] = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["account"] = account + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + _kwargs: dict[str, Any] = { "method": "get", "url": f"/features/{feature_key}", + "params": params, } return _kwargs @@ -61,6 +70,7 @@ def sync_detailed( feature_key: str, *, client: Client, + account: Union[Unset, str] = UNSET, ) -> Response[Union[Error, TestFeatureFlagResponse200]]: """Retrieve feature flag evaluation for workspace @@ -69,6 +79,7 @@ def sync_detailed( Args: feature_key (str): + account (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -80,6 +91,7 @@ def sync_detailed( kwargs = _get_kwargs( feature_key=feature_key, + account=account, ) response = client.get_httpx_client().request( @@ -93,6 +105,7 @@ def sync( feature_key: str, *, client: Client, + account: Union[Unset, str] = UNSET, ) -> Union[Error, TestFeatureFlagResponse200] | None: """Retrieve feature flag evaluation for workspace @@ -101,6 +114,7 @@ def sync( Args: feature_key (str): + account (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -113,6 +127,7 @@ def sync( return sync_detailed( feature_key=feature_key, client=client, + account=account, ).parsed @@ -120,6 +135,7 @@ async def asyncio_detailed( feature_key: str, *, client: Client, + account: Union[Unset, str] = UNSET, ) -> Response[Union[Error, TestFeatureFlagResponse200]]: """Retrieve feature flag evaluation for workspace @@ -128,6 +144,7 @@ async def asyncio_detailed( Args: feature_key (str): + account (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,6 +156,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( feature_key=feature_key, + account=account, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -150,6 +168,7 @@ async def asyncio( feature_key: str, *, client: Client, + account: Union[Unset, str] = UNSET, ) -> Union[Error, TestFeatureFlagResponse200] | None: """Retrieve feature flag evaluation for workspace @@ -158,6 +177,7 @@ async def asyncio( Args: feature_key (str): + account (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -171,5 +191,6 @@ async def asyncio( await asyncio_detailed( feature_key=feature_key, client=client, + account=account, ) ).parsed diff --git a/src/blaxel/core/client/models/__init__.py b/src/blaxel/core/client/models/__init__.py index a11242bf..fc16c165 100644 --- a/src/blaxel/core/client/models/__init__.py +++ b/src/blaxel/core/client/models/__init__.py @@ -65,6 +65,8 @@ from .get_workspace_service_accounts_response_200_item import ( GetWorkspaceServiceAccountsResponse200Item, ) +from .group_workspace_mapping import GroupWorkspaceMapping +from .group_workspace_mapping_role import GroupWorkspaceMappingRole from .image import Image from .image_metadata import ImageMetadata from .image_spec import ImageSpec @@ -156,6 +158,10 @@ from .sandbox_network import SandboxNetwork from .sandbox_runtime import SandboxRuntime from .sandbox_spec import SandboxSpec +from .sso_domain import SSODomain +from .sso_domain_metadata import SSODomainMetadata +from .sso_domain_spec import SSODomainSpec +from .sso_domain_spec_status import SSODomainSpecStatus from .status import Status from .template import Template from .template_variable import TemplateVariable @@ -185,6 +191,7 @@ from .workspace_runtime import WorkspaceRuntime from .workspace_status import WorkspaceStatus from .workspace_user import WorkspaceUser +from .workspace_user_source import WorkspaceUserSource __all__ = ( "Agent", @@ -250,6 +257,8 @@ "GetWorkspaceFeaturesResponse200", "GetWorkspaceFeaturesResponse200Features", "GetWorkspaceServiceAccountsResponse200Item", + "GroupWorkspaceMapping", + "GroupWorkspaceMappingRole", "Image", "ImageMetadata", "ImageSpec", @@ -339,6 +348,10 @@ "SandboxNetwork", "SandboxRuntime", "SandboxSpec", + "SSODomain", + "SSODomainMetadata", + "SSODomainSpec", + "SSODomainSpecStatus", "Status", "Template", "TemplateVariable", @@ -368,4 +381,5 @@ "WorkspaceRuntime", "WorkspaceStatus", "WorkspaceUser", + "WorkspaceUserSource", ) diff --git a/src/blaxel/core/client/models/agent.py b/src/blaxel/core/client/models/agent.py index b1aa662c..b0c8e09d 100644 --- a/src/blaxel/core/client/models/agent.py +++ b/src/blaxel/core/client/models/agent.py @@ -36,6 +36,7 @@ class Agent: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/agent_runtime.py b/src/blaxel/core/client/models/agent_runtime.py index e4666217..4cb72a90 100644 --- a/src/blaxel/core/client/models/agent_runtime.py +++ b/src/blaxel/core/client/models/agent_runtime.py @@ -41,6 +41,7 @@ class AgentRuntime: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + envs: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.envs, Unset): envs = [] diff --git a/src/blaxel/core/client/models/agent_spec.py b/src/blaxel/core/client/models/agent_spec.py index 9dcd9bed..1fc8f3c0 100644 --- a/src/blaxel/core/client/models/agent_spec.py +++ b/src/blaxel/core/client/models/agent_spec.py @@ -10,6 +10,7 @@ from ..models.repository import Repository from ..models.revision_configuration import RevisionConfiguration from ..models.trigger import Trigger + from ..models.volume_attachment import VolumeAttachment T = TypeVar("T", bound="AgentSpec") @@ -25,23 +26,29 @@ class AgentSpec: policies (Union[Unset, list[str]]): public (Union[Unset, bool]): When true, the agent is publicly accessible without authentication. Only available for mk3 generation. Default: False. + region (Union[Unset, str]): Region where the agent should be deployed (e.g. us-pdx-1, eu-lon-1). Required when + volumes are attached. Example: us-pdx-1. repository (Union[Unset, Repository]): Repository revision (Union[Unset, RevisionConfiguration]): Revision configuration runtime (Union[Unset, AgentRuntime]): Runtime configuration defining how the AI agent is deployed and scaled globally triggers (Union[Unset, list['Trigger']]): Triggers to use your agent + volumes (Union[Unset, list['VolumeAttachment']]): """ enabled: Union[Unset, bool] = True policies: Union[Unset, list[str]] = UNSET public: Union[Unset, bool] = False + region: Union[Unset, str] = UNSET repository: Union[Unset, "Repository"] = UNSET revision: Union[Unset, "RevisionConfiguration"] = UNSET runtime: Union[Unset, "AgentRuntime"] = UNSET triggers: Union[Unset, list["Trigger"]] = UNSET + volumes: Union[Unset, list["VolumeAttachment"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + enabled = self.enabled policies: Union[Unset, list[str]] = UNSET @@ -50,6 +57,8 @@ def to_dict(self) -> dict[str, Any]: public = self.public + region = self.region + repository: Union[Unset, dict[str, Any]] = UNSET if ( self.repository @@ -90,6 +99,20 @@ def to_dict(self) -> dict[str, Any]: componentsschemas_triggers_item = componentsschemas_triggers_item_data.to_dict() triggers.append(componentsschemas_triggers_item) + volumes: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.volumes, Unset): + volumes = [] + for componentsschemas_volume_attachments_item_data in self.volumes: + if type(componentsschemas_volume_attachments_item_data) is dict: + componentsschemas_volume_attachments_item = ( + componentsschemas_volume_attachments_item_data + ) + else: + componentsschemas_volume_attachments_item = ( + componentsschemas_volume_attachments_item_data.to_dict() + ) + volumes.append(componentsschemas_volume_attachments_item) + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -99,6 +122,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["policies"] = policies if public is not UNSET: field_dict["public"] = public + if region is not UNSET: + field_dict["region"] = region if repository is not UNSET: field_dict["repository"] = repository if revision is not UNSET: @@ -107,6 +132,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["runtime"] = runtime if triggers is not UNSET: field_dict["triggers"] = triggers + if volumes is not UNSET: + field_dict["volumes"] = volumes return field_dict @@ -116,6 +143,7 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: from ..models.repository import Repository from ..models.revision_configuration import RevisionConfiguration from ..models.trigger import Trigger + from ..models.volume_attachment import VolumeAttachment if not src_dict: return None @@ -126,6 +154,8 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: public = d.pop("public", UNSET) + region = d.pop("region", UNSET) + _repository = d.pop("repository", UNSET) repository: Union[Unset, Repository] if isinstance(_repository, Unset): @@ -156,14 +186,25 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: triggers.append(componentsschemas_triggers_item) + volumes = [] + _volumes = d.pop("volumes", UNSET) + for componentsschemas_volume_attachments_item_data in _volumes or []: + componentsschemas_volume_attachments_item = VolumeAttachment.from_dict( + componentsschemas_volume_attachments_item_data + ) + + volumes.append(componentsschemas_volume_attachments_item) + agent_spec = cls( enabled=enabled, policies=policies, public=public, + region=region, repository=repository, revision=revision, runtime=runtime, triggers=triggers, + volumes=volumes, ) agent_spec.additional_properties = d diff --git a/src/blaxel/core/client/models/configuration.py b/src/blaxel/core/client/models/configuration.py index ba6aaef8..d0eec18b 100644 --- a/src/blaxel/core/client/models/configuration.py +++ b/src/blaxel/core/client/models/configuration.py @@ -33,6 +33,7 @@ class Configuration: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + continents: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.continents, Unset): continents = [] diff --git a/src/blaxel/core/client/models/create_job_execution_output.py b/src/blaxel/core/client/models/create_job_execution_output.py index 7d31cab9..ab7e2203 100644 --- a/src/blaxel/core/client/models/create_job_execution_output.py +++ b/src/blaxel/core/client/models/create_job_execution_output.py @@ -37,6 +37,7 @@ class CreateJobExecutionOutput: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + execution_id = self.execution_id id = self.id diff --git a/src/blaxel/core/client/models/create_job_execution_request.py b/src/blaxel/core/client/models/create_job_execution_request.py index 7ec4f73a..110a3a1b 100644 --- a/src/blaxel/core/client/models/create_job_execution_request.py +++ b/src/blaxel/core/client/models/create_job_execution_request.py @@ -40,6 +40,7 @@ class CreateJobExecutionRequest: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + env: Union[Unset, dict[str, Any]] = UNSET if self.env and not isinstance(self.env, Unset) and not isinstance(self.env, dict): env = self.env.to_dict() diff --git a/src/blaxel/core/client/models/custom_domain.py b/src/blaxel/core/client/models/custom_domain.py index 6b17e9ab..fe1fa967 100644 --- a/src/blaxel/core/client/models/custom_domain.py +++ b/src/blaxel/core/client/models/custom_domain.py @@ -28,6 +28,7 @@ class CustomDomain: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/custom_domain_metadata.py b/src/blaxel/core/client/models/custom_domain_metadata.py index 1b354e48..ae0506f3 100644 --- a/src/blaxel/core/client/models/custom_domain_metadata.py +++ b/src/blaxel/core/client/models/custom_domain_metadata.py @@ -39,6 +39,7 @@ class CustomDomainMetadata: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + created_at = self.created_at updated_at = self.updated_at diff --git a/src/blaxel/core/client/models/custom_domain_spec.py b/src/blaxel/core/client/models/custom_domain_spec.py index 01f4ece2..03116ca3 100644 --- a/src/blaxel/core/client/models/custom_domain_spec.py +++ b/src/blaxel/core/client/models/custom_domain_spec.py @@ -37,6 +37,7 @@ class CustomDomainSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + cname_records = self.cname_records last_verified_at = self.last_verified_at diff --git a/src/blaxel/core/client/models/delete_volume_template_version_response_200.py b/src/blaxel/core/client/models/delete_volume_template_version_response_200.py index c7d99aee..5a8cf60e 100644 --- a/src/blaxel/core/client/models/delete_volume_template_version_response_200.py +++ b/src/blaxel/core/client/models/delete_volume_template_version_response_200.py @@ -25,6 +25,7 @@ class DeleteVolumeTemplateVersionResponse200: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + message = self.message template: Union[Unset, dict[str, Any]] = UNSET diff --git a/src/blaxel/core/client/models/drive.py b/src/blaxel/core/client/models/drive.py index 7f2a6918..aead16e7 100644 --- a/src/blaxel/core/client/models/drive.py +++ b/src/blaxel/core/client/models/drive.py @@ -17,8 +17,8 @@ @_attrs_define class Drive: - """Drive providing persistent storage that can be attached to agents, functions, and sandboxes. Drives are backed by - SeaweedFS buckets and can be mounted at runtime via the sbx API. + """Drive providing persistent storage that can be attached to agents, functions, and sandboxes. Drives can be mounted + at runtime via the sbx API. Attributes: metadata (Metadata): Common metadata fields shared by all Blaxel resources including name, labels, timestamps, @@ -37,6 +37,7 @@ class Drive: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/egress_gateway.py b/src/blaxel/core/client/models/egress_gateway.py index cf6cfb23..4cf8db08 100644 --- a/src/blaxel/core/client/models/egress_gateway.py +++ b/src/blaxel/core/client/models/egress_gateway.py @@ -34,6 +34,7 @@ class EgressGateway: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/egress_ip.py b/src/blaxel/core/client/models/egress_ip.py index 92fca87c..e8542d77 100644 --- a/src/blaxel/core/client/models/egress_ip.py +++ b/src/blaxel/core/client/models/egress_ip.py @@ -33,6 +33,7 @@ class EgressIP: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/entrypoint.py b/src/blaxel/core/client/models/entrypoint.py index f56e3db8..9188c712 100644 --- a/src/blaxel/core/client/models/entrypoint.py +++ b/src/blaxel/core/client/models/entrypoint.py @@ -32,6 +32,7 @@ class Entrypoint: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + args: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.args, Unset): args = [] diff --git a/src/blaxel/core/client/models/form.py b/src/blaxel/core/client/models/form.py index e55e8722..6486251b 100644 --- a/src/blaxel/core/client/models/form.py +++ b/src/blaxel/core/client/models/form.py @@ -30,6 +30,7 @@ class Form: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + config: Union[Unset, dict[str, Any]] = UNSET if self.config and not isinstance(self.config, Unset) and not isinstance(self.config, dict): config = self.config.to_dict() diff --git a/src/blaxel/core/client/models/function.py b/src/blaxel/core/client/models/function.py index fd2528b4..b3d16028 100644 --- a/src/blaxel/core/client/models/function.py +++ b/src/blaxel/core/client/models/function.py @@ -36,6 +36,7 @@ class Function: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/function_runtime.py b/src/blaxel/core/client/models/function_runtime.py index 3b9891e0..9e2623ab 100644 --- a/src/blaxel/core/client/models/function_runtime.py +++ b/src/blaxel/core/client/models/function_runtime.py @@ -44,6 +44,7 @@ class FunctionRuntime: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + envs: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.envs, Unset): envs = [] diff --git a/src/blaxel/core/client/models/function_spec.py b/src/blaxel/core/client/models/function_spec.py index 30161bd5..21cc973d 100644 --- a/src/blaxel/core/client/models/function_spec.py +++ b/src/blaxel/core/client/models/function_spec.py @@ -25,6 +25,8 @@ class FunctionSpec: policies (Union[Unset, list[str]]): public (Union[Unset, bool]): When true, the function is publicly accessible without authentication. Only available for mk3 generation. Default: False. + region (Union[Unset, str]): Region where the function should be deployed (e.g. us-pdx-1, eu-lon-1). If not + specified, the function is deployed based on policy locations. Example: us-pdx-1. revision (Union[Unset, RevisionConfiguration]): Revision configuration runtime (Union[Unset, FunctionRuntime]): Runtime configuration defining how the MCP server function is deployed and scaled @@ -35,12 +37,14 @@ class FunctionSpec: integration_connections: Union[Unset, list[str]] = UNSET policies: Union[Unset, list[str]] = UNSET public: Union[Unset, bool] = False + region: Union[Unset, str] = UNSET revision: Union[Unset, "RevisionConfiguration"] = UNSET runtime: Union[Unset, "FunctionRuntime"] = UNSET triggers: Union[Unset, list["Trigger"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + enabled = self.enabled integration_connections: Union[Unset, list[str]] = UNSET @@ -53,6 +57,8 @@ def to_dict(self) -> dict[str, Any]: public = self.public + region = self.region + revision: Union[Unset, dict[str, Any]] = UNSET if ( self.revision @@ -94,6 +100,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["policies"] = policies if public is not UNSET: field_dict["public"] = public + if region is not UNSET: + field_dict["region"] = region if revision is not UNSET: field_dict["revision"] = revision if runtime is not UNSET: @@ -122,6 +130,8 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: public = d.pop("public", UNSET) + region = d.pop("region", UNSET) + _revision = d.pop("revision", UNSET) revision: Union[Unset, RevisionConfiguration] if isinstance(_revision, Unset): @@ -150,6 +160,7 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: integration_connections=integration_connections, policies=policies, public=public, + region=region, revision=revision, runtime=runtime, triggers=triggers, diff --git a/src/blaxel/core/client/models/get_drive_jwks_response_200.py b/src/blaxel/core/client/models/get_drive_jwks_response_200.py index 8e429369..261bfe78 100644 --- a/src/blaxel/core/client/models/get_drive_jwks_response_200.py +++ b/src/blaxel/core/client/models/get_drive_jwks_response_200.py @@ -23,6 +23,7 @@ class GetDriveJWKSResponse200: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + keys: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.keys, Unset): keys = [] diff --git a/src/blaxel/core/client/models/get_workspace_features_response_200.py b/src/blaxel/core/client/models/get_workspace_features_response_200.py index e2818c60..ef225b64 100644 --- a/src/blaxel/core/client/models/get_workspace_features_response_200.py +++ b/src/blaxel/core/client/models/get_workspace_features_response_200.py @@ -26,6 +26,7 @@ class GetWorkspaceFeaturesResponse200: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + features: Union[Unset, dict[str, Any]] = UNSET if ( self.features diff --git a/src/blaxel/core/client/models/group_workspace_mapping.py b/src/blaxel/core/client/models/group_workspace_mapping.py new file mode 100644 index 00000000..fc8f3eb6 --- /dev/null +++ b/src/blaxel/core/client/models/group_workspace_mapping.py @@ -0,0 +1,79 @@ +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.group_workspace_mapping_role import GroupWorkspaceMappingRole +from ..types import UNSET, Unset + +T = TypeVar("T", bound="GroupWorkspaceMapping") + + +@_attrs_define +class GroupWorkspaceMapping: + """Mapping between an IdP group and a workspace role for directory sync + + Attributes: + group_name (Union[Unset, str]): Name of the IdP group (e.g. "Engineering", "Platform") Example: Engineering. + role (Union[Unset, GroupWorkspaceMappingRole]): Role to assign in this workspace (admin or member) Example: + admin. + """ + + group_name: Union[Unset, str] = UNSET + role: Union[Unset, GroupWorkspaceMappingRole] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + group_name = self.group_name + + role: Union[Unset, str] = UNSET + if not isinstance(self.role, Unset): + role = self.role.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if group_name is not UNSET: + field_dict["groupName"] = group_name + if role is not UNSET: + field_dict["role"] = role + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: + if not src_dict: + return None + d = src_dict.copy() + group_name = d.pop("groupName", d.pop("group_name", UNSET)) + + _role = d.pop("role", UNSET) + role: Union[Unset, GroupWorkspaceMappingRole] + if isinstance(_role, Unset): + role = UNSET + else: + role = GroupWorkspaceMappingRole(_role) + + group_workspace_mapping = cls( + group_name=group_name, + role=role, + ) + + group_workspace_mapping.additional_properties = d + return group_workspace_mapping + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/blaxel/core/client/models/group_workspace_mapping_role.py b/src/blaxel/core/client/models/group_workspace_mapping_role.py new file mode 100644 index 00000000..1131e452 --- /dev/null +++ b/src/blaxel/core/client/models/group_workspace_mapping_role.py @@ -0,0 +1,18 @@ +from enum import Enum + + +class GroupWorkspaceMappingRole(str, Enum): + ADMIN = "admin" + MEMBER = "member" + + def __str__(self) -> str: + return str(self.value) + + @classmethod + def _missing_(cls, value: object) -> "GroupWorkspaceMappingRole | None": + if isinstance(value, str): + upper_value = value.upper() + for member in cls: + if member.value.upper() == upper_value: + return member + return None diff --git a/src/blaxel/core/client/models/image.py b/src/blaxel/core/client/models/image.py index 2132b76c..98e25bb5 100644 --- a/src/blaxel/core/client/models/image.py +++ b/src/blaxel/core/client/models/image.py @@ -24,6 +24,7 @@ class Image: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/image_spec.py b/src/blaxel/core/client/models/image_spec.py index ff47facf..34225801 100644 --- a/src/blaxel/core/client/models/image_spec.py +++ b/src/blaxel/core/client/models/image_spec.py @@ -25,6 +25,7 @@ class ImageSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + size = self.size tags: Union[Unset, list[dict[str, Any]]] = UNSET diff --git a/src/blaxel/core/client/models/integration.py b/src/blaxel/core/client/models/integration.py index b893983c..57108161 100644 --- a/src/blaxel/core/client/models/integration.py +++ b/src/blaxel/core/client/models/integration.py @@ -41,6 +41,7 @@ class Integration: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + additional_infos: Union[Unset, dict[str, Any]] = UNSET if ( self.additional_infos diff --git a/src/blaxel/core/client/models/integration_connection.py b/src/blaxel/core/client/models/integration_connection.py index ba41b5fc..0ed7f358 100644 --- a/src/blaxel/core/client/models/integration_connection.py +++ b/src/blaxel/core/client/models/integration_connection.py @@ -28,6 +28,7 @@ class IntegrationConnection: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/integration_connection_spec.py b/src/blaxel/core/client/models/integration_connection_spec.py index 2f42e019..27c6d86b 100644 --- a/src/blaxel/core/client/models/integration_connection_spec.py +++ b/src/blaxel/core/client/models/integration_connection_spec.py @@ -34,6 +34,7 @@ class IntegrationConnectionSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + config: Union[Unset, dict[str, Any]] = UNSET if self.config and not isinstance(self.config, Unset) and not isinstance(self.config, dict): config = self.config.to_dict() diff --git a/src/blaxel/core/client/models/integration_endpoint.py b/src/blaxel/core/client/models/integration_endpoint.py index d1c9fea6..ade0dae2 100644 --- a/src/blaxel/core/client/models/integration_endpoint.py +++ b/src/blaxel/core/client/models/integration_endpoint.py @@ -38,6 +38,7 @@ class IntegrationEndpoint: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + body = self.body ignore_models: Union[Unset, list[dict[str, Any]]] = UNSET diff --git a/src/blaxel/core/client/models/integration_endpoints.py b/src/blaxel/core/client/models/integration_endpoints.py index 61fb17b5..76c5b99a 100644 --- a/src/blaxel/core/client/models/integration_endpoints.py +++ b/src/blaxel/core/client/models/integration_endpoints.py @@ -17,6 +17,7 @@ class IntegrationEndpoints: additional_properties: dict[str, "IntegrationEndpoint"] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} for prop_name, prop in self.additional_properties.items(): if type(prop) is dict: @@ -35,6 +36,7 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: d = src_dict.copy() integration_endpoints = cls() + additional_properties = {} for prop_name, prop_dict in d.items(): additional_property = IntegrationEndpoint.from_dict(prop_dict) diff --git a/src/blaxel/core/client/models/job.py b/src/blaxel/core/client/models/job.py index 04aae372..50901929 100644 --- a/src/blaxel/core/client/models/job.py +++ b/src/blaxel/core/client/models/job.py @@ -36,6 +36,7 @@ class Job: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/job_execution.py b/src/blaxel/core/client/models/job_execution.py index 1710452c..4bae77c9 100644 --- a/src/blaxel/core/client/models/job_execution.py +++ b/src/blaxel/core/client/models/job_execution.py @@ -36,6 +36,7 @@ class JobExecution: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/job_execution_spec.py b/src/blaxel/core/client/models/job_execution_spec.py index c0590774..f18077f8 100644 --- a/src/blaxel/core/client/models/job_execution_spec.py +++ b/src/blaxel/core/client/models/job_execution_spec.py @@ -35,6 +35,7 @@ class JobExecutionSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + env_override: Union[Unset, dict[str, Any]] = UNSET if ( self.env_override diff --git a/src/blaxel/core/client/models/job_execution_task.py b/src/blaxel/core/client/models/job_execution_task.py index f9319086..b73e476d 100644 --- a/src/blaxel/core/client/models/job_execution_task.py +++ b/src/blaxel/core/client/models/job_execution_task.py @@ -33,6 +33,7 @@ class JobExecutionTask: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + conditions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] diff --git a/src/blaxel/core/client/models/job_runtime.py b/src/blaxel/core/client/models/job_runtime.py index 1daf89eb..7b4f26ac 100644 --- a/src/blaxel/core/client/models/job_runtime.py +++ b/src/blaxel/core/client/models/job_runtime.py @@ -46,6 +46,7 @@ class JobRuntime: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + envs: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.envs, Unset): envs = [] diff --git a/src/blaxel/core/client/models/job_spec.py b/src/blaxel/core/client/models/job_spec.py index be089999..35b1c6b3 100644 --- a/src/blaxel/core/client/models/job_spec.py +++ b/src/blaxel/core/client/models/job_spec.py @@ -38,6 +38,7 @@ class JobSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + enabled = self.enabled policies: Union[Unset, list[str]] = UNSET diff --git a/src/blaxel/core/client/models/location_response.py b/src/blaxel/core/client/models/location_response.py index 1ba28924..a413cf84 100644 --- a/src/blaxel/core/client/models/location_response.py +++ b/src/blaxel/core/client/models/location_response.py @@ -34,6 +34,7 @@ class LocationResponse: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + continent = self.continent country = self.country diff --git a/src/blaxel/core/client/models/mcp_definition.py b/src/blaxel/core/client/models/mcp_definition.py index b46583e4..bd80c485 100644 --- a/src/blaxel/core/client/models/mcp_definition.py +++ b/src/blaxel/core/client/models/mcp_definition.py @@ -60,6 +60,7 @@ class MCPDefinition: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + created_at = self.created_at updated_at = self.updated_at diff --git a/src/blaxel/core/client/models/metadata.py b/src/blaxel/core/client/models/metadata.py index 1bf488a9..96b34e84 100644 --- a/src/blaxel/core/client/models/metadata.py +++ b/src/blaxel/core/client/models/metadata.py @@ -46,6 +46,7 @@ class Metadata: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + name = self.name created_at = self.created_at diff --git a/src/blaxel/core/client/models/model.py b/src/blaxel/core/client/models/model.py index 92b6ee53..e7689923 100644 --- a/src/blaxel/core/client/models/model.py +++ b/src/blaxel/core/client/models/model.py @@ -36,6 +36,7 @@ class Model: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/model_spec.py b/src/blaxel/core/client/models/model_spec.py index 1e053ae1..c26c2b52 100644 --- a/src/blaxel/core/client/models/model_spec.py +++ b/src/blaxel/core/client/models/model_spec.py @@ -37,6 +37,7 @@ class ModelSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + enabled = self.enabled flavors: Union[Unset, list[dict[str, Any]]] = UNSET diff --git a/src/blaxel/core/client/models/o_auth.py b/src/blaxel/core/client/models/o_auth.py index 8965f520..ad63ddf8 100644 --- a/src/blaxel/core/client/models/o_auth.py +++ b/src/blaxel/core/client/models/o_auth.py @@ -26,6 +26,7 @@ class OAuth: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + scope: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.scope, Unset): scope = [] diff --git a/src/blaxel/core/client/models/pending_invitation.py b/src/blaxel/core/client/models/pending_invitation.py index a0baead8..988d7160 100644 --- a/src/blaxel/core/client/models/pending_invitation.py +++ b/src/blaxel/core/client/models/pending_invitation.py @@ -18,6 +18,7 @@ class PendingInvitation: created_by (Union[Unset, str]): The user or service account who created the resource updated_by (Union[Unset, str]): The user or service account who updated the resource email (Union[Unset, str]): User email + expires_at (Union[Unset, str]): The date and time when the invitation expires invited_by (Union[Unset, str]): User sub role (Union[Unset, str]): ACL role workspace (Union[Unset, str]): Workspace name @@ -28,6 +29,7 @@ class PendingInvitation: created_by: Union[Unset, str] = UNSET updated_by: Union[Unset, str] = UNSET email: Union[Unset, str] = UNSET + expires_at: Union[Unset, str] = UNSET invited_by: Union[Unset, str] = UNSET role: Union[Unset, str] = UNSET workspace: Union[Unset, str] = UNSET @@ -44,6 +46,8 @@ def to_dict(self) -> dict[str, Any]: email = self.email + expires_at = self.expires_at + invited_by = self.invited_by role = self.role @@ -63,6 +67,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["updatedBy"] = updated_by if email is not UNSET: field_dict["email"] = email + if expires_at is not UNSET: + field_dict["expiresAt"] = expires_at if invited_by is not UNSET: field_dict["invitedBy"] = invited_by if role is not UNSET: @@ -87,6 +93,8 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: email = d.pop("email", UNSET) + expires_at = d.pop("expiresAt", d.pop("expires_at", UNSET)) + invited_by = d.pop("invitedBy", d.pop("invited_by", UNSET)) role = d.pop("role", UNSET) @@ -99,6 +107,7 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: created_by=created_by, updated_by=updated_by, email=email, + expires_at=expires_at, invited_by=invited_by, role=role, workspace=workspace, diff --git a/src/blaxel/core/client/models/pending_invitation_accept.py b/src/blaxel/core/client/models/pending_invitation_accept.py index 063b69a7..845871ad 100644 --- a/src/blaxel/core/client/models/pending_invitation_accept.py +++ b/src/blaxel/core/client/models/pending_invitation_accept.py @@ -27,6 +27,7 @@ class PendingInvitationAccept: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + email = self.email workspace: Union[Unset, dict[str, Any]] = UNSET diff --git a/src/blaxel/core/client/models/pending_invitation_render.py b/src/blaxel/core/client/models/pending_invitation_render.py index 1bca3280..003dd74b 100644 --- a/src/blaxel/core/client/models/pending_invitation_render.py +++ b/src/blaxel/core/client/models/pending_invitation_render.py @@ -20,6 +20,7 @@ class PendingInvitationRender: Attributes: email (Union[Unset, str]): User email + expires_at (Union[Unset, str]): The date and time when the invitation expires invited_at (Union[Unset, str]): Invitation date invited_by (Union[Unset, PendingInvitationRenderInvitedBy]): Invited by role (Union[Unset, str]): ACL role @@ -28,6 +29,7 @@ class PendingInvitationRender: """ email: Union[Unset, str] = UNSET + expires_at: Union[Unset, str] = UNSET invited_at: Union[Unset, str] = UNSET invited_by: Union[Unset, "PendingInvitationRenderInvitedBy"] = UNSET role: Union[Unset, str] = UNSET @@ -36,8 +38,11 @@ class PendingInvitationRender: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + email = self.email + expires_at = self.expires_at + invited_at = self.invited_at invited_by: Union[Unset, dict[str, Any]] = UNSET @@ -77,6 +82,8 @@ def to_dict(self) -> dict[str, Any]: field_dict.update({}) if email is not UNSET: field_dict["email"] = email + if expires_at is not UNSET: + field_dict["expiresAt"] = expires_at if invited_at is not UNSET: field_dict["invitedAt"] = invited_at if invited_by is not UNSET: @@ -101,6 +108,8 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: d = src_dict.copy() email = d.pop("email", UNSET) + expires_at = d.pop("expiresAt", d.pop("expires_at", UNSET)) + invited_at = d.pop("invitedAt", d.pop("invited_at", UNSET)) _invited_by = d.pop("invitedBy", d.pop("invited_by", UNSET)) @@ -128,6 +137,7 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: pending_invitation_render = cls( email=email, + expires_at=expires_at, invited_at=invited_at, invited_by=invited_by, role=role, diff --git a/src/blaxel/core/client/models/pending_invitation_workspace_details.py b/src/blaxel/core/client/models/pending_invitation_workspace_details.py index be4320b9..6ec1525e 100644 --- a/src/blaxel/core/client/models/pending_invitation_workspace_details.py +++ b/src/blaxel/core/client/models/pending_invitation_workspace_details.py @@ -28,6 +28,7 @@ class PendingInvitationWorkspaceDetails: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + emails: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.emails, Unset): emails = [] diff --git a/src/blaxel/core/client/models/policy.py b/src/blaxel/core/client/models/policy.py index 2cf88cf9..9b913727 100644 --- a/src/blaxel/core/client/models/policy.py +++ b/src/blaxel/core/client/models/policy.py @@ -26,6 +26,7 @@ class Policy: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/policy_spec.py b/src/blaxel/core/client/models/policy_spec.py index e343e629..19ad5059 100644 --- a/src/blaxel/core/client/models/policy_spec.py +++ b/src/blaxel/core/client/models/policy_spec.py @@ -40,6 +40,7 @@ class PolicySpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + flavors: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.flavors, Unset): flavors = [] diff --git a/src/blaxel/core/client/models/preview.py b/src/blaxel/core/client/models/preview.py index bba76417..38d1601a 100644 --- a/src/blaxel/core/client/models/preview.py +++ b/src/blaxel/core/client/models/preview.py @@ -33,6 +33,7 @@ class Preview: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/preview_spec.py b/src/blaxel/core/client/models/preview_spec.py index 2f4cbc8a..2a6d50b2 100644 --- a/src/blaxel/core/client/models/preview_spec.py +++ b/src/blaxel/core/client/models/preview_spec.py @@ -46,6 +46,7 @@ class PreviewSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + custom_domain = self.custom_domain expires = self.expires diff --git a/src/blaxel/core/client/models/preview_token.py b/src/blaxel/core/client/models/preview_token.py index accc7383..3ae85791 100644 --- a/src/blaxel/core/client/models/preview_token.py +++ b/src/blaxel/core/client/models/preview_token.py @@ -25,6 +25,7 @@ class PreviewToken: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/public_ips.py b/src/blaxel/core/client/models/public_ips.py index fa7f59a5..7dae820d 100644 --- a/src/blaxel/core/client/models/public_ips.py +++ b/src/blaxel/core/client/models/public_ips.py @@ -17,6 +17,7 @@ class PublicIps: additional_properties: dict[str, "PublicIp"] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} for prop_name, prop in self.additional_properties.items(): if type(prop) is dict: diff --git a/src/blaxel/core/client/models/region.py b/src/blaxel/core/client/models/region.py index ebc42bbb..8f626a56 100644 --- a/src/blaxel/core/client/models/region.py +++ b/src/blaxel/core/client/models/region.py @@ -43,6 +43,7 @@ class Region: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + agent_drive_public_url: Union[Unset, dict[str, Any]] = UNSET if ( self.agent_drive_public_url diff --git a/src/blaxel/core/client/models/sandbox.py b/src/blaxel/core/client/models/sandbox.py index 839a4db8..d943739a 100644 --- a/src/blaxel/core/client/models/sandbox.py +++ b/src/blaxel/core/client/models/sandbox.py @@ -41,6 +41,7 @@ class Sandbox: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/sandbox_definition.py b/src/blaxel/core/client/models/sandbox_definition.py index 4adf930d..5074b15d 100644 --- a/src/blaxel/core/client/models/sandbox_definition.py +++ b/src/blaxel/core/client/models/sandbox_definition.py @@ -53,6 +53,7 @@ class SandboxDefinition: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + categories: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.categories, Unset): categories = [] diff --git a/src/blaxel/core/client/models/sandbox_error.py b/src/blaxel/core/client/models/sandbox_error.py index aa861111..f73196d4 100644 --- a/src/blaxel/core/client/models/sandbox_error.py +++ b/src/blaxel/core/client/models/sandbox_error.py @@ -42,6 +42,7 @@ class SandboxError: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + code = self.code message = self.message diff --git a/src/blaxel/core/client/models/sandbox_lifecycle.py b/src/blaxel/core/client/models/sandbox_lifecycle.py index 6f3291f7..45a4c2fd 100644 --- a/src/blaxel/core/client/models/sandbox_lifecycle.py +++ b/src/blaxel/core/client/models/sandbox_lifecycle.py @@ -19,12 +19,16 @@ class SandboxLifecycle: Attributes: expiration_policies (Union[Unset, list['ExpirationPolicy']]): List of expiration policies. Multiple policies can be combined; whichever condition is met first triggers the action. + terminated_retention (Union[Unset, str]): Duration to keep the sandbox record after termination for log access + (e.g., '1h', '24h', '7d'). Defaults to 5m. Subject to maximum quota limits. Example: 24h. """ expiration_policies: Union[Unset, list["ExpirationPolicy"]] = UNSET + terminated_retention: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + expiration_policies: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.expiration_policies, Unset): expiration_policies = [] @@ -35,11 +39,15 @@ def to_dict(self) -> dict[str, Any]: expiration_policies_item = expiration_policies_item_data.to_dict() expiration_policies.append(expiration_policies_item) + terminated_retention = self.terminated_retention + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) if expiration_policies is not UNSET: field_dict["expirationPolicies"] = expiration_policies + if terminated_retention is not UNSET: + field_dict["terminatedRetention"] = terminated_retention return field_dict @@ -57,8 +65,11 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: expiration_policies.append(expiration_policies_item) + terminated_retention = d.pop("terminatedRetention", d.pop("terminated_retention", UNSET)) + sandbox_lifecycle = cls( expiration_policies=expiration_policies, + terminated_retention=terminated_retention, ) sandbox_lifecycle.additional_properties = d diff --git a/src/blaxel/core/client/models/sandbox_network.py b/src/blaxel/core/client/models/sandbox_network.py index 321defc1..e451ac96 100644 --- a/src/blaxel/core/client/models/sandbox_network.py +++ b/src/blaxel/core/client/models/sandbox_network.py @@ -8,14 +8,14 @@ @_attrs_define class SandboxNetwork: - """Network configuration for a sandbox including egress IP binding. All three fields (vpcName, egressGatewayName, - egressIpName) must be specified together to assign a dedicated IP. + """Network configuration for a sandbox including egress IP binding. All fields (vpcName, egressGatewayName) must be + specified together to assign a dedicated IP. Attributes: - egress_gateway_name (str): Name of the egress gateway in the VPC. Must be specified together with vpcName and - egressIpName. Example: my-egress-gateway. + egress_gateway_name (str): Name of the egress gateway in the VPC. Must be specified together with vpcName. + Example: my-egress-gateway. vpc_name (str): Name of the VPC where the egress gateway is provisioned. Must be specified together with - egressGatewayName and egressIpName. Example: my-vpc. + egressGatewayName. Example: my-vpc. """ egress_gateway_name: str diff --git a/src/blaxel/core/client/models/sandbox_runtime.py b/src/blaxel/core/client/models/sandbox_runtime.py index 40ddef02..809f3a5e 100644 --- a/src/blaxel/core/client/models/sandbox_runtime.py +++ b/src/blaxel/core/client/models/sandbox_runtime.py @@ -40,6 +40,7 @@ class SandboxRuntime: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + envs: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.envs, Unset): envs = [] diff --git a/src/blaxel/core/client/models/sandbox_spec.py b/src/blaxel/core/client/models/sandbox_spec.py index bd68fd47..cc288563 100644 --- a/src/blaxel/core/client/models/sandbox_spec.py +++ b/src/blaxel/core/client/models/sandbox_spec.py @@ -25,7 +25,7 @@ class SandboxSpec: lifecycle (Union[Unset, SandboxLifecycle]): Lifecycle configuration controlling automatic sandbox deletion based on idle time, max age, or specific dates network (Union[Unset, SandboxNetwork]): Network configuration for a sandbox including egress IP binding. All - three fields (vpcName, egressGatewayName, egressIpName) must be specified together to assign a dedicated IP. + fields (vpcName, egressGatewayName) must be specified together to assign a dedicated IP. region (Union[Unset, str]): Region where the sandbox should be created (e.g. us-pdx-1, eu-lon-1). If not specified, defaults to the region closest to the user. Example: us-pdx-1. runtime (Union[Unset, SandboxRuntime]): Runtime configuration defining how the sandbox VM is provisioned and its @@ -42,6 +42,7 @@ class SandboxSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + enabled = self.enabled lifecycle: Union[Unset, dict[str, Any]] = UNSET diff --git a/src/blaxel/core/client/models/sso_domain.py b/src/blaxel/core/client/models/sso_domain.py new file mode 100644 index 00000000..a69f25cd --- /dev/null +++ b/src/blaxel/core/client/models/sso_domain.py @@ -0,0 +1,87 @@ +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.sso_domain_metadata import SSODomainMetadata + from ..models.sso_domain_spec import SSODomainSpec + + +T = TypeVar("T", bound="SSODomain") + + +@_attrs_define +class SSODomain: + """SSO domain for SAML-based Single Sign-On + An SSO domain links an email domain (e.g., acme.com) to a workspace so that + users with that email domain are redirected to the workspace's + SSO/SAML identity provider during login. + + Attributes: + metadata (SSODomainMetadata): SSO domain metadata + spec (SSODomainSpec): SSO domain specification + """ + + metadata: "SSODomainMetadata" + spec: "SSODomainSpec" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + if type(self.metadata) is dict: + metadata = self.metadata + else: + metadata = self.metadata.to_dict() + + if type(self.spec) is dict: + spec = self.spec + else: + spec = self.spec.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "metadata": metadata, + "spec": spec, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: + from ..models.sso_domain_metadata import SSODomainMetadata + from ..models.sso_domain_spec import SSODomainSpec + + if not src_dict: + return None + d = src_dict.copy() + metadata = SSODomainMetadata.from_dict(d.pop("metadata")) + + spec = SSODomainSpec.from_dict(d.pop("spec")) + + sso_domain = cls( + metadata=metadata, + spec=spec, + ) + + sso_domain.additional_properties = d + return sso_domain + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/blaxel/core/client/models/sso_domain_metadata.py b/src/blaxel/core/client/models/sso_domain_metadata.py new file mode 100644 index 00000000..8cea2af8 --- /dev/null +++ b/src/blaxel/core/client/models/sso_domain_metadata.py @@ -0,0 +1,115 @@ +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SSODomainMetadata") + + +@_attrs_define +class SSODomainMetadata: + """SSO domain metadata + + Attributes: + created_at (Union[Unset, str]): The date and time when the resource was created + updated_at (Union[Unset, str]): The date and time when the resource was updated + created_by (Union[Unset, str]): The user or service account who created the resource + updated_by (Union[Unset, str]): The user or service account who updated the resource + account_id (Union[Unset, str]): Account ID + display_name (Union[Unset, str]): Display name for the SSO domain Example: Acme Corp. + name (Union[Unset, str]): Domain name (e.g., "acme.com") Example: acme.com. + """ + + created_at: Union[Unset, str] = UNSET + updated_at: Union[Unset, str] = UNSET + created_by: Union[Unset, str] = UNSET + updated_by: Union[Unset, str] = UNSET + account_id: Union[Unset, str] = UNSET + display_name: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at + + updated_at = self.updated_at + + created_by = self.created_by + + updated_by = self.updated_by + + account_id = self.account_id + + display_name = self.display_name + + name = self.name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if created_at is not UNSET: + field_dict["createdAt"] = created_at + if updated_at is not UNSET: + field_dict["updatedAt"] = updated_at + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if updated_by is not UNSET: + field_dict["updatedBy"] = updated_by + if account_id is not UNSET: + field_dict["accountId"] = account_id + if display_name is not UNSET: + field_dict["displayName"] = display_name + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: + if not src_dict: + return None + d = src_dict.copy() + created_at = d.pop("createdAt", d.pop("created_at", UNSET)) + + updated_at = d.pop("updatedAt", d.pop("updated_at", UNSET)) + + created_by = d.pop("createdBy", d.pop("created_by", UNSET)) + + updated_by = d.pop("updatedBy", d.pop("updated_by", UNSET)) + + account_id = d.pop("accountId", d.pop("account_id", UNSET)) + + display_name = d.pop("displayName", d.pop("display_name", UNSET)) + + name = d.pop("name", UNSET) + + sso_domain_metadata = cls( + created_at=created_at, + updated_at=updated_at, + created_by=created_by, + updated_by=updated_by, + account_id=account_id, + display_name=display_name, + name=name, + ) + + sso_domain_metadata.additional_properties = d + return sso_domain_metadata + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/blaxel/core/client/models/sso_domain_spec.py b/src/blaxel/core/client/models/sso_domain_spec.py new file mode 100644 index 00000000..9618eea4 --- /dev/null +++ b/src/blaxel/core/client/models/sso_domain_spec.py @@ -0,0 +1,156 @@ +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.sso_domain_spec_status import SSODomainSpecStatus +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SSODomainSpec") + + +@_attrs_define +class SSODomainSpec: + """SSO domain specification + + Attributes: + allowed_auth_methods (Union[Unset, list[str]]): List of allowed login methods for this domain. When set, users + with this email domain can only use the specified methods. Possible values are google, saml, email. Empty list + means no restriction. + auto_join_workspaces (Union[Unset, list[str]]): List of workspace names where users with this domain auto-join + on login + last_used_auth_method (Union[Unset, str]): The authentication method last used by a user with this domain + (google, saml, email) + last_used_auth_method_at (Union[Unset, str]): Timestamp of when the last authentication method was used + last_verified_at (Union[Unset, str]): Last verification attempt timestamp + status (Union[Unset, SSODomainSpecStatus]): Current verification status of the domain (pending, verified, + failed) Example: verified. + txt_record_name (Union[Unset, str]): DNS TXT record name that must be created for verification + txt_record_value (Union[Unset, str]): DNS TXT record value that must be set for verification + verification_error (Union[Unset, str]): Error message if verification failed + """ + + allowed_auth_methods: Union[Unset, list[str]] = UNSET + auto_join_workspaces: Union[Unset, list[str]] = UNSET + last_used_auth_method: Union[Unset, str] = UNSET + last_used_auth_method_at: Union[Unset, str] = UNSET + last_verified_at: Union[Unset, str] = UNSET + status: Union[Unset, SSODomainSpecStatus] = UNSET + txt_record_name: Union[Unset, str] = UNSET + txt_record_value: Union[Unset, str] = UNSET + verification_error: Union[Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + allowed_auth_methods: Union[Unset, list[str]] = UNSET + if not isinstance(self.allowed_auth_methods, Unset): + allowed_auth_methods = self.allowed_auth_methods + + auto_join_workspaces: Union[Unset, list[str]] = UNSET + if not isinstance(self.auto_join_workspaces, Unset): + auto_join_workspaces = self.auto_join_workspaces + + last_used_auth_method = self.last_used_auth_method + + last_used_auth_method_at = self.last_used_auth_method_at + + last_verified_at = self.last_verified_at + + status: Union[Unset, str] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + txt_record_name = self.txt_record_name + + txt_record_value = self.txt_record_value + + verification_error = self.verification_error + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if allowed_auth_methods is not UNSET: + field_dict["allowedAuthMethods"] = allowed_auth_methods + if auto_join_workspaces is not UNSET: + field_dict["autoJoinWorkspaces"] = auto_join_workspaces + if last_used_auth_method is not UNSET: + field_dict["lastUsedAuthMethod"] = last_used_auth_method + if last_used_auth_method_at is not UNSET: + field_dict["lastUsedAuthMethodAt"] = last_used_auth_method_at + if last_verified_at is not UNSET: + field_dict["lastVerifiedAt"] = last_verified_at + if status is not UNSET: + field_dict["status"] = status + if txt_record_name is not UNSET: + field_dict["txtRecordName"] = txt_record_name + if txt_record_value is not UNSET: + field_dict["txtRecordValue"] = txt_record_value + if verification_error is not UNSET: + field_dict["verificationError"] = verification_error + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: + if not src_dict: + return None + d = src_dict.copy() + allowed_auth_methods = cast( + list[str], d.pop("allowedAuthMethods", d.pop("allowed_auth_methods", UNSET)) + ) + + auto_join_workspaces = cast( + list[str], d.pop("autoJoinWorkspaces", d.pop("auto_join_workspaces", UNSET)) + ) + + last_used_auth_method = d.pop("lastUsedAuthMethod", d.pop("last_used_auth_method", UNSET)) + + last_used_auth_method_at = d.pop( + "lastUsedAuthMethodAt", d.pop("last_used_auth_method_at", UNSET) + ) + + last_verified_at = d.pop("lastVerifiedAt", d.pop("last_verified_at", UNSET)) + + _status = d.pop("status", UNSET) + status: Union[Unset, SSODomainSpecStatus] + if isinstance(_status, Unset): + status = UNSET + else: + status = SSODomainSpecStatus(_status) + + txt_record_name = d.pop("txtRecordName", d.pop("txt_record_name", UNSET)) + + txt_record_value = d.pop("txtRecordValue", d.pop("txt_record_value", UNSET)) + + verification_error = d.pop("verificationError", d.pop("verification_error", UNSET)) + + sso_domain_spec = cls( + allowed_auth_methods=allowed_auth_methods, + auto_join_workspaces=auto_join_workspaces, + last_used_auth_method=last_used_auth_method, + last_used_auth_method_at=last_used_auth_method_at, + last_verified_at=last_verified_at, + status=status, + txt_record_name=txt_record_name, + txt_record_value=txt_record_value, + verification_error=verification_error, + ) + + sso_domain_spec.additional_properties = d + return sso_domain_spec + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/blaxel/core/client/models/sso_domain_spec_status.py b/src/blaxel/core/client/models/sso_domain_spec_status.py new file mode 100644 index 00000000..915b31b2 --- /dev/null +++ b/src/blaxel/core/client/models/sso_domain_spec_status.py @@ -0,0 +1,19 @@ +from enum import Enum + + +class SSODomainSpecStatus(str, Enum): + FAILED = "failed" + PENDING = "pending" + VERIFIED = "verified" + + def __str__(self) -> str: + return str(self.value) + + @classmethod + def _missing_(cls, value: object) -> "SSODomainSpecStatus | None": + if isinstance(value, str): + upper_value = value.upper() + for member in cls: + if member.value.upper() == upper_value: + return member + return None diff --git a/src/blaxel/core/client/models/template.py b/src/blaxel/core/client/models/template.py index 363ed0f8..56ee013b 100644 --- a/src/blaxel/core/client/models/template.py +++ b/src/blaxel/core/client/models/template.py @@ -47,6 +47,7 @@ class Template: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + default_branch = self.default_branch description = self.description diff --git a/src/blaxel/core/client/models/test_feature_flag_response_200.py b/src/blaxel/core/client/models/test_feature_flag_response_200.py index 68967aa9..ab81dc75 100644 --- a/src/blaxel/core/client/models/test_feature_flag_response_200.py +++ b/src/blaxel/core/client/models/test_feature_flag_response_200.py @@ -33,6 +33,7 @@ class TestFeatureFlagResponse200: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + enabled = self.enabled evaluated_at: Union[Unset, str] = UNSET diff --git a/src/blaxel/core/client/models/trigger.py b/src/blaxel/core/client/models/trigger.py index 9de86906..8ddd3013 100644 --- a/src/blaxel/core/client/models/trigger.py +++ b/src/blaxel/core/client/models/trigger.py @@ -31,6 +31,7 @@ class Trigger: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + configuration: Union[Unset, dict[str, Any]] = UNSET if ( self.configuration diff --git a/src/blaxel/core/client/models/trigger_configuration.py b/src/blaxel/core/client/models/trigger_configuration.py index cf320103..798d50bc 100644 --- a/src/blaxel/core/client/models/trigger_configuration.py +++ b/src/blaxel/core/client/models/trigger_configuration.py @@ -39,6 +39,7 @@ class TriggerConfiguration: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + authentication_type = self.authentication_type callback_secret = self.callback_secret diff --git a/src/blaxel/core/client/models/volume.py b/src/blaxel/core/client/models/volume.py index 61556357..9640491a 100644 --- a/src/blaxel/core/client/models/volume.py +++ b/src/blaxel/core/client/models/volume.py @@ -40,6 +40,7 @@ class Volume: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/volume_template.py b/src/blaxel/core/client/models/volume_template.py index ac1143c6..d43a9145 100644 --- a/src/blaxel/core/client/models/volume_template.py +++ b/src/blaxel/core/client/models/volume_template.py @@ -34,6 +34,7 @@ class VolumeTemplate: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/vpc.py b/src/blaxel/core/client/models/vpc.py index 1d1b279f..005a9f2e 100644 --- a/src/blaxel/core/client/models/vpc.py +++ b/src/blaxel/core/client/models/vpc.py @@ -34,6 +34,7 @@ class VPC: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/workspace.py b/src/blaxel/core/client/models/workspace.py index cbb6b3a5..9a62f326 100644 --- a/src/blaxel/core/client/models/workspace.py +++ b/src/blaxel/core/client/models/workspace.py @@ -7,6 +7,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.group_workspace_mapping import GroupWorkspaceMapping from ..models.metadata_labels import MetadataLabels from ..models.workspace_runtime import WorkspaceRuntime @@ -26,6 +27,8 @@ class Workspace: updated_by (Union[Unset, str]): The user or service account who updated the resource account_id (Union[Unset, str]): Workspace account id display_name (Union[Unset, str]): Workspace display name Example: My Workspace. + group_mappings (Union[Unset, list['GroupWorkspaceMapping']]): Group-to-role mappings for directory sync (SCIM) + group membership id (Union[Unset, str]): Autogenerated unique workspace id labels (Union[Unset, MetadataLabels]): Key-value pairs for organizing and filtering resources. Labels can be used to categorize resources by environment, project, team, or any custom taxonomy. @@ -43,6 +46,7 @@ class Workspace: updated_by: Union[Unset, str] = UNSET account_id: Union[Unset, str] = UNSET display_name: Union[Unset, str] = UNSET + group_mappings: Union[Unset, list["GroupWorkspaceMapping"]] = UNSET id: Union[Unset, str] = UNSET labels: Union[Unset, "MetadataLabels"] = UNSET name: Union[Unset, str] = UNSET @@ -53,6 +57,7 @@ class Workspace: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + created_at = self.created_at updated_at = self.updated_at @@ -65,6 +70,16 @@ def to_dict(self) -> dict[str, Any]: display_name = self.display_name + group_mappings: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.group_mappings, Unset): + group_mappings = [] + for group_mappings_item_data in self.group_mappings: + if type(group_mappings_item_data) is dict: + group_mappings_item = group_mappings_item_data + else: + group_mappings_item = group_mappings_item_data.to_dict() + group_mappings.append(group_mappings_item) + id = self.id labels: Union[Unset, dict[str, Any]] = UNSET @@ -108,6 +123,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["accountId"] = account_id if display_name is not UNSET: field_dict["displayName"] = display_name + if group_mappings is not UNSET: + field_dict["groupMappings"] = group_mappings if id is not UNSET: field_dict["id"] = id if labels is not UNSET: @@ -127,6 +144,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: + from ..models.group_workspace_mapping import GroupWorkspaceMapping from ..models.metadata_labels import MetadataLabels from ..models.workspace_runtime import WorkspaceRuntime @@ -145,6 +163,13 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: display_name = d.pop("displayName", d.pop("display_name", UNSET)) + group_mappings = [] + _group_mappings = d.pop("groupMappings", d.pop("group_mappings", UNSET)) + for group_mappings_item_data in _group_mappings or []: + group_mappings_item = GroupWorkspaceMapping.from_dict(group_mappings_item_data) + + group_mappings.append(group_mappings_item) + id = d.pop("id", UNSET) _labels = d.pop("labels", UNSET) @@ -181,6 +206,7 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: updated_by=updated_by, account_id=account_id, display_name=display_name, + group_mappings=group_mappings, id=id, labels=labels, name=name, diff --git a/src/blaxel/core/client/models/workspace_user.py b/src/blaxel/core/client/models/workspace_user.py index 5c7e994b..f2433acc 100644 --- a/src/blaxel/core/client/models/workspace_user.py +++ b/src/blaxel/core/client/models/workspace_user.py @@ -3,6 +3,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..models.workspace_user_source import WorkspaceUserSource from ..types import UNSET, Unset T = TypeVar("T", bound="WorkspaceUser") @@ -16,18 +17,22 @@ class WorkspaceUser: accepted (Union[Unset, bool]): Whether the user has accepted the workspace invitation email (Union[Unset, str]): Workspace user email email_verified (Union[Unset, bool]): Whether the user's email has been verified + expired (Union[Unset, bool]): Whether the invitation has expired family_name (Union[Unset, str]): Workspace user family name given_name (Union[Unset, str]): Workspace user given name role (Union[Unset, str]): Workspace user role + source (Union[Unset, WorkspaceUserSource]): Source of the user provisioning sub (Union[Unset, str]): Workspace user identifier """ accepted: Union[Unset, bool] = UNSET email: Union[Unset, str] = UNSET email_verified: Union[Unset, bool] = UNSET + expired: Union[Unset, bool] = UNSET family_name: Union[Unset, str] = UNSET given_name: Union[Unset, str] = UNSET role: Union[Unset, str] = UNSET + source: Union[Unset, WorkspaceUserSource] = UNSET sub: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -38,12 +43,18 @@ def to_dict(self) -> dict[str, Any]: email_verified = self.email_verified + expired = self.expired + family_name = self.family_name given_name = self.given_name role = self.role + source: Union[Unset, str] = UNSET + if not isinstance(self.source, Unset): + source = self.source.value + sub = self.sub field_dict: dict[str, Any] = {} @@ -55,12 +66,16 @@ def to_dict(self) -> dict[str, Any]: field_dict["email"] = email if email_verified is not UNSET: field_dict["email_verified"] = email_verified + if expired is not UNSET: + field_dict["expired"] = expired if family_name is not UNSET: field_dict["family_name"] = family_name if given_name is not UNSET: field_dict["given_name"] = given_name if role is not UNSET: field_dict["role"] = role + if source is not UNSET: + field_dict["source"] = source if sub is not UNSET: field_dict["sub"] = sub @@ -77,21 +92,32 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: email_verified = d.pop("email_verified", UNSET) + expired = d.pop("expired", UNSET) + family_name = d.pop("family_name", UNSET) given_name = d.pop("given_name", UNSET) role = d.pop("role", UNSET) + _source = d.pop("source", UNSET) + source: Union[Unset, WorkspaceUserSource] + if isinstance(_source, Unset): + source = UNSET + else: + source = WorkspaceUserSource(_source) + sub = d.pop("sub", UNSET) workspace_user = cls( accepted=accepted, email=email, email_verified=email_verified, + expired=expired, family_name=family_name, given_name=given_name, role=role, + source=source, sub=sub, ) diff --git a/src/blaxel/core/client/models/workspace_user_source.py b/src/blaxel/core/client/models/workspace_user_source.py new file mode 100644 index 00000000..e8118ac8 --- /dev/null +++ b/src/blaxel/core/client/models/workspace_user_source.py @@ -0,0 +1,19 @@ +from enum import Enum + + +class WorkspaceUserSource(str, Enum): + DIRECTORY_SYNC = "directory_sync" + DOMAIN_CAPTURE = "domain_capture" + INVITATION = "invitation" + + def __str__(self) -> str: + return str(self.value) + + @classmethod + def _missing_(cls, value: object) -> "WorkspaceUserSource | None": + if isinstance(value, str): + upper_value = value.upper() + for member in cls: + if member.value.upper() == upper_value: + return member + return None diff --git a/src/blaxel/core/sandbox/default/sandbox.py b/src/blaxel/core/sandbox/default/sandbox.py index 69c68ab0..21b5402a 100644 --- a/src/blaxel/core/sandbox/default/sandbox.py +++ b/src/blaxel/core/sandbox/default/sandbox.py @@ -1,3 +1,4 @@ +import asyncio import logging import uuid import warnings @@ -138,6 +139,7 @@ async def create( cls, sandbox: Union[Sandbox, SandboxCreateConfiguration, Dict[str, Any], None] = None, safe: bool = False, + create_if_not_exist: bool = False, ) -> "SandboxInstance": default_name = f"sandbox-{uuid.uuid4().hex[:8]}" default_image = "blaxel/base-image:latest" @@ -263,6 +265,7 @@ async def create( response = await create_sandbox( client=client, body=sandbox, + create_if_not_exist=create_if_not_exist, ) # Check if response is an error @@ -430,7 +433,7 @@ async def create_if_not_exists( ) -> "SandboxInstance": """Create a sandbox if it doesn't exist, otherwise return existing.""" try: - return await cls.create(sandbox) + return await cls.create(sandbox, create_if_not_exist=True) except SandboxAPIError as e: # Check if it's a 409 conflict error (sandbox already exists) if e.status_code == 409 or e.code in [409, "SANDBOX_ALREADY_EXISTS"]: @@ -452,13 +455,16 @@ async def create_if_not_exists( if not name: raise ValueError("Sandbox name is required") + # Brief delay to handle parallel-creation race condition + await asyncio.sleep(2) + # Get the existing sandbox to check its status sandbox_instance = await cls.get(name) # If the sandbox is TERMINATED, treat it as not existing if sandbox_instance.status == "TERMINATED": # Create a new sandbox - backend will handle cleanup of the terminated one - return await cls.create(sandbox) + return await cls.create(sandbox, create_if_not_exist=True) # Otherwise return the existing active sandbox return sandbox_instance diff --git a/src/blaxel/core/sandbox/sync/sandbox.py b/src/blaxel/core/sandbox/sync/sandbox.py index e8cd9a15..a6c3f77c 100644 --- a/src/blaxel/core/sandbox/sync/sandbox.py +++ b/src/blaxel/core/sandbox/sync/sandbox.py @@ -1,4 +1,5 @@ import logging +import time import uuid import warnings from typing import Any, Callable, Dict, List, Union @@ -123,6 +124,7 @@ def create( cls, sandbox: Union[Sandbox, SandboxCreateConfiguration, Dict[str, Any], None] = None, safe: bool = False, + create_if_not_exist: bool = False, ) -> "SyncSandboxInstance": default_name = f"sandbox-{uuid.uuid4().hex[:8]}" default_image = "blaxel/base-image:latest" @@ -231,6 +233,7 @@ def create( response = create_sandbox( client=client, body=sandbox, + create_if_not_exist=create_if_not_exist, ) # Check if response is an error @@ -370,7 +373,7 @@ def create_if_not_exists( cls, sandbox: Union[Sandbox, SandboxCreateConfiguration, Dict[str, Any]] ) -> "SyncSandboxInstance": try: - return cls.create(sandbox) + return cls.create(sandbox, create_if_not_exist=True) except SandboxAPIError as e: if e.status_code == 409 or e.code in [409, "SANDBOX_ALREADY_EXISTS"]: if isinstance(sandbox, SandboxCreateConfiguration): @@ -388,9 +391,11 @@ def create_if_not_exists( name = None if not name: raise ValueError("Sandbox name is required") + # Brief delay to handle parallel-creation race condition + time.sleep(2) sandbox_instance = cls.get(name) if sandbox_instance.status == "TERMINATED": - return cls.create(sandbox) + return cls.create(sandbox, create_if_not_exist=True) return sandbox_instance raise From 07968b858a1093c17e3776e76ea5d5bbabf81f0e Mon Sep 17 00:00:00 2001 From: cdrappier Date: Sat, 21 Mar 2026 21:04:11 +0000 Subject: [PATCH 2/5] revert: restore client types to main branch versions The controlplane branch OpenAPI spec introduced unrelated model changes (sso_domain, group_workspace_mapping, etc) that should not be in this PR. The create_if_not_exist query param already exists in the main branch client, so no client regeneration is needed. ENG-2188 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../core/client/api/drives/create_drive.py | 28 +++++++------ .../api/drives/create_drive_access_token.py | 8 ++-- .../core/client/api/drives/get_drive_jwks.py | 8 ++-- .../core/client/api/drives/update_drive.py | 12 ++++-- .../api/feature_flags/test_feature_flag.py | 23 +---------- src/blaxel/core/client/models/__init__.py | 14 ------- src/blaxel/core/client/models/agent.py | 1 - .../core/client/models/agent_runtime.py | 1 - src/blaxel/core/client/models/agent_spec.py | 41 ------------------- .../core/client/models/configuration.py | 1 - .../models/create_job_execution_output.py | 1 - .../models/create_job_execution_request.py | 1 - .../core/client/models/custom_domain.py | 1 - .../client/models/custom_domain_metadata.py | 1 - .../core/client/models/custom_domain_spec.py | 1 - ...te_volume_template_version_response_200.py | 1 - src/blaxel/core/client/models/drive.py | 5 +-- .../core/client/models/egress_gateway.py | 1 - src/blaxel/core/client/models/egress_ip.py | 1 - src/blaxel/core/client/models/entrypoint.py | 1 - src/blaxel/core/client/models/form.py | 1 - src/blaxel/core/client/models/function.py | 1 - .../core/client/models/function_runtime.py | 1 - .../core/client/models/function_spec.py | 11 ----- .../models/get_drive_jwks_response_200.py | 1 - .../get_workspace_features_response_200.py | 1 - src/blaxel/core/client/models/image.py | 1 - src/blaxel/core/client/models/image_spec.py | 1 - src/blaxel/core/client/models/integration.py | 1 - .../client/models/integration_connection.py | 1 - .../models/integration_connection_spec.py | 1 - .../client/models/integration_endpoint.py | 1 - .../client/models/integration_endpoints.py | 2 - src/blaxel/core/client/models/job.py | 1 - .../core/client/models/job_execution.py | 1 - .../core/client/models/job_execution_spec.py | 1 - .../core/client/models/job_execution_task.py | 1 - src/blaxel/core/client/models/job_runtime.py | 1 - src/blaxel/core/client/models/job_spec.py | 1 - .../core/client/models/location_response.py | 1 - .../core/client/models/mcp_definition.py | 1 - src/blaxel/core/client/models/metadata.py | 1 - src/blaxel/core/client/models/model.py | 1 - src/blaxel/core/client/models/model_spec.py | 1 - src/blaxel/core/client/models/o_auth.py | 1 - .../core/client/models/pending_invitation.py | 9 ---- .../models/pending_invitation_accept.py | 1 - .../models/pending_invitation_render.py | 10 ----- .../pending_invitation_workspace_details.py | 1 - src/blaxel/core/client/models/policy.py | 1 - src/blaxel/core/client/models/policy_spec.py | 1 - src/blaxel/core/client/models/preview.py | 1 - src/blaxel/core/client/models/preview_spec.py | 1 - .../core/client/models/preview_token.py | 1 - src/blaxel/core/client/models/public_ips.py | 1 - src/blaxel/core/client/models/region.py | 1 - src/blaxel/core/client/models/sandbox.py | 1 - .../core/client/models/sandbox_definition.py | 1 - .../core/client/models/sandbox_error.py | 1 - .../core/client/models/sandbox_lifecycle.py | 11 ----- .../core/client/models/sandbox_network.py | 10 ++--- .../core/client/models/sandbox_runtime.py | 1 - src/blaxel/core/client/models/sandbox_spec.py | 3 +- src/blaxel/core/client/models/template.py | 1 - .../models/test_feature_flag_response_200.py | 1 - src/blaxel/core/client/models/trigger.py | 1 - .../client/models/trigger_configuration.py | 1 - src/blaxel/core/client/models/volume.py | 1 - .../core/client/models/volume_template.py | 1 - src/blaxel/core/client/models/vpc.py | 1 - src/blaxel/core/client/models/workspace.py | 26 ------------ .../core/client/models/workspace_user.py | 26 ------------ 72 files changed, 41 insertions(+), 261 deletions(-) diff --git a/src/blaxel/core/client/api/drives/create_drive.py b/src/blaxel/core/client/api/drives/create_drive.py index 0ebe3962..99df885d 100644 --- a/src/blaxel/core/client/api/drives/create_drive.py +++ b/src/blaxel/core/client/api/drives/create_drive.py @@ -62,12 +62,13 @@ def sync_detailed( ) -> Response[Union[Any, Drive]]: """Create a drive - Creates a new drive in the workspace. Drives can be buckets and can be mounted at runtime to - sandboxes. + Creates a new drive in the workspace. Drives are backed by SeaweedFS buckets and can be mounted at + runtime to sandboxes. Args: body (Drive): Drive providing persistent storage that can be attached to agents, - functions, and sandboxes. Drives can be mounted at runtime via the sbx API. + functions, and sandboxes. Drives are backed by SeaweedFS buckets and can be mounted at + runtime via the sbx API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -95,12 +96,13 @@ def sync( ) -> Union[Any, Drive] | None: """Create a drive - Creates a new drive in the workspace. Drives can be buckets and can be mounted at runtime to - sandboxes. + Creates a new drive in the workspace. Drives are backed by SeaweedFS buckets and can be mounted at + runtime to sandboxes. Args: body (Drive): Drive providing persistent storage that can be attached to agents, - functions, and sandboxes. Drives can be mounted at runtime via the sbx API. + functions, and sandboxes. Drives are backed by SeaweedFS buckets and can be mounted at + runtime via the sbx API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -123,12 +125,13 @@ async def asyncio_detailed( ) -> Response[Union[Any, Drive]]: """Create a drive - Creates a new drive in the workspace. Drives can be buckets and can be mounted at runtime to - sandboxes. + Creates a new drive in the workspace. Drives are backed by SeaweedFS buckets and can be mounted at + runtime to sandboxes. Args: body (Drive): Drive providing persistent storage that can be attached to agents, - functions, and sandboxes. Drives can be mounted at runtime via the sbx API. + functions, and sandboxes. Drives are backed by SeaweedFS buckets and can be mounted at + runtime via the sbx API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -154,12 +157,13 @@ async def asyncio( ) -> Union[Any, Drive] | None: """Create a drive - Creates a new drive in the workspace. Drives can be buckets and can be mounted at runtime to - sandboxes. + Creates a new drive in the workspace. Drives are backed by SeaweedFS buckets and can be mounted at + runtime to sandboxes. Args: body (Drive): Drive providing persistent storage that can be attached to agents, - functions, and sandboxes. Drives can be mounted at runtime via the sbx API. + functions, and sandboxes. Drives are backed by SeaweedFS buckets and can be mounted at + runtime via the sbx API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/blaxel/core/client/api/drives/create_drive_access_token.py b/src/blaxel/core/client/api/drives/create_drive_access_token.py index 0c428dc2..7498aa82 100644 --- a/src/blaxel/core/client/api/drives/create_drive_access_token.py +++ b/src/blaxel/core/client/api/drives/create_drive_access_token.py @@ -61,7 +61,7 @@ def sync_detailed( """Create drive access token Issues a short-lived JWT access token scoped to a specific drive. The token can be used as Bearer - authentication for direct S3 operations against the drive's bucket. + authentication for direct S3 operations against the drive's SeaweedFS bucket. Args: drive_name (str): @@ -93,7 +93,7 @@ def sync( """Create drive access token Issues a short-lived JWT access token scoped to a specific drive. The token can be used as Bearer - authentication for direct S3 operations against the drive's bucket. + authentication for direct S3 operations against the drive's SeaweedFS bucket. Args: drive_name (str): @@ -120,7 +120,7 @@ async def asyncio_detailed( """Create drive access token Issues a short-lived JWT access token scoped to a specific drive. The token can be used as Bearer - authentication for direct S3 operations against the drive's bucket. + authentication for direct S3 operations against the drive's SeaweedFS bucket. Args: drive_name (str): @@ -150,7 +150,7 @@ async def asyncio( """Create drive access token Issues a short-lived JWT access token scoped to a specific drive. The token can be used as Bearer - authentication for direct S3 operations against the drive's bucket. + authentication for direct S3 operations against the drive's SeaweedFS bucket. Args: drive_name (str): diff --git a/src/blaxel/core/client/api/drives/get_drive_jwks.py b/src/blaxel/core/client/api/drives/get_drive_jwks.py index acfa3f1e..6cbda76d 100644 --- a/src/blaxel/core/client/api/drives/get_drive_jwks.py +++ b/src/blaxel/core/client/api/drives/get_drive_jwks.py @@ -47,7 +47,7 @@ def sync_detailed( """Get drive token JWKS Returns the JSON Web Key Set containing the Ed25519 public key used to verify drive access tokens. - Other S3-compatible storage can use this endpoint to validate Bearer tokens. + SeaweedFS or other S3-compatible storage can use this endpoint to validate Bearer tokens. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -73,7 +73,7 @@ def sync( """Get drive token JWKS Returns the JSON Web Key Set containing the Ed25519 public key used to verify drive access tokens. - Other S3-compatible storage can use this endpoint to validate Bearer tokens. + SeaweedFS or other S3-compatible storage can use this endpoint to validate Bearer tokens. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -95,7 +95,7 @@ async def asyncio_detailed( """Get drive token JWKS Returns the JSON Web Key Set containing the Ed25519 public key used to verify drive access tokens. - Other S3-compatible storage can use this endpoint to validate Bearer tokens. + SeaweedFS or other S3-compatible storage can use this endpoint to validate Bearer tokens. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -119,7 +119,7 @@ async def asyncio( """Get drive token JWKS Returns the JSON Web Key Set containing the Ed25519 public key used to verify drive access tokens. - Other S3-compatible storage can use this endpoint to validate Bearer tokens. + SeaweedFS or other S3-compatible storage can use this endpoint to validate Bearer tokens. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/blaxel/core/client/api/drives/update_drive.py b/src/blaxel/core/client/api/drives/update_drive.py index fdf7e80d..6a67cfd9 100644 --- a/src/blaxel/core/client/api/drives/update_drive.py +++ b/src/blaxel/core/client/api/drives/update_drive.py @@ -73,7 +73,8 @@ def sync_detailed( Args: drive_name (str): body (Drive): Drive providing persistent storage that can be attached to agents, - functions, and sandboxes. Drives can be mounted at runtime via the sbx API. + functions, and sandboxes. Drives are backed by SeaweedFS buckets and can be mounted at + runtime via the sbx API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -109,7 +110,8 @@ def sync( Args: drive_name (str): body (Drive): Drive providing persistent storage that can be attached to agents, - functions, and sandboxes. Drives can be mounted at runtime via the sbx API. + functions, and sandboxes. Drives are backed by SeaweedFS buckets and can be mounted at + runtime via the sbx API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -140,7 +142,8 @@ async def asyncio_detailed( Args: drive_name (str): body (Drive): Drive providing persistent storage that can be attached to agents, - functions, and sandboxes. Drives can be mounted at runtime via the sbx API. + functions, and sandboxes. Drives are backed by SeaweedFS buckets and can be mounted at + runtime via the sbx API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -174,7 +177,8 @@ async def asyncio( Args: drive_name (str): body (Drive): Drive providing persistent storage that can be attached to agents, - functions, and sandboxes. Drives can be mounted at runtime via the sbx API. + functions, and sandboxes. Drives are backed by SeaweedFS buckets and can be mounted at + runtime via the sbx API. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/blaxel/core/client/api/feature_flags/test_feature_flag.py b/src/blaxel/core/client/api/feature_flags/test_feature_flag.py index 81ebcef6..24d31fbf 100644 --- a/src/blaxel/core/client/api/feature_flags/test_feature_flag.py +++ b/src/blaxel/core/client/api/feature_flags/test_feature_flag.py @@ -7,24 +7,15 @@ from ...client import Client from ...models.error import Error from ...models.test_feature_flag_response_200 import TestFeatureFlagResponse200 -from ...types import UNSET, Response, Unset +from ...types import Response def _get_kwargs( feature_key: str, - *, - account: Union[Unset, str] = UNSET, ) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["account"] = account - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - _kwargs: dict[str, Any] = { "method": "get", "url": f"/features/{feature_key}", - "params": params, } return _kwargs @@ -70,7 +61,6 @@ def sync_detailed( feature_key: str, *, client: Client, - account: Union[Unset, str] = UNSET, ) -> Response[Union[Error, TestFeatureFlagResponse200]]: """Retrieve feature flag evaluation for workspace @@ -79,7 +69,6 @@ def sync_detailed( Args: feature_key (str): - account (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -91,7 +80,6 @@ def sync_detailed( kwargs = _get_kwargs( feature_key=feature_key, - account=account, ) response = client.get_httpx_client().request( @@ -105,7 +93,6 @@ def sync( feature_key: str, *, client: Client, - account: Union[Unset, str] = UNSET, ) -> Union[Error, TestFeatureFlagResponse200] | None: """Retrieve feature flag evaluation for workspace @@ -114,7 +101,6 @@ def sync( Args: feature_key (str): - account (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -127,7 +113,6 @@ def sync( return sync_detailed( feature_key=feature_key, client=client, - account=account, ).parsed @@ -135,7 +120,6 @@ async def asyncio_detailed( feature_key: str, *, client: Client, - account: Union[Unset, str] = UNSET, ) -> Response[Union[Error, TestFeatureFlagResponse200]]: """Retrieve feature flag evaluation for workspace @@ -144,7 +128,6 @@ async def asyncio_detailed( Args: feature_key (str): - account (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -156,7 +139,6 @@ async def asyncio_detailed( kwargs = _get_kwargs( feature_key=feature_key, - account=account, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -168,7 +150,6 @@ async def asyncio( feature_key: str, *, client: Client, - account: Union[Unset, str] = UNSET, ) -> Union[Error, TestFeatureFlagResponse200] | None: """Retrieve feature flag evaluation for workspace @@ -177,7 +158,6 @@ async def asyncio( Args: feature_key (str): - account (Union[Unset, str]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,6 +171,5 @@ async def asyncio( await asyncio_detailed( feature_key=feature_key, client=client, - account=account, ) ).parsed diff --git a/src/blaxel/core/client/models/__init__.py b/src/blaxel/core/client/models/__init__.py index fc16c165..a11242bf 100644 --- a/src/blaxel/core/client/models/__init__.py +++ b/src/blaxel/core/client/models/__init__.py @@ -65,8 +65,6 @@ from .get_workspace_service_accounts_response_200_item import ( GetWorkspaceServiceAccountsResponse200Item, ) -from .group_workspace_mapping import GroupWorkspaceMapping -from .group_workspace_mapping_role import GroupWorkspaceMappingRole from .image import Image from .image_metadata import ImageMetadata from .image_spec import ImageSpec @@ -158,10 +156,6 @@ from .sandbox_network import SandboxNetwork from .sandbox_runtime import SandboxRuntime from .sandbox_spec import SandboxSpec -from .sso_domain import SSODomain -from .sso_domain_metadata import SSODomainMetadata -from .sso_domain_spec import SSODomainSpec -from .sso_domain_spec_status import SSODomainSpecStatus from .status import Status from .template import Template from .template_variable import TemplateVariable @@ -191,7 +185,6 @@ from .workspace_runtime import WorkspaceRuntime from .workspace_status import WorkspaceStatus from .workspace_user import WorkspaceUser -from .workspace_user_source import WorkspaceUserSource __all__ = ( "Agent", @@ -257,8 +250,6 @@ "GetWorkspaceFeaturesResponse200", "GetWorkspaceFeaturesResponse200Features", "GetWorkspaceServiceAccountsResponse200Item", - "GroupWorkspaceMapping", - "GroupWorkspaceMappingRole", "Image", "ImageMetadata", "ImageSpec", @@ -348,10 +339,6 @@ "SandboxNetwork", "SandboxRuntime", "SandboxSpec", - "SSODomain", - "SSODomainMetadata", - "SSODomainSpec", - "SSODomainSpecStatus", "Status", "Template", "TemplateVariable", @@ -381,5 +368,4 @@ "WorkspaceRuntime", "WorkspaceStatus", "WorkspaceUser", - "WorkspaceUserSource", ) diff --git a/src/blaxel/core/client/models/agent.py b/src/blaxel/core/client/models/agent.py index b0c8e09d..b1aa662c 100644 --- a/src/blaxel/core/client/models/agent.py +++ b/src/blaxel/core/client/models/agent.py @@ -36,7 +36,6 @@ class Agent: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/agent_runtime.py b/src/blaxel/core/client/models/agent_runtime.py index 4cb72a90..e4666217 100644 --- a/src/blaxel/core/client/models/agent_runtime.py +++ b/src/blaxel/core/client/models/agent_runtime.py @@ -41,7 +41,6 @@ class AgentRuntime: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - envs: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.envs, Unset): envs = [] diff --git a/src/blaxel/core/client/models/agent_spec.py b/src/blaxel/core/client/models/agent_spec.py index 1fc8f3c0..9dcd9bed 100644 --- a/src/blaxel/core/client/models/agent_spec.py +++ b/src/blaxel/core/client/models/agent_spec.py @@ -10,7 +10,6 @@ from ..models.repository import Repository from ..models.revision_configuration import RevisionConfiguration from ..models.trigger import Trigger - from ..models.volume_attachment import VolumeAttachment T = TypeVar("T", bound="AgentSpec") @@ -26,29 +25,23 @@ class AgentSpec: policies (Union[Unset, list[str]]): public (Union[Unset, bool]): When true, the agent is publicly accessible without authentication. Only available for mk3 generation. Default: False. - region (Union[Unset, str]): Region where the agent should be deployed (e.g. us-pdx-1, eu-lon-1). Required when - volumes are attached. Example: us-pdx-1. repository (Union[Unset, Repository]): Repository revision (Union[Unset, RevisionConfiguration]): Revision configuration runtime (Union[Unset, AgentRuntime]): Runtime configuration defining how the AI agent is deployed and scaled globally triggers (Union[Unset, list['Trigger']]): Triggers to use your agent - volumes (Union[Unset, list['VolumeAttachment']]): """ enabled: Union[Unset, bool] = True policies: Union[Unset, list[str]] = UNSET public: Union[Unset, bool] = False - region: Union[Unset, str] = UNSET repository: Union[Unset, "Repository"] = UNSET revision: Union[Unset, "RevisionConfiguration"] = UNSET runtime: Union[Unset, "AgentRuntime"] = UNSET triggers: Union[Unset, list["Trigger"]] = UNSET - volumes: Union[Unset, list["VolumeAttachment"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - enabled = self.enabled policies: Union[Unset, list[str]] = UNSET @@ -57,8 +50,6 @@ def to_dict(self) -> dict[str, Any]: public = self.public - region = self.region - repository: Union[Unset, dict[str, Any]] = UNSET if ( self.repository @@ -99,20 +90,6 @@ def to_dict(self) -> dict[str, Any]: componentsschemas_triggers_item = componentsschemas_triggers_item_data.to_dict() triggers.append(componentsschemas_triggers_item) - volumes: Union[Unset, list[dict[str, Any]]] = UNSET - if not isinstance(self.volumes, Unset): - volumes = [] - for componentsschemas_volume_attachments_item_data in self.volumes: - if type(componentsschemas_volume_attachments_item_data) is dict: - componentsschemas_volume_attachments_item = ( - componentsschemas_volume_attachments_item_data - ) - else: - componentsschemas_volume_attachments_item = ( - componentsschemas_volume_attachments_item_data.to_dict() - ) - volumes.append(componentsschemas_volume_attachments_item) - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -122,8 +99,6 @@ def to_dict(self) -> dict[str, Any]: field_dict["policies"] = policies if public is not UNSET: field_dict["public"] = public - if region is not UNSET: - field_dict["region"] = region if repository is not UNSET: field_dict["repository"] = repository if revision is not UNSET: @@ -132,8 +107,6 @@ def to_dict(self) -> dict[str, Any]: field_dict["runtime"] = runtime if triggers is not UNSET: field_dict["triggers"] = triggers - if volumes is not UNSET: - field_dict["volumes"] = volumes return field_dict @@ -143,7 +116,6 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: from ..models.repository import Repository from ..models.revision_configuration import RevisionConfiguration from ..models.trigger import Trigger - from ..models.volume_attachment import VolumeAttachment if not src_dict: return None @@ -154,8 +126,6 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: public = d.pop("public", UNSET) - region = d.pop("region", UNSET) - _repository = d.pop("repository", UNSET) repository: Union[Unset, Repository] if isinstance(_repository, Unset): @@ -186,25 +156,14 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: triggers.append(componentsschemas_triggers_item) - volumes = [] - _volumes = d.pop("volumes", UNSET) - for componentsschemas_volume_attachments_item_data in _volumes or []: - componentsschemas_volume_attachments_item = VolumeAttachment.from_dict( - componentsschemas_volume_attachments_item_data - ) - - volumes.append(componentsschemas_volume_attachments_item) - agent_spec = cls( enabled=enabled, policies=policies, public=public, - region=region, repository=repository, revision=revision, runtime=runtime, triggers=triggers, - volumes=volumes, ) agent_spec.additional_properties = d diff --git a/src/blaxel/core/client/models/configuration.py b/src/blaxel/core/client/models/configuration.py index d0eec18b..ba6aaef8 100644 --- a/src/blaxel/core/client/models/configuration.py +++ b/src/blaxel/core/client/models/configuration.py @@ -33,7 +33,6 @@ class Configuration: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - continents: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.continents, Unset): continents = [] diff --git a/src/blaxel/core/client/models/create_job_execution_output.py b/src/blaxel/core/client/models/create_job_execution_output.py index ab7e2203..7d31cab9 100644 --- a/src/blaxel/core/client/models/create_job_execution_output.py +++ b/src/blaxel/core/client/models/create_job_execution_output.py @@ -37,7 +37,6 @@ class CreateJobExecutionOutput: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - execution_id = self.execution_id id = self.id diff --git a/src/blaxel/core/client/models/create_job_execution_request.py b/src/blaxel/core/client/models/create_job_execution_request.py index 110a3a1b..7ec4f73a 100644 --- a/src/blaxel/core/client/models/create_job_execution_request.py +++ b/src/blaxel/core/client/models/create_job_execution_request.py @@ -40,7 +40,6 @@ class CreateJobExecutionRequest: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - env: Union[Unset, dict[str, Any]] = UNSET if self.env and not isinstance(self.env, Unset) and not isinstance(self.env, dict): env = self.env.to_dict() diff --git a/src/blaxel/core/client/models/custom_domain.py b/src/blaxel/core/client/models/custom_domain.py index fe1fa967..6b17e9ab 100644 --- a/src/blaxel/core/client/models/custom_domain.py +++ b/src/blaxel/core/client/models/custom_domain.py @@ -28,7 +28,6 @@ class CustomDomain: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/custom_domain_metadata.py b/src/blaxel/core/client/models/custom_domain_metadata.py index ae0506f3..1b354e48 100644 --- a/src/blaxel/core/client/models/custom_domain_metadata.py +++ b/src/blaxel/core/client/models/custom_domain_metadata.py @@ -39,7 +39,6 @@ class CustomDomainMetadata: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - created_at = self.created_at updated_at = self.updated_at diff --git a/src/blaxel/core/client/models/custom_domain_spec.py b/src/blaxel/core/client/models/custom_domain_spec.py index 03116ca3..01f4ece2 100644 --- a/src/blaxel/core/client/models/custom_domain_spec.py +++ b/src/blaxel/core/client/models/custom_domain_spec.py @@ -37,7 +37,6 @@ class CustomDomainSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - cname_records = self.cname_records last_verified_at = self.last_verified_at diff --git a/src/blaxel/core/client/models/delete_volume_template_version_response_200.py b/src/blaxel/core/client/models/delete_volume_template_version_response_200.py index 5a8cf60e..c7d99aee 100644 --- a/src/blaxel/core/client/models/delete_volume_template_version_response_200.py +++ b/src/blaxel/core/client/models/delete_volume_template_version_response_200.py @@ -25,7 +25,6 @@ class DeleteVolumeTemplateVersionResponse200: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - message = self.message template: Union[Unset, dict[str, Any]] = UNSET diff --git a/src/blaxel/core/client/models/drive.py b/src/blaxel/core/client/models/drive.py index aead16e7..7f2a6918 100644 --- a/src/blaxel/core/client/models/drive.py +++ b/src/blaxel/core/client/models/drive.py @@ -17,8 +17,8 @@ @_attrs_define class Drive: - """Drive providing persistent storage that can be attached to agents, functions, and sandboxes. Drives can be mounted - at runtime via the sbx API. + """Drive providing persistent storage that can be attached to agents, functions, and sandboxes. Drives are backed by + SeaweedFS buckets and can be mounted at runtime via the sbx API. Attributes: metadata (Metadata): Common metadata fields shared by all Blaxel resources including name, labels, timestamps, @@ -37,7 +37,6 @@ class Drive: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/egress_gateway.py b/src/blaxel/core/client/models/egress_gateway.py index 4cf8db08..cf6cfb23 100644 --- a/src/blaxel/core/client/models/egress_gateway.py +++ b/src/blaxel/core/client/models/egress_gateway.py @@ -34,7 +34,6 @@ class EgressGateway: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/egress_ip.py b/src/blaxel/core/client/models/egress_ip.py index e8542d77..92fca87c 100644 --- a/src/blaxel/core/client/models/egress_ip.py +++ b/src/blaxel/core/client/models/egress_ip.py @@ -33,7 +33,6 @@ class EgressIP: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/entrypoint.py b/src/blaxel/core/client/models/entrypoint.py index 9188c712..f56e3db8 100644 --- a/src/blaxel/core/client/models/entrypoint.py +++ b/src/blaxel/core/client/models/entrypoint.py @@ -32,7 +32,6 @@ class Entrypoint: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - args: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.args, Unset): args = [] diff --git a/src/blaxel/core/client/models/form.py b/src/blaxel/core/client/models/form.py index 6486251b..e55e8722 100644 --- a/src/blaxel/core/client/models/form.py +++ b/src/blaxel/core/client/models/form.py @@ -30,7 +30,6 @@ class Form: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - config: Union[Unset, dict[str, Any]] = UNSET if self.config and not isinstance(self.config, Unset) and not isinstance(self.config, dict): config = self.config.to_dict() diff --git a/src/blaxel/core/client/models/function.py b/src/blaxel/core/client/models/function.py index b3d16028..fd2528b4 100644 --- a/src/blaxel/core/client/models/function.py +++ b/src/blaxel/core/client/models/function.py @@ -36,7 +36,6 @@ class Function: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/function_runtime.py b/src/blaxel/core/client/models/function_runtime.py index 9e2623ab..3b9891e0 100644 --- a/src/blaxel/core/client/models/function_runtime.py +++ b/src/blaxel/core/client/models/function_runtime.py @@ -44,7 +44,6 @@ class FunctionRuntime: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - envs: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.envs, Unset): envs = [] diff --git a/src/blaxel/core/client/models/function_spec.py b/src/blaxel/core/client/models/function_spec.py index 21cc973d..30161bd5 100644 --- a/src/blaxel/core/client/models/function_spec.py +++ b/src/blaxel/core/client/models/function_spec.py @@ -25,8 +25,6 @@ class FunctionSpec: policies (Union[Unset, list[str]]): public (Union[Unset, bool]): When true, the function is publicly accessible without authentication. Only available for mk3 generation. Default: False. - region (Union[Unset, str]): Region where the function should be deployed (e.g. us-pdx-1, eu-lon-1). If not - specified, the function is deployed based on policy locations. Example: us-pdx-1. revision (Union[Unset, RevisionConfiguration]): Revision configuration runtime (Union[Unset, FunctionRuntime]): Runtime configuration defining how the MCP server function is deployed and scaled @@ -37,14 +35,12 @@ class FunctionSpec: integration_connections: Union[Unset, list[str]] = UNSET policies: Union[Unset, list[str]] = UNSET public: Union[Unset, bool] = False - region: Union[Unset, str] = UNSET revision: Union[Unset, "RevisionConfiguration"] = UNSET runtime: Union[Unset, "FunctionRuntime"] = UNSET triggers: Union[Unset, list["Trigger"]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - enabled = self.enabled integration_connections: Union[Unset, list[str]] = UNSET @@ -57,8 +53,6 @@ def to_dict(self) -> dict[str, Any]: public = self.public - region = self.region - revision: Union[Unset, dict[str, Any]] = UNSET if ( self.revision @@ -100,8 +94,6 @@ def to_dict(self) -> dict[str, Any]: field_dict["policies"] = policies if public is not UNSET: field_dict["public"] = public - if region is not UNSET: - field_dict["region"] = region if revision is not UNSET: field_dict["revision"] = revision if runtime is not UNSET: @@ -130,8 +122,6 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: public = d.pop("public", UNSET) - region = d.pop("region", UNSET) - _revision = d.pop("revision", UNSET) revision: Union[Unset, RevisionConfiguration] if isinstance(_revision, Unset): @@ -160,7 +150,6 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: integration_connections=integration_connections, policies=policies, public=public, - region=region, revision=revision, runtime=runtime, triggers=triggers, diff --git a/src/blaxel/core/client/models/get_drive_jwks_response_200.py b/src/blaxel/core/client/models/get_drive_jwks_response_200.py index 261bfe78..8e429369 100644 --- a/src/blaxel/core/client/models/get_drive_jwks_response_200.py +++ b/src/blaxel/core/client/models/get_drive_jwks_response_200.py @@ -23,7 +23,6 @@ class GetDriveJWKSResponse200: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - keys: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.keys, Unset): keys = [] diff --git a/src/blaxel/core/client/models/get_workspace_features_response_200.py b/src/blaxel/core/client/models/get_workspace_features_response_200.py index ef225b64..e2818c60 100644 --- a/src/blaxel/core/client/models/get_workspace_features_response_200.py +++ b/src/blaxel/core/client/models/get_workspace_features_response_200.py @@ -26,7 +26,6 @@ class GetWorkspaceFeaturesResponse200: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - features: Union[Unset, dict[str, Any]] = UNSET if ( self.features diff --git a/src/blaxel/core/client/models/image.py b/src/blaxel/core/client/models/image.py index 98e25bb5..2132b76c 100644 --- a/src/blaxel/core/client/models/image.py +++ b/src/blaxel/core/client/models/image.py @@ -24,7 +24,6 @@ class Image: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/image_spec.py b/src/blaxel/core/client/models/image_spec.py index 34225801..ff47facf 100644 --- a/src/blaxel/core/client/models/image_spec.py +++ b/src/blaxel/core/client/models/image_spec.py @@ -25,7 +25,6 @@ class ImageSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - size = self.size tags: Union[Unset, list[dict[str, Any]]] = UNSET diff --git a/src/blaxel/core/client/models/integration.py b/src/blaxel/core/client/models/integration.py index 57108161..b893983c 100644 --- a/src/blaxel/core/client/models/integration.py +++ b/src/blaxel/core/client/models/integration.py @@ -41,7 +41,6 @@ class Integration: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - additional_infos: Union[Unset, dict[str, Any]] = UNSET if ( self.additional_infos diff --git a/src/blaxel/core/client/models/integration_connection.py b/src/blaxel/core/client/models/integration_connection.py index 0ed7f358..ba41b5fc 100644 --- a/src/blaxel/core/client/models/integration_connection.py +++ b/src/blaxel/core/client/models/integration_connection.py @@ -28,7 +28,6 @@ class IntegrationConnection: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/integration_connection_spec.py b/src/blaxel/core/client/models/integration_connection_spec.py index 27c6d86b..2f42e019 100644 --- a/src/blaxel/core/client/models/integration_connection_spec.py +++ b/src/blaxel/core/client/models/integration_connection_spec.py @@ -34,7 +34,6 @@ class IntegrationConnectionSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - config: Union[Unset, dict[str, Any]] = UNSET if self.config and not isinstance(self.config, Unset) and not isinstance(self.config, dict): config = self.config.to_dict() diff --git a/src/blaxel/core/client/models/integration_endpoint.py b/src/blaxel/core/client/models/integration_endpoint.py index ade0dae2..d1c9fea6 100644 --- a/src/blaxel/core/client/models/integration_endpoint.py +++ b/src/blaxel/core/client/models/integration_endpoint.py @@ -38,7 +38,6 @@ class IntegrationEndpoint: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - body = self.body ignore_models: Union[Unset, list[dict[str, Any]]] = UNSET diff --git a/src/blaxel/core/client/models/integration_endpoints.py b/src/blaxel/core/client/models/integration_endpoints.py index 76c5b99a..61fb17b5 100644 --- a/src/blaxel/core/client/models/integration_endpoints.py +++ b/src/blaxel/core/client/models/integration_endpoints.py @@ -17,7 +17,6 @@ class IntegrationEndpoints: additional_properties: dict[str, "IntegrationEndpoint"] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} for prop_name, prop in self.additional_properties.items(): if type(prop) is dict: @@ -36,7 +35,6 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: d = src_dict.copy() integration_endpoints = cls() - additional_properties = {} for prop_name, prop_dict in d.items(): additional_property = IntegrationEndpoint.from_dict(prop_dict) diff --git a/src/blaxel/core/client/models/job.py b/src/blaxel/core/client/models/job.py index 50901929..04aae372 100644 --- a/src/blaxel/core/client/models/job.py +++ b/src/blaxel/core/client/models/job.py @@ -36,7 +36,6 @@ class Job: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/job_execution.py b/src/blaxel/core/client/models/job_execution.py index 4bae77c9..1710452c 100644 --- a/src/blaxel/core/client/models/job_execution.py +++ b/src/blaxel/core/client/models/job_execution.py @@ -36,7 +36,6 @@ class JobExecution: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/job_execution_spec.py b/src/blaxel/core/client/models/job_execution_spec.py index f18077f8..c0590774 100644 --- a/src/blaxel/core/client/models/job_execution_spec.py +++ b/src/blaxel/core/client/models/job_execution_spec.py @@ -35,7 +35,6 @@ class JobExecutionSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - env_override: Union[Unset, dict[str, Any]] = UNSET if ( self.env_override diff --git a/src/blaxel/core/client/models/job_execution_task.py b/src/blaxel/core/client/models/job_execution_task.py index b73e476d..f9319086 100644 --- a/src/blaxel/core/client/models/job_execution_task.py +++ b/src/blaxel/core/client/models/job_execution_task.py @@ -33,7 +33,6 @@ class JobExecutionTask: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - conditions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] diff --git a/src/blaxel/core/client/models/job_runtime.py b/src/blaxel/core/client/models/job_runtime.py index 7b4f26ac..1daf89eb 100644 --- a/src/blaxel/core/client/models/job_runtime.py +++ b/src/blaxel/core/client/models/job_runtime.py @@ -46,7 +46,6 @@ class JobRuntime: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - envs: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.envs, Unset): envs = [] diff --git a/src/blaxel/core/client/models/job_spec.py b/src/blaxel/core/client/models/job_spec.py index 35b1c6b3..be089999 100644 --- a/src/blaxel/core/client/models/job_spec.py +++ b/src/blaxel/core/client/models/job_spec.py @@ -38,7 +38,6 @@ class JobSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - enabled = self.enabled policies: Union[Unset, list[str]] = UNSET diff --git a/src/blaxel/core/client/models/location_response.py b/src/blaxel/core/client/models/location_response.py index a413cf84..1ba28924 100644 --- a/src/blaxel/core/client/models/location_response.py +++ b/src/blaxel/core/client/models/location_response.py @@ -34,7 +34,6 @@ class LocationResponse: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - continent = self.continent country = self.country diff --git a/src/blaxel/core/client/models/mcp_definition.py b/src/blaxel/core/client/models/mcp_definition.py index bd80c485..b46583e4 100644 --- a/src/blaxel/core/client/models/mcp_definition.py +++ b/src/blaxel/core/client/models/mcp_definition.py @@ -60,7 +60,6 @@ class MCPDefinition: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - created_at = self.created_at updated_at = self.updated_at diff --git a/src/blaxel/core/client/models/metadata.py b/src/blaxel/core/client/models/metadata.py index 96b34e84..1bf488a9 100644 --- a/src/blaxel/core/client/models/metadata.py +++ b/src/blaxel/core/client/models/metadata.py @@ -46,7 +46,6 @@ class Metadata: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - name = self.name created_at = self.created_at diff --git a/src/blaxel/core/client/models/model.py b/src/blaxel/core/client/models/model.py index e7689923..92b6ee53 100644 --- a/src/blaxel/core/client/models/model.py +++ b/src/blaxel/core/client/models/model.py @@ -36,7 +36,6 @@ class Model: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/model_spec.py b/src/blaxel/core/client/models/model_spec.py index c26c2b52..1e053ae1 100644 --- a/src/blaxel/core/client/models/model_spec.py +++ b/src/blaxel/core/client/models/model_spec.py @@ -37,7 +37,6 @@ class ModelSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - enabled = self.enabled flavors: Union[Unset, list[dict[str, Any]]] = UNSET diff --git a/src/blaxel/core/client/models/o_auth.py b/src/blaxel/core/client/models/o_auth.py index ad63ddf8..8965f520 100644 --- a/src/blaxel/core/client/models/o_auth.py +++ b/src/blaxel/core/client/models/o_auth.py @@ -26,7 +26,6 @@ class OAuth: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - scope: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.scope, Unset): scope = [] diff --git a/src/blaxel/core/client/models/pending_invitation.py b/src/blaxel/core/client/models/pending_invitation.py index 988d7160..a0baead8 100644 --- a/src/blaxel/core/client/models/pending_invitation.py +++ b/src/blaxel/core/client/models/pending_invitation.py @@ -18,7 +18,6 @@ class PendingInvitation: created_by (Union[Unset, str]): The user or service account who created the resource updated_by (Union[Unset, str]): The user or service account who updated the resource email (Union[Unset, str]): User email - expires_at (Union[Unset, str]): The date and time when the invitation expires invited_by (Union[Unset, str]): User sub role (Union[Unset, str]): ACL role workspace (Union[Unset, str]): Workspace name @@ -29,7 +28,6 @@ class PendingInvitation: created_by: Union[Unset, str] = UNSET updated_by: Union[Unset, str] = UNSET email: Union[Unset, str] = UNSET - expires_at: Union[Unset, str] = UNSET invited_by: Union[Unset, str] = UNSET role: Union[Unset, str] = UNSET workspace: Union[Unset, str] = UNSET @@ -46,8 +44,6 @@ def to_dict(self) -> dict[str, Any]: email = self.email - expires_at = self.expires_at - invited_by = self.invited_by role = self.role @@ -67,8 +63,6 @@ def to_dict(self) -> dict[str, Any]: field_dict["updatedBy"] = updated_by if email is not UNSET: field_dict["email"] = email - if expires_at is not UNSET: - field_dict["expiresAt"] = expires_at if invited_by is not UNSET: field_dict["invitedBy"] = invited_by if role is not UNSET: @@ -93,8 +87,6 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: email = d.pop("email", UNSET) - expires_at = d.pop("expiresAt", d.pop("expires_at", UNSET)) - invited_by = d.pop("invitedBy", d.pop("invited_by", UNSET)) role = d.pop("role", UNSET) @@ -107,7 +99,6 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: created_by=created_by, updated_by=updated_by, email=email, - expires_at=expires_at, invited_by=invited_by, role=role, workspace=workspace, diff --git a/src/blaxel/core/client/models/pending_invitation_accept.py b/src/blaxel/core/client/models/pending_invitation_accept.py index 845871ad..063b69a7 100644 --- a/src/blaxel/core/client/models/pending_invitation_accept.py +++ b/src/blaxel/core/client/models/pending_invitation_accept.py @@ -27,7 +27,6 @@ class PendingInvitationAccept: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - email = self.email workspace: Union[Unset, dict[str, Any]] = UNSET diff --git a/src/blaxel/core/client/models/pending_invitation_render.py b/src/blaxel/core/client/models/pending_invitation_render.py index 003dd74b..1bca3280 100644 --- a/src/blaxel/core/client/models/pending_invitation_render.py +++ b/src/blaxel/core/client/models/pending_invitation_render.py @@ -20,7 +20,6 @@ class PendingInvitationRender: Attributes: email (Union[Unset, str]): User email - expires_at (Union[Unset, str]): The date and time when the invitation expires invited_at (Union[Unset, str]): Invitation date invited_by (Union[Unset, PendingInvitationRenderInvitedBy]): Invited by role (Union[Unset, str]): ACL role @@ -29,7 +28,6 @@ class PendingInvitationRender: """ email: Union[Unset, str] = UNSET - expires_at: Union[Unset, str] = UNSET invited_at: Union[Unset, str] = UNSET invited_by: Union[Unset, "PendingInvitationRenderInvitedBy"] = UNSET role: Union[Unset, str] = UNSET @@ -38,11 +36,8 @@ class PendingInvitationRender: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - email = self.email - expires_at = self.expires_at - invited_at = self.invited_at invited_by: Union[Unset, dict[str, Any]] = UNSET @@ -82,8 +77,6 @@ def to_dict(self) -> dict[str, Any]: field_dict.update({}) if email is not UNSET: field_dict["email"] = email - if expires_at is not UNSET: - field_dict["expiresAt"] = expires_at if invited_at is not UNSET: field_dict["invitedAt"] = invited_at if invited_by is not UNSET: @@ -108,8 +101,6 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: d = src_dict.copy() email = d.pop("email", UNSET) - expires_at = d.pop("expiresAt", d.pop("expires_at", UNSET)) - invited_at = d.pop("invitedAt", d.pop("invited_at", UNSET)) _invited_by = d.pop("invitedBy", d.pop("invited_by", UNSET)) @@ -137,7 +128,6 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: pending_invitation_render = cls( email=email, - expires_at=expires_at, invited_at=invited_at, invited_by=invited_by, role=role, diff --git a/src/blaxel/core/client/models/pending_invitation_workspace_details.py b/src/blaxel/core/client/models/pending_invitation_workspace_details.py index 6ec1525e..be4320b9 100644 --- a/src/blaxel/core/client/models/pending_invitation_workspace_details.py +++ b/src/blaxel/core/client/models/pending_invitation_workspace_details.py @@ -28,7 +28,6 @@ class PendingInvitationWorkspaceDetails: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - emails: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.emails, Unset): emails = [] diff --git a/src/blaxel/core/client/models/policy.py b/src/blaxel/core/client/models/policy.py index 9b913727..2cf88cf9 100644 --- a/src/blaxel/core/client/models/policy.py +++ b/src/blaxel/core/client/models/policy.py @@ -26,7 +26,6 @@ class Policy: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/policy_spec.py b/src/blaxel/core/client/models/policy_spec.py index 19ad5059..e343e629 100644 --- a/src/blaxel/core/client/models/policy_spec.py +++ b/src/blaxel/core/client/models/policy_spec.py @@ -40,7 +40,6 @@ class PolicySpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - flavors: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.flavors, Unset): flavors = [] diff --git a/src/blaxel/core/client/models/preview.py b/src/blaxel/core/client/models/preview.py index 38d1601a..bba76417 100644 --- a/src/blaxel/core/client/models/preview.py +++ b/src/blaxel/core/client/models/preview.py @@ -33,7 +33,6 @@ class Preview: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/preview_spec.py b/src/blaxel/core/client/models/preview_spec.py index 2a6d50b2..2f4cbc8a 100644 --- a/src/blaxel/core/client/models/preview_spec.py +++ b/src/blaxel/core/client/models/preview_spec.py @@ -46,7 +46,6 @@ class PreviewSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - custom_domain = self.custom_domain expires = self.expires diff --git a/src/blaxel/core/client/models/preview_token.py b/src/blaxel/core/client/models/preview_token.py index 3ae85791..accc7383 100644 --- a/src/blaxel/core/client/models/preview_token.py +++ b/src/blaxel/core/client/models/preview_token.py @@ -25,7 +25,6 @@ class PreviewToken: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/public_ips.py b/src/blaxel/core/client/models/public_ips.py index 7dae820d..fa7f59a5 100644 --- a/src/blaxel/core/client/models/public_ips.py +++ b/src/blaxel/core/client/models/public_ips.py @@ -17,7 +17,6 @@ class PublicIps: additional_properties: dict[str, "PublicIp"] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} for prop_name, prop in self.additional_properties.items(): if type(prop) is dict: diff --git a/src/blaxel/core/client/models/region.py b/src/blaxel/core/client/models/region.py index 8f626a56..ebc42bbb 100644 --- a/src/blaxel/core/client/models/region.py +++ b/src/blaxel/core/client/models/region.py @@ -43,7 +43,6 @@ class Region: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - agent_drive_public_url: Union[Unset, dict[str, Any]] = UNSET if ( self.agent_drive_public_url diff --git a/src/blaxel/core/client/models/sandbox.py b/src/blaxel/core/client/models/sandbox.py index d943739a..839a4db8 100644 --- a/src/blaxel/core/client/models/sandbox.py +++ b/src/blaxel/core/client/models/sandbox.py @@ -41,7 +41,6 @@ class Sandbox: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/sandbox_definition.py b/src/blaxel/core/client/models/sandbox_definition.py index 5074b15d..4adf930d 100644 --- a/src/blaxel/core/client/models/sandbox_definition.py +++ b/src/blaxel/core/client/models/sandbox_definition.py @@ -53,7 +53,6 @@ class SandboxDefinition: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - categories: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.categories, Unset): categories = [] diff --git a/src/blaxel/core/client/models/sandbox_error.py b/src/blaxel/core/client/models/sandbox_error.py index f73196d4..aa861111 100644 --- a/src/blaxel/core/client/models/sandbox_error.py +++ b/src/blaxel/core/client/models/sandbox_error.py @@ -42,7 +42,6 @@ class SandboxError: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - code = self.code message = self.message diff --git a/src/blaxel/core/client/models/sandbox_lifecycle.py b/src/blaxel/core/client/models/sandbox_lifecycle.py index 45a4c2fd..6f3291f7 100644 --- a/src/blaxel/core/client/models/sandbox_lifecycle.py +++ b/src/blaxel/core/client/models/sandbox_lifecycle.py @@ -19,16 +19,12 @@ class SandboxLifecycle: Attributes: expiration_policies (Union[Unset, list['ExpirationPolicy']]): List of expiration policies. Multiple policies can be combined; whichever condition is met first triggers the action. - terminated_retention (Union[Unset, str]): Duration to keep the sandbox record after termination for log access - (e.g., '1h', '24h', '7d'). Defaults to 5m. Subject to maximum quota limits. Example: 24h. """ expiration_policies: Union[Unset, list["ExpirationPolicy"]] = UNSET - terminated_retention: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - expiration_policies: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.expiration_policies, Unset): expiration_policies = [] @@ -39,15 +35,11 @@ def to_dict(self) -> dict[str, Any]: expiration_policies_item = expiration_policies_item_data.to_dict() expiration_policies.append(expiration_policies_item) - terminated_retention = self.terminated_retention - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) if expiration_policies is not UNSET: field_dict["expirationPolicies"] = expiration_policies - if terminated_retention is not UNSET: - field_dict["terminatedRetention"] = terminated_retention return field_dict @@ -65,11 +57,8 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: expiration_policies.append(expiration_policies_item) - terminated_retention = d.pop("terminatedRetention", d.pop("terminated_retention", UNSET)) - sandbox_lifecycle = cls( expiration_policies=expiration_policies, - terminated_retention=terminated_retention, ) sandbox_lifecycle.additional_properties = d diff --git a/src/blaxel/core/client/models/sandbox_network.py b/src/blaxel/core/client/models/sandbox_network.py index e451ac96..321defc1 100644 --- a/src/blaxel/core/client/models/sandbox_network.py +++ b/src/blaxel/core/client/models/sandbox_network.py @@ -8,14 +8,14 @@ @_attrs_define class SandboxNetwork: - """Network configuration for a sandbox including egress IP binding. All fields (vpcName, egressGatewayName) must be - specified together to assign a dedicated IP. + """Network configuration for a sandbox including egress IP binding. All three fields (vpcName, egressGatewayName, + egressIpName) must be specified together to assign a dedicated IP. Attributes: - egress_gateway_name (str): Name of the egress gateway in the VPC. Must be specified together with vpcName. - Example: my-egress-gateway. + egress_gateway_name (str): Name of the egress gateway in the VPC. Must be specified together with vpcName and + egressIpName. Example: my-egress-gateway. vpc_name (str): Name of the VPC where the egress gateway is provisioned. Must be specified together with - egressGatewayName. Example: my-vpc. + egressGatewayName and egressIpName. Example: my-vpc. """ egress_gateway_name: str diff --git a/src/blaxel/core/client/models/sandbox_runtime.py b/src/blaxel/core/client/models/sandbox_runtime.py index 809f3a5e..40ddef02 100644 --- a/src/blaxel/core/client/models/sandbox_runtime.py +++ b/src/blaxel/core/client/models/sandbox_runtime.py @@ -40,7 +40,6 @@ class SandboxRuntime: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - envs: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.envs, Unset): envs = [] diff --git a/src/blaxel/core/client/models/sandbox_spec.py b/src/blaxel/core/client/models/sandbox_spec.py index cc288563..bd68fd47 100644 --- a/src/blaxel/core/client/models/sandbox_spec.py +++ b/src/blaxel/core/client/models/sandbox_spec.py @@ -25,7 +25,7 @@ class SandboxSpec: lifecycle (Union[Unset, SandboxLifecycle]): Lifecycle configuration controlling automatic sandbox deletion based on idle time, max age, or specific dates network (Union[Unset, SandboxNetwork]): Network configuration for a sandbox including egress IP binding. All - fields (vpcName, egressGatewayName) must be specified together to assign a dedicated IP. + three fields (vpcName, egressGatewayName, egressIpName) must be specified together to assign a dedicated IP. region (Union[Unset, str]): Region where the sandbox should be created (e.g. us-pdx-1, eu-lon-1). If not specified, defaults to the region closest to the user. Example: us-pdx-1. runtime (Union[Unset, SandboxRuntime]): Runtime configuration defining how the sandbox VM is provisioned and its @@ -42,7 +42,6 @@ class SandboxSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - enabled = self.enabled lifecycle: Union[Unset, dict[str, Any]] = UNSET diff --git a/src/blaxel/core/client/models/template.py b/src/blaxel/core/client/models/template.py index 56ee013b..363ed0f8 100644 --- a/src/blaxel/core/client/models/template.py +++ b/src/blaxel/core/client/models/template.py @@ -47,7 +47,6 @@ class Template: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - default_branch = self.default_branch description = self.description diff --git a/src/blaxel/core/client/models/test_feature_flag_response_200.py b/src/blaxel/core/client/models/test_feature_flag_response_200.py index ab81dc75..68967aa9 100644 --- a/src/blaxel/core/client/models/test_feature_flag_response_200.py +++ b/src/blaxel/core/client/models/test_feature_flag_response_200.py @@ -33,7 +33,6 @@ class TestFeatureFlagResponse200: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - enabled = self.enabled evaluated_at: Union[Unset, str] = UNSET diff --git a/src/blaxel/core/client/models/trigger.py b/src/blaxel/core/client/models/trigger.py index 8ddd3013..9de86906 100644 --- a/src/blaxel/core/client/models/trigger.py +++ b/src/blaxel/core/client/models/trigger.py @@ -31,7 +31,6 @@ class Trigger: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - configuration: Union[Unset, dict[str, Any]] = UNSET if ( self.configuration diff --git a/src/blaxel/core/client/models/trigger_configuration.py b/src/blaxel/core/client/models/trigger_configuration.py index 798d50bc..cf320103 100644 --- a/src/blaxel/core/client/models/trigger_configuration.py +++ b/src/blaxel/core/client/models/trigger_configuration.py @@ -39,7 +39,6 @@ class TriggerConfiguration: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - authentication_type = self.authentication_type callback_secret = self.callback_secret diff --git a/src/blaxel/core/client/models/volume.py b/src/blaxel/core/client/models/volume.py index 9640491a..61556357 100644 --- a/src/blaxel/core/client/models/volume.py +++ b/src/blaxel/core/client/models/volume.py @@ -40,7 +40,6 @@ class Volume: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/volume_template.py b/src/blaxel/core/client/models/volume_template.py index d43a9145..ac1143c6 100644 --- a/src/blaxel/core/client/models/volume_template.py +++ b/src/blaxel/core/client/models/volume_template.py @@ -34,7 +34,6 @@ class VolumeTemplate: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/vpc.py b/src/blaxel/core/client/models/vpc.py index 005a9f2e..1d1b279f 100644 --- a/src/blaxel/core/client/models/vpc.py +++ b/src/blaxel/core/client/models/vpc.py @@ -34,7 +34,6 @@ class VPC: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/workspace.py b/src/blaxel/core/client/models/workspace.py index 9a62f326..cbb6b3a5 100644 --- a/src/blaxel/core/client/models/workspace.py +++ b/src/blaxel/core/client/models/workspace.py @@ -7,7 +7,6 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.group_workspace_mapping import GroupWorkspaceMapping from ..models.metadata_labels import MetadataLabels from ..models.workspace_runtime import WorkspaceRuntime @@ -27,8 +26,6 @@ class Workspace: updated_by (Union[Unset, str]): The user or service account who updated the resource account_id (Union[Unset, str]): Workspace account id display_name (Union[Unset, str]): Workspace display name Example: My Workspace. - group_mappings (Union[Unset, list['GroupWorkspaceMapping']]): Group-to-role mappings for directory sync (SCIM) - group membership id (Union[Unset, str]): Autogenerated unique workspace id labels (Union[Unset, MetadataLabels]): Key-value pairs for organizing and filtering resources. Labels can be used to categorize resources by environment, project, team, or any custom taxonomy. @@ -46,7 +43,6 @@ class Workspace: updated_by: Union[Unset, str] = UNSET account_id: Union[Unset, str] = UNSET display_name: Union[Unset, str] = UNSET - group_mappings: Union[Unset, list["GroupWorkspaceMapping"]] = UNSET id: Union[Unset, str] = UNSET labels: Union[Unset, "MetadataLabels"] = UNSET name: Union[Unset, str] = UNSET @@ -57,7 +53,6 @@ class Workspace: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - created_at = self.created_at updated_at = self.updated_at @@ -70,16 +65,6 @@ def to_dict(self) -> dict[str, Any]: display_name = self.display_name - group_mappings: Union[Unset, list[dict[str, Any]]] = UNSET - if not isinstance(self.group_mappings, Unset): - group_mappings = [] - for group_mappings_item_data in self.group_mappings: - if type(group_mappings_item_data) is dict: - group_mappings_item = group_mappings_item_data - else: - group_mappings_item = group_mappings_item_data.to_dict() - group_mappings.append(group_mappings_item) - id = self.id labels: Union[Unset, dict[str, Any]] = UNSET @@ -123,8 +108,6 @@ def to_dict(self) -> dict[str, Any]: field_dict["accountId"] = account_id if display_name is not UNSET: field_dict["displayName"] = display_name - if group_mappings is not UNSET: - field_dict["groupMappings"] = group_mappings if id is not UNSET: field_dict["id"] = id if labels is not UNSET: @@ -144,7 +127,6 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: - from ..models.group_workspace_mapping import GroupWorkspaceMapping from ..models.metadata_labels import MetadataLabels from ..models.workspace_runtime import WorkspaceRuntime @@ -163,13 +145,6 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: display_name = d.pop("displayName", d.pop("display_name", UNSET)) - group_mappings = [] - _group_mappings = d.pop("groupMappings", d.pop("group_mappings", UNSET)) - for group_mappings_item_data in _group_mappings or []: - group_mappings_item = GroupWorkspaceMapping.from_dict(group_mappings_item_data) - - group_mappings.append(group_mappings_item) - id = d.pop("id", UNSET) _labels = d.pop("labels", UNSET) @@ -206,7 +181,6 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: updated_by=updated_by, account_id=account_id, display_name=display_name, - group_mappings=group_mappings, id=id, labels=labels, name=name, diff --git a/src/blaxel/core/client/models/workspace_user.py b/src/blaxel/core/client/models/workspace_user.py index f2433acc..5c7e994b 100644 --- a/src/blaxel/core/client/models/workspace_user.py +++ b/src/blaxel/core/client/models/workspace_user.py @@ -3,7 +3,6 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..models.workspace_user_source import WorkspaceUserSource from ..types import UNSET, Unset T = TypeVar("T", bound="WorkspaceUser") @@ -17,22 +16,18 @@ class WorkspaceUser: accepted (Union[Unset, bool]): Whether the user has accepted the workspace invitation email (Union[Unset, str]): Workspace user email email_verified (Union[Unset, bool]): Whether the user's email has been verified - expired (Union[Unset, bool]): Whether the invitation has expired family_name (Union[Unset, str]): Workspace user family name given_name (Union[Unset, str]): Workspace user given name role (Union[Unset, str]): Workspace user role - source (Union[Unset, WorkspaceUserSource]): Source of the user provisioning sub (Union[Unset, str]): Workspace user identifier """ accepted: Union[Unset, bool] = UNSET email: Union[Unset, str] = UNSET email_verified: Union[Unset, bool] = UNSET - expired: Union[Unset, bool] = UNSET family_name: Union[Unset, str] = UNSET given_name: Union[Unset, str] = UNSET role: Union[Unset, str] = UNSET - source: Union[Unset, WorkspaceUserSource] = UNSET sub: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -43,18 +38,12 @@ def to_dict(self) -> dict[str, Any]: email_verified = self.email_verified - expired = self.expired - family_name = self.family_name given_name = self.given_name role = self.role - source: Union[Unset, str] = UNSET - if not isinstance(self.source, Unset): - source = self.source.value - sub = self.sub field_dict: dict[str, Any] = {} @@ -66,16 +55,12 @@ def to_dict(self) -> dict[str, Any]: field_dict["email"] = email if email_verified is not UNSET: field_dict["email_verified"] = email_verified - if expired is not UNSET: - field_dict["expired"] = expired if family_name is not UNSET: field_dict["family_name"] = family_name if given_name is not UNSET: field_dict["given_name"] = given_name if role is not UNSET: field_dict["role"] = role - if source is not UNSET: - field_dict["source"] = source if sub is not UNSET: field_dict["sub"] = sub @@ -92,32 +77,21 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: email_verified = d.pop("email_verified", UNSET) - expired = d.pop("expired", UNSET) - family_name = d.pop("family_name", UNSET) given_name = d.pop("given_name", UNSET) role = d.pop("role", UNSET) - _source = d.pop("source", UNSET) - source: Union[Unset, WorkspaceUserSource] - if isinstance(_source, Unset): - source = UNSET - else: - source = WorkspaceUserSource(_source) - sub = d.pop("sub", UNSET) workspace_user = cls( accepted=accepted, email=email, email_verified=email_verified, - expired=expired, family_name=family_name, given_name=given_name, role=role, - source=source, sub=sub, ) From f216e38cbfc8b412acd026f7b64cddea301b5183 Mon Sep 17 00:00:00 2001 From: cdrappier Date: Thu, 9 Apr 2026 19:33:08 +0000 Subject: [PATCH 3/5] fix: forward create_if_not_exist flag through CodeInterpreter.create Both async CodeInterpreter.create and sync SyncCodeInterpreter.create previously only accepted safe parameter, silently dropping create_if_not_exist when called via create_if_not_exists. The server never received the query parameter, falling back to 409 + unnecessary 2s delay. ENG-2188 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- src/blaxel/core/sandbox/default/interpreter.py | 3 ++- src/blaxel/core/sandbox/sync/interpreter.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/blaxel/core/sandbox/default/interpreter.py b/src/blaxel/core/sandbox/default/interpreter.py index afd28746..f76ffd15 100644 --- a/src/blaxel/core/sandbox/default/interpreter.py +++ b/src/blaxel/core/sandbox/default/interpreter.py @@ -36,6 +36,7 @@ async def create( cls, sandbox: Sandbox | SandboxCreateConfiguration | Dict[str, Any] | None = None, safe: bool = True, + create_if_not_exist: bool = False, ) -> CodeInterpreter: """ Create a sandbox instance using the jupyter-server image. @@ -83,7 +84,7 @@ async def create( if sandbox.spec and getattr(sandbox.spec, "region", None): payload["region"] = sandbox.spec.region - base_instance = await SandboxInstance.create(payload, safe=safe) + base_instance = await SandboxInstance.create(payload, safe=safe, create_if_not_exist=create_if_not_exist) return cls( sandbox=base_instance.sandbox, force_url=base_instance.config.force_url, diff --git a/src/blaxel/core/sandbox/sync/interpreter.py b/src/blaxel/core/sandbox/sync/interpreter.py index 6080d0d6..8056eebe 100644 --- a/src/blaxel/core/sandbox/sync/interpreter.py +++ b/src/blaxel/core/sandbox/sync/interpreter.py @@ -29,6 +29,7 @@ def create( cls, sandbox: Union[Sandbox, SandboxCreateConfiguration, Dict[str, Any], None] = None, safe: bool = True, + create_if_not_exist: bool = False, ) -> "SyncCodeInterpreter": """ Create a sandbox instance using the jupyter-server image. @@ -72,7 +73,7 @@ def create( if sandbox.spec and getattr(sandbox.spec, "region", None): payload["region"] = sandbox.spec.region - base_instance = SyncSandboxInstance.create(payload, safe=safe) + base_instance = SyncSandboxInstance.create(payload, safe=safe, create_if_not_exist=create_if_not_exist) return cls( sandbox=base_instance.sandbox, force_url=base_instance.config.force_url, From 7819a0068c2ba91a8e035239dce96dc3d0096ca8 Mon Sep 17 00:00:00 2001 From: cdrappier Date: Mon, 13 Apr 2026 19:39:56 +0000 Subject: [PATCH 4/5] feat: simplify createIfNotExist - just add query param, keep existing 409 handling Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- src/blaxel/core/client/models/__init__.py | 4 ++++ src/blaxel/core/client/models/agent.py | 1 + src/blaxel/core/client/models/agent_runtime.py | 1 + src/blaxel/core/client/models/agent_spec.py | 1 + src/blaxel/core/client/models/configuration.py | 1 + .../models/create_job_execution_output.py | 1 + .../models/create_job_execution_request.py | 1 + src/blaxel/core/client/models/custom_domain.py | 1 + .../client/models/custom_domain_metadata.py | 1 + .../core/client/models/custom_domain_spec.py | 1 + ...ete_volume_template_version_response_200.py | 1 + src/blaxel/core/client/models/drive.py | 1 + src/blaxel/core/client/models/egress_config.py | 1 + .../core/client/models/egress_gateway.py | 1 + src/blaxel/core/client/models/egress_ip.py | 1 + src/blaxel/core/client/models/entrypoint.py | 1 + src/blaxel/core/client/models/form.py | 1 + src/blaxel/core/client/models/function.py | 1 + .../core/client/models/function_runtime.py | 1 + src/blaxel/core/client/models/function_spec.py | 1 + .../models/get_drive_jwks_response_200.py | 1 + .../get_workspace_features_response_200.py | 1 + src/blaxel/core/client/models/image.py | 1 + .../core/client/models/image_metadata.py | 11 +++++++++++ src/blaxel/core/client/models/image_spec.py | 1 + src/blaxel/core/client/models/integration.py | 1 + .../client/models/integration_connection.py | 1 + .../models/integration_connection_spec.py | 1 + .../core/client/models/integration_endpoint.py | 1 + .../client/models/integration_endpoints.py | 2 ++ src/blaxel/core/client/models/job.py | 1 + src/blaxel/core/client/models/job_execution.py | 1 + .../core/client/models/job_execution_spec.py | 1 + .../core/client/models/job_execution_task.py | 1 + src/blaxel/core/client/models/job_runtime.py | 1 + src/blaxel/core/client/models/job_spec.py | 1 + .../core/client/models/location_response.py | 1 + .../core/client/models/mcp_definition.py | 1 + src/blaxel/core/client/models/metadata.py | 1 + src/blaxel/core/client/models/model.py | 1 + src/blaxel/core/client/models/model_spec.py | 1 + src/blaxel/core/client/models/o_auth.py | 1 + .../client/models/pending_invitation_accept.py | 1 + .../client/models/pending_invitation_render.py | 1 + .../pending_invitation_workspace_details.py | 1 + src/blaxel/core/client/models/policy.py | 1 + src/blaxel/core/client/models/policy_spec.py | 1 + src/blaxel/core/client/models/preview.py | 1 + src/blaxel/core/client/models/preview_spec.py | 1 + src/blaxel/core/client/models/preview_token.py | 1 + src/blaxel/core/client/models/proxy_config.py | 1 + src/blaxel/core/client/models/proxy_target.py | 1 + src/blaxel/core/client/models/public_ips.py | 1 + src/blaxel/core/client/models/region.py | 1 + src/blaxel/core/client/models/sandbox.py | 18 ++++++++++++++++++ .../core/client/models/sandbox_definition.py | 1 + src/blaxel/core/client/models/sandbox_error.py | 1 + .../core/client/models/sandbox_lifecycle.py | 1 + .../core/client/models/sandbox_network.py | 1 + .../core/client/models/sandbox_runtime.py | 1 + src/blaxel/core/client/models/sandbox_spec.py | 1 + src/blaxel/core/client/models/sso_domain.py | 1 + src/blaxel/core/client/models/template.py | 1 + .../models/test_feature_flag_response_200.py | 1 + src/blaxel/core/client/models/trigger.py | 1 + .../client/models/trigger_configuration.py | 1 + src/blaxel/core/client/models/volume.py | 1 + .../core/client/models/volume_template.py | 1 + src/blaxel/core/client/models/vpc.py | 1 + src/blaxel/core/client/models/workspace.py | 1 + src/blaxel/core/sandbox/default/interpreter.py | 4 +++- src/blaxel/core/sandbox/default/sandbox.py | 4 ---- src/blaxel/core/sandbox/sync/interpreter.py | 4 +++- src/blaxel/core/sandbox/sync/sandbox.py | 3 --- 74 files changed, 107 insertions(+), 9 deletions(-) diff --git a/src/blaxel/core/client/models/__init__.py b/src/blaxel/core/client/models/__init__.py index f7c153fc..f6c328d6 100644 --- a/src/blaxel/core/client/models/__init__.py +++ b/src/blaxel/core/client/models/__init__.py @@ -172,6 +172,8 @@ from .sandbox_network import SandboxNetwork from .sandbox_runtime import SandboxRuntime from .sandbox_spec import SandboxSpec +from .sandbox_state import SandboxState +from .share_image_body import ShareImageBody from .sso_domain import SSODomain from .sso_domain_metadata import SSODomainMetadata from .sso_domain_spec import SSODomainSpec @@ -376,6 +378,8 @@ "SandboxNetwork", "SandboxRuntime", "SandboxSpec", + "SandboxState", + "ShareImageBody", "SSODomain", "SSODomainMetadata", "SSODomainSpec", diff --git a/src/blaxel/core/client/models/agent.py b/src/blaxel/core/client/models/agent.py index b1aa662c..b0c8e09d 100644 --- a/src/blaxel/core/client/models/agent.py +++ b/src/blaxel/core/client/models/agent.py @@ -36,6 +36,7 @@ class Agent: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/agent_runtime.py b/src/blaxel/core/client/models/agent_runtime.py index e4666217..4cb72a90 100644 --- a/src/blaxel/core/client/models/agent_runtime.py +++ b/src/blaxel/core/client/models/agent_runtime.py @@ -41,6 +41,7 @@ class AgentRuntime: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + envs: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.envs, Unset): envs = [] diff --git a/src/blaxel/core/client/models/agent_spec.py b/src/blaxel/core/client/models/agent_spec.py index 7775b4fb..1fc8f3c0 100644 --- a/src/blaxel/core/client/models/agent_spec.py +++ b/src/blaxel/core/client/models/agent_spec.py @@ -48,6 +48,7 @@ class AgentSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + enabled = self.enabled policies: Union[Unset, list[str]] = UNSET diff --git a/src/blaxel/core/client/models/configuration.py b/src/blaxel/core/client/models/configuration.py index ba6aaef8..d0eec18b 100644 --- a/src/blaxel/core/client/models/configuration.py +++ b/src/blaxel/core/client/models/configuration.py @@ -33,6 +33,7 @@ class Configuration: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + continents: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.continents, Unset): continents = [] diff --git a/src/blaxel/core/client/models/create_job_execution_output.py b/src/blaxel/core/client/models/create_job_execution_output.py index 7d31cab9..ab7e2203 100644 --- a/src/blaxel/core/client/models/create_job_execution_output.py +++ b/src/blaxel/core/client/models/create_job_execution_output.py @@ -37,6 +37,7 @@ class CreateJobExecutionOutput: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + execution_id = self.execution_id id = self.id diff --git a/src/blaxel/core/client/models/create_job_execution_request.py b/src/blaxel/core/client/models/create_job_execution_request.py index 7ec4f73a..110a3a1b 100644 --- a/src/blaxel/core/client/models/create_job_execution_request.py +++ b/src/blaxel/core/client/models/create_job_execution_request.py @@ -40,6 +40,7 @@ class CreateJobExecutionRequest: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + env: Union[Unset, dict[str, Any]] = UNSET if self.env and not isinstance(self.env, Unset) and not isinstance(self.env, dict): env = self.env.to_dict() diff --git a/src/blaxel/core/client/models/custom_domain.py b/src/blaxel/core/client/models/custom_domain.py index 6b17e9ab..fe1fa967 100644 --- a/src/blaxel/core/client/models/custom_domain.py +++ b/src/blaxel/core/client/models/custom_domain.py @@ -28,6 +28,7 @@ class CustomDomain: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/custom_domain_metadata.py b/src/blaxel/core/client/models/custom_domain_metadata.py index 1b354e48..ae0506f3 100644 --- a/src/blaxel/core/client/models/custom_domain_metadata.py +++ b/src/blaxel/core/client/models/custom_domain_metadata.py @@ -39,6 +39,7 @@ class CustomDomainMetadata: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + created_at = self.created_at updated_at = self.updated_at diff --git a/src/blaxel/core/client/models/custom_domain_spec.py b/src/blaxel/core/client/models/custom_domain_spec.py index 01f4ece2..03116ca3 100644 --- a/src/blaxel/core/client/models/custom_domain_spec.py +++ b/src/blaxel/core/client/models/custom_domain_spec.py @@ -37,6 +37,7 @@ class CustomDomainSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + cname_records = self.cname_records last_verified_at = self.last_verified_at diff --git a/src/blaxel/core/client/models/delete_volume_template_version_response_200.py b/src/blaxel/core/client/models/delete_volume_template_version_response_200.py index c7d99aee..5a8cf60e 100644 --- a/src/blaxel/core/client/models/delete_volume_template_version_response_200.py +++ b/src/blaxel/core/client/models/delete_volume_template_version_response_200.py @@ -25,6 +25,7 @@ class DeleteVolumeTemplateVersionResponse200: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + message = self.message template: Union[Unset, dict[str, Any]] = UNSET diff --git a/src/blaxel/core/client/models/drive.py b/src/blaxel/core/client/models/drive.py index 9367391e..aead16e7 100644 --- a/src/blaxel/core/client/models/drive.py +++ b/src/blaxel/core/client/models/drive.py @@ -37,6 +37,7 @@ class Drive: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/egress_config.py b/src/blaxel/core/client/models/egress_config.py index 256fdd21..98a2603b 100644 --- a/src/blaxel/core/client/models/egress_config.py +++ b/src/blaxel/core/client/models/egress_config.py @@ -29,6 +29,7 @@ class EgressConfig: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + gateway = self.gateway mode = self.mode diff --git a/src/blaxel/core/client/models/egress_gateway.py b/src/blaxel/core/client/models/egress_gateway.py index cf6cfb23..4cf8db08 100644 --- a/src/blaxel/core/client/models/egress_gateway.py +++ b/src/blaxel/core/client/models/egress_gateway.py @@ -34,6 +34,7 @@ class EgressGateway: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/egress_ip.py b/src/blaxel/core/client/models/egress_ip.py index 92fca87c..e8542d77 100644 --- a/src/blaxel/core/client/models/egress_ip.py +++ b/src/blaxel/core/client/models/egress_ip.py @@ -33,6 +33,7 @@ class EgressIP: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/entrypoint.py b/src/blaxel/core/client/models/entrypoint.py index f56e3db8..9188c712 100644 --- a/src/blaxel/core/client/models/entrypoint.py +++ b/src/blaxel/core/client/models/entrypoint.py @@ -32,6 +32,7 @@ class Entrypoint: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + args: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.args, Unset): args = [] diff --git a/src/blaxel/core/client/models/form.py b/src/blaxel/core/client/models/form.py index e55e8722..6486251b 100644 --- a/src/blaxel/core/client/models/form.py +++ b/src/blaxel/core/client/models/form.py @@ -30,6 +30,7 @@ class Form: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + config: Union[Unset, dict[str, Any]] = UNSET if self.config and not isinstance(self.config, Unset) and not isinstance(self.config, dict): config = self.config.to_dict() diff --git a/src/blaxel/core/client/models/function.py b/src/blaxel/core/client/models/function.py index fd2528b4..b3d16028 100644 --- a/src/blaxel/core/client/models/function.py +++ b/src/blaxel/core/client/models/function.py @@ -36,6 +36,7 @@ class Function: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/function_runtime.py b/src/blaxel/core/client/models/function_runtime.py index 3b9891e0..9e2623ab 100644 --- a/src/blaxel/core/client/models/function_runtime.py +++ b/src/blaxel/core/client/models/function_runtime.py @@ -44,6 +44,7 @@ class FunctionRuntime: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + envs: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.envs, Unset): envs = [] diff --git a/src/blaxel/core/client/models/function_spec.py b/src/blaxel/core/client/models/function_spec.py index b28bb432..21cc973d 100644 --- a/src/blaxel/core/client/models/function_spec.py +++ b/src/blaxel/core/client/models/function_spec.py @@ -44,6 +44,7 @@ class FunctionSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + enabled = self.enabled integration_connections: Union[Unset, list[str]] = UNSET diff --git a/src/blaxel/core/client/models/get_drive_jwks_response_200.py b/src/blaxel/core/client/models/get_drive_jwks_response_200.py index 8e429369..261bfe78 100644 --- a/src/blaxel/core/client/models/get_drive_jwks_response_200.py +++ b/src/blaxel/core/client/models/get_drive_jwks_response_200.py @@ -23,6 +23,7 @@ class GetDriveJWKSResponse200: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + keys: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.keys, Unset): keys = [] diff --git a/src/blaxel/core/client/models/get_workspace_features_response_200.py b/src/blaxel/core/client/models/get_workspace_features_response_200.py index e2818c60..ef225b64 100644 --- a/src/blaxel/core/client/models/get_workspace_features_response_200.py +++ b/src/blaxel/core/client/models/get_workspace_features_response_200.py @@ -26,6 +26,7 @@ class GetWorkspaceFeaturesResponse200: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + features: Union[Unset, dict[str, Any]] = UNSET if ( self.features diff --git a/src/blaxel/core/client/models/image.py b/src/blaxel/core/client/models/image.py index 2132b76c..98e25bb5 100644 --- a/src/blaxel/core/client/models/image.py +++ b/src/blaxel/core/client/models/image.py @@ -24,6 +24,7 @@ class Image: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/image_metadata.py b/src/blaxel/core/client/models/image_metadata.py index 22d584b8..a33148d8 100644 --- a/src/blaxel/core/client/models/image_metadata.py +++ b/src/blaxel/core/client/models/image_metadata.py @@ -24,6 +24,8 @@ class ImageMetadata: tags). name (Union[Unset, str]): The name of the image (repository name). resource_type (Union[Unset, str]): The resource type of the image. + source_workspace (Union[Unset, str]): If this image is shared from another workspace, this field contains the + name of the source workspace. Empty for non-shared images. status (Union[Unset, Status]): Deployment status of a resource deployed on Blaxel updated_at (Union[Unset, str]): The date and time when the image was last updated. workspace (Union[Unset, str]): The workspace of the image. @@ -35,12 +37,14 @@ class ImageMetadata: last_deployed_at: Union[Unset, str] = UNSET name: Union[Unset, str] = UNSET resource_type: Union[Unset, str] = UNSET + source_workspace: Union[Unset, str] = UNSET status: Union[Unset, Status] = UNSET updated_at: Union[Unset, str] = UNSET workspace: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + created_at = self.created_at display_name = self.display_name @@ -63,6 +67,8 @@ def to_dict(self) -> dict[str, Any]: resource_type = self.resource_type + source_workspace = self.source_workspace + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status.value @@ -86,6 +92,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["name"] = name if resource_type is not UNSET: field_dict["resourceType"] = resource_type + if source_workspace is not UNSET: + field_dict["sourceWorkspace"] = source_workspace if status is not UNSET: field_dict["status"] = status if updated_at is not UNSET: @@ -121,6 +129,8 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: resource_type = d.pop("resourceType", d.pop("resource_type", UNSET)) + source_workspace = d.pop("sourceWorkspace", d.pop("source_workspace", UNSET)) + _status = d.pop("status", UNSET) status: Union[Unset, Status] if isinstance(_status, Unset): @@ -139,6 +149,7 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: last_deployed_at=last_deployed_at, name=name, resource_type=resource_type, + source_workspace=source_workspace, status=status, updated_at=updated_at, workspace=workspace, diff --git a/src/blaxel/core/client/models/image_spec.py b/src/blaxel/core/client/models/image_spec.py index ff47facf..34225801 100644 --- a/src/blaxel/core/client/models/image_spec.py +++ b/src/blaxel/core/client/models/image_spec.py @@ -25,6 +25,7 @@ class ImageSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + size = self.size tags: Union[Unset, list[dict[str, Any]]] = UNSET diff --git a/src/blaxel/core/client/models/integration.py b/src/blaxel/core/client/models/integration.py index b893983c..57108161 100644 --- a/src/blaxel/core/client/models/integration.py +++ b/src/blaxel/core/client/models/integration.py @@ -41,6 +41,7 @@ class Integration: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + additional_infos: Union[Unset, dict[str, Any]] = UNSET if ( self.additional_infos diff --git a/src/blaxel/core/client/models/integration_connection.py b/src/blaxel/core/client/models/integration_connection.py index ba41b5fc..0ed7f358 100644 --- a/src/blaxel/core/client/models/integration_connection.py +++ b/src/blaxel/core/client/models/integration_connection.py @@ -28,6 +28,7 @@ class IntegrationConnection: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/integration_connection_spec.py b/src/blaxel/core/client/models/integration_connection_spec.py index 2f42e019..27c6d86b 100644 --- a/src/blaxel/core/client/models/integration_connection_spec.py +++ b/src/blaxel/core/client/models/integration_connection_spec.py @@ -34,6 +34,7 @@ class IntegrationConnectionSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + config: Union[Unset, dict[str, Any]] = UNSET if self.config and not isinstance(self.config, Unset) and not isinstance(self.config, dict): config = self.config.to_dict() diff --git a/src/blaxel/core/client/models/integration_endpoint.py b/src/blaxel/core/client/models/integration_endpoint.py index d1c9fea6..ade0dae2 100644 --- a/src/blaxel/core/client/models/integration_endpoint.py +++ b/src/blaxel/core/client/models/integration_endpoint.py @@ -38,6 +38,7 @@ class IntegrationEndpoint: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + body = self.body ignore_models: Union[Unset, list[dict[str, Any]]] = UNSET diff --git a/src/blaxel/core/client/models/integration_endpoints.py b/src/blaxel/core/client/models/integration_endpoints.py index 61fb17b5..76c5b99a 100644 --- a/src/blaxel/core/client/models/integration_endpoints.py +++ b/src/blaxel/core/client/models/integration_endpoints.py @@ -17,6 +17,7 @@ class IntegrationEndpoints: additional_properties: dict[str, "IntegrationEndpoint"] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} for prop_name, prop in self.additional_properties.items(): if type(prop) is dict: @@ -35,6 +36,7 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: d = src_dict.copy() integration_endpoints = cls() + additional_properties = {} for prop_name, prop_dict in d.items(): additional_property = IntegrationEndpoint.from_dict(prop_dict) diff --git a/src/blaxel/core/client/models/job.py b/src/blaxel/core/client/models/job.py index 04aae372..50901929 100644 --- a/src/blaxel/core/client/models/job.py +++ b/src/blaxel/core/client/models/job.py @@ -36,6 +36,7 @@ class Job: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/job_execution.py b/src/blaxel/core/client/models/job_execution.py index 1710452c..4bae77c9 100644 --- a/src/blaxel/core/client/models/job_execution.py +++ b/src/blaxel/core/client/models/job_execution.py @@ -36,6 +36,7 @@ class JobExecution: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/job_execution_spec.py b/src/blaxel/core/client/models/job_execution_spec.py index c0590774..f18077f8 100644 --- a/src/blaxel/core/client/models/job_execution_spec.py +++ b/src/blaxel/core/client/models/job_execution_spec.py @@ -35,6 +35,7 @@ class JobExecutionSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + env_override: Union[Unset, dict[str, Any]] = UNSET if ( self.env_override diff --git a/src/blaxel/core/client/models/job_execution_task.py b/src/blaxel/core/client/models/job_execution_task.py index f9319086..b73e476d 100644 --- a/src/blaxel/core/client/models/job_execution_task.py +++ b/src/blaxel/core/client/models/job_execution_task.py @@ -33,6 +33,7 @@ class JobExecutionTask: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + conditions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.conditions, Unset): conditions = [] diff --git a/src/blaxel/core/client/models/job_runtime.py b/src/blaxel/core/client/models/job_runtime.py index 9920b4e4..59fe4c6e 100644 --- a/src/blaxel/core/client/models/job_runtime.py +++ b/src/blaxel/core/client/models/job_runtime.py @@ -49,6 +49,7 @@ class JobRuntime: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + disk_percent = self.disk_percent envs: Union[Unset, list[dict[str, Any]]] = UNSET diff --git a/src/blaxel/core/client/models/job_spec.py b/src/blaxel/core/client/models/job_spec.py index 51ef6255..c7b55d42 100644 --- a/src/blaxel/core/client/models/job_spec.py +++ b/src/blaxel/core/client/models/job_spec.py @@ -46,6 +46,7 @@ class JobSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + enabled = self.enabled github_runner: Union[Unset, dict[str, Any]] = UNSET diff --git a/src/blaxel/core/client/models/location_response.py b/src/blaxel/core/client/models/location_response.py index 1ba28924..a413cf84 100644 --- a/src/blaxel/core/client/models/location_response.py +++ b/src/blaxel/core/client/models/location_response.py @@ -34,6 +34,7 @@ class LocationResponse: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + continent = self.continent country = self.country diff --git a/src/blaxel/core/client/models/mcp_definition.py b/src/blaxel/core/client/models/mcp_definition.py index b46583e4..bd80c485 100644 --- a/src/blaxel/core/client/models/mcp_definition.py +++ b/src/blaxel/core/client/models/mcp_definition.py @@ -60,6 +60,7 @@ class MCPDefinition: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + created_at = self.created_at updated_at = self.updated_at diff --git a/src/blaxel/core/client/models/metadata.py b/src/blaxel/core/client/models/metadata.py index 1bf488a9..96b34e84 100644 --- a/src/blaxel/core/client/models/metadata.py +++ b/src/blaxel/core/client/models/metadata.py @@ -46,6 +46,7 @@ class Metadata: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + name = self.name created_at = self.created_at diff --git a/src/blaxel/core/client/models/model.py b/src/blaxel/core/client/models/model.py index 92b6ee53..e7689923 100644 --- a/src/blaxel/core/client/models/model.py +++ b/src/blaxel/core/client/models/model.py @@ -36,6 +36,7 @@ class Model: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/model_spec.py b/src/blaxel/core/client/models/model_spec.py index 1e053ae1..c26c2b52 100644 --- a/src/blaxel/core/client/models/model_spec.py +++ b/src/blaxel/core/client/models/model_spec.py @@ -37,6 +37,7 @@ class ModelSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + enabled = self.enabled flavors: Union[Unset, list[dict[str, Any]]] = UNSET diff --git a/src/blaxel/core/client/models/o_auth.py b/src/blaxel/core/client/models/o_auth.py index 8965f520..ad63ddf8 100644 --- a/src/blaxel/core/client/models/o_auth.py +++ b/src/blaxel/core/client/models/o_auth.py @@ -26,6 +26,7 @@ class OAuth: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + scope: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.scope, Unset): scope = [] diff --git a/src/blaxel/core/client/models/pending_invitation_accept.py b/src/blaxel/core/client/models/pending_invitation_accept.py index 063b69a7..845871ad 100644 --- a/src/blaxel/core/client/models/pending_invitation_accept.py +++ b/src/blaxel/core/client/models/pending_invitation_accept.py @@ -27,6 +27,7 @@ class PendingInvitationAccept: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + email = self.email workspace: Union[Unset, dict[str, Any]] = UNSET diff --git a/src/blaxel/core/client/models/pending_invitation_render.py b/src/blaxel/core/client/models/pending_invitation_render.py index 213c640a..3534130c 100644 --- a/src/blaxel/core/client/models/pending_invitation_render.py +++ b/src/blaxel/core/client/models/pending_invitation_render.py @@ -44,6 +44,7 @@ class PendingInvitationRender: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + account: Union[Unset, dict[str, Any]] = UNSET if ( self.account diff --git a/src/blaxel/core/client/models/pending_invitation_workspace_details.py b/src/blaxel/core/client/models/pending_invitation_workspace_details.py index be4320b9..6ec1525e 100644 --- a/src/blaxel/core/client/models/pending_invitation_workspace_details.py +++ b/src/blaxel/core/client/models/pending_invitation_workspace_details.py @@ -28,6 +28,7 @@ class PendingInvitationWorkspaceDetails: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + emails: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.emails, Unset): emails = [] diff --git a/src/blaxel/core/client/models/policy.py b/src/blaxel/core/client/models/policy.py index 2cf88cf9..9b913727 100644 --- a/src/blaxel/core/client/models/policy.py +++ b/src/blaxel/core/client/models/policy.py @@ -26,6 +26,7 @@ class Policy: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/policy_spec.py b/src/blaxel/core/client/models/policy_spec.py index e343e629..19ad5059 100644 --- a/src/blaxel/core/client/models/policy_spec.py +++ b/src/blaxel/core/client/models/policy_spec.py @@ -40,6 +40,7 @@ class PolicySpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + flavors: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.flavors, Unset): flavors = [] diff --git a/src/blaxel/core/client/models/preview.py b/src/blaxel/core/client/models/preview.py index bba76417..38d1601a 100644 --- a/src/blaxel/core/client/models/preview.py +++ b/src/blaxel/core/client/models/preview.py @@ -33,6 +33,7 @@ class Preview: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/preview_spec.py b/src/blaxel/core/client/models/preview_spec.py index 2f4cbc8a..2a6d50b2 100644 --- a/src/blaxel/core/client/models/preview_spec.py +++ b/src/blaxel/core/client/models/preview_spec.py @@ -46,6 +46,7 @@ class PreviewSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + custom_domain = self.custom_domain expires = self.expires diff --git a/src/blaxel/core/client/models/preview_token.py b/src/blaxel/core/client/models/preview_token.py index accc7383..3ae85791 100644 --- a/src/blaxel/core/client/models/preview_token.py +++ b/src/blaxel/core/client/models/preview_token.py @@ -25,6 +25,7 @@ class PreviewToken: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/proxy_config.py b/src/blaxel/core/client/models/proxy_config.py index fa2a8173..6da195db 100644 --- a/src/blaxel/core/client/models/proxy_config.py +++ b/src/blaxel/core/client/models/proxy_config.py @@ -31,6 +31,7 @@ class ProxyConfig: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + bypass: Union[Unset, list[str]] = UNSET if not isinstance(self.bypass, Unset): bypass = self.bypass diff --git a/src/blaxel/core/client/models/proxy_target.py b/src/blaxel/core/client/models/proxy_target.py index 69fae5fb..2b08464a 100644 --- a/src/blaxel/core/client/models/proxy_target.py +++ b/src/blaxel/core/client/models/proxy_target.py @@ -39,6 +39,7 @@ class ProxyTarget: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + body: Union[Unset, dict[str, Any]] = UNSET if self.body and not isinstance(self.body, Unset) and not isinstance(self.body, dict): body = self.body.to_dict() diff --git a/src/blaxel/core/client/models/public_ips.py b/src/blaxel/core/client/models/public_ips.py index fa7f59a5..7dae820d 100644 --- a/src/blaxel/core/client/models/public_ips.py +++ b/src/blaxel/core/client/models/public_ips.py @@ -17,6 +17,7 @@ class PublicIps: additional_properties: dict[str, "PublicIp"] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} for prop_name, prop in self.additional_properties.items(): if type(prop) is dict: diff --git a/src/blaxel/core/client/models/region.py b/src/blaxel/core/client/models/region.py index 9a2a7eb1..9c193c56 100644 --- a/src/blaxel/core/client/models/region.py +++ b/src/blaxel/core/client/models/region.py @@ -46,6 +46,7 @@ class Region: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + agent_drive_public_url: Union[Unset, dict[str, Any]] = UNSET if ( self.agent_drive_public_url diff --git a/src/blaxel/core/client/models/sandbox.py b/src/blaxel/core/client/models/sandbox.py index 839a4db8..17a0d431 100644 --- a/src/blaxel/core/client/models/sandbox.py +++ b/src/blaxel/core/client/models/sandbox.py @@ -3,6 +3,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..models.sandbox_state import SandboxState from ..models.status import Status from ..types import UNSET, Unset @@ -29,6 +30,7 @@ class Sandbox: expires_in (Union[Unset, int]): Time in seconds until the sandbox is automatically deleted based on TTL and lifecycle policies. Only present for sandboxes with lifecycle configured. last_used_at (Union[Unset, str]): Last time the sandbox was used (read-only, managed by the system) + state (Union[Unset, SandboxState]): Current state of the sandbox (read-only, managed by the system) status (Union[Unset, Status]): Deployment status of a resource deployed on Blaxel """ @@ -37,10 +39,12 @@ class Sandbox: events: Union[Unset, list["CoreEvent"]] = UNSET expires_in: Union[Unset, int] = UNSET last_used_at: Union[Unset, str] = UNSET + state: Union[Unset, SandboxState] = UNSET status: Union[Unset, Status] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: @@ -67,6 +71,10 @@ def to_dict(self) -> dict[str, Any]: last_used_at = self.last_used_at + state: Union[Unset, str] = UNSET + if not isinstance(self.state, Unset): + state = self.state.value + status: Union[Unset, str] = UNSET if not isinstance(self.status, Unset): status = self.status.value @@ -85,6 +93,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["expiresIn"] = expires_in if last_used_at is not UNSET: field_dict["lastUsedAt"] = last_used_at + if state is not UNSET: + field_dict["state"] = state if status is not UNSET: field_dict["status"] = status @@ -116,6 +126,13 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: last_used_at = d.pop("lastUsedAt", d.pop("last_used_at", UNSET)) + _state = d.pop("state", UNSET) + state: Union[Unset, SandboxState] + if isinstance(_state, Unset): + state = UNSET + else: + state = SandboxState(_state) + _status = d.pop("status", UNSET) status: Union[Unset, Status] if isinstance(_status, Unset): @@ -129,6 +146,7 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: events=events, expires_in=expires_in, last_used_at=last_used_at, + state=state, status=status, ) diff --git a/src/blaxel/core/client/models/sandbox_definition.py b/src/blaxel/core/client/models/sandbox_definition.py index 4adf930d..5074b15d 100644 --- a/src/blaxel/core/client/models/sandbox_definition.py +++ b/src/blaxel/core/client/models/sandbox_definition.py @@ -53,6 +53,7 @@ class SandboxDefinition: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + categories: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.categories, Unset): categories = [] diff --git a/src/blaxel/core/client/models/sandbox_error.py b/src/blaxel/core/client/models/sandbox_error.py index aa861111..f73196d4 100644 --- a/src/blaxel/core/client/models/sandbox_error.py +++ b/src/blaxel/core/client/models/sandbox_error.py @@ -42,6 +42,7 @@ class SandboxError: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + code = self.code message = self.message diff --git a/src/blaxel/core/client/models/sandbox_lifecycle.py b/src/blaxel/core/client/models/sandbox_lifecycle.py index ea0dfbd3..45a4c2fd 100644 --- a/src/blaxel/core/client/models/sandbox_lifecycle.py +++ b/src/blaxel/core/client/models/sandbox_lifecycle.py @@ -28,6 +28,7 @@ class SandboxLifecycle: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + expiration_policies: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.expiration_policies, Unset): expiration_policies = [] diff --git a/src/blaxel/core/client/models/sandbox_network.py b/src/blaxel/core/client/models/sandbox_network.py index ad061107..19e337ef 100644 --- a/src/blaxel/core/client/models/sandbox_network.py +++ b/src/blaxel/core/client/models/sandbox_network.py @@ -37,6 +37,7 @@ class SandboxNetwork: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + allowed_domains: Union[Unset, list[str]] = UNSET if not isinstance(self.allowed_domains, Unset): allowed_domains = self.allowed_domains diff --git a/src/blaxel/core/client/models/sandbox_runtime.py b/src/blaxel/core/client/models/sandbox_runtime.py index 40ddef02..809f3a5e 100644 --- a/src/blaxel/core/client/models/sandbox_runtime.py +++ b/src/blaxel/core/client/models/sandbox_runtime.py @@ -40,6 +40,7 @@ class SandboxRuntime: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + envs: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.envs, Unset): envs = [] diff --git a/src/blaxel/core/client/models/sandbox_spec.py b/src/blaxel/core/client/models/sandbox_spec.py index 540416c3..baf93cc3 100644 --- a/src/blaxel/core/client/models/sandbox_spec.py +++ b/src/blaxel/core/client/models/sandbox_spec.py @@ -42,6 +42,7 @@ class SandboxSpec: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + enabled = self.enabled lifecycle: Union[Unset, dict[str, Any]] = UNSET diff --git a/src/blaxel/core/client/models/sso_domain.py b/src/blaxel/core/client/models/sso_domain.py index de9c67bb..a69f25cd 100644 --- a/src/blaxel/core/client/models/sso_domain.py +++ b/src/blaxel/core/client/models/sso_domain.py @@ -28,6 +28,7 @@ class SSODomain: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/template.py b/src/blaxel/core/client/models/template.py index 363ed0f8..56ee013b 100644 --- a/src/blaxel/core/client/models/template.py +++ b/src/blaxel/core/client/models/template.py @@ -47,6 +47,7 @@ class Template: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + default_branch = self.default_branch description = self.description diff --git a/src/blaxel/core/client/models/test_feature_flag_response_200.py b/src/blaxel/core/client/models/test_feature_flag_response_200.py index 68967aa9..ab81dc75 100644 --- a/src/blaxel/core/client/models/test_feature_flag_response_200.py +++ b/src/blaxel/core/client/models/test_feature_flag_response_200.py @@ -33,6 +33,7 @@ class TestFeatureFlagResponse200: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + enabled = self.enabled evaluated_at: Union[Unset, str] = UNSET diff --git a/src/blaxel/core/client/models/trigger.py b/src/blaxel/core/client/models/trigger.py index 9de86906..8ddd3013 100644 --- a/src/blaxel/core/client/models/trigger.py +++ b/src/blaxel/core/client/models/trigger.py @@ -31,6 +31,7 @@ class Trigger: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + configuration: Union[Unset, dict[str, Any]] = UNSET if ( self.configuration diff --git a/src/blaxel/core/client/models/trigger_configuration.py b/src/blaxel/core/client/models/trigger_configuration.py index cf320103..798d50bc 100644 --- a/src/blaxel/core/client/models/trigger_configuration.py +++ b/src/blaxel/core/client/models/trigger_configuration.py @@ -39,6 +39,7 @@ class TriggerConfiguration: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + authentication_type = self.authentication_type callback_secret = self.callback_secret diff --git a/src/blaxel/core/client/models/volume.py b/src/blaxel/core/client/models/volume.py index 61556357..9640491a 100644 --- a/src/blaxel/core/client/models/volume.py +++ b/src/blaxel/core/client/models/volume.py @@ -40,6 +40,7 @@ class Volume: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/volume_template.py b/src/blaxel/core/client/models/volume_template.py index ac1143c6..d43a9145 100644 --- a/src/blaxel/core/client/models/volume_template.py +++ b/src/blaxel/core/client/models/volume_template.py @@ -34,6 +34,7 @@ class VolumeTemplate: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/vpc.py b/src/blaxel/core/client/models/vpc.py index 1d1b279f..005a9f2e 100644 --- a/src/blaxel/core/client/models/vpc.py +++ b/src/blaxel/core/client/models/vpc.py @@ -34,6 +34,7 @@ class VPC: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + if type(self.metadata) is dict: metadata = self.metadata else: diff --git a/src/blaxel/core/client/models/workspace.py b/src/blaxel/core/client/models/workspace.py index 1cd29d03..9a62f326 100644 --- a/src/blaxel/core/client/models/workspace.py +++ b/src/blaxel/core/client/models/workspace.py @@ -57,6 +57,7 @@ class Workspace: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + created_at = self.created_at updated_at = self.updated_at diff --git a/src/blaxel/core/sandbox/default/interpreter.py b/src/blaxel/core/sandbox/default/interpreter.py index f76ffd15..e4a5cf3a 100644 --- a/src/blaxel/core/sandbox/default/interpreter.py +++ b/src/blaxel/core/sandbox/default/interpreter.py @@ -84,7 +84,9 @@ async def create( if sandbox.spec and getattr(sandbox.spec, "region", None): payload["region"] = sandbox.spec.region - base_instance = await SandboxInstance.create(payload, safe=safe, create_if_not_exist=create_if_not_exist) + base_instance = await SandboxInstance.create( + payload, safe=safe, create_if_not_exist=create_if_not_exist + ) return cls( sandbox=base_instance.sandbox, force_url=base_instance.config.force_url, diff --git a/src/blaxel/core/sandbox/default/sandbox.py b/src/blaxel/core/sandbox/default/sandbox.py index 21b5402a..5a533bd2 100644 --- a/src/blaxel/core/sandbox/default/sandbox.py +++ b/src/blaxel/core/sandbox/default/sandbox.py @@ -1,4 +1,3 @@ -import asyncio import logging import uuid import warnings @@ -455,9 +454,6 @@ async def create_if_not_exists( if not name: raise ValueError("Sandbox name is required") - # Brief delay to handle parallel-creation race condition - await asyncio.sleep(2) - # Get the existing sandbox to check its status sandbox_instance = await cls.get(name) diff --git a/src/blaxel/core/sandbox/sync/interpreter.py b/src/blaxel/core/sandbox/sync/interpreter.py index 8056eebe..ff7c1d01 100644 --- a/src/blaxel/core/sandbox/sync/interpreter.py +++ b/src/blaxel/core/sandbox/sync/interpreter.py @@ -73,7 +73,9 @@ def create( if sandbox.spec and getattr(sandbox.spec, "region", None): payload["region"] = sandbox.spec.region - base_instance = SyncSandboxInstance.create(payload, safe=safe, create_if_not_exist=create_if_not_exist) + base_instance = SyncSandboxInstance.create( + payload, safe=safe, create_if_not_exist=create_if_not_exist + ) return cls( sandbox=base_instance.sandbox, force_url=base_instance.config.force_url, diff --git a/src/blaxel/core/sandbox/sync/sandbox.py b/src/blaxel/core/sandbox/sync/sandbox.py index a6c3f77c..7d406430 100644 --- a/src/blaxel/core/sandbox/sync/sandbox.py +++ b/src/blaxel/core/sandbox/sync/sandbox.py @@ -1,5 +1,4 @@ import logging -import time import uuid import warnings from typing import Any, Callable, Dict, List, Union @@ -391,8 +390,6 @@ def create_if_not_exists( name = None if not name: raise ValueError("Sandbox name is required") - # Brief delay to handle parallel-creation race condition - time.sleep(2) sandbox_instance = cls.get(name) if sandbox_instance.status == "TERMINATED": return cls.create(sandbox, create_if_not_exist=True) From 81f0eaf8f2918c68b09035f2042a5df4c6ac1080 Mon Sep 17 00:00:00 2001 From: cdrappier Date: Mon, 13 Apr 2026 19:40:01 +0000 Subject: [PATCH 5/5] feat: add new regenerated client files from main Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../client/api/images/list_image_shares.py | 169 +++++++++++++++ .../core/client/api/images/share_image.py | 203 ++++++++++++++++++ .../core/client/api/images/unshare_image.py | 187 ++++++++++++++++ .../core/client/models/sandbox_state.py | 18 ++ .../core/client/models/share_image_body.py | 62 ++++++ 5 files changed, 639 insertions(+) create mode 100644 src/blaxel/core/client/api/images/list_image_shares.py create mode 100644 src/blaxel/core/client/api/images/share_image.py create mode 100644 src/blaxel/core/client/api/images/unshare_image.py create mode 100644 src/blaxel/core/client/models/sandbox_state.py create mode 100644 src/blaxel/core/client/models/share_image_body.py diff --git a/src/blaxel/core/client/api/images/list_image_shares.py b/src/blaxel/core/client/api/images/list_image_shares.py new file mode 100644 index 00000000..c03701b5 --- /dev/null +++ b/src/blaxel/core/client/api/images/list_image_shares.py @@ -0,0 +1,169 @@ +from http import HTTPStatus +from typing import Any, Union, cast + +import httpx + +from ... import errors +from ...client import Client +from ...types import Response + + +def _get_kwargs( + resource_type: str, + image_name: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": f"/images/{resource_type}/{image_name}/share", + } + + return _kwargs + + +def _parse_response(*, client: Client, response: httpx.Response) -> Union[Any, list[str]] | None: + if response.status_code == 200: + response_200 = cast(list[str], response.json()) + + return response_200 + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, list[str]]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + resource_type: str, + image_name: str, + *, + client: Client, +) -> Response[Union[Any, list[str]]]: + """List image shares + + Returns the list of workspaces that a container image is currently shared with. + + Args: + resource_type (str): + image_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, list[str]]] + """ + + kwargs = _get_kwargs( + resource_type=resource_type, + image_name=image_name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + resource_type: str, + image_name: str, + *, + client: Client, +) -> Union[Any, list[str]] | None: + """List image shares + + Returns the list of workspaces that a container image is currently shared with. + + Args: + resource_type (str): + image_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, list[str]] + """ + + return sync_detailed( + resource_type=resource_type, + image_name=image_name, + client=client, + ).parsed + + +async def asyncio_detailed( + resource_type: str, + image_name: str, + *, + client: Client, +) -> Response[Union[Any, list[str]]]: + """List image shares + + Returns the list of workspaces that a container image is currently shared with. + + Args: + resource_type (str): + image_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, list[str]]] + """ + + kwargs = _get_kwargs( + resource_type=resource_type, + image_name=image_name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + resource_type: str, + image_name: str, + *, + client: Client, +) -> Union[Any, list[str]] | None: + """List image shares + + Returns the list of workspaces that a container image is currently shared with. + + Args: + resource_type (str): + image_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, list[str]] + """ + + return ( + await asyncio_detailed( + resource_type=resource_type, + image_name=image_name, + client=client, + ) + ).parsed diff --git a/src/blaxel/core/client/api/images/share_image.py b/src/blaxel/core/client/api/images/share_image.py new file mode 100644 index 00000000..c0394993 --- /dev/null +++ b/src/blaxel/core/client/api/images/share_image.py @@ -0,0 +1,203 @@ +from http import HTTPStatus +from typing import Any, Union, cast + +import httpx + +from ... import errors +from ...client import Client +from ...models.image import Image +from ...models.share_image_body import ShareImageBody +from ...types import Response + + +def _get_kwargs( + resource_type: str, + image_name: str, + *, + body: ShareImageBody, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": f"/images/{resource_type}/{image_name}/share", + } + + if type(body) is dict: + _body = body + else: + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Client, response: httpx.Response) -> Union[Any, Image] | None: + if response.status_code == 200: + response_200 = Image.from_dict(response.json()) + + return response_200 + if response.status_code == 400: + response_400 = cast(Any, None) + return response_400 + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, Image]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + resource_type: str, + image_name: str, + *, + client: Client, + body: ShareImageBody, +) -> Response[Union[Any, Image]]: + """Share a container image + + Shares a container image with another workspace by copying the metadata record. The underlying + storage (S3) data is not duplicated. The target workspace must belong to the same account. + + Args: + resource_type (str): + image_name (str): + body (ShareImageBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, Image]] + """ + + kwargs = _get_kwargs( + resource_type=resource_type, + image_name=image_name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + resource_type: str, + image_name: str, + *, + client: Client, + body: ShareImageBody, +) -> Union[Any, Image] | None: + """Share a container image + + Shares a container image with another workspace by copying the metadata record. The underlying + storage (S3) data is not duplicated. The target workspace must belong to the same account. + + Args: + resource_type (str): + image_name (str): + body (ShareImageBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, Image] + """ + + return sync_detailed( + resource_type=resource_type, + image_name=image_name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + resource_type: str, + image_name: str, + *, + client: Client, + body: ShareImageBody, +) -> Response[Union[Any, Image]]: + """Share a container image + + Shares a container image with another workspace by copying the metadata record. The underlying + storage (S3) data is not duplicated. The target workspace must belong to the same account. + + Args: + resource_type (str): + image_name (str): + body (ShareImageBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, Image]] + """ + + kwargs = _get_kwargs( + resource_type=resource_type, + image_name=image_name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + resource_type: str, + image_name: str, + *, + client: Client, + body: ShareImageBody, +) -> Union[Any, Image] | None: + """Share a container image + + Shares a container image with another workspace by copying the metadata record. The underlying + storage (S3) data is not duplicated. The target workspace must belong to the same account. + + Args: + resource_type (str): + image_name (str): + body (ShareImageBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, Image] + """ + + return ( + await asyncio_detailed( + resource_type=resource_type, + image_name=image_name, + client=client, + body=body, + ) + ).parsed diff --git a/src/blaxel/core/client/api/images/unshare_image.py b/src/blaxel/core/client/api/images/unshare_image.py new file mode 100644 index 00000000..07aa73dc --- /dev/null +++ b/src/blaxel/core/client/api/images/unshare_image.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, Union, cast + +import httpx + +from ... import errors +from ...client import Client +from ...models.image import Image +from ...types import Response + + +def _get_kwargs( + resource_type: str, + image_name: str, + target_workspace: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": f"/images/{resource_type}/{image_name}/share/{target_workspace}", + } + + return _kwargs + + +def _parse_response(*, client: Client, response: httpx.Response) -> Union[Any, Image] | None: + if response.status_code == 200: + response_200 = Image.from_dict(response.json()) + + return response_200 + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, Image]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + resource_type: str, + image_name: str, + target_workspace: str, + *, + client: Client, +) -> Response[Union[Any, Image]]: + """Unshare a container image + + Revokes sharing of a container image with a target workspace. Removes the metadata copy from the + target workspace. The source image is not affected. + + Args: + resource_type (str): + image_name (str): + target_workspace (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, Image]] + """ + + kwargs = _get_kwargs( + resource_type=resource_type, + image_name=image_name, + target_workspace=target_workspace, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + resource_type: str, + image_name: str, + target_workspace: str, + *, + client: Client, +) -> Union[Any, Image] | None: + """Unshare a container image + + Revokes sharing of a container image with a target workspace. Removes the metadata copy from the + target workspace. The source image is not affected. + + Args: + resource_type (str): + image_name (str): + target_workspace (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, Image] + """ + + return sync_detailed( + resource_type=resource_type, + image_name=image_name, + target_workspace=target_workspace, + client=client, + ).parsed + + +async def asyncio_detailed( + resource_type: str, + image_name: str, + target_workspace: str, + *, + client: Client, +) -> Response[Union[Any, Image]]: + """Unshare a container image + + Revokes sharing of a container image with a target workspace. Removes the metadata copy from the + target workspace. The source image is not affected. + + Args: + resource_type (str): + image_name (str): + target_workspace (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, Image]] + """ + + kwargs = _get_kwargs( + resource_type=resource_type, + image_name=image_name, + target_workspace=target_workspace, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + resource_type: str, + image_name: str, + target_workspace: str, + *, + client: Client, +) -> Union[Any, Image] | None: + """Unshare a container image + + Revokes sharing of a container image with a target workspace. Removes the metadata copy from the + target workspace. The source image is not affected. + + Args: + resource_type (str): + image_name (str): + target_workspace (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, Image] + """ + + return ( + await asyncio_detailed( + resource_type=resource_type, + image_name=image_name, + target_workspace=target_workspace, + client=client, + ) + ).parsed diff --git a/src/blaxel/core/client/models/sandbox_state.py b/src/blaxel/core/client/models/sandbox_state.py new file mode 100644 index 00000000..de7709de --- /dev/null +++ b/src/blaxel/core/client/models/sandbox_state.py @@ -0,0 +1,18 @@ +from enum import Enum + + +class SandboxState(str, Enum): + RUNNING = "RUNNING" + STANDBY = "STANDBY" + + def __str__(self) -> str: + return str(self.value) + + @classmethod + def _missing_(cls, value: object) -> "SandboxState | None": + if isinstance(value, str): + upper_value = value.upper() + for member in cls: + if member.value.upper() == upper_value: + return member + return None diff --git a/src/blaxel/core/client/models/share_image_body.py b/src/blaxel/core/client/models/share_image_body.py new file mode 100644 index 00000000..c122af1f --- /dev/null +++ b/src/blaxel/core/client/models/share_image_body.py @@ -0,0 +1,62 @@ +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ShareImageBody") + + +@_attrs_define +class ShareImageBody: + """ + Attributes: + target_workspace (str): Name of the workspace to share the image with + """ + + target_workspace: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + target_workspace = self.target_workspace + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "targetWorkspace": target_workspace, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None: + if not src_dict: + return None + d = src_dict.copy() + target_workspace = ( + d.pop("targetWorkspace") if "targetWorkspace" in d else d.pop("target_workspace") + ) + + share_image_body = cls( + target_workspace=target_workspace, + ) + + share_image_body.additional_properties = d + return share_image_body + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties