1#[cfg(feature = "rust")]
2use bon::Builder;
3#[cfg(feature = "node")]
4use napi_derive::napi;
5#[cfg(feature = "python")]
6use pyo3::pyclass;
7#[cfg(feature = "python")]
8use pyo3_stub_gen::derive::gen_stub_pyclass;
9use serde::{Deserialize, Serialize};
10
11#[cfg_attr(feature = "python", gen_stub_pyclass)]
13#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
14#[cfg_attr(feature = "node", napi(object))]
15#[derive(Debug, Clone, Serialize, Deserialize)]
16pub struct TeamUser {
17 pub id: i64,
19 pub full_name: Option<String>,
21 pub email: String,
23 pub role: Option<String>,
25 pub status: Option<String>,
27 pub created_at: Option<String>,
29 pub photo_url: Option<String>,
31 pub account_primary_user: Option<bool>,
33}
34
35#[cfg_attr(feature = "python", gen_stub_pyclass)]
37#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
38#[cfg_attr(feature = "node", napi(object))]
39#[derive(Debug, Clone, Serialize, Deserialize)]
40pub struct TeamSummary {
41 pub id: i64,
43 pub name: String,
45 pub members_count: Option<i64>,
47 #[serde(default)]
49 pub users: Vec<TeamUser>,
50}
51
52#[cfg_attr(feature = "python", gen_stub_pyclass)]
54#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
55#[cfg_attr(feature = "node", napi(object))]
56#[derive(Debug, Clone, Serialize, Deserialize)]
57pub struct TeamDetail {
58 pub id: i64,
60 pub name: String,
62 pub default_role: Option<String>,
64 pub members_count: Option<i64>,
66 #[serde(default)]
68 pub users: Vec<TeamUser>,
69 #[serde(default)]
71 pub pending_invites: Vec<TeamUser>,
72}
73
74#[cfg_attr(feature = "python", gen_stub_pyclass)]
76#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
77#[cfg_attr(feature = "node", napi(object))]
78#[derive(Debug, Clone, Serialize, Deserialize)]
79pub struct ListTeamsResponse {
80 #[serde(default)]
82 pub data: Vec<TeamSummary>,
83 pub error: Option<String>,
85}
86
87#[cfg_attr(feature = "python", gen_stub_pyclass)]
89#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
90#[cfg_attr(feature = "node", napi(object))]
91#[cfg_attr(feature = "rust", derive(Builder))]
92#[derive(Debug, Clone, Default, Serialize)]
93pub struct CreateTeamRequest {
94 pub name: String,
96}
97
98#[cfg_attr(feature = "python", gen_stub_pyclass)]
100#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
101#[cfg_attr(feature = "node", napi(object))]
102#[derive(Debug, Clone, Serialize, Deserialize)]
103pub struct CreateTeamData {
104 pub id: i64,
106 pub name: String,
108 pub default_role: Option<String>,
110 pub members_count: Option<i64>,
112}
113
114#[cfg_attr(feature = "python", gen_stub_pyclass)]
116#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
117#[cfg_attr(feature = "node", napi(object))]
118#[derive(Debug, Clone, Serialize, Deserialize)]
119pub struct CreateTeamResponse {
120 pub data: Option<CreateTeamData>,
122 pub error: Option<String>,
124}
125
126#[cfg_attr(feature = "python", gen_stub_pyclass)]
128#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
129#[cfg_attr(feature = "node", napi(object))]
130#[derive(Debug, Clone, Serialize, Deserialize)]
131pub struct GetTeamResponse {
132 pub data: Option<TeamDetail>,
134 pub error: Option<String>,
136}
137
138#[cfg_attr(feature = "python", gen_stub_pyclass)]
140#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
141#[cfg_attr(feature = "node", napi(object))]
142#[derive(Debug, Clone, Serialize, Deserialize)]
143pub struct DeleteTeamData {
144 pub message: Option<String>,
146}
147
148#[cfg_attr(feature = "python", gen_stub_pyclass)]
150#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
151#[cfg_attr(feature = "node", napi(object))]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153pub struct DeleteTeamResponse {
154 pub data: Option<DeleteTeamData>,
156 pub error: Option<String>,
158}
159
160#[cfg_attr(feature = "python", gen_stub_pyclass)]
162#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
163#[cfg_attr(feature = "node", napi(object))]
164#[derive(Debug, Clone, Serialize, Deserialize)]
165pub struct TeamEndpoint {
166 pub id: i64,
168 pub subdomain: String,
170 pub chain: Option<String>,
172 pub network: Option<String>,
174}
175
176#[cfg_attr(feature = "python", gen_stub_pyclass)]
178#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
179#[cfg_attr(feature = "node", napi(object))]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181pub struct ListTeamEndpointsResponse {
182 #[serde(default)]
184 pub data: Vec<TeamEndpoint>,
185 pub error: Option<String>,
187}
188
189#[cfg_attr(feature = "python", gen_stub_pyclass)]
191#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
192#[cfg_attr(feature = "node", napi(object))]
193#[cfg_attr(feature = "rust", derive(Builder))]
194#[derive(Debug, Clone, Default, Serialize)]
195pub struct UpdateTeamEndpointsRequest {
196 pub endpoint_ids: Vec<String>,
198}
199
200#[cfg_attr(feature = "python", gen_stub_pyclass)]
202#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
203#[cfg_attr(feature = "node", napi(object))]
204#[derive(Debug, Clone, Serialize, Deserialize)]
205pub struct UpdateTeamEndpointsData {
206 pub success: Option<bool>,
208}
209
210#[cfg_attr(feature = "python", gen_stub_pyclass)]
212#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
213#[cfg_attr(feature = "node", napi(object))]
214#[derive(Debug, Clone, Serialize, Deserialize)]
215pub struct UpdateTeamEndpointsResponse {
216 pub data: Option<UpdateTeamEndpointsData>,
218 pub error: Option<String>,
220}
221
222#[cfg_attr(feature = "python", gen_stub_pyclass)]
224#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
225#[cfg_attr(feature = "node", napi(object))]
226#[cfg_attr(feature = "rust", derive(Builder))]
227#[derive(Debug, Clone, Default, Serialize)]
228pub struct InviteTeamMemberRequest {
229 pub email: String,
231 #[serde(skip_serializing_if = "Option::is_none")]
233 pub full_name: Option<String>,
234 #[serde(skip_serializing_if = "Option::is_none")]
236 pub role: Option<String>,
237}
238
239#[cfg_attr(feature = "python", gen_stub_pyclass)]
241#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
242#[cfg_attr(feature = "node", napi(object))]
243#[derive(Debug, Clone, Serialize, Deserialize)]
244pub struct InviteTeamMemberResponse {
245 pub data: Option<TeamUser>,
247 pub error: Option<String>,
249}
250
251#[cfg_attr(feature = "python", gen_stub_pyclass)]
253#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
254#[cfg_attr(feature = "node", napi(object))]
255#[cfg_attr(feature = "rust", derive(Builder))]
256#[derive(Debug, Clone, Default, Serialize)]
257pub struct RemoveTeamMemberRequest {
258 #[serde(skip_serializing_if = "Option::is_none")]
260 pub destroy_user: Option<bool>,
261}
262
263#[cfg_attr(feature = "python", gen_stub_pyclass)]
265#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
266#[cfg_attr(feature = "node", napi(object))]
267#[derive(Debug, Clone, Serialize, Deserialize)]
268pub struct TeamMessageData {
269 pub message: Option<String>,
271}
272
273#[cfg_attr(feature = "python", gen_stub_pyclass)]
275#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
276#[cfg_attr(feature = "node", napi(object))]
277#[derive(Debug, Clone, Serialize, Deserialize)]
278pub struct RemoveTeamMemberResponse {
279 pub data: Option<TeamMessageData>,
281 pub error: Option<String>,
283}
284
285#[cfg_attr(feature = "python", gen_stub_pyclass)]
287#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
288#[cfg_attr(feature = "node", napi(object))]
289#[derive(Debug, Clone, Serialize, Deserialize)]
290pub struct ResendTeamInviteResponse {
291 pub data: Option<TeamMessageData>,
293 pub error: Option<String>,
295}