---
title: prefactor_http.models.base module
editUrl: true
head: []
template: doc
sidebar:
  hidden: false
  attrs: {}
pagefind: true
draft: false
---

# prefactor_http.models.base module

Base response models for Prefactor API.

### *class* prefactor_http.models.base.ApiError(, status: str = 'error', code: str, message: str)

Bases: `BaseModel`

API error response.

#### status

Response status (always “error”)

* **Type:**
  str

#### code

Error code

* **Type:**
  str

#### message

Human-readable error message

* **Type:**
  str

#### code *: str*

#### message *: str*

#### model_config *= {}*

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

#### status *: str*

### *class* prefactor_http.models.base.ApiResponse(, status: str, details: T)

Bases: `BaseModel`, `Generic`[`T`]

Generic API response wrapper.

#### status

Response status (always “success” for successful requests)

* **Type:**
  str

#### details

Detailed response data

* **Type:**
  prefactor_http.models.base.T

#### details *: T*

#### model_config *= {}*

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

#### status *: str*

### *class* prefactor_http.models.base.DetailedApiError(, status: str = 'error', code: str, message: str, errors: dict[str, Any])

Bases: [`ApiError`](#prefactor_http.models.base.ApiError)

API error with detailed validation errors.

#### errors

Map of field names to error messages

* **Type:**
  dict[str, Any]

#### errors *: dict[str, Any]*

#### 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](#prefactor_http.models.base.PaginationOutput) | None, sorting: [Sorting](#prefactor_http.models.base.Sorting) | None)

Bases: `BaseModel`, `Generic`[`T`]

Generic list response wrapper.

#### status

Response status (always “success”)

* **Type:**
  str

#### summaries

List of items

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

#### pagination

Pagination information

* **Type:**
  [prefactor_http.models.base.PaginationOutput](#prefactor_http.models.base.PaginationOutput) | None

#### sorting

Sorting information

* **Type:**
  [prefactor_http.models.base.Sorting](#prefactor_http.models.base.Sorting) | None

#### model_config *= {}*

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

#### pagination *: [PaginationOutput](#prefactor_http.models.base.PaginationOutput) | None*

#### sorting *: [Sorting](#prefactor_http.models.base.Sorting) | None*

#### status *: str*

#### 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)

Bases: `BaseModel`

Pagination information.

#### item_count

Total number of items

* **Type:**
  int

#### item_end

Index of last item in page (one-based)

* **Type:**
  int

#### item_start

Index of first item in page (one-based)

* **Type:**
  int

#### next_page_offset

Offset of next page (null if last page)

* **Type:**
  int | None

#### page_count

Total number of pages

* **Type:**
  int

#### page_index

Index of current page (one-based)

* **Type:**
  int

#### page_offset

Offset of first item (zero-based)

* **Type:**
  int

#### page_size

Number of items per page

* **Type:**
  int

#### previous_page_offset

Offset of previous page (null if first page)

* **Type:**
  int | None

#### item_count *: int*

#### item_end *: int*

#### item_start *: int*

#### model_config *= {}*

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

#### next_page_offset *: int | None*

#### page_count *: int*

#### page_index *: int*

#### page_offset *: int*

#### page_size *: int*

#### previous_page_offset *: int | None*

### *class* prefactor_http.models.base.Sorting(, field: str, direction: str)

Bases: `BaseModel`

Sorting information.

#### field

Field to sort by

* **Type:**
  str

#### direction

Sort direction (asc or desc)

* **Type:**
  str

#### direction *: str*

#### field *: str*

#### model_config *= {}*

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