pydantic cleanup

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2024-01-06 18:32:21 -08:00
parent b233f94a24
commit 8d476bbec6
140 changed files with 1122 additions and 540 deletions

View File

@ -1,6 +1,6 @@
from typing import List, Literal, Union
from pydantic import BaseModel, Field, RootModel
from pydantic import BaseModel, ConfigDict, Field, RootModel
from typing_extensions import Annotated
from ..models.ice_server import IceServer
@ -15,6 +15,8 @@ class IceServerInfoData(BaseModel):
ice_servers: List[IceServer]
model_config = ConfigDict(protected_namespaces=())
class ice_server_info(BaseModel):
"""Information about the ICE servers."""
@ -23,12 +25,16 @@ class ice_server_info(BaseModel):
type: Literal["ice_server_info"] = "ice_server_info"
model_config = ConfigDict(protected_namespaces=())
class TrickleIceData(BaseModel):
""""""
candidate: RtcIceCandidateInit
model_config = ConfigDict(protected_namespaces=())
class trickle_ice(BaseModel):
"""The trickle ICE candidate response."""
@ -37,12 +43,16 @@ class trickle_ice(BaseModel):
type: Literal["trickle_ice"] = "trickle_ice"
model_config = ConfigDict(protected_namespaces=())
class SdpAnswerData(BaseModel):
""""""
answer: RtcSessionDescription
model_config = ConfigDict(protected_namespaces=())
class sdp_answer(BaseModel):
"""The SDP answer response."""
@ -51,12 +61,16 @@ class sdp_answer(BaseModel):
type: Literal["sdp_answer"] = "sdp_answer"
model_config = ConfigDict(protected_namespaces=())
class ModelingData(BaseModel):
""""""
modeling_response: OkModelingCmdResponse
model_config = ConfigDict(protected_namespaces=())
class modeling(BaseModel):
"""The modeling command response."""
@ -65,12 +79,16 @@ class modeling(BaseModel):
type: Literal["modeling"] = "modeling"
model_config = ConfigDict(protected_namespaces=())
class ExportData(BaseModel):
""""""
files: List[RawFile]
model_config = ConfigDict(protected_namespaces=())
class export(BaseModel):
"""The exported files."""
@ -79,10 +97,14 @@ class export(BaseModel):
type: Literal["export"] = "export"
model_config = ConfigDict(protected_namespaces=())
class MetricsRequestData(BaseModel):
""""""
model_config = ConfigDict(protected_namespaces=())
class metrics_request(BaseModel):
"""Request a collection of metrics, to include WebRTC."""
@ -91,6 +113,8 @@ class metrics_request(BaseModel):
type: Literal["metrics_request"] = "metrics_request"
model_config = ConfigDict(protected_namespaces=())
OkWebSocketResponseData = RootModel[
Annotated[