Coverage for fingerprint_server_sdk / api_response.py: 100%
11 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-11 18:41 +0000
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-11 18:41 +0000
1"""API response object."""
3from __future__ import annotations
5from collections.abc import Mapping
6from typing import Generic, Optional, TypeVar
8from pydantic import BaseModel, Field, StrictBytes, StrictInt
10T = TypeVar('T')
13class ApiResponse(BaseModel, Generic[T]):
14 """
15 API response object
16 """
18 status_code: StrictInt = Field(description='HTTP status code')
19 headers: Optional[Mapping[str, str]] = Field(None, description='HTTP headers')
20 data: T = Field(description='Deserialized data given the data type')
21 raw_data: StrictBytes = Field(description='Raw data (HTTP response body)')
23 model_config = {'arbitrary_types_allowed': True}