1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

use std::fmt::Debug;
use std::str::FromStr;

use crate::types::*;
use crate::tdkit;

/// Describes the address of UDP reflectors. 
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CallConnection {
  #[doc(hidden)]
  #[serde(rename(serialize = "@type", deserialize = "@type"))]
  td_name: String, // callConnection
  /// Reflector identifier.
  id: Option<i64>,
  /// IPv4 reflector address.
  ip: Option<String>,
  /// IPv6 reflector address.
  ipv6: Option<String>,
  /// Reflector port number.
  port: Option<i32>,
  /// Connection peer tag.
  peer_tag: Option<String>,
  
}



impl Object for CallConnection {}
impl RObject for CallConnection {
  #[doc(hidden)] fn td_name(&self) -> &'static str { "callConnection" }
  fn td_type(&self) -> RTDType { RTDType::CallConnection }
  fn to_json(&self) -> String { rtd_to_json!()(self) }
}



impl CallConnection {
  #[doc(hidden)] pub fn _new() -> Self {
    Self {
      td_name: "callConnection".to_string(),
      id: None,
      ip: None,
      ipv6: None,
      port: None,
      peer_tag: None,
      
    }
  }
  
  pub fn id(&self) -> Option<i64> { self.id.clone() }
  #[doc(hidden)] pub fn _set_id(&mut self, id: i64) -> &mut Self { self.id = Some(id); self }
  
  pub fn ip(&self) -> Option<String> { self.ip.clone() }
  #[doc(hidden)] pub fn _set_ip(&mut self, ip: String) -> &mut Self { self.ip = Some(ip); self }
  
  pub fn ipv6(&self) -> Option<String> { self.ipv6.clone() }
  #[doc(hidden)] pub fn _set_ipv6(&mut self, ipv6: String) -> &mut Self { self.ipv6 = Some(ipv6); self }
  
  pub fn port(&self) -> Option<i32> { self.port.clone() }
  #[doc(hidden)] pub fn _set_port(&mut self, port: i32) -> &mut Self { self.port = Some(port); self }
  
  pub fn peer_tag(&self) -> Option<String> { self.peer_tag.clone() }
  #[doc(hidden)] pub fn _set_peer_tag(&mut self, peer_tag: String) -> &mut Self { self.peer_tag = Some(peer_tag); self }
  
  pub fn from_json<S: AsRef<str>>(json: S) -> Option<Self> { from_json!()(json.as_ref()) }
}