2024-07-28 15:21:51 -07:00
|
|
|
from typing import Dict, List, Literal, Union
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-07-28 15:21:51 -07:00
|
|
|
from pydantic import BaseModel, ConfigDict, Field, RootModel
|
2023-11-29 10:32:31 -08:00
|
|
|
from typing_extensions import Annotated
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-04-12 12:03:34 -07:00
|
|
|
from ..models.batch_response import BatchResponse
|
2023-11-28 23:50:50 -08:00
|
|
|
from ..models.ice_server import IceServer
|
2024-08-23 13:21:00 -07:00
|
|
|
from ..models.modeling_session_data import ModelingSessionData
|
2023-11-28 23:50:50 -08:00
|
|
|
from ..models.ok_modeling_cmd_response import OkModelingCmdResponse
|
|
|
|
from ..models.raw_file import RawFile
|
|
|
|
from ..models.rtc_ice_candidate_init import RtcIceCandidateInit
|
|
|
|
from ..models.rtc_session_description import RtcSessionDescription
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
class IceServerInfoData(BaseModel):
|
|
|
|
""""""
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
ice_servers: List[IceServer]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-09-10 15:24:19 -07:00
|
|
|
class OptionIceServerInfo(BaseModel):
|
2023-11-28 23:50:50 -08:00
|
|
|
"""Information about the ICE servers."""
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
data: IceServerInfoData
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-29 10:32:31 -08:00
|
|
|
type: Literal["ice_server_info"] = "ice_server_info"
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
class TrickleIceData(BaseModel):
|
|
|
|
""""""
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
candidate: RtcIceCandidateInit
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-09-10 15:24:19 -07:00
|
|
|
class OptionTrickleIce(BaseModel):
|
2023-11-28 23:50:50 -08:00
|
|
|
"""The trickle ICE candidate response."""
|
2023-09-29 16:05:40 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
data: TrickleIceData
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-29 10:32:31 -08:00
|
|
|
type: Literal["trickle_ice"] = "trickle_ice"
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
class SdpAnswerData(BaseModel):
|
|
|
|
""""""
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
answer: RtcSessionDescription
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-09-10 15:24:19 -07:00
|
|
|
class OptionSdpAnswer(BaseModel):
|
2023-11-28 23:50:50 -08:00
|
|
|
"""The SDP answer response."""
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
data: SdpAnswerData
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-29 10:32:31 -08:00
|
|
|
type: Literal["sdp_answer"] = "sdp_answer"
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
class ModelingData(BaseModel):
|
|
|
|
""""""
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
modeling_response: OkModelingCmdResponse
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-09-10 15:24:19 -07:00
|
|
|
class OptionModeling(BaseModel):
|
2023-11-28 23:50:50 -08:00
|
|
|
"""The modeling command response."""
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
data: ModelingData
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-29 10:32:31 -08:00
|
|
|
type: Literal["modeling"] = "modeling"
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-04-12 12:03:34 -07:00
|
|
|
class ModelingBatchData(BaseModel):
|
|
|
|
""""""
|
|
|
|
|
|
|
|
responses: Dict[str, BatchResponse]
|
|
|
|
|
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
|
|
|
|
2024-09-10 15:24:19 -07:00
|
|
|
class OptionModelingBatch(BaseModel):
|
2024-04-12 12:03:34 -07:00
|
|
|
"""Response to a ModelingBatch."""
|
|
|
|
|
|
|
|
data: ModelingBatchData
|
|
|
|
|
|
|
|
type: Literal["modeling_batch"] = "modeling_batch"
|
|
|
|
|
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
class ExportData(BaseModel):
|
|
|
|
""""""
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
files: List[RawFile]
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-09-10 15:24:19 -07:00
|
|
|
class OptionExport(BaseModel):
|
2023-11-28 23:50:50 -08:00
|
|
|
"""The exported files."""
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
data: ExportData
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-29 10:32:31 -08:00
|
|
|
type: Literal["export"] = "export"
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
class MetricsRequestData(BaseModel):
|
|
|
|
""""""
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2024-09-10 15:24:19 -07:00
|
|
|
class OptionMetricsRequest(BaseModel):
|
2023-11-28 23:50:50 -08:00
|
|
|
"""Request a collection of metrics, to include WebRTC."""
|
2023-08-17 12:48:13 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
data: MetricsRequestData
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2023-11-29 10:32:31 -08:00
|
|
|
type: Literal["metrics_request"] = "metrics_request"
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
2023-09-29 15:51:03 -07:00
|
|
|
|
2024-08-23 13:21:00 -07:00
|
|
|
class ModelingSessionDataData(BaseModel):
|
|
|
|
""""""
|
|
|
|
|
|
|
|
session: ModelingSessionData
|
|
|
|
|
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
|
|
|
|
2024-09-10 15:24:19 -07:00
|
|
|
class OptionModelingSessionData(BaseModel):
|
2024-08-23 13:21:00 -07:00
|
|
|
"""Data about the Modeling Session (application-level)."""
|
|
|
|
|
|
|
|
data: ModelingSessionDataData
|
|
|
|
|
|
|
|
type: Literal["modeling_session_data"] = "modeling_session_data"
|
|
|
|
|
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
|
|
|
|
2024-03-04 12:53:31 -08:00
|
|
|
class PongData(BaseModel):
|
|
|
|
""""""
|
|
|
|
|
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
|
|
|
|
2024-09-10 15:24:19 -07:00
|
|
|
class OptionPong(BaseModel):
|
2024-03-04 12:53:31 -08:00
|
|
|
"""Pong response to a Ping message."""
|
|
|
|
|
|
|
|
data: PongData
|
|
|
|
|
|
|
|
type: Literal["pong"] = "pong"
|
|
|
|
|
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
|
|
|
|
2023-11-29 00:39:14 -08:00
|
|
|
OkWebSocketResponseData = RootModel[
|
2023-11-29 10:32:31 -08:00
|
|
|
Annotated[
|
|
|
|
Union[
|
2024-09-10 15:24:19 -07:00
|
|
|
OptionIceServerInfo,
|
|
|
|
OptionTrickleIce,
|
|
|
|
OptionSdpAnswer,
|
|
|
|
OptionModeling,
|
|
|
|
OptionModelingBatch,
|
|
|
|
OptionExport,
|
|
|
|
OptionMetricsRequest,
|
|
|
|
OptionModelingSessionData,
|
|
|
|
OptionPong,
|
2023-11-29 10:32:31 -08:00
|
|
|
],
|
|
|
|
Field(discriminator="type"),
|
2023-11-28 14:29:16 -08:00
|
|
|
]
|
2023-11-29 00:39:14 -08:00
|
|
|
]
|