Organizations¶
organizations ¶
Organizations resource group.
Wraps two Compliance API endpoints:
GET /v1/compliance/organizations— list every organisation under the parent organisation. Unpaginated: the server returns the whole list in one shot, and errors with HTTP 500 when the result would exceed 1,000 organisations. The SDK surfaces that error untouched asInternalServerErrorrather than paginating around it client-side — server is the source of truth on capacity.GET /v1/compliance/organizations/{org_uuid}/users— offset paginated list of users in a given organisation. Exposed vialist_users(one page) anditer_users(auto-paginate).
Example
Organization
dataclass
¶
A single organisation under the parent organisation.
Attributes:
| Name | Type | Description |
|---|---|---|
uuid |
str
|
Stable UUID identifier (used as the path segment for
|
name |
str
|
Human-readable organisation name. |
created_at |
str
|
RFC 3339 creation timestamp. |
extra |
dict[str, Any]
|
Any additional fields the API adds in a later revision. |
from_dict
classmethod
¶
Build an Organization from one decoded record.
User
dataclass
¶
A user member of an organisation.
Role and group memberships are not part of this payload — they come from the Roles and Groups resources.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Tagged user identifier ( |
full_name |
str
|
Current display name. |
email |
str
|
Current email address. |
created_at |
str
|
RFC 3339 account creation timestamp. |
extra |
dict[str, Any]
|
Any additional fields the API adds in a later revision. |
from_dict
classmethod
¶
Build a User from one decoded record.
Organizations ¶
Synchronous client for the Organizations endpoints.
list ¶
List every organisation under the parent organisation.
The Compliance API does not paginate this endpoint and returns
an error when the result would exceed 1,000 organisations; that
error surfaces as
InternalServerError rather than
being papered over client-side.
Returns:
| Type | Description |
|---|---|
list[Organization]
|
Organisations sorted by |
list[Organization]
|
empty. |
Raises:
| Type | Description |
|---|---|
InternalServerError
|
When the server-side 1,000-org cap is
exceeded. The exception's |
APIError
|
For any other non-2xx response. |
list_users ¶
list_users(
org_uuid: str,
*,
limit: int | None = None,
page: str | None = None
) -> OffsetPage[User]
Fetch one offset-paginated page of users for an organisation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
org_uuid
|
str
|
Organisation UUID, from |
required |
limit
|
int | None
|
Maximum results per page (default 500, max 1000). |
None
|
page
|
str | None
|
Opaque pagination token from a prior response's
|
None
|
Returns:
| Type | Description |
|---|---|
OffsetPage[User]
|
One |
iter_users ¶
Iterate every user in an organisation, auto-paginating.
Same filters as list_users except that page is
managed by the iterator and therefore not accepted here.