From 584e0fdd70741545f8a92bc173095ea8df43f3c2 Mon Sep 17 00:00:00 2001 From: scalarbot Date: Tue, 10 Nov 2026 02:42:51 +0000 Subject: [PATCH 1/3] chore(api): update generated SDK content 3 generated files changed with no detected API surface change (documentation, examples, or file content). Build: JC6W8hbP7PPwyiSPfrvUp --- src/dedalus_sdk/_base_client.py | 5 +++-- src/dedalus_sdk/_uuid7.py | 21 +++++++++++++++++++++ src/dedalus_sdk/_version.py | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 src/dedalus_sdk/_uuid7.py diff --git a/src/dedalus_sdk/_base_client.py b/src/dedalus_sdk/_base_client.py index 02b3ce4..efe4146 100644 --- a/src/dedalus_sdk/_base_client.py +++ b/src/dedalus_sdk/_base_client.py @@ -3,7 +3,6 @@ import sys import json import time -import uuid import zlib import email import asyncio @@ -1458,7 +1457,9 @@ def _should_retry(self, response: httpx.Response) -> bool: return False def _idempotency_key(self) -> str: - return f"scalar-python-retry-{uuid.uuid4()}" + from ._uuid7 import uuid7 + + return uuid7().hex class _DefaultHttpxClient(httpx.Client): diff --git a/src/dedalus_sdk/_uuid7.py b/src/dedalus_sdk/_uuid7.py new file mode 100644 index 0000000..494be86 --- /dev/null +++ b/src/dedalus_sdk/_uuid7.py @@ -0,0 +1,21 @@ +"""Time-ordered (version 7) UUIDs for idempotency keys. + +The standard library gains `uuid.uuid7` only in Python 3.14, and the SDK supports older versions +without a third-party dependency, so this module builds one by hand per RFC 9562. +""" + +from __future__ import annotations + +import os +import time +import uuid + + +def uuid7() -> uuid.UUID: + """A version 7 UUID: a 48-bit Unix millisecond timestamp, then version and variant bits, the rest random.""" + value = bytearray(os.urandom(16)) + # Clamped, because `to_bytes` rejects a negative int: a clock set before 1970 writes a zero timestamp. + value[0:6] = max(0, time.time_ns() // 1_000_000).to_bytes(6, "big") + value[6] = (value[6] & 0x0F) | 0x70 + value[8] = (value[8] & 0x3F) | 0x80 + return uuid.UUID(bytes=bytes(value)) diff --git a/src/dedalus_sdk/_version.py b/src/dedalus_sdk/_version.py index d487cb2..7f9557a 100644 --- a/src/dedalus_sdk/_version.py +++ b/src/dedalus_sdk/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Scalar. See README.md for details. __title__ = "dedalus" -__version__ = "0.6.0" # x-release-please-version +__version__ = "0.7.0" # x-release-please-version From eb49ee968e265f7ecadaa263f376049dc7048ec6 Mon Sep 17 00:00:00 2001 From: scalarbot Date: Tue, 10 Nov 2026 23:51:29 +0000 Subject: [PATCH 2/3] feat(api)!: update property policy.cpu (+4 more changes) - Property `policy.cpu` type changed from `enum(on | off)` to `autoresizing_switch`. - Property `policy.memory` type changed from `enum(on | off)` to `autoresizing_switch`. - Property `autoresizing_update.cpu` type changed from `enum(on | off)` to `autoresizing_switch`. - Property `autoresizing_update.memory` type changed from `enum(on | off)` to `autoresizing_switch`. - Added schema `autoresizing_switch`. BREAKING CHANGE: 4 breaking changes to the SDK surface. - Property `policy.cpu` type changed from `enum(on | off)` to `autoresizing_switch`. - Property `policy.memory` type changed from `enum(on | off)` to `autoresizing_switch`. - Property `autoresizing_update.cpu` type changed from `enum(on | off)` to `autoresizing_switch`. - Property `autoresizing_update.memory` type changed from `enum(on | off)` to `autoresizing_switch`. Build: SnEyxlUcXNHo5NK412Uf1 --- scalar-sdk.manifest.json | 81 ++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 52 deletions(-) diff --git a/scalar-sdk.manifest.json b/scalar-sdk.manifest.json index 6896011..affc8a1 100644 --- a/scalar-sdk.manifest.json +++ b/scalar-sdk.manifest.json @@ -198,19 +198,8 @@ "required": true, "deprecated": false, "type": { - "kind": "enum", - "values": [ - "on", - "off" - ], - "names": [ - "On", - "Off" - ], - "deprecations": [ - false, - false - ] + "kind": "ref", + "name": "autoresizing_switch" } }, { @@ -294,19 +283,8 @@ "required": true, "deprecated": false, "type": { - "kind": "enum", - "values": [ - "on", - "off" - ], - "names": [ - "On", - "Off" - ], - "deprecations": [ - false, - false - ] + "kind": "ref", + "name": "autoresizing_switch" } }, { @@ -370,19 +348,8 @@ "required": false, "deprecated": false, "type": { - "kind": "enum", - "values": [ - "on", - "off" - ], - "names": [ - "On", - "Off" - ], - "deprecations": [ - false, - false - ] + "kind": "ref", + "name": "autoresizing_switch" } }, { @@ -414,19 +381,8 @@ "required": false, "deprecated": false, "type": { - "kind": "enum", - "values": [ - "on", - "off" - ], - "names": [ - "On", - "Off" - ], - "deprecations": [ - false, - false - ] + "kind": "ref", + "name": "autoresizing_switch" } }, { @@ -3180,6 +3136,27 @@ "additionalProperties": false } }, + { + "name": "autoresizing_switch", + "source": "autoresizing_switch", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "enum", + "values": [ + "on", + "off" + ], + "names": [ + "On", + "Off" + ], + "deprecations": [ + false, + false + ] + } + }, { "name": "CreateResponseHeaders", "source": "CreateResponseHeaders", From 947b94cdb9da7800aa5fea9c117e49616bc966a4 Mon Sep 17 00:00:00 2001 From: scalarbot Date: Tue, 10 Nov 2026 23:54:36 +0000 Subject: [PATCH 3/3] chore(api): update generated SDK content 8 generated files changed with no detected API surface change (documentation, examples, or file content). Build: PxBlS5x7VncwMmSYymVbm --- src/dedalus_sdk/resources/machines/autoresizing.py | 10 +++++----- src/dedalus_sdk/resources/organization/autoresizing.py | 10 +++++----- src/dedalus_sdk/types/__init__.py | 1 + src/dedalus_sdk/types/autoresizing_switch.py | 7 +++++++ .../types/machines/autoresizing_update_params.py | 8 +++++--- src/dedalus_sdk/types/machines/policy.py | 6 ++++-- .../types/organization/autoresizing_update_params.py | 8 +++++--- 7 files changed, 32 insertions(+), 18 deletions(-) create mode 100644 src/dedalus_sdk/types/autoresizing_switch.py diff --git a/src/dedalus_sdk/resources/machines/autoresizing.py b/src/dedalus_sdk/resources/machines/autoresizing.py index 519ce04..db809c9 100644 --- a/src/dedalus_sdk/resources/machines/autoresizing.py +++ b/src/dedalus_sdk/resources/machines/autoresizing.py @@ -5,7 +5,6 @@ import httpx from typing import Optional -from typing_extensions import Literal from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import path_template, maybe_transform, async_maybe_transform @@ -19,6 +18,7 @@ ) from ..._base_client import make_request_options from ...types.machines.policy import Policy +from ...types.autoresizing_switch import AutoresizingSwitch from ...types.machines import autoresizing_update_params __all__ = ["AutoresizingResource", "AsyncAutoresizingResource"] @@ -78,9 +78,9 @@ def update( self, *, machine_id: str, - cpu: Literal["on", "off"] | Omit = omit, + cpu: AutoresizingSwitch | Omit = omit, cpu_max_vcpu: Optional[float] | Omit = omit, - memory: Literal["on", "off"] | Omit = omit, + memory: AutoresizingSwitch | Omit = omit, memory_max_mib: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -194,9 +194,9 @@ async def update( self, *, machine_id: str, - cpu: Literal["on", "off"] | Omit = omit, + cpu: AutoresizingSwitch | Omit = omit, cpu_max_vcpu: Optional[float] | Omit = omit, - memory: Literal["on", "off"] | Omit = omit, + memory: AutoresizingSwitch | Omit = omit, memory_max_mib: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/dedalus_sdk/resources/organization/autoresizing.py b/src/dedalus_sdk/resources/organization/autoresizing.py index 1fed981..83f062c 100644 --- a/src/dedalus_sdk/resources/organization/autoresizing.py +++ b/src/dedalus_sdk/resources/organization/autoresizing.py @@ -5,7 +5,6 @@ import httpx from typing import Optional -from typing_extensions import Literal from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform @@ -19,6 +18,7 @@ ) from ..._base_client import make_request_options from ...types.machines.policy import Policy +from ...types.autoresizing_switch import AutoresizingSwitch from ...types.organization import autoresizing_update_params __all__ = ["AutoresizingResource", "AsyncAutoresizingResource"] @@ -71,9 +71,9 @@ def retrieve( def update( self, *, - cpu: Literal["on", "off"] | Omit = omit, + cpu: AutoresizingSwitch | Omit = omit, cpu_max_vcpu: Optional[float] | Omit = omit, - memory: Literal["on", "off"] | Omit = omit, + memory: AutoresizingSwitch | Omit = omit, memory_max_mib: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -176,9 +176,9 @@ async def retrieve( async def update( self, *, - cpu: Literal["on", "off"] | Omit = omit, + cpu: AutoresizingSwitch | Omit = omit, cpu_max_vcpu: Optional[float] | Omit = omit, - memory: Literal["on", "off"] | Omit = omit, + memory: AutoresizingSwitch | Omit = omit, memory_max_mib: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/dedalus_sdk/types/__init__.py b/src/dedalus_sdk/types/__init__.py index 54b6050..7df9672 100644 --- a/src/dedalus_sdk/types/__init__.py +++ b/src/dedalus_sdk/types/__init__.py @@ -10,6 +10,7 @@ from .machine_list import MachineList as MachineList from .image import Image as Image from .source import Source as Source +from .autoresizing_switch import AutoresizingSwitch as AutoresizingSwitch from .source_param import SourceParam as SourceParam from .machine_list_params import MachineListParams as MachineListParams from .machine_create_params import MachineCreateParams as MachineCreateParams diff --git a/src/dedalus_sdk/types/autoresizing_switch.py b/src/dedalus_sdk/types/autoresizing_switch.py new file mode 100644 index 0000000..fad9bb7 --- /dev/null +++ b/src/dedalus_sdk/types/autoresizing_switch.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Scalar. See README.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["AutoresizingSwitch"] + +AutoresizingSwitch: TypeAlias = Literal["on", "off"] diff --git a/src/dedalus_sdk/types/machines/autoresizing_update_params.py b/src/dedalus_sdk/types/machines/autoresizing_update_params.py index c00cb0b..d8f83e8 100644 --- a/src/dedalus_sdk/types/machines/autoresizing_update_params.py +++ b/src/dedalus_sdk/types/machines/autoresizing_update_params.py @@ -3,7 +3,9 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Required, TypedDict + +from ..autoresizing_switch import AutoresizingSwitch __all__ = ["AutoresizingUpdateParams"] @@ -12,10 +14,10 @@ class AutoresizingUpdateParams(TypedDict, total=False): machine_id: Required[str] """Bare, lowercase, hyphenated Machine UUID. Pass the returned machine_id unchanged.""" - cpu: Literal["on", "off"] + cpu: AutoresizingSwitch cpu_max_vcpu: Optional[float] - memory: Literal["on", "off"] + memory: AutoresizingSwitch memory_max_mib: Optional[int] diff --git a/src/dedalus_sdk/types/machines/policy.py b/src/dedalus_sdk/types/machines/policy.py index 03fa595..176d70a 100644 --- a/src/dedalus_sdk/types/machines/policy.py +++ b/src/dedalus_sdk/types/machines/policy.py @@ -5,11 +5,13 @@ from ..._models import BaseModel +from ..autoresizing_switch import AutoresizingSwitch + __all__ = ["Policy"] class Policy(BaseModel): - cpu: Literal["on", "off"] + cpu: AutoresizingSwitch """Permit automatic CPU growth independently of RAM.""" cpu_limit_source: Literal["plan", "configured", "platform"] @@ -26,7 +28,7 @@ class Policy(BaseModel): enabled: bool """Deprecated RAM permission alias. Use memory.""" - memory: Literal["on", "off"] + memory: AutoresizingSwitch """Permit automatic RAM growth. Automatic shrink remains internal.""" memory_limit_source: Literal["plan", "configured", "platform"] diff --git a/src/dedalus_sdk/types/organization/autoresizing_update_params.py b/src/dedalus_sdk/types/organization/autoresizing_update_params.py index 425325b..907a7de 100644 --- a/src/dedalus_sdk/types/organization/autoresizing_update_params.py +++ b/src/dedalus_sdk/types/organization/autoresizing_update_params.py @@ -3,16 +3,18 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Literal, TypedDict +from typing_extensions import TypedDict + +from ..autoresizing_switch import AutoresizingSwitch __all__ = ["AutoresizingUpdateParams"] class AutoresizingUpdateParams(TypedDict, total=False): - cpu: Literal["on", "off"] + cpu: AutoresizingSwitch cpu_max_vcpu: Optional[float] - memory: Literal["on", "off"] + memory: AutoresizingSwitch memory_max_mib: Optional[int]