Add Pydantic JSON model files

This commit is contained in:
hygienic-books 2022-03-15 04:25:03 +01:00
parent 98d307db73
commit 1110f3b024
3 changed files with 54 additions and 0 deletions

0
type_def/__init__.py Normal file
View File

View 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

View 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