prefactor_http.models.base module
prefactor_http.models.base module
Section titled “prefactor_http.models.base module”Base response models for Prefactor API.
class prefactor_http.models.base.ApiError(, status: str = ‘error’, code: str, message: str)
Section titled “class prefactor_http.models.base.ApiError(, status: str = ‘error’, code: str, message: str)”Bases: BaseModel
API error response.
status
Section titled “status”Response status (always “error”)
- Type: str
Error code
- Type: str
message
Section titled “message”Human-readable error message
- Type: str
code : str
Section titled “code : str”message : str
Section titled “message : str”model_config = {}
Section titled “model_config = {}”Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
status : str
Section titled “status : str”class prefactor_http.models.base.ApiResponse(, status: str, details: T)
Section titled “class prefactor_http.models.base.ApiResponse(, status: str, details: T)”Bases: BaseModel, Generic[T]
Generic API response wrapper.
status
Section titled “status”Response status (always “success” for successful requests)
- Type: str
details
Section titled “details”Detailed response data
- Type: prefactor_http.models.base.T
details : T
Section titled “details : T”model_config = {}
Section titled “model_config = {}”Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
status : str
Section titled “status : str”class prefactor_http.models.base.DetailedApiError(, status: str = ‘error’, code: str, message: str, errors: dict[str, Any])
Section titled “class prefactor_http.models.base.DetailedApiError(, status: str = ‘error’, code: str, message: str, errors: dict[str, Any])”Bases: ApiError
API error with detailed validation errors.
errors
Section titled “errors”Map of field names to error messages
- Type: dict[str, Any]
errors : dict[str, Any]
Section titled “errors : dict[str, Any]”model_config = {}
Section titled “model_config = {}”Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
class prefactor_http.models.base.ListResponse(, status: str, summaries: list[T], pagination: PaginationOutput | None, sorting: Sorting | None)
Section titled “class prefactor_http.models.base.ListResponse(, status: str, summaries: list[T], pagination: PaginationOutput | None, sorting: Sorting | None)”Bases: BaseModel, Generic[T]
Generic list response wrapper.
status
Section titled “status”Response status (always “success”)
- Type: str
summaries
Section titled “summaries”List of items
- Type: list[prefactor_http.models.base.T]
pagination
Section titled “pagination”Pagination information
- Type: prefactor_http.models.base.PaginationOutput | None
sorting
Section titled “sorting”Sorting information
- Type: prefactor_http.models.base.Sorting | None
model_config = {}
Section titled “model_config = {}”Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
pagination : PaginationOutput | None
Section titled “pagination : PaginationOutput | None”sorting : Sorting | None
Section titled “sorting : Sorting | None”status : str
Section titled “status : str”summaries : list[T]
Section titled “summaries : list[T]”class prefactor_http.models.base.PaginationOutput(, item_count: int, item_end: int, item_start: int, next_page_offset: int | None, page_count: int, page_index: int, page_offset: int, page_size: int, previous_page_offset: int | None)
Section titled “class prefactor_http.models.base.PaginationOutput(, item_count: int, item_end: int, item_start: int, next_page_offset: int | None, page_count: int, page_index: int, page_offset: int, page_size: int, previous_page_offset: int | None)”Bases: BaseModel
Pagination information.
item_count
Section titled “item_count”Total number of items
- Type: int
item_end
Section titled “item_end”Index of last item in page (one-based)
- Type: int
item_start
Section titled “item_start”Index of first item in page (one-based)
- Type: int
next_page_offset
Section titled “next_page_offset”Offset of next page (null if last page)
- Type: int | None
page_count
Section titled “page_count”Total number of pages
- Type: int
page_index
Section titled “page_index”Index of current page (one-based)
- Type: int
page_offset
Section titled “page_offset”Offset of first item (zero-based)
- Type: int
page_size
Section titled “page_size”Number of items per page
- Type: int
previous_page_offset
Section titled “previous_page_offset”Offset of previous page (null if first page)
- Type: int | None
item_count : int
Section titled “item_count : int”item_end : int
Section titled “item_end : int”item_start : int
Section titled “item_start : int”model_config = {}
Section titled “model_config = {}”Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
next_page_offset : int | None
Section titled “next_page_offset : int | None”page_count : int
Section titled “page_count : int”page_index : int
Section titled “page_index : int”page_offset : int
Section titled “page_offset : int”page_size : int
Section titled “page_size : int”previous_page_offset : int | None
Section titled “previous_page_offset : int | None”class prefactor_http.models.base.Sorting(, field: str, direction: str)
Section titled “class prefactor_http.models.base.Sorting(, field: str, direction: str)”Bases: BaseModel
Sorting information.
Field to sort by
- Type: str
direction
Section titled “direction”Sort direction (asc or desc)
- Type: str
direction : str
Section titled “direction : str”field : str
Section titled “field : str”model_config = {}
Section titled “model_config = {}”Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].