|
| 1 | +# generated by datamodel-codegen: |
| 2 | +# filename: allof_array_ref_override.yaml |
| 3 | +# timestamp: 2019-07-26T00:00:00+00:00 |
| 4 | + |
| 5 | +from __future__ import annotations |
| 6 | + |
| 7 | +from typing import Any |
| 8 | +from uuid import UUID |
| 9 | + |
| 10 | +from pydantic import AwareDatetime, BaseModel, Field, conint |
| 11 | + |
| 12 | + |
| 13 | +class DataType(BaseModel): |
| 14 | + property_1: UUID | None = Field( |
| 15 | + None, description='Unique identifier for the installation.' |
| 16 | + ) |
| 17 | + property_2: str | None = Field(None, description='Description of the installation.') |
| 18 | + property_3: AwareDatetime | None = Field( |
| 19 | + None, description='Timestamp when the installation was created.' |
| 20 | + ) |
| 21 | + |
| 22 | + |
| 23 | +class Metadata(BaseModel): |
| 24 | + limit: conint(ge=1, le=100) = Field( |
| 25 | + ..., description='Number of data types returned in this response', examples=[20] |
| 26 | + ) |
| 27 | + page: conint(ge=1) = Field( |
| 28 | + ..., description='The page number to retrieve', examples=[2] |
| 29 | + ) |
| 30 | + |
| 31 | + |
| 32 | +class CollectionWrapper(BaseModel): |
| 33 | + """ |
| 34 | + Generic response wrapper containing a collection of items and pagination metadata. |
| 35 | + """ |
| 36 | + |
| 37 | + data: list[dict[str, Any]] = Field( |
| 38 | + ..., description='Array of items in the collection.' |
| 39 | + ) |
| 40 | + pagination: Metadata = Field( |
| 41 | + ..., description='Pagination metadata for the collection.' |
| 42 | + ) |
| 43 | + |
| 44 | + |
| 45 | +class PaginatedDataTypeList(CollectionWrapper): |
| 46 | + data: list[DataType] | None = Field( |
| 47 | + None, description='Array of items in the collection.' |
| 48 | + ) |
0 commit comments