1use std::collections::HashMap;
4
5use nanoserde::DeJson;
6
7
8#[derive(Debug, Clone)]
9pub enum Authentication {
10 Basic {
11 username: String,
12 password: String
13 },
14 Bearer {
15 token: String
16 }
17}
18
19#[derive(Debug, Clone, PartialEq, Copy)]
20pub enum Method {
21 Post, Get, Put, Delete
22}
23
24#[derive(Debug, Clone)]
25pub struct RestRequest<Response> {
26 pub authentication: Authentication,
27 pub urlpath: String,
28 pub query_params: String,
29 pub body: String,
30 pub method: Method,
31 _marker: std::marker::PhantomData<Response>
32}
33
34trait ToRestString {
35 fn to_string(&self) -> String;
36}
37
38#[derive(Debug, DeJson, Default)]
40#[nserde(default)]
41pub struct GroupUserListGroupUser {
42 pub state: i32,
43 pub user: ApiUser,
44}
45
46impl ToRestString for GroupUserListGroupUser {
47 fn to_string(&self) -> String {
48 let mut output = String::new();
49
50
51 output.push_str("{");
52
53 output.push_str(&format!("\"state\": {}", self.state.to_string()));
54
55 output.push_str(",");
56 output.push_str(&format!("\"user\": {}", self.user.to_string()));
57 output.push_str("}");
58 return output;
59 }
60}
61
62#[derive(Debug, DeJson, Default)]
64#[nserde(default)]
65pub struct UserGroupListUserGroup {
66 pub group: ApiGroup,
67 pub state: i32,
68}
69
70impl ToRestString for UserGroupListUserGroup {
71 fn to_string(&self) -> String {
72 let mut output = String::new();
73
74
75 output.push_str("{");
76
77 output.push_str(&format!("\"group\": {}", self.group.to_string()));
78
79 output.push_str(",");
80 output.push_str(&format!("\"state\": {}", self.state.to_string()));
81 output.push_str("}");
82 return output;
83 }
84}
85
86#[derive(Debug, DeJson, Default)]
88#[nserde(default)]
89pub struct WriteLeaderboardRecordRequestLeaderboardRecordWrite {
90 pub metadata: String,
91 pub score: String,
92 pub subscore: String,
93}
94
95impl ToRestString for WriteLeaderboardRecordRequestLeaderboardRecordWrite {
96 fn to_string(&self) -> String {
97 let mut output = String::new();
98
99
100 output.push_str("{");
101
102 output.push_str(&format!("\"metadata\": \"{}\"", self.metadata));
103
104 output.push_str(",");
105 output.push_str(&format!("\"score\": \"{}\"", self.score));
106
107 output.push_str(",");
108 output.push_str(&format!("\"subscore\": \"{}\"", self.subscore));
109 output.push_str("}");
110 return output;
111 }
112}
113
114#[derive(Debug, DeJson, Default)]
116#[nserde(default)]
117pub struct WriteTournamentRecordRequestTournamentRecordWrite {
118 pub metadata: String,
119 pub score: String,
120 pub subscore: String,
121}
122
123impl ToRestString for WriteTournamentRecordRequestTournamentRecordWrite {
124 fn to_string(&self) -> String {
125 let mut output = String::new();
126
127
128 output.push_str("{");
129
130 output.push_str(&format!("\"metadata\": \"{}\"", self.metadata));
131
132 output.push_str(",");
133 output.push_str(&format!("\"score\": \"{}\"", self.score));
134
135 output.push_str(",");
136 output.push_str(&format!("\"subscore\": \"{}\"", self.subscore));
137 output.push_str("}");
138 return output;
139 }
140}
141
142#[derive(Debug, DeJson, Default)]
144#[nserde(default)]
145pub struct ApiAccount {
146 pub custom_id: String,
147 pub devices: Vec<ApiAccountDevice>,
148 pub disable_time: String,
149 pub email: String,
150 pub user: ApiUser,
151 pub verify_time: String,
152 pub wallet: String,
153}
154
155impl ToRestString for ApiAccount {
156 fn to_string(&self) -> String {
157 let mut output = String::new();
158
159
160 output.push_str("{");
161
162 output.push_str(&format!("\"customId\": \"{}\"", self.custom_id));
163
164 output.push_str(",");
165 output.push_str(&format!("\"devices\": [{}],", {
166 let vec_string = self.devices.iter().map(|x| x.to_string()).collect::<Vec<_>>();
167 vec_string.join(", ")
168 }));
169
170 output.push_str(",");
171 output.push_str(&format!("\"disableTime\": \"{}\"", self.disable_time));
172
173 output.push_str(",");
174 output.push_str(&format!("\"email\": \"{}\"", self.email));
175
176 output.push_str(",");
177 output.push_str(&format!("\"user\": {}", self.user.to_string()));
178
179 output.push_str(",");
180 output.push_str(&format!("\"verifyTime\": \"{}\"", self.verify_time));
181
182 output.push_str(",");
183 output.push_str(&format!("\"wallet\": \"{}\"", self.wallet));
184 output.push_str("}");
185 return output;
186 }
187}
188
189#[derive(Debug, DeJson, Default)]
191#[nserde(default)]
192pub struct ApiAccountApple {
193 pub token: String,
194 pub vars: HashMap<String, String>,
195}
196
197impl ToRestString for ApiAccountApple {
198 fn to_string(&self) -> String {
199 let mut output = String::new();
200
201
202 output.push_str("{");
203
204 output.push_str(&format!("\"token\": \"{}\"", self.token));
205
206 output.push_str(",");
207 output.push_str(&format!("\"vars\": {{ {} }}", {
208 let map_string = self
209 .vars
210 .iter()
211 .map(|(key, value)| format!("\"{}\" = {}", key.to_string(), value.to_string()))
212 .collect::<Vec<_>>();
213 map_string.join(", ")
214 }));
215 output.push_str("}");
216 return output;
217 }
218}
219
220#[derive(Debug, DeJson, Default)]
222#[nserde(default)]
223pub struct ApiAccountCustom {
224 pub id: String,
225 pub vars: HashMap<String, String>,
226}
227
228impl ToRestString for ApiAccountCustom {
229 fn to_string(&self) -> String {
230 let mut output = String::new();
231
232
233 output.push_str("{");
234
235 output.push_str(&format!("\"id\": \"{}\"", self.id));
236
237 output.push_str(",");
238 output.push_str(&format!("\"vars\": {{ {} }}", {
239 let map_string = self
240 .vars
241 .iter()
242 .map(|(key, value)| format!("\"{}\" = {}", key.to_string(), value.to_string()))
243 .collect::<Vec<_>>();
244 map_string.join(", ")
245 }));
246 output.push_str("}");
247 return output;
248 }
249}
250
251#[derive(Debug, DeJson, Default)]
253#[nserde(default)]
254pub struct ApiAccountDevice {
255 pub id: String,
256 pub vars: HashMap<String, String>,
257}
258
259impl ToRestString for ApiAccountDevice {
260 fn to_string(&self) -> String {
261 let mut output = String::new();
262
263
264 output.push_str("{");
265
266 output.push_str(&format!("\"id\": \"{}\"", self.id));
267
268 output.push_str(",");
269 output.push_str(&format!("\"vars\": {{ {} }}", {
270 let map_string = self
271 .vars
272 .iter()
273 .map(|(key, value)| format!("\"{}\" = {}", key.to_string(), value.to_string()))
274 .collect::<Vec<_>>();
275 map_string.join(", ")
276 }));
277 output.push_str("}");
278 return output;
279 }
280}
281
282#[derive(Debug, DeJson, Default)]
284#[nserde(default)]
285pub struct ApiAccountEmail {
286 pub email: String,
287 pub password: String,
288 pub vars: HashMap<String, String>,
289}
290
291impl ToRestString for ApiAccountEmail {
292 fn to_string(&self) -> String {
293 let mut output = String::new();
294
295
296 output.push_str("{");
297
298 output.push_str(&format!("\"email\": \"{}\"", self.email));
299
300 output.push_str(",");
301 output.push_str(&format!("\"password\": \"{}\"", self.password));
302
303 output.push_str(",");
304 output.push_str(&format!("\"vars\": {{ {} }}", {
305 let map_string = self
306 .vars
307 .iter()
308 .map(|(key, value)| format!("\"{}\" = {}", key.to_string(), value.to_string()))
309 .collect::<Vec<_>>();
310 map_string.join(", ")
311 }));
312 output.push_str("}");
313 return output;
314 }
315}
316
317#[derive(Debug, DeJson, Default)]
319#[nserde(default)]
320pub struct ApiAccountFacebook {
321 pub token: String,
322 pub vars: HashMap<String, String>,
323}
324
325impl ToRestString for ApiAccountFacebook {
326 fn to_string(&self) -> String {
327 let mut output = String::new();
328
329
330 output.push_str("{");
331
332 output.push_str(&format!("\"token\": \"{}\"", self.token));
333
334 output.push_str(",");
335 output.push_str(&format!("\"vars\": {{ {} }}", {
336 let map_string = self
337 .vars
338 .iter()
339 .map(|(key, value)| format!("\"{}\" = {}", key.to_string(), value.to_string()))
340 .collect::<Vec<_>>();
341 map_string.join(", ")
342 }));
343 output.push_str("}");
344 return output;
345 }
346}
347
348#[derive(Debug, DeJson, Default)]
350#[nserde(default)]
351pub struct ApiAccountFacebookInstantGame {
352 pub signed_player_info: String,
353 pub vars: HashMap<String, String>,
354}
355
356impl ToRestString for ApiAccountFacebookInstantGame {
357 fn to_string(&self) -> String {
358 let mut output = String::new();
359
360
361 output.push_str("{");
362
363 output.push_str(&format!("\"signedPlayerInfo\": \"{}\"", self.signed_player_info));
364
365 output.push_str(",");
366 output.push_str(&format!("\"vars\": {{ {} }}", {
367 let map_string = self
368 .vars
369 .iter()
370 .map(|(key, value)| format!("\"{}\" = {}", key.to_string(), value.to_string()))
371 .collect::<Vec<_>>();
372 map_string.join(", ")
373 }));
374 output.push_str("}");
375 return output;
376 }
377}
378
379#[derive(Debug, DeJson, Default)]
381#[nserde(default)]
382pub struct ApiAccountGameCenter {
383 pub bundle_id: String,
384 pub player_id: String,
385 pub public_key_url: String,
386 pub salt: String,
387 pub signature: String,
388 pub timestamp_seconds: String,
389 pub vars: HashMap<String, String>,
390}
391
392impl ToRestString for ApiAccountGameCenter {
393 fn to_string(&self) -> String {
394 let mut output = String::new();
395
396
397 output.push_str("{");
398
399 output.push_str(&format!("\"bundleId\": \"{}\"", self.bundle_id));
400
401 output.push_str(",");
402 output.push_str(&format!("\"playerId\": \"{}\"", self.player_id));
403
404 output.push_str(",");
405 output.push_str(&format!("\"publicKeyUrl\": \"{}\"", self.public_key_url));
406
407 output.push_str(",");
408 output.push_str(&format!("\"salt\": \"{}\"", self.salt));
409
410 output.push_str(",");
411 output.push_str(&format!("\"signature\": \"{}\"", self.signature));
412
413 output.push_str(",");
414 output.push_str(&format!("\"timestampSeconds\": \"{}\"", self.timestamp_seconds));
415
416 output.push_str(",");
417 output.push_str(&format!("\"vars\": {{ {} }}", {
418 let map_string = self
419 .vars
420 .iter()
421 .map(|(key, value)| format!("\"{}\" = {}", key.to_string(), value.to_string()))
422 .collect::<Vec<_>>();
423 map_string.join(", ")
424 }));
425 output.push_str("}");
426 return output;
427 }
428}
429
430#[derive(Debug, DeJson, Default)]
432#[nserde(default)]
433pub struct ApiAccountGoogle {
434 pub token: String,
435 pub vars: HashMap<String, String>,
436}
437
438impl ToRestString for ApiAccountGoogle {
439 fn to_string(&self) -> String {
440 let mut output = String::new();
441
442
443 output.push_str("{");
444
445 output.push_str(&format!("\"token\": \"{}\"", self.token));
446
447 output.push_str(",");
448 output.push_str(&format!("\"vars\": {{ {} }}", {
449 let map_string = self
450 .vars
451 .iter()
452 .map(|(key, value)| format!("\"{}\" = {}", key.to_string(), value.to_string()))
453 .collect::<Vec<_>>();
454 map_string.join(", ")
455 }));
456 output.push_str("}");
457 return output;
458 }
459}
460
461#[derive(Debug, DeJson, Default)]
463#[nserde(default)]
464pub struct ApiAccountSteam {
465 pub token: String,
466 pub vars: HashMap<String, String>,
467}
468
469impl ToRestString for ApiAccountSteam {
470 fn to_string(&self) -> String {
471 let mut output = String::new();
472
473
474 output.push_str("{");
475
476 output.push_str(&format!("\"token\": \"{}\"", self.token));
477
478 output.push_str(",");
479 output.push_str(&format!("\"vars\": {{ {} }}", {
480 let map_string = self
481 .vars
482 .iter()
483 .map(|(key, value)| format!("\"{}\" = {}", key.to_string(), value.to_string()))
484 .collect::<Vec<_>>();
485 map_string.join(", ")
486 }));
487 output.push_str("}");
488 return output;
489 }
490}
491
492#[derive(Debug, DeJson, Default)]
494#[nserde(default)]
495pub struct ApiChannelMessage {
496 pub channel_id: String,
497 pub code: i32,
498 pub content: String,
499 pub create_time: String,
500 pub group_id: String,
501 pub message_id: String,
502 pub persistent: bool,
503 pub room_name: String,
504 pub sender_id: String,
505 pub update_time: String,
506 pub user_id_one: String,
507 pub user_id_two: String,
508 pub username: String,
509}
510
511impl ToRestString for ApiChannelMessage {
512 fn to_string(&self) -> String {
513 let mut output = String::new();
514
515
516 output.push_str("{");
517
518 output.push_str(&format!("\"channelId\": \"{}\"", self.channel_id));
519
520 output.push_str(",");
521 output.push_str(&format!("\"code\": {}", self.code.to_string()));
522
523 output.push_str(",");
524 output.push_str(&format!("\"content\": \"{}\"", self.content));
525
526 output.push_str(",");
527 output.push_str(&format!("\"createTime\": \"{}\"", self.create_time));
528
529 output.push_str(",");
530 output.push_str(&format!("\"groupId\": \"{}\"", self.group_id));
531
532 output.push_str(",");
533 output.push_str(&format!("\"messageId\": \"{}\"", self.message_id));
534
535 output.push_str(",");
536 output.push_str(&format!("\"persistent\": {}", self.persistent.to_string()));
537
538 output.push_str(",");
539 output.push_str(&format!("\"roomName\": \"{}\"", self.room_name));
540
541 output.push_str(",");
542 output.push_str(&format!("\"senderId\": \"{}\"", self.sender_id));
543
544 output.push_str(",");
545 output.push_str(&format!("\"updateTime\": \"{}\"", self.update_time));
546
547 output.push_str(",");
548 output.push_str(&format!("\"userIdOne\": \"{}\"", self.user_id_one));
549
550 output.push_str(",");
551 output.push_str(&format!("\"userIdTwo\": \"{}\"", self.user_id_two));
552
553 output.push_str(",");
554 output.push_str(&format!("\"username\": \"{}\"", self.username));
555 output.push_str("}");
556 return output;
557 }
558}
559
560#[derive(Debug, DeJson, Default)]
562#[nserde(default)]
563pub struct ApiChannelMessageList {
564 pub cacheable_cursor: String,
565 pub messages: Vec<ApiChannelMessage>,
566 pub next_cursor: String,
567 pub prev_cursor: String,
568}
569
570impl ToRestString for ApiChannelMessageList {
571 fn to_string(&self) -> String {
572 let mut output = String::new();
573
574
575 output.push_str("{");
576
577 output.push_str(&format!("\"cacheableCursor\": \"{}\"", self.cacheable_cursor));
578
579 output.push_str(",");
580 output.push_str(&format!("\"messages\": [{}],", {
581 let vec_string = self.messages.iter().map(|x| x.to_string()).collect::<Vec<_>>();
582 vec_string.join(", ")
583 }));
584
585 output.push_str(",");
586 output.push_str(&format!("\"nextCursor\": \"{}\"", self.next_cursor));
587
588 output.push_str(",");
589 output.push_str(&format!("\"prevCursor\": \"{}\"", self.prev_cursor));
590 output.push_str("}");
591 return output;
592 }
593}
594
595#[derive(Debug, DeJson, Default)]
597#[nserde(default)]
598pub struct ApiCreateGroupRequest {
599 pub avatar_url: String,
600 pub description: String,
601 pub lang_tag: String,
602 pub max_count: i32,
603 pub name: String,
604 pub open: bool,
605}
606
607impl ToRestString for ApiCreateGroupRequest {
608 fn to_string(&self) -> String {
609 let mut output = String::new();
610
611
612 output.push_str("{");
613
614 output.push_str(&format!("\"avatarUrl\": \"{}\"", self.avatar_url));
615
616 output.push_str(",");
617 output.push_str(&format!("\"description\": \"{}\"", self.description));
618
619 output.push_str(",");
620 output.push_str(&format!("\"langTag\": \"{}\"", self.lang_tag));
621
622 output.push_str(",");
623 output.push_str(&format!("\"maxCount\": {}", self.max_count.to_string()));
624
625 output.push_str(",");
626 output.push_str(&format!("\"name\": \"{}\"", self.name));
627
628 output.push_str(",");
629 output.push_str(&format!("\"open\": {}", self.open.to_string()));
630 output.push_str("}");
631 return output;
632 }
633}
634
635#[derive(Debug, DeJson, Default)]
637#[nserde(default)]
638pub struct ApiDeleteStorageObjectId {
639 pub collection: String,
640 pub key: String,
641 pub version: String,
642}
643
644impl ToRestString for ApiDeleteStorageObjectId {
645 fn to_string(&self) -> String {
646 let mut output = String::new();
647
648
649 output.push_str("{");
650
651 output.push_str(&format!("\"collection\": \"{}\"", self.collection));
652
653 output.push_str(",");
654 output.push_str(&format!("\"key\": \"{}\"", self.key));
655
656 output.push_str(",");
657 output.push_str(&format!("\"version\": \"{}\"", self.version));
658 output.push_str("}");
659 return output;
660 }
661}
662
663#[derive(Debug, DeJson, Default)]
665#[nserde(default)]
666pub struct ApiDeleteStorageObjectsRequest {
667 pub object_ids: Vec<ApiDeleteStorageObjectId>,
668}
669
670impl ToRestString for ApiDeleteStorageObjectsRequest {
671 fn to_string(&self) -> String {
672 let mut output = String::new();
673
674
675 output.push_str("{");
676
677 output.push_str(&format!("\"objectIds\": [{}],", {
678 let vec_string = self.object_ids.iter().map(|x| x.to_string()).collect::<Vec<_>>();
679 vec_string.join(", ")
680 }));
681 output.push_str("}");
682 return output;
683 }
684}
685
686#[derive(Debug, DeJson, Default)]
688#[nserde(default)]
689pub struct ApiEvent {
690 pub external: bool,
691 pub name: String,
692 pub properties: HashMap<String, String>,
693 pub timestamp: String,
694}
695
696impl ToRestString for ApiEvent {
697 fn to_string(&self) -> String {
698 let mut output = String::new();
699
700
701 output.push_str("{");
702
703 output.push_str(&format!("\"external\": {}", self.external.to_string()));
704
705 output.push_str(",");
706 output.push_str(&format!("\"name\": \"{}\"", self.name));
707
708 output.push_str(",");
709 output.push_str(&format!("\"properties\": {{ {} }}", {
710 let map_string = self
711 .properties
712 .iter()
713 .map(|(key, value)| format!("\"{}\" = {}", key.to_string(), value.to_string()))
714 .collect::<Vec<_>>();
715 map_string.join(", ")
716 }));
717
718 output.push_str(",");
719 output.push_str(&format!("\"timestamp\": \"{}\"", self.timestamp));
720 output.push_str("}");
721 return output;
722 }
723}
724
725#[derive(Debug, DeJson, Default)]
727#[nserde(default)]
728pub struct ApiFriend {
729 pub state: i32,
730 pub update_time: String,
731 pub user: ApiUser,
732}
733
734impl ToRestString for ApiFriend {
735 fn to_string(&self) -> String {
736 let mut output = String::new();
737
738
739 output.push_str("{");
740
741 output.push_str(&format!("\"state\": {}", self.state.to_string()));
742
743 output.push_str(",");
744 output.push_str(&format!("\"updateTime\": \"{}\"", self.update_time));
745
746 output.push_str(",");
747 output.push_str(&format!("\"user\": {}", self.user.to_string()));
748 output.push_str("}");
749 return output;
750 }
751}
752
753#[derive(Debug, DeJson, Default)]
755#[nserde(default)]
756pub struct ApiFriendList {
757 pub cursor: String,
758 pub friends: Vec<ApiFriend>,
759}
760
761impl ToRestString for ApiFriendList {
762 fn to_string(&self) -> String {
763 let mut output = String::new();
764
765
766 output.push_str("{");
767
768 output.push_str(&format!("\"cursor\": \"{}\"", self.cursor));
769
770 output.push_str(",");
771 output.push_str(&format!("\"friends\": [{}],", {
772 let vec_string = self.friends.iter().map(|x| x.to_string()).collect::<Vec<_>>();
773 vec_string.join(", ")
774 }));
775 output.push_str("}");
776 return output;
777 }
778}
779
780#[derive(Debug, DeJson, Default)]
782#[nserde(default)]
783pub struct ApiGroup {
784 pub avatar_url: String,
785 pub create_time: String,
786 pub creator_id: String,
787 pub description: String,
788 pub edge_count: i32,
789 pub id: String,
790 pub lang_tag: String,
791 pub max_count: i32,
792 pub metadata: String,
793 pub name: String,
794 pub open: bool,
795 pub update_time: String,
796}
797
798impl ToRestString for ApiGroup {
799 fn to_string(&self) -> String {
800 let mut output = String::new();
801
802
803 output.push_str("{");
804
805 output.push_str(&format!("\"avatarUrl\": \"{}\"", self.avatar_url));
806
807 output.push_str(",");
808 output.push_str(&format!("\"createTime\": \"{}\"", self.create_time));
809
810 output.push_str(",");
811 output.push_str(&format!("\"creatorId\": \"{}\"", self.creator_id));
812
813 output.push_str(",");
814 output.push_str(&format!("\"description\": \"{}\"", self.description));
815
816 output.push_str(",");
817 output.push_str(&format!("\"edgeCount\": {}", self.edge_count.to_string()));
818
819 output.push_str(",");
820 output.push_str(&format!("\"id\": \"{}\"", self.id));
821
822 output.push_str(",");
823 output.push_str(&format!("\"langTag\": \"{}\"", self.lang_tag));
824
825 output.push_str(",");
826 output.push_str(&format!("\"maxCount\": {}", self.max_count.to_string()));
827
828 output.push_str(",");
829 output.push_str(&format!("\"metadata\": \"{}\"", self.metadata));
830
831 output.push_str(",");
832 output.push_str(&format!("\"name\": \"{}\"", self.name));
833
834 output.push_str(",");
835 output.push_str(&format!("\"open\": {}", self.open.to_string()));
836
837 output.push_str(",");
838 output.push_str(&format!("\"updateTime\": \"{}\"", self.update_time));
839 output.push_str("}");
840 return output;
841 }
842}
843
844#[derive(Debug, DeJson, Default)]
846#[nserde(default)]
847pub struct ApiGroupList {
848 pub cursor: String,
849 pub groups: Vec<ApiGroup>,
850}
851
852impl ToRestString for ApiGroupList {
853 fn to_string(&self) -> String {
854 let mut output = String::new();
855
856
857 output.push_str("{");
858
859 output.push_str(&format!("\"cursor\": \"{}\"", self.cursor));
860
861 output.push_str(",");
862 output.push_str(&format!("\"groups\": [{}],", {
863 let vec_string = self.groups.iter().map(|x| x.to_string()).collect::<Vec<_>>();
864 vec_string.join(", ")
865 }));
866 output.push_str("}");
867 return output;
868 }
869}
870
871#[derive(Debug, DeJson, Default)]
873#[nserde(default)]
874pub struct ApiGroupUserList {
875 pub cursor: String,
876 pub group_users: Vec<GroupUserListGroupUser>,
877}
878
879impl ToRestString for ApiGroupUserList {
880 fn to_string(&self) -> String {
881 let mut output = String::new();
882
883
884 output.push_str("{");
885
886 output.push_str(&format!("\"cursor\": \"{}\"", self.cursor));
887
888 output.push_str(",");
889 output.push_str(&format!("\"groupUsers\": [{}],", {
890 let vec_string = self.group_users.iter().map(|x| x.to_string()).collect::<Vec<_>>();
891 vec_string.join(", ")
892 }));
893 output.push_str("}");
894 return output;
895 }
896}
897
898#[derive(Debug, DeJson, Default)]
900#[nserde(default)]
901pub struct ApiLeaderboardRecord {
902 pub create_time: String,
903 pub expiry_time: String,
904 pub leaderboard_id: String,
905 pub max_num_score: i32,
906 pub metadata: String,
907 pub num_score: i32,
908 pub owner_id: String,
909 pub rank: String,
910 pub score: String,
911 pub subscore: String,
912 pub update_time: String,
913 pub username: String,
914}
915
916impl ToRestString for ApiLeaderboardRecord {
917 fn to_string(&self) -> String {
918 let mut output = String::new();
919
920
921 output.push_str("{");
922
923 output.push_str(&format!("\"createTime\": \"{}\"", self.create_time));
924
925 output.push_str(",");
926 output.push_str(&format!("\"expiryTime\": \"{}\"", self.expiry_time));
927
928 output.push_str(",");
929 output.push_str(&format!("\"leaderboardId\": \"{}\"", self.leaderboard_id));
930
931 output.push_str(",");
932 output.push_str(&format!("\"maxNumScore\": {}", self.max_num_score.to_string()));
933
934 output.push_str(",");
935 output.push_str(&format!("\"metadata\": \"{}\"", self.metadata));
936
937 output.push_str(",");
938 output.push_str(&format!("\"numScore\": {}", self.num_score.to_string()));
939
940 output.push_str(",");
941 output.push_str(&format!("\"ownerId\": \"{}\"", self.owner_id));
942
943 output.push_str(",");
944 output.push_str(&format!("\"rank\": \"{}\"", self.rank));
945
946 output.push_str(",");
947 output.push_str(&format!("\"score\": \"{}\"", self.score));
948
949 output.push_str(",");
950 output.push_str(&format!("\"subscore\": \"{}\"", self.subscore));
951
952 output.push_str(",");
953 output.push_str(&format!("\"updateTime\": \"{}\"", self.update_time));
954
955 output.push_str(",");
956 output.push_str(&format!("\"username\": \"{}\"", self.username));
957 output.push_str("}");
958 return output;
959 }
960}
961
962#[derive(Debug, DeJson, Default)]
964#[nserde(default)]
965pub struct ApiLeaderboardRecordList {
966 pub next_cursor: String,
967 pub owner_records: Vec<ApiLeaderboardRecord>,
968 pub prev_cursor: String,
969 pub records: Vec<ApiLeaderboardRecord>,
970}
971
972impl ToRestString for ApiLeaderboardRecordList {
973 fn to_string(&self) -> String {
974 let mut output = String::new();
975
976
977 output.push_str("{");
978
979 output.push_str(&format!("\"nextCursor\": \"{}\"", self.next_cursor));
980
981 output.push_str(",");
982 output.push_str(&format!("\"ownerRecords\": [{}],", {
983 let vec_string = self.owner_records.iter().map(|x| x.to_string()).collect::<Vec<_>>();
984 vec_string.join(", ")
985 }));
986
987 output.push_str(",");
988 output.push_str(&format!("\"prevCursor\": \"{}\"", self.prev_cursor));
989
990 output.push_str(",");
991 output.push_str(&format!("\"records\": [{}],", {
992 let vec_string = self.records.iter().map(|x| x.to_string()).collect::<Vec<_>>();
993 vec_string.join(", ")
994 }));
995 output.push_str("}");
996 return output;
997 }
998}
999
1000#[derive(Debug, DeJson, Default)]
1002#[nserde(default)]
1003pub struct ApiLinkSteamRequest {
1004 pub account: ApiAccountSteam,
1005 pub sync: bool,
1006}
1007
1008impl ToRestString for ApiLinkSteamRequest {
1009 fn to_string(&self) -> String {
1010 let mut output = String::new();
1011
1012
1013 output.push_str("{");
1014
1015 output.push_str(&format!("\"account\": {}", self.account.to_string()));
1016
1017 output.push_str(",");
1018 output.push_str(&format!("\"sync\": {}", self.sync.to_string()));
1019 output.push_str("}");
1020 return output;
1021 }
1022}
1023
1024#[derive(Debug, DeJson, Default)]
1026#[nserde(default)]
1027pub struct ApiMatch {
1028 pub authoritative: bool,
1029 pub handler_name: String,
1030 pub label: String,
1031 pub match_id: String,
1032 pub size: i32,
1033 pub tick_rate: i32,
1034}
1035
1036impl ToRestString for ApiMatch {
1037 fn to_string(&self) -> String {
1038 let mut output = String::new();
1039
1040
1041 output.push_str("{");
1042
1043 output.push_str(&format!("\"authoritative\": {}", self.authoritative.to_string()));
1044
1045 output.push_str(",");
1046 output.push_str(&format!("\"handlerName\": \"{}\"", self.handler_name));
1047
1048 output.push_str(",");
1049 output.push_str(&format!("\"label\": \"{}\"", self.label));
1050
1051 output.push_str(",");
1052 output.push_str(&format!("\"matchId\": \"{}\"", self.match_id));
1053
1054 output.push_str(",");
1055 output.push_str(&format!("\"size\": {}", self.size.to_string()));
1056
1057 output.push_str(",");
1058 output.push_str(&format!("\"tickRate\": {}", self.tick_rate.to_string()));
1059 output.push_str("}");
1060 return output;
1061 }
1062}
1063
1064#[derive(Debug, DeJson, Default)]
1066#[nserde(default)]
1067pub struct ApiMatchList {
1068 pub matches: Vec<ApiMatch>,
1069}
1070
1071impl ToRestString for ApiMatchList {
1072 fn to_string(&self) -> String {
1073 let mut output = String::new();
1074
1075
1076 output.push_str("{");
1077
1078 output.push_str(&format!("\"matches\": [{}],", {
1079 let vec_string = self.matches.iter().map(|x| x.to_string()).collect::<Vec<_>>();
1080 vec_string.join(", ")
1081 }));
1082 output.push_str("}");
1083 return output;
1084 }
1085}
1086
1087#[derive(Debug, DeJson, Default)]
1089#[nserde(default)]
1090pub struct ApiNotification {
1091 pub code: i32,
1092 pub content: String,
1093 pub create_time: String,
1094 pub id: String,
1095 pub persistent: bool,
1096 pub sender_id: String,
1097 pub subject: String,
1098}
1099
1100impl ToRestString for ApiNotification {
1101 fn to_string(&self) -> String {
1102 let mut output = String::new();
1103
1104
1105 output.push_str("{");
1106
1107 output.push_str(&format!("\"code\": {}", self.code.to_string()));
1108
1109 output.push_str(",");
1110 output.push_str(&format!("\"content\": \"{}\"", self.content));
1111
1112 output.push_str(",");
1113 output.push_str(&format!("\"createTime\": \"{}\"", self.create_time));
1114
1115 output.push_str(",");
1116 output.push_str(&format!("\"id\": \"{}\"", self.id));
1117
1118 output.push_str(",");
1119 output.push_str(&format!("\"persistent\": {}", self.persistent.to_string()));
1120
1121 output.push_str(",");
1122 output.push_str(&format!("\"senderId\": \"{}\"", self.sender_id));
1123
1124 output.push_str(",");
1125 output.push_str(&format!("\"subject\": \"{}\"", self.subject));
1126 output.push_str("}");
1127 return output;
1128 }
1129}
1130
1131#[derive(Debug, DeJson, Default)]
1133#[nserde(default)]
1134pub struct ApiNotificationList {
1135 pub cacheable_cursor: String,
1136 pub notifications: Vec<ApiNotification>,
1137}
1138
1139impl ToRestString for ApiNotificationList {
1140 fn to_string(&self) -> String {
1141 let mut output = String::new();
1142
1143
1144 output.push_str("{");
1145
1146 output.push_str(&format!("\"cacheableCursor\": \"{}\"", self.cacheable_cursor));
1147
1148 output.push_str(",");
1149 output.push_str(&format!("\"notifications\": [{}],", {
1150 let vec_string = self.notifications.iter().map(|x| x.to_string()).collect::<Vec<_>>();
1151 vec_string.join(", ")
1152 }));
1153 output.push_str("}");
1154 return output;
1155 }
1156}
1157
1158#[derive(Debug, DeJson, Default)]
1160#[nserde(default)]
1161pub struct ApiReadStorageObjectId {
1162 pub collection: String,
1163 pub key: String,
1164 pub user_id: String,
1165}
1166
1167impl ToRestString for ApiReadStorageObjectId {
1168 fn to_string(&self) -> String {
1169 let mut output = String::new();
1170
1171
1172 output.push_str("{");
1173
1174 output.push_str(&format!("\"collection\": \"{}\"", self.collection));
1175
1176 output.push_str(",");
1177 output.push_str(&format!("\"key\": \"{}\"", self.key));
1178
1179 output.push_str(",");
1180 output.push_str(&format!("\"userId\": \"{}\"", self.user_id));
1181 output.push_str("}");
1182 return output;
1183 }
1184}
1185
1186#[derive(Debug, DeJson, Default)]
1188#[nserde(default)]
1189pub struct ApiReadStorageObjectsRequest {
1190 pub object_ids: Vec<ApiReadStorageObjectId>,
1191}
1192
1193impl ToRestString for ApiReadStorageObjectsRequest {
1194 fn to_string(&self) -> String {
1195 let mut output = String::new();
1196
1197
1198 output.push_str("{");
1199
1200 output.push_str(&format!("\"objectIds\": [{}],", {
1201 let vec_string = self.object_ids.iter().map(|x| x.to_string()).collect::<Vec<_>>();
1202 vec_string.join(", ")
1203 }));
1204 output.push_str("}");
1205 return output;
1206 }
1207}
1208
1209#[derive(Debug, DeJson, Default)]
1211#[nserde(default)]
1212pub struct ApiRpc {
1213 pub http_key: String,
1214 pub id: String,
1215 pub payload: String,
1216}
1217
1218impl ToRestString for ApiRpc {
1219 fn to_string(&self) -> String {
1220 let mut output = String::new();
1221
1222
1223 output.push_str("{");
1224
1225 output.push_str(&format!("\"httpKey\": \"{}\"", self.http_key));
1226
1227 output.push_str(",");
1228 output.push_str(&format!("\"id\": \"{}\"", self.id));
1229
1230 output.push_str(",");
1231 output.push_str(&format!("\"payload\": \"{}\"", self.payload));
1232 output.push_str("}");
1233 return output;
1234 }
1235}
1236
1237#[derive(Debug, DeJson, Default)]
1239#[nserde(default)]
1240pub struct ApiSession {
1241 pub created: bool,
1242 pub refresh_token: String,
1243 pub token: String,
1244}
1245
1246impl ToRestString for ApiSession {
1247 fn to_string(&self) -> String {
1248 let mut output = String::new();
1249
1250
1251 output.push_str("{");
1252
1253 output.push_str(&format!("\"created\": {}", self.created.to_string()));
1254
1255 output.push_str(",");
1256 output.push_str(&format!("\"refreshToken\": \"{}\"", self.refresh_token));
1257
1258 output.push_str(",");
1259 output.push_str(&format!("\"token\": \"{}\"", self.token));
1260 output.push_str("}");
1261 return output;
1262 }
1263}
1264
1265#[derive(Debug, DeJson, Default)]
1267#[nserde(default)]
1268pub struct ApiSessionLogoutRequest {
1269 pub refresh_token: String,
1270 pub token: String,
1271}
1272
1273impl ToRestString for ApiSessionLogoutRequest {
1274 fn to_string(&self) -> String {
1275 let mut output = String::new();
1276
1277
1278 output.push_str("{");
1279
1280 output.push_str(&format!("\"refreshToken\": \"{}\"", self.refresh_token));
1281
1282 output.push_str(",");
1283 output.push_str(&format!("\"token\": \"{}\"", self.token));
1284 output.push_str("}");
1285 return output;
1286 }
1287}
1288
1289#[derive(Debug, DeJson, Default)]
1291#[nserde(default)]
1292pub struct ApiSessionRefreshRequest {
1293 pub token: String,
1294 pub vars: HashMap<String, String>,
1295}
1296
1297impl ToRestString for ApiSessionRefreshRequest {
1298 fn to_string(&self) -> String {
1299 let mut output = String::new();
1300
1301
1302 output.push_str("{");
1303
1304 output.push_str(&format!("\"token\": \"{}\"", self.token));
1305
1306 output.push_str(",");
1307 output.push_str(&format!("\"vars\": {{ {} }}", {
1308 let map_string = self
1309 .vars
1310 .iter()
1311 .map(|(key, value)| format!("\"{}\" = {}", key.to_string(), value.to_string()))
1312 .collect::<Vec<_>>();
1313 map_string.join(", ")
1314 }));
1315 output.push_str("}");
1316 return output;
1317 }
1318}
1319
1320#[derive(Debug, DeJson, Default)]
1322#[nserde(default)]
1323pub struct ApiStorageObject {
1324 pub collection: String,
1325 pub create_time: String,
1326 pub key: String,
1327 pub permission_read: i32,
1328 pub permission_write: i32,
1329 pub update_time: String,
1330 pub user_id: String,
1331 pub value: String,
1332 pub version: String,
1333}
1334
1335impl ToRestString for ApiStorageObject {
1336 fn to_string(&self) -> String {
1337 let mut output = String::new();
1338
1339
1340 output.push_str("{");
1341
1342 output.push_str(&format!("\"collection\": \"{}\"", self.collection));
1343
1344 output.push_str(",");
1345 output.push_str(&format!("\"createTime\": \"{}\"", self.create_time));
1346
1347 output.push_str(",");
1348 output.push_str(&format!("\"key\": \"{}\"", self.key));
1349
1350 output.push_str(",");
1351 output.push_str(&format!("\"permissionRead\": {}", self.permission_read.to_string()));
1352
1353 output.push_str(",");
1354 output.push_str(&format!("\"permissionWrite\": {}", self.permission_write.to_string()));
1355
1356 output.push_str(",");
1357 output.push_str(&format!("\"updateTime\": \"{}\"", self.update_time));
1358
1359 output.push_str(",");
1360 output.push_str(&format!("\"userId\": \"{}\"", self.user_id));
1361
1362 output.push_str(",");
1363 output.push_str(&format!("\"value\": \"{}\"", self.value));
1364
1365 output.push_str(",");
1366 output.push_str(&format!("\"version\": \"{}\"", self.version));
1367 output.push_str("}");
1368 return output;
1369 }
1370}
1371
1372#[derive(Debug, DeJson, Default)]
1374#[nserde(default)]
1375pub struct ApiStorageObjectAck {
1376 pub collection: String,
1377 pub key: String,
1378 pub user_id: String,
1379 pub version: String,
1380}
1381
1382impl ToRestString for ApiStorageObjectAck {
1383 fn to_string(&self) -> String {
1384 let mut output = String::new();
1385
1386
1387 output.push_str("{");
1388
1389 output.push_str(&format!("\"collection\": \"{}\"", self.collection));
1390
1391 output.push_str(",");
1392 output.push_str(&format!("\"key\": \"{}\"", self.key));
1393
1394 output.push_str(",");
1395 output.push_str(&format!("\"userId\": \"{}\"", self.user_id));
1396
1397 output.push_str(",");
1398 output.push_str(&format!("\"version\": \"{}\"", self.version));
1399 output.push_str("}");
1400 return output;
1401 }
1402}
1403
1404#[derive(Debug, DeJson, Default)]
1406#[nserde(default)]
1407pub struct ApiStorageObjectAcks {
1408 pub acks: Vec<ApiStorageObjectAck>,
1409}
1410
1411impl ToRestString for ApiStorageObjectAcks {
1412 fn to_string(&self) -> String {
1413 let mut output = String::new();
1414
1415
1416 output.push_str("{");
1417
1418 output.push_str(&format!("\"acks\": [{}],", {
1419 let vec_string = self.acks.iter().map(|x| x.to_string()).collect::<Vec<_>>();
1420 vec_string.join(", ")
1421 }));
1422 output.push_str("}");
1423 return output;
1424 }
1425}
1426
1427#[derive(Debug, DeJson, Default)]
1429#[nserde(default)]
1430pub struct ApiStorageObjectList {
1431 pub cursor: String,
1432 pub objects: Vec<ApiStorageObject>,
1433}
1434
1435impl ToRestString for ApiStorageObjectList {
1436 fn to_string(&self) -> String {
1437 let mut output = String::new();
1438
1439
1440 output.push_str("{");
1441
1442 output.push_str(&format!("\"cursor\": \"{}\"", self.cursor));
1443
1444 output.push_str(",");
1445 output.push_str(&format!("\"objects\": [{}],", {
1446 let vec_string = self.objects.iter().map(|x| x.to_string()).collect::<Vec<_>>();
1447 vec_string.join(", ")
1448 }));
1449 output.push_str("}");
1450 return output;
1451 }
1452}
1453
1454#[derive(Debug, DeJson, Default)]
1456#[nserde(default)]
1457pub struct ApiStorageObjects {
1458 pub objects: Vec<ApiStorageObject>,
1459}
1460
1461impl ToRestString for ApiStorageObjects {
1462 fn to_string(&self) -> String {
1463 let mut output = String::new();
1464
1465
1466 output.push_str("{");
1467
1468 output.push_str(&format!("\"objects\": [{}],", {
1469 let vec_string = self.objects.iter().map(|x| x.to_string()).collect::<Vec<_>>();
1470 vec_string.join(", ")
1471 }));
1472 output.push_str("}");
1473 return output;
1474 }
1475}
1476
1477#[derive(Debug, DeJson, Default)]
1479#[nserde(default)]
1480pub struct ApiTournament {
1481 pub can_enter: bool,
1482 pub category: i32,
1483 pub create_time: String,
1484 pub description: String,
1485 pub duration: i32,
1486 pub end_active: i32,
1487 pub end_time: String,
1488 pub id: String,
1489 pub max_num_score: i32,
1490 pub max_size: i32,
1491 pub metadata: String,
1492 pub next_reset: i32,
1493 pub size: i32,
1494 pub sort_order: i32,
1495 pub start_active: i32,
1496 pub start_time: String,
1497 pub title: String,
1498}
1499
1500impl ToRestString for ApiTournament {
1501 fn to_string(&self) -> String {
1502 let mut output = String::new();
1503
1504
1505 output.push_str("{");
1506
1507 output.push_str(&format!("\"canEnter\": {}", self.can_enter.to_string()));
1508
1509 output.push_str(",");
1510 output.push_str(&format!("\"category\": {}", self.category.to_string()));
1511
1512 output.push_str(",");
1513 output.push_str(&format!("\"createTime\": \"{}\"", self.create_time));
1514
1515 output.push_str(",");
1516 output.push_str(&format!("\"description\": \"{}\"", self.description));
1517
1518 output.push_str(",");
1519 output.push_str(&format!("\"duration\": {}", self.duration.to_string()));
1520
1521 output.push_str(",");
1522 output.push_str(&format!("\"endActive\": {}", self.end_active.to_string()));
1523
1524 output.push_str(",");
1525 output.push_str(&format!("\"endTime\": \"{}\"", self.end_time));
1526
1527 output.push_str(",");
1528 output.push_str(&format!("\"id\": \"{}\"", self.id));
1529
1530 output.push_str(",");
1531 output.push_str(&format!("\"maxNumScore\": {}", self.max_num_score.to_string()));
1532
1533 output.push_str(",");
1534 output.push_str(&format!("\"maxSize\": {}", self.max_size.to_string()));
1535
1536 output.push_str(",");
1537 output.push_str(&format!("\"metadata\": \"{}\"", self.metadata));
1538
1539 output.push_str(",");
1540 output.push_str(&format!("\"nextReset\": {}", self.next_reset.to_string()));
1541
1542 output.push_str(",");
1543 output.push_str(&format!("\"size\": {}", self.size.to_string()));
1544
1545 output.push_str(",");
1546 output.push_str(&format!("\"sortOrder\": {}", self.sort_order.to_string()));
1547
1548 output.push_str(",");
1549 output.push_str(&format!("\"startActive\": {}", self.start_active.to_string()));
1550
1551 output.push_str(",");
1552 output.push_str(&format!("\"startTime\": \"{}\"", self.start_time));
1553
1554 output.push_str(",");
1555 output.push_str(&format!("\"title\": \"{}\"", self.title));
1556 output.push_str("}");
1557 return output;
1558 }
1559}
1560
1561#[derive(Debug, DeJson, Default)]
1563#[nserde(default)]
1564pub struct ApiTournamentList {
1565 pub cursor: String,
1566 pub tournaments: Vec<ApiTournament>,
1567}
1568
1569impl ToRestString for ApiTournamentList {
1570 fn to_string(&self) -> String {
1571 let mut output = String::new();
1572
1573
1574 output.push_str("{");
1575
1576 output.push_str(&format!("\"cursor\": \"{}\"", self.cursor));
1577
1578 output.push_str(",");
1579 output.push_str(&format!("\"tournaments\": [{}],", {
1580 let vec_string = self.tournaments.iter().map(|x| x.to_string()).collect::<Vec<_>>();
1581 vec_string.join(", ")
1582 }));
1583 output.push_str("}");
1584 return output;
1585 }
1586}
1587
1588#[derive(Debug, DeJson, Default)]
1590#[nserde(default)]
1591pub struct ApiTournamentRecordList {
1592 pub next_cursor: String,
1593 pub owner_records: Vec<ApiLeaderboardRecord>,
1594 pub prev_cursor: String,
1595 pub records: Vec<ApiLeaderboardRecord>,
1596}
1597
1598impl ToRestString for ApiTournamentRecordList {
1599 fn to_string(&self) -> String {
1600 let mut output = String::new();
1601
1602
1603 output.push_str("{");
1604
1605 output.push_str(&format!("\"nextCursor\": \"{}\"", self.next_cursor));
1606
1607 output.push_str(",");
1608 output.push_str(&format!("\"ownerRecords\": [{}],", {
1609 let vec_string = self.owner_records.iter().map(|x| x.to_string()).collect::<Vec<_>>();
1610 vec_string.join(", ")
1611 }));
1612
1613 output.push_str(",");
1614 output.push_str(&format!("\"prevCursor\": \"{}\"", self.prev_cursor));
1615
1616 output.push_str(",");
1617 output.push_str(&format!("\"records\": [{}],", {
1618 let vec_string = self.records.iter().map(|x| x.to_string()).collect::<Vec<_>>();
1619 vec_string.join(", ")
1620 }));
1621 output.push_str("}");
1622 return output;
1623 }
1624}
1625
1626#[derive(Debug, DeJson, Default)]
1628#[nserde(default)]
1629pub struct ApiUpdateAccountRequest {
1630 pub avatar_url: String,
1631 pub display_name: String,
1632 pub lang_tag: String,
1633 pub location: String,
1634 pub timezone: String,
1635 pub username: String,
1636}
1637
1638impl ToRestString for ApiUpdateAccountRequest {
1639 fn to_string(&self) -> String {
1640 let mut output = String::new();
1641
1642
1643 output.push_str("{");
1644
1645 output.push_str(&format!("\"avatarUrl\": \"{}\"", self.avatar_url));
1646
1647 output.push_str(",");
1648 output.push_str(&format!("\"displayName\": \"{}\"", self.display_name));
1649
1650 output.push_str(",");
1651 output.push_str(&format!("\"langTag\": \"{}\"", self.lang_tag));
1652
1653 output.push_str(",");
1654 output.push_str(&format!("\"location\": \"{}\"", self.location));
1655
1656 output.push_str(",");
1657 output.push_str(&format!("\"timezone\": \"{}\"", self.timezone));
1658
1659 output.push_str(",");
1660 output.push_str(&format!("\"username\": \"{}\"", self.username));
1661 output.push_str("}");
1662 return output;
1663 }
1664}
1665
1666#[derive(Debug, DeJson, Default)]
1668#[nserde(default)]
1669pub struct ApiUpdateGroupRequest {
1670 pub avatar_url: String,
1671 pub description: String,
1672 pub group_id: String,
1673 pub lang_tag: String,
1674 pub name: String,
1675 pub open: bool,
1676}
1677
1678impl ToRestString for ApiUpdateGroupRequest {
1679 fn to_string(&self) -> String {
1680 let mut output = String::new();
1681
1682
1683 output.push_str("{");
1684
1685 output.push_str(&format!("\"avatarUrl\": \"{}\"", self.avatar_url));
1686
1687 output.push_str(",");
1688 output.push_str(&format!("\"description\": \"{}\"", self.description));
1689
1690 output.push_str(",");
1691 output.push_str(&format!("\"groupId\": \"{}\"", self.group_id));
1692
1693 output.push_str(",");
1694 output.push_str(&format!("\"langTag\": \"{}\"", self.lang_tag));
1695
1696 output.push_str(",");
1697 output.push_str(&format!("\"name\": \"{}\"", self.name));
1698
1699 output.push_str(",");
1700 output.push_str(&format!("\"open\": {}", self.open.to_string()));
1701 output.push_str("}");
1702 return output;
1703 }
1704}
1705
1706#[derive(Debug, DeJson, Default)]
1708#[nserde(default)]
1709pub struct ApiUser {
1710 pub apple_id: String,
1711 pub avatar_url: String,
1712 pub create_time: String,
1713 pub display_name: String,
1714 pub edge_count: i32,
1715 pub facebook_id: String,
1716 pub facebook_instant_game_id: String,
1717 pub gamecenter_id: String,
1718 pub google_id: String,
1719 pub id: String,
1720 pub lang_tag: String,
1721 pub location: String,
1722 pub metadata: String,
1723 pub online: bool,
1724 pub steam_id: String,
1725 pub timezone: String,
1726 pub update_time: String,
1727 pub username: String,
1728}
1729
1730impl ToRestString for ApiUser {
1731 fn to_string(&self) -> String {
1732 let mut output = String::new();
1733
1734
1735 output.push_str("{");
1736
1737 output.push_str(&format!("\"appleId\": \"{}\"", self.apple_id));
1738
1739 output.push_str(",");
1740 output.push_str(&format!("\"avatarUrl\": \"{}\"", self.avatar_url));
1741
1742 output.push_str(",");
1743 output.push_str(&format!("\"createTime\": \"{}\"", self.create_time));
1744
1745 output.push_str(",");
1746 output.push_str(&format!("\"displayName\": \"{}\"", self.display_name));
1747
1748 output.push_str(",");
1749 output.push_str(&format!("\"edgeCount\": {}", self.edge_count.to_string()));
1750
1751 output.push_str(",");
1752 output.push_str(&format!("\"facebookId\": \"{}\"", self.facebook_id));
1753
1754 output.push_str(",");
1755 output.push_str(&format!("\"facebookInstantGameId\": \"{}\"", self.facebook_instant_game_id));
1756
1757 output.push_str(",");
1758 output.push_str(&format!("\"gamecenterId\": \"{}\"", self.gamecenter_id));
1759
1760 output.push_str(",");
1761 output.push_str(&format!("\"googleId\": \"{}\"", self.google_id));
1762
1763 output.push_str(",");
1764 output.push_str(&format!("\"id\": \"{}\"", self.id));
1765
1766 output.push_str(",");
1767 output.push_str(&format!("\"langTag\": \"{}\"", self.lang_tag));
1768
1769 output.push_str(",");
1770 output.push_str(&format!("\"location\": \"{}\"", self.location));
1771
1772 output.push_str(",");
1773 output.push_str(&format!("\"metadata\": \"{}\"", self.metadata));
1774
1775 output.push_str(",");
1776 output.push_str(&format!("\"online\": {}", self.online.to_string()));
1777
1778 output.push_str(",");
1779 output.push_str(&format!("\"steamId\": \"{}\"", self.steam_id));
1780
1781 output.push_str(",");
1782 output.push_str(&format!("\"timezone\": \"{}\"", self.timezone));
1783
1784 output.push_str(",");
1785 output.push_str(&format!("\"updateTime\": \"{}\"", self.update_time));
1786
1787 output.push_str(",");
1788 output.push_str(&format!("\"username\": \"{}\"", self.username));
1789 output.push_str("}");
1790 return output;
1791 }
1792}
1793
1794#[derive(Debug, DeJson, Default)]
1796#[nserde(default)]
1797pub struct ApiUserGroupList {
1798 pub cursor: String,
1799 pub user_groups: Vec<UserGroupListUserGroup>,
1800}
1801
1802impl ToRestString for ApiUserGroupList {
1803 fn to_string(&self) -> String {
1804 let mut output = String::new();
1805
1806
1807 output.push_str("{");
1808
1809 output.push_str(&format!("\"cursor\": \"{}\"", self.cursor));
1810
1811 output.push_str(",");
1812 output.push_str(&format!("\"userGroups\": [{}],", {
1813 let vec_string = self.user_groups.iter().map(|x| x.to_string()).collect::<Vec<_>>();
1814 vec_string.join(", ")
1815 }));
1816 output.push_str("}");
1817 return output;
1818 }
1819}
1820
1821#[derive(Debug, DeJson, Default)]
1823#[nserde(default)]
1824pub struct ApiUsers {
1825 pub users: Vec<ApiUser>,
1826}
1827
1828impl ToRestString for ApiUsers {
1829 fn to_string(&self) -> String {
1830 let mut output = String::new();
1831
1832
1833 output.push_str("{");
1834
1835 output.push_str(&format!("\"users\": [{}],", {
1836 let vec_string = self.users.iter().map(|x| x.to_string()).collect::<Vec<_>>();
1837 vec_string.join(", ")
1838 }));
1839 output.push_str("}");
1840 return output;
1841 }
1842}
1843
1844#[derive(Debug, DeJson, Default)]
1846#[nserde(default)]
1847pub struct ApiWriteStorageObject {
1848 pub collection: String,
1849 pub key: String,
1850 pub permission_read: i32,
1851 pub permission_write: i32,
1852 pub value: String,
1853 pub version: String,
1854}
1855
1856impl ToRestString for ApiWriteStorageObject {
1857 fn to_string(&self) -> String {
1858 let mut output = String::new();
1859
1860
1861 output.push_str("{");
1862
1863 output.push_str(&format!("\"collection\": \"{}\"", self.collection));
1864
1865 output.push_str(",");
1866 output.push_str(&format!("\"key\": \"{}\"", self.key));
1867
1868 output.push_str(",");
1869 output.push_str(&format!("\"permissionRead\": {}", self.permission_read.to_string()));
1870
1871 output.push_str(",");
1872 output.push_str(&format!("\"permissionWrite\": {}", self.permission_write.to_string()));
1873
1874 output.push_str(",");
1875 output.push_str(&format!("\"value\": \"{}\"", self.value));
1876
1877 output.push_str(",");
1878 output.push_str(&format!("\"version\": \"{}\"", self.version));
1879 output.push_str("}");
1880 return output;
1881 }
1882}
1883
1884#[derive(Debug, DeJson, Default)]
1886#[nserde(default)]
1887pub struct ApiWriteStorageObjectsRequest {
1888 pub objects: Vec<ApiWriteStorageObject>,
1889}
1890
1891impl ToRestString for ApiWriteStorageObjectsRequest {
1892 fn to_string(&self) -> String {
1893 let mut output = String::new();
1894
1895
1896 output.push_str("{");
1897
1898 output.push_str(&format!("\"objects\": [{}],", {
1899 let vec_string = self.objects.iter().map(|x| x.to_string()).collect::<Vec<_>>();
1900 vec_string.join(", ")
1901 }));
1902 output.push_str("}");
1903 return output;
1904 }
1905}
1906
1907#[derive(Debug, DeJson, Default)]
1909#[nserde(default)]
1910pub struct ProtobufAny {
1911 pub type_url: String,
1912 pub value: String,
1913}
1914
1915impl ToRestString for ProtobufAny {
1916 fn to_string(&self) -> String {
1917 let mut output = String::new();
1918
1919
1920 output.push_str("{");
1921
1922 output.push_str(&format!("\"typeUrl\": \"{}\"", self.type_url));
1923
1924 output.push_str(",");
1925 output.push_str(&format!("\"value\": \"{}\"", self.value));
1926 output.push_str("}");
1927 return output;
1928 }
1929}
1930
1931#[derive(Debug, DeJson, Default)]
1933#[nserde(default)]
1934pub struct RpcStatus {
1935 pub code: i32,
1936 pub details: Vec<ProtobufAny>,
1937 pub message: String,
1938}
1939
1940impl ToRestString for RpcStatus {
1941 fn to_string(&self) -> String {
1942 let mut output = String::new();
1943
1944
1945 output.push_str("{");
1946
1947 output.push_str(&format!("\"code\": {}", self.code.to_string()));
1948
1949 output.push_str(",");
1950 output.push_str(&format!("\"details\": [{}],", {
1951 let vec_string = self.details.iter().map(|x| x.to_string()).collect::<Vec<_>>();
1952 vec_string.join(", ")
1953 }));
1954
1955 output.push_str(",");
1956 output.push_str(&format!("\"message\": \"{}\"", self.message));
1957 output.push_str("}");
1958 return output;
1959 }
1960}
1961pub fn healthcheck(
1963 bearer_token: &str,
1964) -> RestRequest<()> {
1965 #[allow(unused_mut)]
1966 let mut urlpath = "/healthcheck".to_string();
1967
1968 #[allow(unused_mut)]
1969 let mut query_params = String::new();
1970
1971 let authentication =
1972 Authentication::Bearer {
1973 token: bearer_token.to_owned()
1974 };
1975
1976 let body_json = String::new();
1977
1978 let method = Method::Get;
1979
1980 RestRequest {
1981 authentication,
1982 urlpath,
1983 query_params,
1984 body: body_json,
1985 method,
1986 _marker: std::marker::PhantomData
1987 }
1988}
1989pub fn get_account(
1991 bearer_token: &str,
1992) -> RestRequest<ApiAccount> {
1993 #[allow(unused_mut)]
1994 let mut urlpath = "/v2/account".to_string();
1995
1996 #[allow(unused_mut)]
1997 let mut query_params = String::new();
1998
1999 let authentication =
2000 Authentication::Bearer {
2001 token: bearer_token.to_owned()
2002 };
2003
2004 let body_json = String::new();
2005
2006 let method = Method::Get;
2007
2008 RestRequest {
2009 authentication,
2010 urlpath,
2011 query_params,
2012 body: body_json,
2013 method,
2014 _marker: std::marker::PhantomData
2015 }
2016}
2017pub fn update_account(
2019 bearer_token: &str,
2020 body: ApiUpdateAccountRequest,
2021) -> RestRequest<()> {
2022 #[allow(unused_mut)]
2023 let mut urlpath = "/v2/account".to_string();
2024
2025 #[allow(unused_mut)]
2026 let mut query_params = String::new();
2027
2028 let authentication =
2029 Authentication::Bearer {
2030 token: bearer_token.to_owned()
2031 };
2032 let body_json = body.to_string();
2033
2034
2035 let method = Method::Put;
2036
2037 RestRequest {
2038 authentication,
2039 urlpath,
2040 query_params,
2041 body: body_json,
2042 method,
2043 _marker: std::marker::PhantomData
2044 }
2045}
2046pub fn authenticate_apple(
2048 basic_auth_username: &str,
2049 basic_auth_password: &str,
2050 body: ApiAccountApple,
2051 create: Option<bool>,
2052 username: Option<&str>,
2053) -> RestRequest<ApiSession> {
2054 #[allow(unused_mut)]
2055 let mut urlpath = "/v2/account/authenticate/apple".to_string();
2056
2057 #[allow(unused_mut)]
2058 let mut query_params = String::new();
2059if let Some(param) = create {
2060 query_params.push_str(&format!("create={:?}&", param));
2061}
2062if let Some(param) = username {
2063 query_params.push_str(&format!("username={}&", param));
2064}
2065
2066 let authentication =
2067Authentication::Basic {
2068 username: basic_auth_username.to_owned(),
2069 password: basic_auth_password.to_owned()
2070 };
2071 let body_json = body.to_string();
2072
2073
2074 let method = Method::Post;
2075
2076 RestRequest {
2077 authentication,
2078 urlpath,
2079 query_params,
2080 body: body_json,
2081 method,
2082 _marker: std::marker::PhantomData
2083 }
2084}
2085pub fn authenticate_custom(
2087 basic_auth_username: &str,
2088 basic_auth_password: &str,
2089 body: ApiAccountCustom,
2090 create: Option<bool>,
2091 username: Option<&str>,
2092) -> RestRequest<ApiSession> {
2093 #[allow(unused_mut)]
2094 let mut urlpath = "/v2/account/authenticate/custom".to_string();
2095
2096 #[allow(unused_mut)]
2097 let mut query_params = String::new();
2098if let Some(param) = create {
2099 query_params.push_str(&format!("create={:?}&", param));
2100}
2101if let Some(param) = username {
2102 query_params.push_str(&format!("username={}&", param));
2103}
2104
2105 let authentication =
2106Authentication::Basic {
2107 username: basic_auth_username.to_owned(),
2108 password: basic_auth_password.to_owned()
2109 };
2110 let body_json = body.to_string();
2111
2112
2113 let method = Method::Post;
2114
2115 RestRequest {
2116 authentication,
2117 urlpath,
2118 query_params,
2119 body: body_json,
2120 method,
2121 _marker: std::marker::PhantomData
2122 }
2123}
2124pub fn authenticate_device(
2126 basic_auth_username: &str,
2127 basic_auth_password: &str,
2128 body: ApiAccountDevice,
2129 create: Option<bool>,
2130 username: Option<&str>,
2131) -> RestRequest<ApiSession> {
2132 #[allow(unused_mut)]
2133 let mut urlpath = "/v2/account/authenticate/device".to_string();
2134
2135 #[allow(unused_mut)]
2136 let mut query_params = String::new();
2137if let Some(param) = create {
2138 query_params.push_str(&format!("create={:?}&", param));
2139}
2140if let Some(param) = username {
2141 query_params.push_str(&format!("username={}&", param));
2142}
2143
2144 let authentication =
2145Authentication::Basic {
2146 username: basic_auth_username.to_owned(),
2147 password: basic_auth_password.to_owned()
2148 };
2149 let body_json = body.to_string();
2150
2151
2152 let method = Method::Post;
2153
2154 RestRequest {
2155 authentication,
2156 urlpath,
2157 query_params,
2158 body: body_json,
2159 method,
2160 _marker: std::marker::PhantomData
2161 }
2162}
2163pub fn authenticate_email(
2165 basic_auth_username: &str,
2166 basic_auth_password: &str,
2167 body: ApiAccountEmail,
2168 create: Option<bool>,
2169 username: Option<&str>,
2170) -> RestRequest<ApiSession> {
2171 #[allow(unused_mut)]
2172 let mut urlpath = "/v2/account/authenticate/email".to_string();
2173
2174 #[allow(unused_mut)]
2175 let mut query_params = String::new();
2176if let Some(param) = create {
2177 query_params.push_str(&format!("create={:?}&", param));
2178}
2179if let Some(param) = username {
2180 query_params.push_str(&format!("username={}&", param));
2181}
2182
2183 let authentication =
2184Authentication::Basic {
2185 username: basic_auth_username.to_owned(),
2186 password: basic_auth_password.to_owned()
2187 };
2188 let body_json = body.to_string();
2189
2190
2191 let method = Method::Post;
2192
2193 RestRequest {
2194 authentication,
2195 urlpath,
2196 query_params,
2197 body: body_json,
2198 method,
2199 _marker: std::marker::PhantomData
2200 }
2201}
2202pub fn authenticate_facebook(
2204 basic_auth_username: &str,
2205 basic_auth_password: &str,
2206 body: ApiAccountFacebook,
2207 create: Option<bool>,
2208 username: Option<&str>,
2209 sync: Option<bool>,
2210) -> RestRequest<ApiSession> {
2211 #[allow(unused_mut)]
2212 let mut urlpath = "/v2/account/authenticate/facebook".to_string();
2213
2214 #[allow(unused_mut)]
2215 let mut query_params = String::new();
2216if let Some(param) = create {
2217 query_params.push_str(&format!("create={:?}&", param));
2218}
2219if let Some(param) = username {
2220 query_params.push_str(&format!("username={}&", param));
2221}
2222if let Some(param) = sync {
2223 query_params.push_str(&format!("sync={:?}&", param));
2224}
2225
2226 let authentication =
2227Authentication::Basic {
2228 username: basic_auth_username.to_owned(),
2229 password: basic_auth_password.to_owned()
2230 };
2231 let body_json = body.to_string();
2232
2233
2234 let method = Method::Post;
2235
2236 RestRequest {
2237 authentication,
2238 urlpath,
2239 query_params,
2240 body: body_json,
2241 method,
2242 _marker: std::marker::PhantomData
2243 }
2244}
2245pub fn authenticate_facebook_instant_game(
2247 basic_auth_username: &str,
2248 basic_auth_password: &str,
2249 body: ApiAccountFacebookInstantGame,
2250 create: Option<bool>,
2251 username: Option<&str>,
2252) -> RestRequest<ApiSession> {
2253 #[allow(unused_mut)]
2254 let mut urlpath = "/v2/account/authenticate/facebookinstantgame".to_string();
2255
2256 #[allow(unused_mut)]
2257 let mut query_params = String::new();
2258if let Some(param) = create {
2259 query_params.push_str(&format!("create={:?}&", param));
2260}
2261if let Some(param) = username {
2262 query_params.push_str(&format!("username={}&", param));
2263}
2264
2265 let authentication =
2266Authentication::Basic {
2267 username: basic_auth_username.to_owned(),
2268 password: basic_auth_password.to_owned()
2269 };
2270 let body_json = body.to_string();
2271
2272
2273 let method = Method::Post;
2274
2275 RestRequest {
2276 authentication,
2277 urlpath,
2278 query_params,
2279 body: body_json,
2280 method,
2281 _marker: std::marker::PhantomData
2282 }
2283}
2284pub fn authenticate_game_center(
2286 basic_auth_username: &str,
2287 basic_auth_password: &str,
2288 body: ApiAccountGameCenter,
2289 create: Option<bool>,
2290 username: Option<&str>,
2291) -> RestRequest<ApiSession> {
2292 #[allow(unused_mut)]
2293 let mut urlpath = "/v2/account/authenticate/gamecenter".to_string();
2294
2295 #[allow(unused_mut)]
2296 let mut query_params = String::new();
2297if let Some(param) = create {
2298 query_params.push_str(&format!("create={:?}&", param));
2299}
2300if let Some(param) = username {
2301 query_params.push_str(&format!("username={}&", param));
2302}
2303
2304 let authentication =
2305Authentication::Basic {
2306 username: basic_auth_username.to_owned(),
2307 password: basic_auth_password.to_owned()
2308 };
2309 let body_json = body.to_string();
2310
2311
2312 let method = Method::Post;
2313
2314 RestRequest {
2315 authentication,
2316 urlpath,
2317 query_params,
2318 body: body_json,
2319 method,
2320 _marker: std::marker::PhantomData
2321 }
2322}
2323pub fn authenticate_google(
2325 basic_auth_username: &str,
2326 basic_auth_password: &str,
2327 body: ApiAccountGoogle,
2328 create: Option<bool>,
2329 username: Option<&str>,
2330) -> RestRequest<ApiSession> {
2331 #[allow(unused_mut)]
2332 let mut urlpath = "/v2/account/authenticate/google".to_string();
2333
2334 #[allow(unused_mut)]
2335 let mut query_params = String::new();
2336if let Some(param) = create {
2337 query_params.push_str(&format!("create={:?}&", param));
2338}
2339if let Some(param) = username {
2340 query_params.push_str(&format!("username={}&", param));
2341}
2342
2343 let authentication =
2344Authentication::Basic {
2345 username: basic_auth_username.to_owned(),
2346 password: basic_auth_password.to_owned()
2347 };
2348 let body_json = body.to_string();
2349
2350
2351 let method = Method::Post;
2352
2353 RestRequest {
2354 authentication,
2355 urlpath,
2356 query_params,
2357 body: body_json,
2358 method,
2359 _marker: std::marker::PhantomData
2360 }
2361}
2362pub fn authenticate_steam(
2364 basic_auth_username: &str,
2365 basic_auth_password: &str,
2366 body: ApiAccountSteam,
2367 create: Option<bool>,
2368 username: Option<&str>,
2369 sync: Option<bool>,
2370) -> RestRequest<ApiSession> {
2371 #[allow(unused_mut)]
2372 let mut urlpath = "/v2/account/authenticate/steam".to_string();
2373
2374 #[allow(unused_mut)]
2375 let mut query_params = String::new();
2376if let Some(param) = create {
2377 query_params.push_str(&format!("create={:?}&", param));
2378}
2379if let Some(param) = username {
2380 query_params.push_str(&format!("username={}&", param));
2381}
2382if let Some(param) = sync {
2383 query_params.push_str(&format!("sync={:?}&", param));
2384}
2385
2386 let authentication =
2387Authentication::Basic {
2388 username: basic_auth_username.to_owned(),
2389 password: basic_auth_password.to_owned()
2390 };
2391 let body_json = body.to_string();
2392
2393
2394 let method = Method::Post;
2395
2396 RestRequest {
2397 authentication,
2398 urlpath,
2399 query_params,
2400 body: body_json,
2401 method,
2402 _marker: std::marker::PhantomData
2403 }
2404}
2405pub fn link_apple(
2407 bearer_token: &str,
2408 body: ApiAccountApple,
2409) -> RestRequest<()> {
2410 #[allow(unused_mut)]
2411 let mut urlpath = "/v2/account/link/apple".to_string();
2412
2413 #[allow(unused_mut)]
2414 let mut query_params = String::new();
2415
2416 let authentication =
2417 Authentication::Bearer {
2418 token: bearer_token.to_owned()
2419 };
2420 let body_json = body.to_string();
2421
2422
2423 let method = Method::Post;
2424
2425 RestRequest {
2426 authentication,
2427 urlpath,
2428 query_params,
2429 body: body_json,
2430 method,
2431 _marker: std::marker::PhantomData
2432 }
2433}
2434pub fn link_custom(
2436 bearer_token: &str,
2437 body: ApiAccountCustom,
2438) -> RestRequest<()> {
2439 #[allow(unused_mut)]
2440 let mut urlpath = "/v2/account/link/custom".to_string();
2441
2442 #[allow(unused_mut)]
2443 let mut query_params = String::new();
2444
2445 let authentication =
2446 Authentication::Bearer {
2447 token: bearer_token.to_owned()
2448 };
2449 let body_json = body.to_string();
2450
2451
2452 let method = Method::Post;
2453
2454 RestRequest {
2455 authentication,
2456 urlpath,
2457 query_params,
2458 body: body_json,
2459 method,
2460 _marker: std::marker::PhantomData
2461 }
2462}
2463pub fn link_device(
2465 bearer_token: &str,
2466 body: ApiAccountDevice,
2467) -> RestRequest<()> {
2468 #[allow(unused_mut)]
2469 let mut urlpath = "/v2/account/link/device".to_string();
2470
2471 #[allow(unused_mut)]
2472 let mut query_params = String::new();
2473
2474 let authentication =
2475 Authentication::Bearer {
2476 token: bearer_token.to_owned()
2477 };
2478 let body_json = body.to_string();
2479
2480
2481 let method = Method::Post;
2482
2483 RestRequest {
2484 authentication,
2485 urlpath,
2486 query_params,
2487 body: body_json,
2488 method,
2489 _marker: std::marker::PhantomData
2490 }
2491}
2492pub fn link_email(
2494 bearer_token: &str,
2495 body: ApiAccountEmail,
2496) -> RestRequest<()> {
2497 #[allow(unused_mut)]
2498 let mut urlpath = "/v2/account/link/email".to_string();
2499
2500 #[allow(unused_mut)]
2501 let mut query_params = String::new();
2502
2503 let authentication =
2504 Authentication::Bearer {
2505 token: bearer_token.to_owned()
2506 };
2507 let body_json = body.to_string();
2508
2509
2510 let method = Method::Post;
2511
2512 RestRequest {
2513 authentication,
2514 urlpath,
2515 query_params,
2516 body: body_json,
2517 method,
2518 _marker: std::marker::PhantomData
2519 }
2520}
2521pub fn link_facebook(
2523 bearer_token: &str,
2524 body: ApiAccountFacebook,
2525 sync: Option<bool>,
2526) -> RestRequest<()> {
2527 #[allow(unused_mut)]
2528 let mut urlpath = "/v2/account/link/facebook".to_string();
2529
2530 #[allow(unused_mut)]
2531 let mut query_params = String::new();
2532if let Some(param) = sync {
2533 query_params.push_str(&format!("sync={:?}&", param));
2534}
2535
2536 let authentication =
2537 Authentication::Bearer {
2538 token: bearer_token.to_owned()
2539 };
2540 let body_json = body.to_string();
2541
2542
2543 let method = Method::Post;
2544
2545 RestRequest {
2546 authentication,
2547 urlpath,
2548 query_params,
2549 body: body_json,
2550 method,
2551 _marker: std::marker::PhantomData
2552 }
2553}
2554pub fn link_facebook_instant_game(
2556 bearer_token: &str,
2557 body: ApiAccountFacebookInstantGame,
2558) -> RestRequest<()> {
2559 #[allow(unused_mut)]
2560 let mut urlpath = "/v2/account/link/facebookinstantgame".to_string();
2561
2562 #[allow(unused_mut)]
2563 let mut query_params = String::new();
2564
2565 let authentication =
2566 Authentication::Bearer {
2567 token: bearer_token.to_owned()
2568 };
2569 let body_json = body.to_string();
2570
2571
2572 let method = Method::Post;
2573
2574 RestRequest {
2575 authentication,
2576 urlpath,
2577 query_params,
2578 body: body_json,
2579 method,
2580 _marker: std::marker::PhantomData
2581 }
2582}
2583pub fn link_game_center(
2585 bearer_token: &str,
2586 body: ApiAccountGameCenter,
2587) -> RestRequest<()> {
2588 #[allow(unused_mut)]
2589 let mut urlpath = "/v2/account/link/gamecenter".to_string();
2590
2591 #[allow(unused_mut)]
2592 let mut query_params = String::new();
2593
2594 let authentication =
2595 Authentication::Bearer {
2596 token: bearer_token.to_owned()
2597 };
2598 let body_json = body.to_string();
2599
2600
2601 let method = Method::Post;
2602
2603 RestRequest {
2604 authentication,
2605 urlpath,
2606 query_params,
2607 body: body_json,
2608 method,
2609 _marker: std::marker::PhantomData
2610 }
2611}
2612pub fn link_google(
2614 bearer_token: &str,
2615 body: ApiAccountGoogle,
2616) -> RestRequest<()> {
2617 #[allow(unused_mut)]
2618 let mut urlpath = "/v2/account/link/google".to_string();
2619
2620 #[allow(unused_mut)]
2621 let mut query_params = String::new();
2622
2623 let authentication =
2624 Authentication::Bearer {
2625 token: bearer_token.to_owned()
2626 };
2627 let body_json = body.to_string();
2628
2629
2630 let method = Method::Post;
2631
2632 RestRequest {
2633 authentication,
2634 urlpath,
2635 query_params,
2636 body: body_json,
2637 method,
2638 _marker: std::marker::PhantomData
2639 }
2640}
2641pub fn link_steam(
2643 bearer_token: &str,
2644 body: ApiLinkSteamRequest,
2645) -> RestRequest<()> {
2646 #[allow(unused_mut)]
2647 let mut urlpath = "/v2/account/link/steam".to_string();
2648
2649 #[allow(unused_mut)]
2650 let mut query_params = String::new();
2651
2652 let authentication =
2653 Authentication::Bearer {
2654 token: bearer_token.to_owned()
2655 };
2656 let body_json = body.to_string();
2657
2658
2659 let method = Method::Post;
2660
2661 RestRequest {
2662 authentication,
2663 urlpath,
2664 query_params,
2665 body: body_json,
2666 method,
2667 _marker: std::marker::PhantomData
2668 }
2669}
2670pub fn session_refresh(
2672 basic_auth_username: &str,
2673 basic_auth_password: &str,
2674 body: ApiSessionRefreshRequest,
2675) -> RestRequest<ApiSession> {
2676 #[allow(unused_mut)]
2677 let mut urlpath = "/v2/account/session/refresh".to_string();
2678
2679 #[allow(unused_mut)]
2680 let mut query_params = String::new();
2681
2682 let authentication =
2683Authentication::Basic {
2684 username: basic_auth_username.to_owned(),
2685 password: basic_auth_password.to_owned()
2686 };
2687 let body_json = body.to_string();
2688
2689
2690 let method = Method::Post;
2691
2692 RestRequest {
2693 authentication,
2694 urlpath,
2695 query_params,
2696 body: body_json,
2697 method,
2698 _marker: std::marker::PhantomData
2699 }
2700}
2701pub fn unlink_apple(
2703 bearer_token: &str,
2704 body: ApiAccountApple,
2705) -> RestRequest<()> {
2706 #[allow(unused_mut)]
2707 let mut urlpath = "/v2/account/unlink/apple".to_string();
2708
2709 #[allow(unused_mut)]
2710 let mut query_params = String::new();
2711
2712 let authentication =
2713 Authentication::Bearer {
2714 token: bearer_token.to_owned()
2715 };
2716 let body_json = body.to_string();
2717
2718
2719 let method = Method::Post;
2720
2721 RestRequest {
2722 authentication,
2723 urlpath,
2724 query_params,
2725 body: body_json,
2726 method,
2727 _marker: std::marker::PhantomData
2728 }
2729}
2730pub fn unlink_custom(
2732 bearer_token: &str,
2733 body: ApiAccountCustom,
2734) -> RestRequest<()> {
2735 #[allow(unused_mut)]
2736 let mut urlpath = "/v2/account/unlink/custom".to_string();
2737
2738 #[allow(unused_mut)]
2739 let mut query_params = String::new();
2740
2741 let authentication =
2742 Authentication::Bearer {
2743 token: bearer_token.to_owned()
2744 };
2745 let body_json = body.to_string();
2746
2747
2748 let method = Method::Post;
2749
2750 RestRequest {
2751 authentication,
2752 urlpath,
2753 query_params,
2754 body: body_json,
2755 method,
2756 _marker: std::marker::PhantomData
2757 }
2758}
2759pub fn unlink_device(
2761 bearer_token: &str,
2762 body: ApiAccountDevice,
2763) -> RestRequest<()> {
2764 #[allow(unused_mut)]
2765 let mut urlpath = "/v2/account/unlink/device".to_string();
2766
2767 #[allow(unused_mut)]
2768 let mut query_params = String::new();
2769
2770 let authentication =
2771 Authentication::Bearer {
2772 token: bearer_token.to_owned()
2773 };
2774 let body_json = body.to_string();
2775
2776
2777 let method = Method::Post;
2778
2779 RestRequest {
2780 authentication,
2781 urlpath,
2782 query_params,
2783 body: body_json,
2784 method,
2785 _marker: std::marker::PhantomData
2786 }
2787}
2788pub fn unlink_email(
2790 bearer_token: &str,
2791 body: ApiAccountEmail,
2792) -> RestRequest<()> {
2793 #[allow(unused_mut)]
2794 let mut urlpath = "/v2/account/unlink/email".to_string();
2795
2796 #[allow(unused_mut)]
2797 let mut query_params = String::new();
2798
2799 let authentication =
2800 Authentication::Bearer {
2801 token: bearer_token.to_owned()
2802 };
2803 let body_json = body.to_string();
2804
2805
2806 let method = Method::Post;
2807
2808 RestRequest {
2809 authentication,
2810 urlpath,
2811 query_params,
2812 body: body_json,
2813 method,
2814 _marker: std::marker::PhantomData
2815 }
2816}
2817pub fn unlink_facebook(
2819 bearer_token: &str,
2820 body: ApiAccountFacebook,
2821) -> RestRequest<()> {
2822 #[allow(unused_mut)]
2823 let mut urlpath = "/v2/account/unlink/facebook".to_string();
2824
2825 #[allow(unused_mut)]
2826 let mut query_params = String::new();
2827
2828 let authentication =
2829 Authentication::Bearer {
2830 token: bearer_token.to_owned()
2831 };
2832 let body_json = body.to_string();
2833
2834
2835 let method = Method::Post;
2836
2837 RestRequest {
2838 authentication,
2839 urlpath,
2840 query_params,
2841 body: body_json,
2842 method,
2843 _marker: std::marker::PhantomData
2844 }
2845}
2846pub fn unlink_facebook_instant_game(
2848 bearer_token: &str,
2849 body: ApiAccountFacebookInstantGame,
2850) -> RestRequest<()> {
2851 #[allow(unused_mut)]
2852 let mut urlpath = "/v2/account/unlink/facebookinstantgame".to_string();
2853
2854 #[allow(unused_mut)]
2855 let mut query_params = String::new();
2856
2857 let authentication =
2858 Authentication::Bearer {
2859 token: bearer_token.to_owned()
2860 };
2861 let body_json = body.to_string();
2862
2863
2864 let method = Method::Post;
2865
2866 RestRequest {
2867 authentication,
2868 urlpath,
2869 query_params,
2870 body: body_json,
2871 method,
2872 _marker: std::marker::PhantomData
2873 }
2874}
2875pub fn unlink_game_center(
2877 bearer_token: &str,
2878 body: ApiAccountGameCenter,
2879) -> RestRequest<()> {
2880 #[allow(unused_mut)]
2881 let mut urlpath = "/v2/account/unlink/gamecenter".to_string();
2882
2883 #[allow(unused_mut)]
2884 let mut query_params = String::new();
2885
2886 let authentication =
2887 Authentication::Bearer {
2888 token: bearer_token.to_owned()
2889 };
2890 let body_json = body.to_string();
2891
2892
2893 let method = Method::Post;
2894
2895 RestRequest {
2896 authentication,
2897 urlpath,
2898 query_params,
2899 body: body_json,
2900 method,
2901 _marker: std::marker::PhantomData
2902 }
2903}
2904pub fn unlink_google(
2906 bearer_token: &str,
2907 body: ApiAccountGoogle,
2908) -> RestRequest<()> {
2909 #[allow(unused_mut)]
2910 let mut urlpath = "/v2/account/unlink/google".to_string();
2911
2912 #[allow(unused_mut)]
2913 let mut query_params = String::new();
2914
2915 let authentication =
2916 Authentication::Bearer {
2917 token: bearer_token.to_owned()
2918 };
2919 let body_json = body.to_string();
2920
2921
2922 let method = Method::Post;
2923
2924 RestRequest {
2925 authentication,
2926 urlpath,
2927 query_params,
2928 body: body_json,
2929 method,
2930 _marker: std::marker::PhantomData
2931 }
2932}
2933pub fn unlink_steam(
2935 bearer_token: &str,
2936 body: ApiAccountSteam,
2937) -> RestRequest<()> {
2938 #[allow(unused_mut)]
2939 let mut urlpath = "/v2/account/unlink/steam".to_string();
2940
2941 #[allow(unused_mut)]
2942 let mut query_params = String::new();
2943
2944 let authentication =
2945 Authentication::Bearer {
2946 token: bearer_token.to_owned()
2947 };
2948 let body_json = body.to_string();
2949
2950
2951 let method = Method::Post;
2952
2953 RestRequest {
2954 authentication,
2955 urlpath,
2956 query_params,
2957 body: body_json,
2958 method,
2959 _marker: std::marker::PhantomData
2960 }
2961}
2962pub fn list_channel_messages(
2964 bearer_token: &str,
2965 channel_id: &str,
2966 limit: Option<i32>,
2967 forward: Option<bool>,
2968 cursor: Option<&str>,
2969) -> RestRequest<ApiChannelMessageList> {
2970 #[allow(unused_mut)]
2971 let mut urlpath = "/v2/channel/{channelId}".to_string();
2972 urlpath = urlpath.replace("{channelId}", channel_id);
2973
2974 #[allow(unused_mut)]
2975 let mut query_params = String::new();
2976if let Some(param) = limit {
2977 query_params.push_str(&format!("limit={}&", param));
2978}
2979if let Some(param) = forward {
2980 query_params.push_str(&format!("forward={:?}&", param));
2981}
2982if let Some(param) = cursor {
2983 query_params.push_str(&format!("cursor={}&", param));
2984}
2985
2986 let authentication =
2987 Authentication::Bearer {
2988 token: bearer_token.to_owned()
2989 };
2990
2991 let body_json = String::new();
2992
2993 let method = Method::Get;
2994
2995 RestRequest {
2996 authentication,
2997 urlpath,
2998 query_params,
2999 body: body_json,
3000 method,
3001 _marker: std::marker::PhantomData
3002 }
3003}
3004pub fn event(
3006 bearer_token: &str,
3007 body: ApiEvent,
3008) -> RestRequest<()> {
3009 #[allow(unused_mut)]
3010 let mut urlpath = "/v2/event".to_string();
3011
3012 #[allow(unused_mut)]
3013 let mut query_params = String::new();
3014
3015 let authentication =
3016 Authentication::Bearer {
3017 token: bearer_token.to_owned()
3018 };
3019 let body_json = body.to_string();
3020
3021
3022 let method = Method::Post;
3023
3024 RestRequest {
3025 authentication,
3026 urlpath,
3027 query_params,
3028 body: body_json,
3029 method,
3030 _marker: std::marker::PhantomData
3031 }
3032}
3033pub fn delete_friends(
3035 bearer_token: &str,
3036 ids: &[String],
3037 usernames: &[String],
3038) -> RestRequest<()> {
3039 #[allow(unused_mut)]
3040 let mut urlpath = "/v2/friend".to_string();
3041
3042 #[allow(unused_mut)]
3043 let mut query_params = String::new();
3044for elem in ids
3045{
3046 query_params.push_str(&format!("ids={:?}&", elem));
3047}
3048for elem in usernames
3049{
3050 query_params.push_str(&format!("usernames={:?}&", elem));
3051}
3052
3053 let authentication =
3054 Authentication::Bearer {
3055 token: bearer_token.to_owned()
3056 };
3057
3058 let body_json = String::new();
3059
3060 let method = Method::Delete;
3061
3062 RestRequest {
3063 authentication,
3064 urlpath,
3065 query_params,
3066 body: body_json,
3067 method,
3068 _marker: std::marker::PhantomData
3069 }
3070}
3071pub fn list_friends(
3073 bearer_token: &str,
3074 limit: Option<i32>,
3075 state: Option<i32>,
3076 cursor: Option<&str>,
3077) -> RestRequest<ApiFriendList> {
3078 #[allow(unused_mut)]
3079 let mut urlpath = "/v2/friend".to_string();
3080
3081 #[allow(unused_mut)]
3082 let mut query_params = String::new();
3083if let Some(param) = limit {
3084 query_params.push_str(&format!("limit={}&", param));
3085}
3086if let Some(param) = state {
3087 query_params.push_str(&format!("state={}&", param));
3088}
3089if let Some(param) = cursor {
3090 query_params.push_str(&format!("cursor={}&", param));
3091}
3092
3093 let authentication =
3094 Authentication::Bearer {
3095 token: bearer_token.to_owned()
3096 };
3097
3098 let body_json = String::new();
3099
3100 let method = Method::Get;
3101
3102 RestRequest {
3103 authentication,
3104 urlpath,
3105 query_params,
3106 body: body_json,
3107 method,
3108 _marker: std::marker::PhantomData
3109 }
3110}
3111pub fn add_friends(
3113 bearer_token: &str,
3114 ids: &[String],
3115 usernames: &[String],
3116) -> RestRequest<()> {
3117 #[allow(unused_mut)]
3118 let mut urlpath = "/v2/friend".to_string();
3119
3120 #[allow(unused_mut)]
3121 let mut query_params = String::new();
3122for elem in ids
3123{
3124 query_params.push_str(&format!("ids={:?}&", elem));
3125}
3126for elem in usernames
3127{
3128 query_params.push_str(&format!("usernames={:?}&", elem));
3129}
3130
3131 let authentication =
3132 Authentication::Bearer {
3133 token: bearer_token.to_owned()
3134 };
3135
3136 let body_json = String::new();
3137
3138 let method = Method::Post;
3139
3140 RestRequest {
3141 authentication,
3142 urlpath,
3143 query_params,
3144 body: body_json,
3145 method,
3146 _marker: std::marker::PhantomData
3147 }
3148}
3149pub fn block_friends(
3151 bearer_token: &str,
3152 ids: &[String],
3153 usernames: &[String],
3154) -> RestRequest<()> {
3155 #[allow(unused_mut)]
3156 let mut urlpath = "/v2/friend/block".to_string();
3157
3158 #[allow(unused_mut)]
3159 let mut query_params = String::new();
3160for elem in ids
3161{
3162 query_params.push_str(&format!("ids={:?}&", elem));
3163}
3164for elem in usernames
3165{
3166 query_params.push_str(&format!("usernames={:?}&", elem));
3167}
3168
3169 let authentication =
3170 Authentication::Bearer {
3171 token: bearer_token.to_owned()
3172 };
3173
3174 let body_json = String::new();
3175
3176 let method = Method::Post;
3177
3178 RestRequest {
3179 authentication,
3180 urlpath,
3181 query_params,
3182 body: body_json,
3183 method,
3184 _marker: std::marker::PhantomData
3185 }
3186}
3187pub fn import_facebook_friends(
3189 bearer_token: &str,
3190 body: ApiAccountFacebook,
3191 reset: Option<bool>,
3192) -> RestRequest<()> {
3193 #[allow(unused_mut)]
3194 let mut urlpath = "/v2/friend/facebook".to_string();
3195
3196 #[allow(unused_mut)]
3197 let mut query_params = String::new();
3198if let Some(param) = reset {
3199 query_params.push_str(&format!("reset={:?}&", param));
3200}
3201
3202 let authentication =
3203 Authentication::Bearer {
3204 token: bearer_token.to_owned()
3205 };
3206 let body_json = body.to_string();
3207
3208
3209 let method = Method::Post;
3210
3211 RestRequest {
3212 authentication,
3213 urlpath,
3214 query_params,
3215 body: body_json,
3216 method,
3217 _marker: std::marker::PhantomData
3218 }
3219}
3220pub fn import_steam_friends(
3222 bearer_token: &str,
3223 body: ApiAccountSteam,
3224 reset: Option<bool>,
3225) -> RestRequest<()> {
3226 #[allow(unused_mut)]
3227 let mut urlpath = "/v2/friend/steam".to_string();
3228
3229 #[allow(unused_mut)]
3230 let mut query_params = String::new();
3231if let Some(param) = reset {
3232 query_params.push_str(&format!("reset={:?}&", param));
3233}
3234
3235 let authentication =
3236 Authentication::Bearer {
3237 token: bearer_token.to_owned()
3238 };
3239 let body_json = body.to_string();
3240
3241
3242 let method = Method::Post;
3243
3244 RestRequest {
3245 authentication,
3246 urlpath,
3247 query_params,
3248 body: body_json,
3249 method,
3250 _marker: std::marker::PhantomData
3251 }
3252}
3253pub fn list_groups(
3255 bearer_token: &str,
3256 name: Option<&str>,
3257 cursor: Option<&str>,
3258 limit: Option<i32>,
3259) -> RestRequest<ApiGroupList> {
3260 #[allow(unused_mut)]
3261 let mut urlpath = "/v2/group".to_string();
3262
3263 #[allow(unused_mut)]
3264 let mut query_params = String::new();
3265if let Some(param) = name {
3266 query_params.push_str(&format!("name={}&", param));
3267}
3268if let Some(param) = cursor {
3269 query_params.push_str(&format!("cursor={}&", param));
3270}
3271if let Some(param) = limit {
3272 query_params.push_str(&format!("limit={}&", param));
3273}
3274
3275 let authentication =
3276 Authentication::Bearer {
3277 token: bearer_token.to_owned()
3278 };
3279
3280 let body_json = String::new();
3281
3282 let method = Method::Get;
3283
3284 RestRequest {
3285 authentication,
3286 urlpath,
3287 query_params,
3288 body: body_json,
3289 method,
3290 _marker: std::marker::PhantomData
3291 }
3292}
3293pub fn create_group(
3295 bearer_token: &str,
3296 body: ApiCreateGroupRequest,
3297) -> RestRequest<ApiGroup> {
3298 #[allow(unused_mut)]
3299 let mut urlpath = "/v2/group".to_string();
3300
3301 #[allow(unused_mut)]
3302 let mut query_params = String::new();
3303
3304 let authentication =
3305 Authentication::Bearer {
3306 token: bearer_token.to_owned()
3307 };
3308 let body_json = body.to_string();
3309
3310
3311 let method = Method::Post;
3312
3313 RestRequest {
3314 authentication,
3315 urlpath,
3316 query_params,
3317 body: body_json,
3318 method,
3319 _marker: std::marker::PhantomData
3320 }
3321}
3322pub fn delete_group(
3324 bearer_token: &str,
3325 group_id: &str,
3326) -> RestRequest<()> {
3327 #[allow(unused_mut)]
3328 let mut urlpath = "/v2/group/{groupId}".to_string();
3329 urlpath = urlpath.replace("{groupId}", group_id);
3330
3331 #[allow(unused_mut)]
3332 let mut query_params = String::new();
3333
3334 let authentication =
3335 Authentication::Bearer {
3336 token: bearer_token.to_owned()
3337 };
3338
3339 let body_json = String::new();
3340
3341 let method = Method::Delete;
3342
3343 RestRequest {
3344 authentication,
3345 urlpath,
3346 query_params,
3347 body: body_json,
3348 method,
3349 _marker: std::marker::PhantomData
3350 }
3351}
3352pub fn update_group(
3354 bearer_token: &str,
3355 group_id: &str,
3356 body: ApiUpdateGroupRequest,
3357) -> RestRequest<()> {
3358 #[allow(unused_mut)]
3359 let mut urlpath = "/v2/group/{groupId}".to_string();
3360 urlpath = urlpath.replace("{groupId}", group_id);
3361
3362 #[allow(unused_mut)]
3363 let mut query_params = String::new();
3364
3365 let authentication =
3366 Authentication::Bearer {
3367 token: bearer_token.to_owned()
3368 };
3369 let body_json = body.to_string();
3370
3371
3372 let method = Method::Put;
3373
3374 RestRequest {
3375 authentication,
3376 urlpath,
3377 query_params,
3378 body: body_json,
3379 method,
3380 _marker: std::marker::PhantomData
3381 }
3382}
3383pub fn add_group_users(
3385 bearer_token: &str,
3386 group_id: &str,
3387 user_ids: &[String],
3388) -> RestRequest<()> {
3389 #[allow(unused_mut)]
3390 let mut urlpath = "/v2/group/{groupId}/add".to_string();
3391 urlpath = urlpath.replace("{groupId}", group_id);
3392
3393 #[allow(unused_mut)]
3394 let mut query_params = String::new();
3395for elem in user_ids
3396{
3397 query_params.push_str(&format!("user_ids={:?}&", elem));
3398}
3399
3400 let authentication =
3401 Authentication::Bearer {
3402 token: bearer_token.to_owned()
3403 };
3404
3405 let body_json = String::new();
3406
3407 let method = Method::Post;
3408
3409 RestRequest {
3410 authentication,
3411 urlpath,
3412 query_params,
3413 body: body_json,
3414 method,
3415 _marker: std::marker::PhantomData
3416 }
3417}
3418pub fn ban_group_users(
3420 bearer_token: &str,
3421 group_id: &str,
3422 user_ids: &[String],
3423) -> RestRequest<()> {
3424 #[allow(unused_mut)]
3425 let mut urlpath = "/v2/group/{groupId}/ban".to_string();
3426 urlpath = urlpath.replace("{groupId}", group_id);
3427
3428 #[allow(unused_mut)]
3429 let mut query_params = String::new();
3430for elem in user_ids
3431{
3432 query_params.push_str(&format!("user_ids={:?}&", elem));
3433}
3434
3435 let authentication =
3436 Authentication::Bearer {
3437 token: bearer_token.to_owned()
3438 };
3439
3440 let body_json = String::new();
3441
3442 let method = Method::Post;
3443
3444 RestRequest {
3445 authentication,
3446 urlpath,
3447 query_params,
3448 body: body_json,
3449 method,
3450 _marker: std::marker::PhantomData
3451 }
3452}
3453pub fn demote_group_users(
3455 bearer_token: &str,
3456 group_id: &str,
3457 user_ids: &[String],
3458) -> RestRequest<()> {
3459 #[allow(unused_mut)]
3460 let mut urlpath = "/v2/group/{groupId}/demote".to_string();
3461 urlpath = urlpath.replace("{groupId}", group_id);
3462
3463 #[allow(unused_mut)]
3464 let mut query_params = String::new();
3465for elem in user_ids
3466{
3467 query_params.push_str(&format!("user_ids={:?}&", elem));
3468}
3469
3470 let authentication =
3471 Authentication::Bearer {
3472 token: bearer_token.to_owned()
3473 };
3474
3475 let body_json = String::new();
3476
3477 let method = Method::Post;
3478
3479 RestRequest {
3480 authentication,
3481 urlpath,
3482 query_params,
3483 body: body_json,
3484 method,
3485 _marker: std::marker::PhantomData
3486 }
3487}
3488pub fn join_group(
3490 bearer_token: &str,
3491 group_id: &str,
3492) -> RestRequest<()> {
3493 #[allow(unused_mut)]
3494 let mut urlpath = "/v2/group/{groupId}/join".to_string();
3495 urlpath = urlpath.replace("{groupId}", group_id);
3496
3497 #[allow(unused_mut)]
3498 let mut query_params = String::new();
3499
3500 let authentication =
3501 Authentication::Bearer {
3502 token: bearer_token.to_owned()
3503 };
3504
3505 let body_json = String::new();
3506
3507 let method = Method::Post;
3508
3509 RestRequest {
3510 authentication,
3511 urlpath,
3512 query_params,
3513 body: body_json,
3514 method,
3515 _marker: std::marker::PhantomData
3516 }
3517}
3518pub fn kick_group_users(
3520 bearer_token: &str,
3521 group_id: &str,
3522 user_ids: &[String],
3523) -> RestRequest<()> {
3524 #[allow(unused_mut)]
3525 let mut urlpath = "/v2/group/{groupId}/kick".to_string();
3526 urlpath = urlpath.replace("{groupId}", group_id);
3527
3528 #[allow(unused_mut)]
3529 let mut query_params = String::new();
3530for elem in user_ids
3531{
3532 query_params.push_str(&format!("user_ids={:?}&", elem));
3533}
3534
3535 let authentication =
3536 Authentication::Bearer {
3537 token: bearer_token.to_owned()
3538 };
3539
3540 let body_json = String::new();
3541
3542 let method = Method::Post;
3543
3544 RestRequest {
3545 authentication,
3546 urlpath,
3547 query_params,
3548 body: body_json,
3549 method,
3550 _marker: std::marker::PhantomData
3551 }
3552}
3553pub fn leave_group(
3555 bearer_token: &str,
3556 group_id: &str,
3557) -> RestRequest<()> {
3558 #[allow(unused_mut)]
3559 let mut urlpath = "/v2/group/{groupId}/leave".to_string();
3560 urlpath = urlpath.replace("{groupId}", group_id);
3561
3562 #[allow(unused_mut)]
3563 let mut query_params = String::new();
3564
3565 let authentication =
3566 Authentication::Bearer {
3567 token: bearer_token.to_owned()
3568 };
3569
3570 let body_json = String::new();
3571
3572 let method = Method::Post;
3573
3574 RestRequest {
3575 authentication,
3576 urlpath,
3577 query_params,
3578 body: body_json,
3579 method,
3580 _marker: std::marker::PhantomData
3581 }
3582}
3583pub fn promote_group_users(
3585 bearer_token: &str,
3586 group_id: &str,
3587 user_ids: &[String],
3588) -> RestRequest<()> {
3589 #[allow(unused_mut)]
3590 let mut urlpath = "/v2/group/{groupId}/promote".to_string();
3591 urlpath = urlpath.replace("{groupId}", group_id);
3592
3593 #[allow(unused_mut)]
3594 let mut query_params = String::new();
3595for elem in user_ids
3596{
3597 query_params.push_str(&format!("user_ids={:?}&", elem));
3598}
3599
3600 let authentication =
3601 Authentication::Bearer {
3602 token: bearer_token.to_owned()
3603 };
3604
3605 let body_json = String::new();
3606
3607 let method = Method::Post;
3608
3609 RestRequest {
3610 authentication,
3611 urlpath,
3612 query_params,
3613 body: body_json,
3614 method,
3615 _marker: std::marker::PhantomData
3616 }
3617}
3618pub fn list_group_users(
3620 bearer_token: &str,
3621 group_id: &str,
3622 limit: Option<i32>,
3623 state: Option<i32>,
3624 cursor: Option<&str>,
3625) -> RestRequest<ApiGroupUserList> {
3626 #[allow(unused_mut)]
3627 let mut urlpath = "/v2/group/{groupId}/user".to_string();
3628 urlpath = urlpath.replace("{groupId}", group_id);
3629
3630 #[allow(unused_mut)]
3631 let mut query_params = String::new();
3632if let Some(param) = limit {
3633 query_params.push_str(&format!("limit={}&", param));
3634}
3635if let Some(param) = state {
3636 query_params.push_str(&format!("state={}&", param));
3637}
3638if let Some(param) = cursor {
3639 query_params.push_str(&format!("cursor={}&", param));
3640}
3641
3642 let authentication =
3643 Authentication::Bearer {
3644 token: bearer_token.to_owned()
3645 };
3646
3647 let body_json = String::new();
3648
3649 let method = Method::Get;
3650
3651 RestRequest {
3652 authentication,
3653 urlpath,
3654 query_params,
3655 body: body_json,
3656 method,
3657 _marker: std::marker::PhantomData
3658 }
3659}
3660pub fn delete_leaderboard_record(
3662 bearer_token: &str,
3663 leaderboard_id: &str,
3664) -> RestRequest<()> {
3665 #[allow(unused_mut)]
3666 let mut urlpath = "/v2/leaderboard/{leaderboardId}".to_string();
3667 urlpath = urlpath.replace("{leaderboardId}", leaderboard_id);
3668
3669 #[allow(unused_mut)]
3670 let mut query_params = String::new();
3671
3672 let authentication =
3673 Authentication::Bearer {
3674 token: bearer_token.to_owned()
3675 };
3676
3677 let body_json = String::new();
3678
3679 let method = Method::Delete;
3680
3681 RestRequest {
3682 authentication,
3683 urlpath,
3684 query_params,
3685 body: body_json,
3686 method,
3687 _marker: std::marker::PhantomData
3688 }
3689}
3690pub fn list_leaderboard_records(
3692 bearer_token: &str,
3693 leaderboard_id: &str,
3694 owner_ids: &[String],
3695 limit: Option<i32>,
3696 cursor: Option<&str>,
3697 expiry: Option<&str>,
3698) -> RestRequest<ApiLeaderboardRecordList> {
3699 #[allow(unused_mut)]
3700 let mut urlpath = "/v2/leaderboard/{leaderboardId}".to_string();
3701 urlpath = urlpath.replace("{leaderboardId}", leaderboard_id);
3702
3703 #[allow(unused_mut)]
3704 let mut query_params = String::new();
3705for elem in owner_ids
3706{
3707 query_params.push_str(&format!("owner_ids={:?}&", elem));
3708}
3709if let Some(param) = limit {
3710 query_params.push_str(&format!("limit={}&", param));
3711}
3712if let Some(param) = cursor {
3713 query_params.push_str(&format!("cursor={}&", param));
3714}
3715if let Some(param) = expiry {
3716 query_params.push_str(&format!("expiry={}&", param));
3717}
3718
3719 let authentication =
3720 Authentication::Bearer {
3721 token: bearer_token.to_owned()
3722 };
3723
3724 let body_json = String::new();
3725
3726 let method = Method::Get;
3727
3728 RestRequest {
3729 authentication,
3730 urlpath,
3731 query_params,
3732 body: body_json,
3733 method,
3734 _marker: std::marker::PhantomData
3735 }
3736}
3737pub fn write_leaderboard_record(
3739 bearer_token: &str,
3740 leaderboard_id: &str,
3741 body: WriteLeaderboardRecordRequestLeaderboardRecordWrite,
3742) -> RestRequest<ApiLeaderboardRecord> {
3743 #[allow(unused_mut)]
3744 let mut urlpath = "/v2/leaderboard/{leaderboardId}".to_string();
3745 urlpath = urlpath.replace("{leaderboardId}", leaderboard_id);
3746
3747 #[allow(unused_mut)]
3748 let mut query_params = String::new();
3749
3750 let authentication =
3751 Authentication::Bearer {
3752 token: bearer_token.to_owned()
3753 };
3754 let body_json = body.to_string();
3755
3756
3757 let method = Method::Post;
3758
3759 RestRequest {
3760 authentication,
3761 urlpath,
3762 query_params,
3763 body: body_json,
3764 method,
3765 _marker: std::marker::PhantomData
3766 }
3767}
3768pub fn list_leaderboard_records_around_owner(
3770 bearer_token: &str,
3771 leaderboard_id: &str,
3772 owner_id: &str,
3773 limit: Option<i32>,
3774 expiry: Option<&str>,
3775) -> RestRequest<ApiLeaderboardRecordList> {
3776 #[allow(unused_mut)]
3777 let mut urlpath = "/v2/leaderboard/{leaderboardId}/owner/{ownerId}".to_string();
3778 urlpath = urlpath.replace("{leaderboardId}", leaderboard_id);
3779 urlpath = urlpath.replace("{ownerId}", owner_id);
3780
3781 #[allow(unused_mut)]
3782 let mut query_params = String::new();
3783if let Some(param) = limit {
3784 query_params.push_str(&format!("limit={}&", param));
3785}
3786if let Some(param) = expiry {
3787 query_params.push_str(&format!("expiry={}&", param));
3788}
3789
3790 let authentication =
3791 Authentication::Bearer {
3792 token: bearer_token.to_owned()
3793 };
3794
3795 let body_json = String::new();
3796
3797 let method = Method::Get;
3798
3799 RestRequest {
3800 authentication,
3801 urlpath,
3802 query_params,
3803 body: body_json,
3804 method,
3805 _marker: std::marker::PhantomData
3806 }
3807}
3808pub fn list_matches(
3810 bearer_token: &str,
3811 limit: Option<i32>,
3812 authoritative: Option<bool>,
3813 label: Option<&str>,
3814 min_size: Option<i32>,
3815 max_size: Option<i32>,
3816 query: Option<&str>,
3817) -> RestRequest<ApiMatchList> {
3818 #[allow(unused_mut)]
3819 let mut urlpath = "/v2/match".to_string();
3820
3821 #[allow(unused_mut)]
3822 let mut query_params = String::new();
3823if let Some(param) = limit {
3824 query_params.push_str(&format!("limit={}&", param));
3825}
3826if let Some(param) = authoritative {
3827 query_params.push_str(&format!("authoritative={:?}&", param));
3828}
3829if let Some(param) = label {
3830 query_params.push_str(&format!("label={}&", param));
3831}
3832if let Some(param) = min_size {
3833 query_params.push_str(&format!("min_size={}&", param));
3834}
3835if let Some(param) = max_size {
3836 query_params.push_str(&format!("max_size={}&", param));
3837}
3838if let Some(param) = query {
3839 query_params.push_str(&format!("query={}&", param));
3840}
3841
3842 let authentication =
3843 Authentication::Bearer {
3844 token: bearer_token.to_owned()
3845 };
3846
3847 let body_json = String::new();
3848
3849 let method = Method::Get;
3850
3851 RestRequest {
3852 authentication,
3853 urlpath,
3854 query_params,
3855 body: body_json,
3856 method,
3857 _marker: std::marker::PhantomData
3858 }
3859}
3860pub fn delete_notifications(
3862 bearer_token: &str,
3863 ids: &[String],
3864) -> RestRequest<()> {
3865 #[allow(unused_mut)]
3866 let mut urlpath = "/v2/notification".to_string();
3867
3868 #[allow(unused_mut)]
3869 let mut query_params = String::new();
3870for elem in ids
3871{
3872 query_params.push_str(&format!("ids={:?}&", elem));
3873}
3874
3875 let authentication =
3876 Authentication::Bearer {
3877 token: bearer_token.to_owned()
3878 };
3879
3880 let body_json = String::new();
3881
3882 let method = Method::Delete;
3883
3884 RestRequest {
3885 authentication,
3886 urlpath,
3887 query_params,
3888 body: body_json,
3889 method,
3890 _marker: std::marker::PhantomData
3891 }
3892}
3893pub fn list_notifications(
3895 bearer_token: &str,
3896 limit: Option<i32>,
3897 cacheable_cursor: Option<&str>,
3898) -> RestRequest<ApiNotificationList> {
3899 #[allow(unused_mut)]
3900 let mut urlpath = "/v2/notification".to_string();
3901
3902 #[allow(unused_mut)]
3903 let mut query_params = String::new();
3904if let Some(param) = limit {
3905 query_params.push_str(&format!("limit={}&", param));
3906}
3907if let Some(param) = cacheable_cursor {
3908 query_params.push_str(&format!("cacheable_cursor={}&", param));
3909}
3910
3911 let authentication =
3912 Authentication::Bearer {
3913 token: bearer_token.to_owned()
3914 };
3915
3916 let body_json = String::new();
3917
3918 let method = Method::Get;
3919
3920 RestRequest {
3921 authentication,
3922 urlpath,
3923 query_params,
3924 body: body_json,
3925 method,
3926 _marker: std::marker::PhantomData
3927 }
3928}
3929pub fn rpc_func_2(
3931 bearer_token: &str,
3932 id: &str,
3933 payload: Option<&str>,
3934 http_key: Option<&str>,
3935) -> RestRequest<ApiRpc> {
3936 #[allow(unused_mut)]
3937 let mut urlpath = "/v2/rpc/{id}".to_string();
3938 urlpath = urlpath.replace("{id}", id);
3939
3940 #[allow(unused_mut)]
3941 let mut query_params = String::new();
3942if let Some(param) = payload {
3943 query_params.push_str(&format!("payload={}&", param));
3944}
3945if let Some(param) = http_key {
3946 query_params.push_str(&format!("http_key={}&", param));
3947}
3948
3949 let authentication =
3950 Authentication::Bearer {
3951 token: bearer_token.to_owned()
3952 };
3953
3954 let body_json = String::new();
3955
3956 let method = Method::Get;
3957
3958 RestRequest {
3959 authentication,
3960 urlpath,
3961 query_params,
3962 body: body_json,
3963 method,
3964 _marker: std::marker::PhantomData
3965 }
3966}
3967pub fn rpc_func(
3969 bearer_token: &str,
3970 id: &str,
3971 body: &str,
3972 http_key: Option<&str>,
3973) -> RestRequest<ApiRpc> {
3974 #[allow(unused_mut)]
3975 let mut urlpath = "/v2/rpc/{id}".to_string();
3976 urlpath = urlpath.replace("{id}", id);
3977
3978 #[allow(unused_mut)]
3979 let mut query_params = String::new();
3980if let Some(param) = http_key {
3981 query_params.push_str(&format!("http_key={}&", param));
3982}
3983
3984 let authentication =
3985 Authentication::Bearer {
3986 token: bearer_token.to_owned()
3987 };
3988 let body_json = body.to_string();
3989
3990
3991 let method = Method::Post;
3992
3993 RestRequest {
3994 authentication,
3995 urlpath,
3996 query_params,
3997 body: body_json,
3998 method,
3999 _marker: std::marker::PhantomData
4000 }
4001}
4002pub fn session_logout(
4004 bearer_token: &str,
4005 body: ApiSessionLogoutRequest,
4006) -> RestRequest<()> {
4007 #[allow(unused_mut)]
4008 let mut urlpath = "/v2/session/logout".to_string();
4009
4010 #[allow(unused_mut)]
4011 let mut query_params = String::new();
4012
4013 let authentication =
4014 Authentication::Bearer {
4015 token: bearer_token.to_owned()
4016 };
4017 let body_json = body.to_string();
4018
4019
4020 let method = Method::Post;
4021
4022 RestRequest {
4023 authentication,
4024 urlpath,
4025 query_params,
4026 body: body_json,
4027 method,
4028 _marker: std::marker::PhantomData
4029 }
4030}
4031pub fn read_storage_objects(
4033 bearer_token: &str,
4034 body: ApiReadStorageObjectsRequest,
4035) -> RestRequest<ApiStorageObjects> {
4036 #[allow(unused_mut)]
4037 let mut urlpath = "/v2/storage".to_string();
4038
4039 #[allow(unused_mut)]
4040 let mut query_params = String::new();
4041
4042 let authentication =
4043 Authentication::Bearer {
4044 token: bearer_token.to_owned()
4045 };
4046 let body_json = body.to_string();
4047
4048
4049 let method = Method::Post;
4050
4051 RestRequest {
4052 authentication,
4053 urlpath,
4054 query_params,
4055 body: body_json,
4056 method,
4057 _marker: std::marker::PhantomData
4058 }
4059}
4060pub fn write_storage_objects(
4062 bearer_token: &str,
4063 body: ApiWriteStorageObjectsRequest,
4064) -> RestRequest<ApiStorageObjectAcks> {
4065 #[allow(unused_mut)]
4066 let mut urlpath = "/v2/storage".to_string();
4067
4068 #[allow(unused_mut)]
4069 let mut query_params = String::new();
4070
4071 let authentication =
4072 Authentication::Bearer {
4073 token: bearer_token.to_owned()
4074 };
4075 let body_json = body.to_string();
4076
4077
4078 let method = Method::Put;
4079
4080 RestRequest {
4081 authentication,
4082 urlpath,
4083 query_params,
4084 body: body_json,
4085 method,
4086 _marker: std::marker::PhantomData
4087 }
4088}
4089pub fn delete_storage_objects(
4091 bearer_token: &str,
4092 body: ApiDeleteStorageObjectsRequest,
4093) -> RestRequest<()> {
4094 #[allow(unused_mut)]
4095 let mut urlpath = "/v2/storage/delete".to_string();
4096
4097 #[allow(unused_mut)]
4098 let mut query_params = String::new();
4099
4100 let authentication =
4101 Authentication::Bearer {
4102 token: bearer_token.to_owned()
4103 };
4104 let body_json = body.to_string();
4105
4106
4107 let method = Method::Put;
4108
4109 RestRequest {
4110 authentication,
4111 urlpath,
4112 query_params,
4113 body: body_json,
4114 method,
4115 _marker: std::marker::PhantomData
4116 }
4117}
4118pub fn list_storage_objects(
4120 bearer_token: &str,
4121 collection: &str,
4122 user_id: Option<&str>,
4123 limit: Option<i32>,
4124 cursor: Option<&str>,
4125) -> RestRequest<ApiStorageObjectList> {
4126 #[allow(unused_mut)]
4127 let mut urlpath = "/v2/storage/{collection}".to_string();
4128 urlpath = urlpath.replace("{collection}", collection);
4129
4130 #[allow(unused_mut)]
4131 let mut query_params = String::new();
4132if let Some(param) = user_id {
4133 query_params.push_str(&format!("user_id={}&", param));
4134}
4135if let Some(param) = limit {
4136 query_params.push_str(&format!("limit={}&", param));
4137}
4138if let Some(param) = cursor {
4139 query_params.push_str(&format!("cursor={}&", param));
4140}
4141
4142 let authentication =
4143 Authentication::Bearer {
4144 token: bearer_token.to_owned()
4145 };
4146
4147 let body_json = String::new();
4148
4149 let method = Method::Get;
4150
4151 RestRequest {
4152 authentication,
4153 urlpath,
4154 query_params,
4155 body: body_json,
4156 method,
4157 _marker: std::marker::PhantomData
4158 }
4159}
4160pub fn list_storage_objects_2(
4162 bearer_token: &str,
4163 collection: &str,
4164 user_id: &str,
4165 limit: Option<i32>,
4166 cursor: Option<&str>,
4167) -> RestRequest<ApiStorageObjectList> {
4168 #[allow(unused_mut)]
4169 let mut urlpath = "/v2/storage/{collection}/{userId}".to_string();
4170 urlpath = urlpath.replace("{collection}", collection);
4171 urlpath = urlpath.replace("{userId}", user_id);
4172
4173 #[allow(unused_mut)]
4174 let mut query_params = String::new();
4175if let Some(param) = limit {
4176 query_params.push_str(&format!("limit={}&", param));
4177}
4178if let Some(param) = cursor {
4179 query_params.push_str(&format!("cursor={}&", param));
4180}
4181
4182 let authentication =
4183 Authentication::Bearer {
4184 token: bearer_token.to_owned()
4185 };
4186
4187 let body_json = String::new();
4188
4189 let method = Method::Get;
4190
4191 RestRequest {
4192 authentication,
4193 urlpath,
4194 query_params,
4195 body: body_json,
4196 method,
4197 _marker: std::marker::PhantomData
4198 }
4199}
4200pub fn list_tournaments(
4202 bearer_token: &str,
4203 category_start: Option<i32>,
4204 category_end: Option<i32>,
4205 start_time: Option<i32>,
4206 end_time: Option<i32>,
4207 limit: Option<i32>,
4208 cursor: Option<&str>,
4209) -> RestRequest<ApiTournamentList> {
4210 #[allow(unused_mut)]
4211 let mut urlpath = "/v2/tournament".to_string();
4212
4213 #[allow(unused_mut)]
4214 let mut query_params = String::new();
4215if let Some(param) = category_start {
4216 query_params.push_str(&format!("category_start={}&", param));
4217}
4218if let Some(param) = category_end {
4219 query_params.push_str(&format!("category_end={}&", param));
4220}
4221if let Some(param) = start_time {
4222 query_params.push_str(&format!("start_time={}&", param));
4223}
4224if let Some(param) = end_time {
4225 query_params.push_str(&format!("end_time={}&", param));
4226}
4227if let Some(param) = limit {
4228 query_params.push_str(&format!("limit={}&", param));
4229}
4230if let Some(param) = cursor {
4231 query_params.push_str(&format!("cursor={}&", param));
4232}
4233
4234 let authentication =
4235 Authentication::Bearer {
4236 token: bearer_token.to_owned()
4237 };
4238
4239 let body_json = String::new();
4240
4241 let method = Method::Get;
4242
4243 RestRequest {
4244 authentication,
4245 urlpath,
4246 query_params,
4247 body: body_json,
4248 method,
4249 _marker: std::marker::PhantomData
4250 }
4251}
4252pub fn list_tournament_records(
4254 bearer_token: &str,
4255 tournament_id: &str,
4256 owner_ids: &[String],
4257 limit: Option<i32>,
4258 cursor: Option<&str>,
4259 expiry: Option<&str>,
4260) -> RestRequest<ApiTournamentRecordList> {
4261 #[allow(unused_mut)]
4262 let mut urlpath = "/v2/tournament/{tournamentId}".to_string();
4263 urlpath = urlpath.replace("{tournamentId}", tournament_id);
4264
4265 #[allow(unused_mut)]
4266 let mut query_params = String::new();
4267for elem in owner_ids
4268{
4269 query_params.push_str(&format!("owner_ids={:?}&", elem));
4270}
4271if let Some(param) = limit {
4272 query_params.push_str(&format!("limit={}&", param));
4273}
4274if let Some(param) = cursor {
4275 query_params.push_str(&format!("cursor={}&", param));
4276}
4277if let Some(param) = expiry {
4278 query_params.push_str(&format!("expiry={}&", param));
4279}
4280
4281 let authentication =
4282 Authentication::Bearer {
4283 token: bearer_token.to_owned()
4284 };
4285
4286 let body_json = String::new();
4287
4288 let method = Method::Get;
4289
4290 RestRequest {
4291 authentication,
4292 urlpath,
4293 query_params,
4294 body: body_json,
4295 method,
4296 _marker: std::marker::PhantomData
4297 }
4298}
4299pub fn write_tournament_record(
4301 bearer_token: &str,
4302 tournament_id: &str,
4303 body: WriteTournamentRecordRequestTournamentRecordWrite,
4304) -> RestRequest<ApiLeaderboardRecord> {
4305 #[allow(unused_mut)]
4306 let mut urlpath = "/v2/tournament/{tournamentId}".to_string();
4307 urlpath = urlpath.replace("{tournamentId}", tournament_id);
4308
4309 #[allow(unused_mut)]
4310 let mut query_params = String::new();
4311
4312 let authentication =
4313 Authentication::Bearer {
4314 token: bearer_token.to_owned()
4315 };
4316 let body_json = body.to_string();
4317
4318
4319 let method = Method::Put;
4320
4321 RestRequest {
4322 authentication,
4323 urlpath,
4324 query_params,
4325 body: body_json,
4326 method,
4327 _marker: std::marker::PhantomData
4328 }
4329}
4330pub fn join_tournament(
4332 bearer_token: &str,
4333 tournament_id: &str,
4334) -> RestRequest<()> {
4335 #[allow(unused_mut)]
4336 let mut urlpath = "/v2/tournament/{tournamentId}/join".to_string();
4337 urlpath = urlpath.replace("{tournamentId}", tournament_id);
4338
4339 #[allow(unused_mut)]
4340 let mut query_params = String::new();
4341
4342 let authentication =
4343 Authentication::Bearer {
4344 token: bearer_token.to_owned()
4345 };
4346
4347 let body_json = String::new();
4348
4349 let method = Method::Post;
4350
4351 RestRequest {
4352 authentication,
4353 urlpath,
4354 query_params,
4355 body: body_json,
4356 method,
4357 _marker: std::marker::PhantomData
4358 }
4359}
4360pub fn list_tournament_records_around_owner(
4362 bearer_token: &str,
4363 tournament_id: &str,
4364 owner_id: &str,
4365 limit: Option<i32>,
4366 expiry: Option<&str>,
4367) -> RestRequest<ApiTournamentRecordList> {
4368 #[allow(unused_mut)]
4369 let mut urlpath = "/v2/tournament/{tournamentId}/owner/{ownerId}".to_string();
4370 urlpath = urlpath.replace("{tournamentId}", tournament_id);
4371 urlpath = urlpath.replace("{ownerId}", owner_id);
4372
4373 #[allow(unused_mut)]
4374 let mut query_params = String::new();
4375if let Some(param) = limit {
4376 query_params.push_str(&format!("limit={}&", param));
4377}
4378if let Some(param) = expiry {
4379 query_params.push_str(&format!("expiry={}&", param));
4380}
4381
4382 let authentication =
4383 Authentication::Bearer {
4384 token: bearer_token.to_owned()
4385 };
4386
4387 let body_json = String::new();
4388
4389 let method = Method::Get;
4390
4391 RestRequest {
4392 authentication,
4393 urlpath,
4394 query_params,
4395 body: body_json,
4396 method,
4397 _marker: std::marker::PhantomData
4398 }
4399}
4400pub fn get_users(
4402 bearer_token: &str,
4403 ids: &[String],
4404 usernames: &[String],
4405 facebook_ids: &[String],
4406) -> RestRequest<ApiUsers> {
4407 #[allow(unused_mut)]
4408 let mut urlpath = "/v2/user".to_string();
4409
4410 #[allow(unused_mut)]
4411 let mut query_params = String::new();
4412for elem in ids
4413{
4414 query_params.push_str(&format!("ids={:?}&", elem));
4415}
4416for elem in usernames
4417{
4418 query_params.push_str(&format!("usernames={:?}&", elem));
4419}
4420for elem in facebook_ids
4421{
4422 query_params.push_str(&format!("facebook_ids={:?}&", elem));
4423}
4424
4425 let authentication =
4426 Authentication::Bearer {
4427 token: bearer_token.to_owned()
4428 };
4429
4430 let body_json = String::new();
4431
4432 let method = Method::Get;
4433
4434 RestRequest {
4435 authentication,
4436 urlpath,
4437 query_params,
4438 body: body_json,
4439 method,
4440 _marker: std::marker::PhantomData
4441 }
4442}
4443pub fn list_user_groups(
4445 bearer_token: &str,
4446 user_id: &str,
4447 limit: Option<i32>,
4448 state: Option<i32>,
4449 cursor: Option<&str>,
4450) -> RestRequest<ApiUserGroupList> {
4451 #[allow(unused_mut)]
4452 let mut urlpath = "/v2/user/{userId}/group".to_string();
4453 urlpath = urlpath.replace("{userId}", user_id);
4454
4455 #[allow(unused_mut)]
4456 let mut query_params = String::new();
4457if let Some(param) = limit {
4458 query_params.push_str(&format!("limit={}&", param));
4459}
4460if let Some(param) = state {
4461 query_params.push_str(&format!("state={}&", param));
4462}
4463if let Some(param) = cursor {
4464 query_params.push_str(&format!("cursor={}&", param));
4465}
4466
4467 let authentication =
4468 Authentication::Bearer {
4469 token: bearer_token.to_owned()
4470 };
4471
4472 let body_json = String::new();
4473
4474 let method = Method::Get;
4475
4476 RestRequest {
4477 authentication,
4478 urlpath,
4479 query_params,
4480 body: body_json,
4481 method,
4482 _marker: std::marker::PhantomData
4483 }
4484}