Skip to content

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.

Response status (always “error”)

  • Type: str

Error code

  • Type: str

Human-readable error message

  • Type: str

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

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.

Response status (always “success” for successful requests)

  • Type: str

Detailed response data

  • Type: prefactor_http.models.base.T

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

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.

Map of field names to error messages

  • Type: dict[str, Any]

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Bases: BaseModel, Generic[T]

Generic list response wrapper.

Response status (always “success”)

  • Type: str

List of items

  • Type: list[prefactor_http.models.base.T]

Pagination information

Sorting information

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

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.

Total number of items

  • Type: int

Index of last item in page (one-based)

  • Type: int

Index of first item in page (one-based)

  • Type: int

Offset of next page (null if last page)

  • Type: int | None

Total number of pages

  • Type: int

Index of current page (one-based)

  • Type: int

Offset of first item (zero-based)

  • Type: int

Number of items per page

  • Type: int

Offset of previous page (null if first page)

  • Type: int | None

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

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

Sort direction (asc or desc)

  • Type: str

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].