use crate::errors::Result;
use crate::types::*;
use uuid::Uuid;
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct TestCallVectorInt {
#[doc(hidden)]
#[serde(rename(serialize = "@extra", deserialize = "@extra"))]
extra: Option<String>,
#[serde(rename(serialize = "@client_id", deserialize = "@client_id"))]
client_id: Option<i32>,
#[serde(default)]
x: Vec<i32>,
#[serde(rename(serialize = "@type"))]
td_type: String,
}
impl RObject for TestCallVectorInt {
#[doc(hidden)]
fn extra(&self) -> Option<&str> {
self.extra.as_deref()
}
#[doc(hidden)]
fn client_id(&self) -> Option<i32> {
self.client_id
}
}
impl RFunction for TestCallVectorInt {}
impl TestCallVectorInt {
pub fn from_json<S: AsRef<str>>(json: S) -> Result<Self> {
Ok(serde_json::from_str(json.as_ref())?)
}
pub fn builder() -> TestCallVectorIntBuilder {
let mut inner = TestCallVectorInt::default();
inner.extra = Some(Uuid::new_v4().to_string());
inner.td_type = "testCallVectorInt".to_string();
TestCallVectorIntBuilder { inner }
}
pub fn x(&self) -> &Vec<i32> {
&self.x
}
}
#[doc(hidden)]
pub struct TestCallVectorIntBuilder {
inner: TestCallVectorInt,
}
#[deprecated]
pub type RTDTestCallVectorIntBuilder = TestCallVectorIntBuilder;
impl TestCallVectorIntBuilder {
pub fn build(&self) -> TestCallVectorInt {
self.inner.clone()
}
pub fn x(&mut self, x: Vec<i32>) -> &mut Self {
self.inner.x = x;
self
}
}
impl AsRef<TestCallVectorInt> for TestCallVectorInt {
fn as_ref(&self) -> &TestCallVectorInt {
self
}
}
impl AsRef<TestCallVectorInt> for TestCallVectorIntBuilder {
fn as_ref(&self) -> &TestCallVectorInt {
&self.inner
}
}