types
konigle.types
¶
Common types and enumerations for the Konigle SDK.
This module exports all shared types, enums, and type definitions used across the SDK.
HTTPMethod
¶
Bases: str, Enum
HTTP methods for API requests.
IDMixin
¶
Bases: BaseModel
Mixin for models that include an ID field.
Provides the standard ID field that most resources include. Default type is string to handle UUIDs and large integers from API. Resource models can override the type if needed.
id = Field(..., title='ID', description='Unique identifier.')
class-attribute
instance-attribute
¶
Unique identifier.
PaginatedResponse
¶
Bases: BaseModel, Generic[T]
Standardized pagination response wrapper.
This generic class wraps paginated API responses with metadata about the pagination state and navigation.
count = Field(..., ge=0, title='Count', description='Total number of resources.')
class-attribute
instance-attribute
¶
Total number of resources.
current_page = Field(..., ge=1, title='Current Page', description='Current page number.')
class-attribute
instance-attribute
¶
Current page number.
is_first_page
property
¶
Check if this is the first page.
is_last_page
property
¶
Check if this is the last page.
next = Field(None, title='Next', description='URL for next page.')
class-attribute
instance-attribute
¶
URL for next page.
num_pages = Field(..., ge=0, title='Number of Pages', description='Total number of pages.')
class-attribute
instance-attribute
¶
Total number of pages.
page_size = Field(..., gt=0, title='Page Size', description='Number of items per page.')
class-attribute
instance-attribute
¶
Number of items per page.
payload = Field(..., title='Payload', description='List of resources in this page.')
class-attribute
instance-attribute
¶
List of resources in this page.
previous = Field(None, title='Previous', description='URL for previous page.')
class-attribute
instance-attribute
¶
URL for previous page.
has_next()
¶
Check if there is a next page.
has_previous()
¶
Check if there is a previous page.
PaginationParams
¶
Bases: BaseModel
Pagination parameter validation and defaults.
Used to validate and normalize pagination parameters across all list operations.
SortOrder
¶
Bases: str, Enum
Common sort order options.
TimestampMixin
¶
Bases: BaseModel
Mixin for models that include timestamp fields.
Provides common timestamp fields that many resources include.