|
1 | | -from typing import Any, Dict, List, Type, TypeVar, Union |
| 1 | +from typing import Any, Dict, List, Type, TypeVar |
2 | 2 |
|
3 | 3 | from attrs import define as _attrs_define |
4 | 4 | from attrs import field as _attrs_field |
5 | 5 |
|
6 | | -from ..types import UNSET, Unset |
7 | | - |
8 | 6 | T = TypeVar("T", bound="ComponentPropertiesRTSP") |
9 | 7 |
|
10 | 8 |
|
11 | 9 | @_attrs_define |
12 | 10 | class ComponentPropertiesRTSP: |
13 | 11 | """Properties specific to the RTSP component""" |
14 | 12 |
|
15 | | - source_uri: str |
16 | | - """URI of RTSP source stream""" |
17 | | - keep_alive_interval: Union[Unset, int] = UNSET |
| 13 | + keep_alive_interval: int |
18 | 14 | """Interval (in ms) in which keep-alive RTSP messages will be sent to the remote stream source""" |
19 | | - pierce_nat: Union[Unset, bool] = UNSET |
| 15 | + pierce_nat: bool |
20 | 16 | """Whether to attempt to create client-side NAT binding by sending an empty datagram from client to source, after the completion of RTSP setup""" |
21 | | - reconnect_delay: Union[Unset, int] = UNSET |
| 17 | + reconnect_delay: int |
22 | 18 | """Delay (in ms) between successive reconnect attempts""" |
23 | | - rtp_port: Union[Unset, int] = UNSET |
| 19 | + rtp_port: int |
24 | 20 | """Local port RTP stream will be received at""" |
| 21 | + source_uri: str |
| 22 | + """URI of RTSP source stream""" |
25 | 23 | additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) |
26 | 24 | """@private""" |
27 | 25 |
|
28 | 26 | def to_dict(self) -> Dict[str, Any]: |
29 | 27 | """@private""" |
30 | | - source_uri = self.source_uri |
31 | 28 | keep_alive_interval = self.keep_alive_interval |
32 | 29 | pierce_nat = self.pierce_nat |
33 | 30 | reconnect_delay = self.reconnect_delay |
34 | 31 | rtp_port = self.rtp_port |
| 32 | + source_uri = self.source_uri |
35 | 33 |
|
36 | 34 | field_dict: Dict[str, Any] = {} |
37 | 35 | field_dict.update(self.additional_properties) |
38 | 36 | field_dict.update( |
39 | 37 | { |
| 38 | + "keepAliveInterval": keep_alive_interval, |
| 39 | + "pierceNat": pierce_nat, |
| 40 | + "reconnectDelay": reconnect_delay, |
| 41 | + "rtpPort": rtp_port, |
40 | 42 | "sourceUri": source_uri, |
41 | 43 | } |
42 | 44 | ) |
43 | | - if keep_alive_interval is not UNSET: |
44 | | - field_dict["keepAliveInterval"] = keep_alive_interval |
45 | | - if pierce_nat is not UNSET: |
46 | | - field_dict["pierceNat"] = pierce_nat |
47 | | - if reconnect_delay is not UNSET: |
48 | | - field_dict["reconnectDelay"] = reconnect_delay |
49 | | - if rtp_port is not UNSET: |
50 | | - field_dict["rtpPort"] = rtp_port |
51 | 45 |
|
52 | 46 | return field_dict |
53 | 47 |
|
54 | 48 | @classmethod |
55 | 49 | def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: |
56 | 50 | """@private""" |
57 | 51 | d = src_dict.copy() |
58 | | - source_uri = d.pop("sourceUri") |
| 52 | + keep_alive_interval = d.pop("keepAliveInterval") |
59 | 53 |
|
60 | | - keep_alive_interval = d.pop("keepAliveInterval", UNSET) |
| 54 | + pierce_nat = d.pop("pierceNat") |
61 | 55 |
|
62 | | - pierce_nat = d.pop("pierceNat", UNSET) |
| 56 | + reconnect_delay = d.pop("reconnectDelay") |
63 | 57 |
|
64 | | - reconnect_delay = d.pop("reconnectDelay", UNSET) |
| 58 | + rtp_port = d.pop("rtpPort") |
65 | 59 |
|
66 | | - rtp_port = d.pop("rtpPort", UNSET) |
| 60 | + source_uri = d.pop("sourceUri") |
67 | 61 |
|
68 | 62 | component_properties_rtsp = cls( |
69 | | - source_uri=source_uri, |
70 | 63 | keep_alive_interval=keep_alive_interval, |
71 | 64 | pierce_nat=pierce_nat, |
72 | 65 | reconnect_delay=reconnect_delay, |
73 | 66 | rtp_port=rtp_port, |
| 67 | + source_uri=source_uri, |
74 | 68 | ) |
75 | 69 |
|
76 | 70 | component_properties_rtsp.additional_properties = d |
|
0 commit comments