Coverage for apps/kwai-api/src/kwai_api/v1/schemas.py: 100%
7 statements
« prev ^ index » next coverage.py v7.11.0, created at 2024-01-01 00:00 +0000
« prev ^ index » next coverage.py v7.11.0, created at 2024-01-01 00:00 +0000
1"""Module for defining common JSON:API schemas."""
3from pydantic import BaseModel
5from kwai_api.schemas.resources import (
6 ApplicationResourceIdentifier,
7 CountryResourceIdentifier,
8)
11class ApplicationAttributes(BaseModel):
12 """Attributes of an application JSON:API resource."""
14 name: str
15 title: str
18class ApplicationResource(ApplicationResourceIdentifier):
19 """A JSON:API resource for an application."""
21 attributes: ApplicationAttributes
24class CountryAttributes(BaseModel):
25 """Attributes for the country JSON:API resource."""
27 iso_2: str
28 iso_3: str
29 name: str
32class CountryResource(CountryResourceIdentifier):
33 """A JSON:API resource for a country."""
35 attributes: CountryAttributes
38class CountryDocument(BaseModel):
39 """A JSON:API document for one or more countries."""
41 data: CountryResource