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

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

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

/// Enables a proxy. Only one proxy can be enabled at a time. Can be called before authorization.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EnableProxy {
  #[doc(hidden)]
  #[serde(rename(serialize = "@type", deserialize = "@type"))]
  td_name: String, // enableProxy
  /// Proxy identifier.
  proxy_id: Option<i32>,
  
}



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


impl Function for EnableProxy {}


impl EnableProxy {
  #[doc(hidden)] pub fn _new() -> Self {
    Self {
      td_name: "enableProxy".to_string(),
      proxy_id: None,
      
    }
  }
  
  pub fn proxy_id(&self) -> Option<i32> { self.proxy_id.clone() }
  #[doc(hidden)] pub fn _set_proxy_id(&mut self, proxy_id: i32) -> &mut Self { self.proxy_id = Some(proxy_id); self }
  
  pub fn from_json<S: AsRef<str>>(json: S) -> Option<Self> { from_json!()(json.as_ref()) }
}