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