vectorize_client.api_response

API response object.

 1"""API response object."""
 2
 3from __future__ import annotations
 4from typing import Optional, Generic, Mapping, TypeVar
 5from pydantic import Field, StrictInt, StrictBytes, BaseModel
 6
 7T = TypeVar("T")
 8
 9class ApiResponse(BaseModel, Generic[T]):
10    """
11    API response object
12    """
13
14    status_code: StrictInt = Field(description="HTTP status code")
15    headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers")
16    data: T = Field(description="Deserialized data given the data type")
17    raw_data: StrictBytes = Field(description="Raw data (HTTP response body)")
18
19    model_config = {
20        "arbitrary_types_allowed": True
21    }
class ApiResponse(pydantic.main.BaseModel, typing.Generic[~T]):
10class ApiResponse(BaseModel, Generic[T]):
11    """
12    API response object
13    """
14
15    status_code: StrictInt = Field(description="HTTP status code")
16    headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers")
17    data: T = Field(description="Deserialized data given the data type")
18    raw_data: StrictBytes = Field(description="Raw data (HTTP response body)")
19
20    model_config = {
21        "arbitrary_types_allowed": True
22    }

API response object

status_code: typing.Annotated[int, Strict(strict=True)]
headers: Optional[Mapping[str, str]]
data: ~T
raw_data: typing.Annotated[bytes, Strict(strict=True)]