File size: 519 Bytes
06555b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from dataclasses import dataclass


@dataclass
class RTCSessionDescription:
    """

    The :class:`RTCSessionDescription` dictionary describes one end of a

    connection and how it's configured.

    """

    sdp: str
    type: str

    def __post_init__(self):
        if self.type not in {"offer", "pranswer", "answer", "rollback"}:
            raise ValueError(
                "'type' must be in ['offer', 'pranswer', 'answer', 'rollback'] "
                f"(got '{self.type}')"
            )