Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.12.0] - 2026-09-22

### Added
- `AccountInfo.organization`, the organization the API key belongs to, as an
`Organization` with `id` and `name`. `client.account.get()` returns it when
the API sends the block. The field is optional and defaults to `None`, so a
response without it parses exactly as before and nothing else on
`AccountInfo` changes.
- `Organization` is exported from the package.

### Changed
- `Account` docs: `uuid` identifies the account the API key belongs to.


## [0.11.1] - 2026-09-19

### Fixed
Expand Down Expand Up @@ -338,7 +352,8 @@ parses is still present and still required.
- Typed Pydantic v2 response models, typed exceptions, and tenacity-backed retry
with exponential backoff.

[Unreleased]: https://github.com/sudomock/sudomock-python/compare/v0.11.0...HEAD
[Unreleased]: https://github.com/sudomock/sudomock-python/compare/v0.12.0...HEAD
[0.12.0]: https://github.com/sudomock/sudomock-python/compare/v0.11.1...v0.12.0
[0.11.0]: https://github.com/sudomock/sudomock-python/compare/v0.10.0...v0.11.0
[0.10.0]: https://github.com/sudomock/sudomock-python/compare/v0.9.1...v0.10.0
[0.7.0]: https://github.com/sudomock/sudomock-python/compare/v0.6.1...v0.7.0
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "sudomock"
version = "0.11.1"
version = "0.12.0"
description = "Official Python SDK for the SudoMock Mockup Generator API"
readme = "README.md"
license = "MIT"
Expand Down
2 changes: 2 additions & 0 deletions src/sudomock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
JobList,
Mockup,
MockupList,
Organization,
PhotoMockup,
PhotoMockupList,
PhotoMockupPrintAreasUpdate,
Expand Down Expand Up @@ -108,6 +109,7 @@
"JobList",
"Mockup",
"MockupList",
"Organization",
"PhotoMockup",
"PhotoMockupList",
"PhotoMockupPrintAreasUpdate",
Expand Down
15 changes: 14 additions & 1 deletion src/sudomock/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ class _Outcome(_Base):


class Account(_Base):
"""User account information."""
"""User account information.

``uuid`` identifies the account the API key belongs to.
"""

uuid: str
email: str
Expand Down Expand Up @@ -120,13 +123,23 @@ class ApiKeyInfo(_Base):
total_requests: int


class Organization(_Base):
"""The organization the API key belongs to."""

id: str
name: str


class AccountInfo(_Base):
"""Aggregate response for GET /api/v1/me."""

account: Account
subscription: Subscription
usage: Usage
api_key: ApiKeyInfo
# Defaulted, not required, for the same reason as ``Usage.prepaid_balance``:
# a response that predates the block must keep parsing.
organization: Optional[Organization] = None


class StudioSessionUi(TypedDict, total=False):
Expand Down
3 changes: 3 additions & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
JobKind,
Mockup,
MockupList,
Organization,
PrintFile,
Render,
Size,
Expand Down Expand Up @@ -173,9 +174,11 @@ def test_full_parse(self) -> None:
created_at="2025-01-01T00:00:00Z",
total_requests=0,
),
organization={"id": "o1", "name": "Acme"},
)
assert info.account.uuid == "u1"
assert info.subscription.plan == "free"
assert info.organization == Organization(id="o1", name="Acme")


class TestSmartObject:
Expand Down
Loading