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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
use crate::types::*;
use crate::errors::*;
use uuid::Uuid;
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct SupergroupFullInfo {
#[doc(hidden)]
#[serde(rename(serialize = "@type", deserialize = "@type"))]
td_name: String,
#[doc(hidden)]
#[serde(rename(serialize = "@extra", deserialize = "@extra"))]
extra: Option<String>,
description: String,
member_count: i64,
administrator_count: i64,
restricted_count: i64,
banned_count: i64,
can_get_members: bool,
can_set_username: bool,
can_set_sticker_set: bool,
can_view_statistics: bool,
is_all_history_available: bool,
#[serde(deserialize_with = "serde_aux::field_attributes::deserialize_number_from_string")] sticker_set_id: isize,
invite_link: String,
upgraded_from_basic_group_id: i64,
upgraded_from_max_message_id: i64,
}
impl RObject for SupergroupFullInfo {
#[doc(hidden)] fn td_name(&self) -> &'static str { "supergroupFullInfo" }
#[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
}
impl SupergroupFullInfo {
pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
pub fn builder() -> RTDSupergroupFullInfoBuilder {
let mut inner = SupergroupFullInfo::default();
inner.td_name = "supergroupFullInfo".to_string();
inner.extra = Some(Uuid::new_v4().to_string());
RTDSupergroupFullInfoBuilder { inner }
}
pub fn description(&self) -> &String { &self.description }
pub fn member_count(&self) -> i64 { self.member_count }
pub fn administrator_count(&self) -> i64 { self.administrator_count }
pub fn restricted_count(&self) -> i64 { self.restricted_count }
pub fn banned_count(&self) -> i64 { self.banned_count }
pub fn can_get_members(&self) -> bool { self.can_get_members }
pub fn can_set_username(&self) -> bool { self.can_set_username }
pub fn can_set_sticker_set(&self) -> bool { self.can_set_sticker_set }
pub fn can_view_statistics(&self) -> bool { self.can_view_statistics }
pub fn is_all_history_available(&self) -> bool { self.is_all_history_available }
pub fn sticker_set_id(&self) -> isize { self.sticker_set_id }
pub fn invite_link(&self) -> &String { &self.invite_link }
pub fn upgraded_from_basic_group_id(&self) -> i64 { self.upgraded_from_basic_group_id }
pub fn upgraded_from_max_message_id(&self) -> i64 { self.upgraded_from_max_message_id }
}
#[doc(hidden)]
pub struct RTDSupergroupFullInfoBuilder {
inner: SupergroupFullInfo
}
impl RTDSupergroupFullInfoBuilder {
pub fn build(&self) -> SupergroupFullInfo { self.inner.clone() }
pub fn description<T: AsRef<str>>(&mut self, description: T) -> &mut Self {
self.inner.description = description.as_ref().to_string();
self
}
pub fn member_count(&mut self, member_count: i64) -> &mut Self {
self.inner.member_count = member_count;
self
}
pub fn administrator_count(&mut self, administrator_count: i64) -> &mut Self {
self.inner.administrator_count = administrator_count;
self
}
pub fn restricted_count(&mut self, restricted_count: i64) -> &mut Self {
self.inner.restricted_count = restricted_count;
self
}
pub fn banned_count(&mut self, banned_count: i64) -> &mut Self {
self.inner.banned_count = banned_count;
self
}
pub fn can_get_members(&mut self, can_get_members: bool) -> &mut Self {
self.inner.can_get_members = can_get_members;
self
}
pub fn can_set_username(&mut self, can_set_username: bool) -> &mut Self {
self.inner.can_set_username = can_set_username;
self
}
pub fn can_set_sticker_set(&mut self, can_set_sticker_set: bool) -> &mut Self {
self.inner.can_set_sticker_set = can_set_sticker_set;
self
}
pub fn can_view_statistics(&mut self, can_view_statistics: bool) -> &mut Self {
self.inner.can_view_statistics = can_view_statistics;
self
}
pub fn is_all_history_available(&mut self, is_all_history_available: bool) -> &mut Self {
self.inner.is_all_history_available = is_all_history_available;
self
}
pub fn sticker_set_id(&mut self, sticker_set_id: isize) -> &mut Self {
self.inner.sticker_set_id = sticker_set_id;
self
}
pub fn invite_link<T: AsRef<str>>(&mut self, invite_link: T) -> &mut Self {
self.inner.invite_link = invite_link.as_ref().to_string();
self
}
pub fn upgraded_from_basic_group_id(&mut self, upgraded_from_basic_group_id: i64) -> &mut Self {
self.inner.upgraded_from_basic_group_id = upgraded_from_basic_group_id;
self
}
pub fn upgraded_from_max_message_id(&mut self, upgraded_from_max_message_id: i64) -> &mut Self {
self.inner.upgraded_from_max_message_id = upgraded_from_max_message_id;
self
}
}
impl AsRef<SupergroupFullInfo> for SupergroupFullInfo {
fn as_ref(&self) -> &SupergroupFullInfo { self }
}
impl AsRef<SupergroupFullInfo> for RTDSupergroupFullInfoBuilder {
fn as_ref(&self) -> &SupergroupFullInfo { &self.inner }
}