Coverage for apps/kwai-api/src/kwai_api/v1/portal/coaches/schemas.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2024-01-01 00:00 +0000

1"""Module that defines schema's for JSON:API structures for one or more coaches.""" 

2 

3from kwai_core.json_api import Meta 

4from pydantic import BaseModel, Field 

5 

6from kwai_api.schemas.resources import CoachResourceIdentifier 

7 

8 

9class CoachAttributes(BaseModel): 

10 """Attributes for a coach.""" 

11 

12 name: str 

13 diploma: str 

14 description: str 

15 

16 

17class CoachResource(CoachResourceIdentifier): 

18 """A JSON:API resource for a coach.""" 

19 

20 attributes: CoachAttributes 

21 

22 

23class CoachesDocument(BaseModel): 

24 """A JSON:API document for multiple coaches.""" 

25 

26 meta: Meta 

27 data: list[CoachResource] = Field(default_factory=list)