Add Pydantic JSON model files
This commit is contained in:
parent
98d307db73
commit
1110f3b024
0
type_def/__init__.py
Normal file
0
type_def/__init__.py
Normal file
17
type_def/mvw_json_request.py
Normal file
17
type_def/mvw_json_request.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
from typing import List
|
||||||
|
from pydantic import BaseModel
|
||||||
|
|
||||||
|
|
||||||
|
class Query(BaseModel):
|
||||||
|
fields: List[str]
|
||||||
|
query: str
|
||||||
|
|
||||||
|
|
||||||
|
class MVWJSONRequest(BaseModel):
|
||||||
|
queries: List[Query]
|
||||||
|
sortBy: str
|
||||||
|
sortOrder: str
|
||||||
|
future: bool
|
||||||
|
offset: int
|
||||||
|
size: int
|
37
type_def/mvw_json_response.py
Normal file
37
type_def/mvw_json_response.py
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
from typing import List, Optional
|
||||||
|
from pydantic import BaseModel
|
||||||
|
|
||||||
|
|
||||||
|
class Show(BaseModel):
|
||||||
|
channel: str
|
||||||
|
topic: str
|
||||||
|
title: str
|
||||||
|
description: str
|
||||||
|
timestamp: int
|
||||||
|
duration: int
|
||||||
|
size: int
|
||||||
|
url_website: str
|
||||||
|
url_subtitle: str
|
||||||
|
url_video: str
|
||||||
|
url_video_low: str
|
||||||
|
url_video_hd: str
|
||||||
|
filmlisteTimestamp: str
|
||||||
|
id: str
|
||||||
|
|
||||||
|
|
||||||
|
class QueryInfo(BaseModel):
|
||||||
|
filmlisteTimestamp: str
|
||||||
|
searchEngineTime: str
|
||||||
|
resultCount: int
|
||||||
|
totalResults: int
|
||||||
|
|
||||||
|
|
||||||
|
class Result(BaseModel):
|
||||||
|
results: List[Show] = []
|
||||||
|
queryInfo: QueryInfo
|
||||||
|
|
||||||
|
|
||||||
|
class MVWJSONResponse(BaseModel):
|
||||||
|
result: Result
|
||||||
|
err: Optional[str] = None
|
Loading…
x
Reference in New Issue
Block a user