1use super::{configuration, Error};
2use crate::{apis::ResponseContent, models};
3use reqwest::StatusCode;
4use serde::{Deserialize, Serialize};
5
6#[derive(Clone, Debug)]
8pub struct AcceptNewTaskParams {
9 pub name: String,
11}
12
13impl AcceptNewTaskParams {
14 pub fn new(name: String) -> Self {
15 Self { name }
16 }
17}
18
19#[derive(Clone, Debug)]
21pub struct BuyBankExpansionParams {
22 pub name: String,
24}
25
26impl BuyBankExpansionParams {
27 pub fn new(name: String) -> Self {
28 Self { name }
29 }
30}
31
32#[derive(Clone, Debug)]
34pub struct CancelTaskParams {
35 pub name: String,
37}
38
39impl CancelTaskParams {
40 pub fn new(name: String) -> Self {
41 Self { name }
42 }
43}
44
45#[derive(Clone, Debug)]
47pub struct ChangeSkinParams {
48 pub name: String,
50 pub change_skin_character_schema: models::ChangeSkinCharacterSchema,
51}
52
53impl ChangeSkinParams {
54 pub fn new(
55 name: String,
56 change_skin_character_schema: models::ChangeSkinCharacterSchema,
57 ) -> Self {
58 Self {
59 name,
60 change_skin_character_schema,
61 }
62 }
63}
64
65#[derive(Clone, Debug)]
67pub struct CompleteTaskParams {
68 pub name: String,
70}
71
72impl CompleteTaskParams {
73 pub fn new(name: String) -> Self {
74 Self { name }
75 }
76}
77
78#[derive(Clone, Debug)]
80pub struct CraftParams {
81 pub name: String,
83 pub crafting_schema: models::CraftingSchema,
84}
85
86impl CraftParams {
87 pub fn new(name: String, crafting_schema: models::CraftingSchema) -> Self {
88 Self {
89 name,
90 crafting_schema,
91 }
92 }
93}
94
95#[derive(Clone, Debug)]
97pub struct DeleteItemParams {
98 pub name: String,
100 pub simple_item_schema: models::SimpleItemSchema,
101}
102
103impl DeleteItemParams {
104 pub fn new(name: String, simple_item_schema: models::SimpleItemSchema) -> Self {
105 Self {
106 name,
107 simple_item_schema,
108 }
109 }
110}
111
112#[derive(Clone, Debug)]
114pub struct DepositGoldParams {
115 pub name: String,
117 pub deposit_withdraw_gold_schema: models::DepositWithdrawGoldSchema,
118}
119
120impl DepositGoldParams {
121 pub fn new(
122 name: String,
123 deposit_withdraw_gold_schema: models::DepositWithdrawGoldSchema,
124 ) -> Self {
125 Self {
126 name,
127 deposit_withdraw_gold_schema,
128 }
129 }
130}
131
132#[derive(Clone, Debug)]
134pub struct DepositItemParams {
135 pub name: String,
137 pub simple_item_schema: Vec<models::SimpleItemSchema>,
138}
139
140impl DepositItemParams {
141 pub fn new(name: String, simple_item_schema: Vec<models::SimpleItemSchema>) -> Self {
142 Self {
143 name,
144 simple_item_schema,
145 }
146 }
147}
148
149#[derive(Clone, Debug)]
151pub struct EquipItemParams {
152 pub name: String,
154 pub equip_schema: models::EquipSchema,
155}
156
157impl EquipItemParams {
158 pub fn new(name: String, equip_schema: models::EquipSchema) -> Self {
159 Self { name, equip_schema }
160 }
161}
162
163#[derive(Clone, Debug)]
165pub struct FightParams {
166 pub name: String,
168}
169
170impl FightParams {
171 pub fn new(name: String) -> Self {
172 Self { name }
173 }
174}
175
176#[derive(Clone, Debug)]
178pub struct GatherParams {
179 pub name: String,
181}
182
183impl GatherParams {
184 pub fn new(name: String) -> Self {
185 Self { name }
186 }
187}
188
189#[derive(Clone, Debug)]
191pub struct GeBuyItemParams {
192 pub name: String,
194 pub ge_buy_order_schema: models::GeBuyOrderSchema,
195}
196
197impl GeBuyItemParams {
198 pub fn new(name: String, ge_buy_order_schema: models::GeBuyOrderSchema) -> Self {
199 Self {
200 name,
201 ge_buy_order_schema,
202 }
203 }
204}
205
206#[derive(Clone, Debug)]
208pub struct GeCancelSellOrderParams {
209 pub name: String,
211 pub ge_cancel_order_schema: models::GeCancelOrderSchema,
212}
213
214impl GeCancelSellOrderParams {
215 pub fn new(name: String, ge_cancel_order_schema: models::GeCancelOrderSchema) -> Self {
216 Self {
217 name,
218 ge_cancel_order_schema,
219 }
220 }
221}
222
223#[derive(Clone, Debug)]
225pub struct GeCreateSellOrderParams {
226 pub name: String,
228 pub ge_order_creationr_schema: models::GeOrderCreationrSchema,
229}
230
231impl GeCreateSellOrderParams {
232 pub fn new(name: String, ge_order_creationr_schema: models::GeOrderCreationrSchema) -> Self {
233 Self {
234 name,
235 ge_order_creationr_schema,
236 }
237 }
238}
239
240#[derive(Clone, Debug)]
242pub struct GetAllCharactersLogsParams {
243 pub page: Option<u32>,
245 pub size: Option<u32>,
247}
248
249impl GetAllCharactersLogsParams {
250 pub fn new(page: Option<u32>, size: Option<u32>) -> Self {
251 Self { page, size }
252 }
253}
254
255#[derive(Clone, Debug)]
257pub struct GetCharacterLogsParams {
258 pub name: String,
260 pub page: Option<u32>,
262 pub size: Option<u32>,
264}
265
266impl GetCharacterLogsParams {
267 pub fn new(name: String, page: Option<u32>, size: Option<u32>) -> Self {
268 Self { name, page, size }
269 }
270}
271
272#[derive(Clone, Debug)]
274pub struct GiveGoldParams {
275 pub name: String,
277 pub give_gold_schema: models::GiveGoldSchema,
278}
279
280impl GiveGoldParams {
281 pub fn new(name: String, give_gold_schema: models::GiveGoldSchema) -> Self {
282 Self {
283 name,
284 give_gold_schema,
285 }
286 }
287}
288
289#[derive(Clone, Debug)]
291pub struct GiveItemsParams {
292 pub name: String,
294 pub give_items_schema: models::GiveItemsSchema,
295}
296
297impl GiveItemsParams {
298 pub fn new(name: String, give_items_schema: models::GiveItemsSchema) -> Self {
299 Self {
300 name,
301 give_items_schema,
302 }
303 }
304}
305
306#[derive(Clone, Debug)]
308pub struct MoveCharacterParams {
309 pub name: String,
311 pub destination_schema: models::DestinationSchema,
312}
313
314impl MoveCharacterParams {
315 pub fn new(name: String, destination_schema: models::DestinationSchema) -> Self {
316 Self {
317 name,
318 destination_schema,
319 }
320 }
321}
322
323#[derive(Clone, Debug)]
325pub struct NpcBuyItemParams {
326 pub name: String,
328 pub npc_merchant_buy_schema: models::NpcMerchantBuySchema,
329}
330
331impl NpcBuyItemParams {
332 pub fn new(name: String, npc_merchant_buy_schema: models::NpcMerchantBuySchema) -> Self {
333 Self {
334 name,
335 npc_merchant_buy_schema,
336 }
337 }
338}
339
340#[derive(Clone, Debug)]
342pub struct NpcSellItemParams {
343 pub name: String,
345 pub npc_merchant_buy_schema: models::NpcMerchantBuySchema,
346}
347
348impl NpcSellItemParams {
349 pub fn new(name: String, npc_merchant_buy_schema: models::NpcMerchantBuySchema) -> Self {
350 Self {
351 name,
352 npc_merchant_buy_schema,
353 }
354 }
355}
356
357#[derive(Clone, Debug)]
359pub struct RecycleParams {
360 pub name: String,
362 pub recycling_schema: models::RecyclingSchema,
363}
364
365impl RecycleParams {
366 pub fn new(name: String, recycling_schema: models::RecyclingSchema) -> Self {
367 Self {
368 name,
369 recycling_schema,
370 }
371 }
372}
373
374#[derive(Clone, Debug)]
376pub struct RestCharacterParams {
377 pub name: String,
379}
380
381impl RestCharacterParams {
382 pub fn new(name: String) -> Self {
383 Self { name }
384 }
385}
386
387#[derive(Clone, Debug)]
389pub struct TaskExchangeParams {
390 pub name: String,
392}
393
394impl TaskExchangeParams {
395 pub fn new(name: String) -> Self {
396 Self { name }
397 }
398}
399
400#[derive(Clone, Debug)]
402pub struct TaskTradeParams {
403 pub name: String,
405 pub simple_item_schema: models::SimpleItemSchema,
406}
407
408impl TaskTradeParams {
409 pub fn new(name: String, simple_item_schema: models::SimpleItemSchema) -> Self {
410 Self {
411 name,
412 simple_item_schema,
413 }
414 }
415}
416
417#[derive(Clone, Debug)]
419pub struct UnequipItemParams {
420 pub name: String,
422 pub unequip_schema: models::UnequipSchema,
423}
424
425impl UnequipItemParams {
426 pub fn new(name: String, unequip_schema: models::UnequipSchema) -> Self {
427 Self {
428 name,
429 unequip_schema,
430 }
431 }
432}
433
434#[derive(Clone, Debug)]
436pub struct UseItemParams {
437 pub name: String,
439 pub simple_item_schema: models::SimpleItemSchema,
440}
441
442impl UseItemParams {
443 pub fn new(name: String, simple_item_schema: models::SimpleItemSchema) -> Self {
444 Self {
445 name,
446 simple_item_schema,
447 }
448 }
449}
450
451#[derive(Clone, Debug)]
453pub struct WithdrawGoldParams {
454 pub name: String,
456 pub deposit_withdraw_gold_schema: models::DepositWithdrawGoldSchema,
457}
458
459impl WithdrawGoldParams {
460 pub fn new(
461 name: String,
462 deposit_withdraw_gold_schema: models::DepositWithdrawGoldSchema,
463 ) -> Self {
464 Self {
465 name,
466 deposit_withdraw_gold_schema,
467 }
468 }
469}
470
471#[derive(Clone, Debug)]
473pub struct WithdrawItemParams {
474 pub name: String,
476 pub simple_item_schema: Vec<models::SimpleItemSchema>,
477}
478
479impl WithdrawItemParams {
480 pub fn new(name: String, simple_item_schema: Vec<models::SimpleItemSchema>) -> Self {
481 Self {
482 name,
483 simple_item_schema,
484 }
485 }
486}
487
488#[derive(Debug, Clone, Serialize, Deserialize)]
490#[serde(untagged)]
491pub enum AcceptNewTaskError {
492 Status498,
494 Status499,
496 Status486,
498 Status598,
500 Status489,
502}
503
504impl TryFrom<StatusCode> for AcceptNewTaskError {
505 type Error = &'static str;
506 #[allow(clippy::match_single_binding)]
507 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
508 match status.as_u16() {
509 498 => Ok(Self::Status498),
510 499 => Ok(Self::Status499),
511 486 => Ok(Self::Status486),
512 598 => Ok(Self::Status598),
513 489 => Ok(Self::Status489),
514 _ => Err("status code not in spec"),
515 }
516 }
517}
518
519#[derive(Debug, Clone, Serialize, Deserialize)]
521#[serde(untagged)]
522pub enum BuyBankExpansionError {
523 Status598,
525 Status498,
527 Status499,
529 Status486,
531 Status492,
533}
534
535impl TryFrom<StatusCode> for BuyBankExpansionError {
536 type Error = &'static str;
537 #[allow(clippy::match_single_binding)]
538 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
539 match status.as_u16() {
540 598 => Ok(Self::Status598),
541 498 => Ok(Self::Status498),
542 499 => Ok(Self::Status499),
543 486 => Ok(Self::Status486),
544 492 => Ok(Self::Status492),
545 _ => Err("status code not in spec"),
546 }
547 }
548}
549
550#[derive(Debug, Clone, Serialize, Deserialize)]
552#[serde(untagged)]
553pub enum CancelTaskError {
554 Status498,
556 Status499,
558 Status486,
560 Status598,
562 Status478,
564}
565
566impl TryFrom<StatusCode> for CancelTaskError {
567 type Error = &'static str;
568 #[allow(clippy::match_single_binding)]
569 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
570 match status.as_u16() {
571 498 => Ok(Self::Status498),
572 499 => Ok(Self::Status499),
573 486 => Ok(Self::Status486),
574 598 => Ok(Self::Status598),
575 478 => Ok(Self::Status478),
576 _ => Err("status code not in spec"),
577 }
578 }
579}
580
581#[derive(Debug, Clone, Serialize, Deserialize)]
583#[serde(untagged)]
584pub enum ChangeSkinError {
585 Status499,
587 Status486,
589 Status550,
591}
592
593impl TryFrom<StatusCode> for ChangeSkinError {
594 type Error = &'static str;
595 #[allow(clippy::match_single_binding)]
596 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
597 match status.as_u16() {
598 499 => Ok(Self::Status499),
599 486 => Ok(Self::Status486),
600 550 => Ok(Self::Status550),
601 _ => Err("status code not in spec"),
602 }
603 }
604}
605
606#[derive(Debug, Clone, Serialize, Deserialize)]
608#[serde(untagged)]
609pub enum CompleteTaskError {
610 Status498,
612 Status499,
614 Status486,
616 Status598,
618 Status488,
620 Status487,
622 Status497,
624}
625
626impl TryFrom<StatusCode> for CompleteTaskError {
627 type Error = &'static str;
628 #[allow(clippy::match_single_binding)]
629 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
630 match status.as_u16() {
631 498 => Ok(Self::Status498),
632 499 => Ok(Self::Status499),
633 486 => Ok(Self::Status486),
634 598 => Ok(Self::Status598),
635 488 => Ok(Self::Status488),
636 487 => Ok(Self::Status487),
637 497 => Ok(Self::Status497),
638 _ => Err("status code not in spec"),
639 }
640 }
641}
642
643#[derive(Debug, Clone, Serialize, Deserialize)]
645#[serde(untagged)]
646pub enum CraftError {
647 Status404,
649 Status598,
651 Status498,
653 Status497,
655 Status499,
657 Status486,
659 Status493,
661 Status478,
663}
664
665impl TryFrom<StatusCode> for CraftError {
666 type Error = &'static str;
667 #[allow(clippy::match_single_binding)]
668 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
669 match status.as_u16() {
670 404 => Ok(Self::Status404),
671 598 => Ok(Self::Status598),
672 498 => Ok(Self::Status498),
673 497 => Ok(Self::Status497),
674 499 => Ok(Self::Status499),
675 486 => Ok(Self::Status486),
676 493 => Ok(Self::Status493),
677 478 => Ok(Self::Status478),
678 _ => Err("status code not in spec"),
679 }
680 }
681}
682
683#[derive(Debug, Clone, Serialize, Deserialize)]
685#[serde(untagged)]
686pub enum DeleteItemError {
687 Status498,
689 Status499,
691 Status486,
693 Status478,
695}
696
697impl TryFrom<StatusCode> for DeleteItemError {
698 type Error = &'static str;
699 #[allow(clippy::match_single_binding)]
700 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
701 match status.as_u16() {
702 498 => Ok(Self::Status498),
703 499 => Ok(Self::Status499),
704 486 => Ok(Self::Status486),
705 478 => Ok(Self::Status478),
706 _ => Err("status code not in spec"),
707 }
708 }
709}
710
711#[derive(Debug, Clone, Serialize, Deserialize)]
713#[serde(untagged)]
714pub enum DepositGoldError {
715 Status598,
717 Status492,
719 Status498,
721 Status499,
723 Status461,
725 Status486,
727}
728
729impl TryFrom<StatusCode> for DepositGoldError {
730 type Error = &'static str;
731 #[allow(clippy::match_single_binding)]
732 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
733 match status.as_u16() {
734 598 => Ok(Self::Status598),
735 492 => Ok(Self::Status492),
736 498 => Ok(Self::Status498),
737 499 => Ok(Self::Status499),
738 461 => Ok(Self::Status461),
739 486 => Ok(Self::Status486),
740 _ => Err("status code not in spec"),
741 }
742 }
743}
744
745#[derive(Debug, Clone, Serialize, Deserialize)]
747#[serde(untagged)]
748pub enum DepositItemError {
749 Status598,
751 Status404,
753 Status461,
755 Status498,
757 Status499,
759 Status486,
761 Status478,
763 Status462,
765}
766
767impl TryFrom<StatusCode> for DepositItemError {
768 type Error = &'static str;
769 #[allow(clippy::match_single_binding)]
770 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
771 match status.as_u16() {
772 598 => Ok(Self::Status598),
773 404 => Ok(Self::Status404),
774 461 => Ok(Self::Status461),
775 498 => Ok(Self::Status498),
776 499 => Ok(Self::Status499),
777 486 => Ok(Self::Status486),
778 478 => Ok(Self::Status478),
779 462 => Ok(Self::Status462),
780 _ => Err("status code not in spec"),
781 }
782 }
783}
784
785#[derive(Debug, Clone, Serialize, Deserialize)]
787#[serde(untagged)]
788pub enum EquipItemError {
789 Status404,
791 Status498,
793 Status483,
795 Status499,
797 Status486,
799 Status478,
801 Status496,
803 Status491,
805 Status485,
807 Status484,
809 Status497,
811}
812
813impl TryFrom<StatusCode> for EquipItemError {
814 type Error = &'static str;
815 #[allow(clippy::match_single_binding)]
816 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
817 match status.as_u16() {
818 404 => Ok(Self::Status404),
819 498 => Ok(Self::Status498),
820 483 => Ok(Self::Status483),
821 499 => Ok(Self::Status499),
822 486 => Ok(Self::Status486),
823 478 => Ok(Self::Status478),
824 496 => Ok(Self::Status496),
825 491 => Ok(Self::Status491),
826 485 => Ok(Self::Status485),
827 484 => Ok(Self::Status484),
828 497 => Ok(Self::Status497),
829 _ => Err("status code not in spec"),
830 }
831 }
832}
833
834#[derive(Debug, Clone, Serialize, Deserialize)]
836#[serde(untagged)]
837pub enum FightError {
838 Status498,
840 Status499,
842 Status598,
844 Status486,
846 Status497,
848}
849
850impl TryFrom<StatusCode> for FightError {
851 type Error = &'static str;
852 #[allow(clippy::match_single_binding)]
853 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
854 match status.as_u16() {
855 498 => Ok(Self::Status498),
856 499 => Ok(Self::Status499),
857 598 => Ok(Self::Status598),
858 486 => Ok(Self::Status486),
859 497 => Ok(Self::Status497),
860 _ => Err("status code not in spec"),
861 }
862 }
863}
864
865#[derive(Debug, Clone, Serialize, Deserialize)]
867#[serde(untagged)]
868pub enum GatherError {
869 Status498,
871 Status499,
873 Status598,
875 Status486,
877 Status493,
879 Status497,
881}
882
883impl TryFrom<StatusCode> for GatherError {
884 type Error = &'static str;
885 #[allow(clippy::match_single_binding)]
886 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
887 match status.as_u16() {
888 498 => Ok(Self::Status498),
889 499 => Ok(Self::Status499),
890 598 => Ok(Self::Status598),
891 486 => Ok(Self::Status486),
892 493 => Ok(Self::Status493),
893 497 => Ok(Self::Status497),
894 _ => Err("status code not in spec"),
895 }
896 }
897}
898
899#[derive(Debug, Clone, Serialize, Deserialize)]
901#[serde(untagged)]
902pub enum GeBuyItemError {
903 Status598,
905 Status498,
907 Status497,
909 Status499,
911 Status436,
913 Status486,
915 Status492,
917 Status434,
919 Status435,
921 Status404,
923}
924
925impl TryFrom<StatusCode> for GeBuyItemError {
926 type Error = &'static str;
927 #[allow(clippy::match_single_binding)]
928 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
929 match status.as_u16() {
930 598 => Ok(Self::Status598),
931 498 => Ok(Self::Status498),
932 497 => Ok(Self::Status497),
933 499 => Ok(Self::Status499),
934 436 => Ok(Self::Status436),
935 486 => Ok(Self::Status486),
936 492 => Ok(Self::Status492),
937 434 => Ok(Self::Status434),
938 435 => Ok(Self::Status435),
939 404 => Ok(Self::Status404),
940 _ => Err("status code not in spec"),
941 }
942 }
943}
944
945#[derive(Debug, Clone, Serialize, Deserialize)]
947#[serde(untagged)]
948pub enum GeCancelSellOrderError {
949 Status598,
951 Status498,
953 Status497,
955 Status499,
957 Status436,
959 Status486,
961 Status438,
963 Status404,
965}
966
967impl TryFrom<StatusCode> for GeCancelSellOrderError {
968 type Error = &'static str;
969 #[allow(clippy::match_single_binding)]
970 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
971 match status.as_u16() {
972 598 => Ok(Self::Status598),
973 498 => Ok(Self::Status498),
974 497 => Ok(Self::Status497),
975 499 => Ok(Self::Status499),
976 436 => Ok(Self::Status436),
977 486 => Ok(Self::Status486),
978 438 => Ok(Self::Status438),
979 404 => Ok(Self::Status404),
980 _ => Err("status code not in spec"),
981 }
982 }
983}
984
985#[derive(Debug, Clone, Serialize, Deserialize)]
987#[serde(untagged)]
988pub enum GeCreateSellOrderError {
989 Status498,
991 Status499,
993 Status486,
995 Status404,
997 Status478,
999 Status492,
1001 Status433,
1003 Status437,
1005 Status598,
1007}
1008
1009impl TryFrom<StatusCode> for GeCreateSellOrderError {
1010 type Error = &'static str;
1011 #[allow(clippy::match_single_binding)]
1012 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
1013 match status.as_u16() {
1014 498 => Ok(Self::Status498),
1015 499 => Ok(Self::Status499),
1016 486 => Ok(Self::Status486),
1017 404 => Ok(Self::Status404),
1018 478 => Ok(Self::Status478),
1019 492 => Ok(Self::Status492),
1020 433 => Ok(Self::Status433),
1021 437 => Ok(Self::Status437),
1022 598 => Ok(Self::Status598),
1023 _ => Err("status code not in spec"),
1024 }
1025 }
1026}
1027
1028#[derive(Debug, Clone, Serialize, Deserialize)]
1030#[serde(untagged)]
1031pub enum GetAllCharactersLogsError {
1032 Status404,
1034}
1035
1036impl TryFrom<StatusCode> for GetAllCharactersLogsError {
1037 type Error = &'static str;
1038 #[allow(clippy::match_single_binding)]
1039 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
1040 match status.as_u16() {
1041 404 => Ok(Self::Status404),
1042 _ => Err("status code not in spec"),
1043 }
1044 }
1045}
1046
1047#[derive(Debug, Clone, Serialize, Deserialize)]
1049#[serde(untagged)]
1050pub enum GetCharacterLogsError {
1051 Status404,
1053 Status498,
1055}
1056
1057impl TryFrom<StatusCode> for GetCharacterLogsError {
1058 type Error = &'static str;
1059 #[allow(clippy::match_single_binding)]
1060 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
1061 match status.as_u16() {
1062 404 => Ok(Self::Status404),
1063 498 => Ok(Self::Status498),
1064 _ => Err("status code not in spec"),
1065 }
1066 }
1067}
1068
1069#[derive(Debug, Clone, Serialize, Deserialize)]
1071#[serde(untagged)]
1072pub enum GetMyCharactersError {}
1073
1074impl TryFrom<StatusCode> for GetMyCharactersError {
1075 type Error = &'static str;
1076 #[allow(clippy::match_single_binding)]
1077 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
1078 match status.as_u16() {
1079 _ => Err("status code not in spec"),
1080 }
1081 }
1082}
1083
1084#[derive(Debug, Clone, Serialize, Deserialize)]
1086#[serde(untagged)]
1087pub enum GiveGoldError {
1088 Status498,
1090 Status499,
1092 Status492,
1094 Status486,
1096}
1097
1098impl TryFrom<StatusCode> for GiveGoldError {
1099 type Error = &'static str;
1100 #[allow(clippy::match_single_binding)]
1101 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
1102 match status.as_u16() {
1103 498 => Ok(Self::Status498),
1104 499 => Ok(Self::Status499),
1105 492 => Ok(Self::Status492),
1106 486 => Ok(Self::Status486),
1107 _ => Err("status code not in spec"),
1108 }
1109 }
1110}
1111
1112#[derive(Debug, Clone, Serialize, Deserialize)]
1114#[serde(untagged)]
1115pub enum GiveItemsError {
1116 Status404,
1118 Status498,
1120 Status499,
1122 Status497,
1124 Status486,
1126 Status478,
1128}
1129
1130impl TryFrom<StatusCode> for GiveItemsError {
1131 type Error = &'static str;
1132 #[allow(clippy::match_single_binding)]
1133 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
1134 match status.as_u16() {
1135 404 => Ok(Self::Status404),
1136 498 => Ok(Self::Status498),
1137 499 => Ok(Self::Status499),
1138 497 => Ok(Self::Status497),
1139 486 => Ok(Self::Status486),
1140 478 => Ok(Self::Status478),
1141 _ => Err("status code not in spec"),
1142 }
1143 }
1144}
1145
1146#[derive(Debug, Clone, Serialize, Deserialize)]
1148#[serde(untagged)]
1149pub enum MoveCharacterError {
1150 Status498,
1152 Status499,
1154 Status490,
1156 Status404,
1158 Status486,
1160}
1161
1162impl TryFrom<StatusCode> for MoveCharacterError {
1163 type Error = &'static str;
1164 #[allow(clippy::match_single_binding)]
1165 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
1166 match status.as_u16() {
1167 498 => Ok(Self::Status498),
1168 499 => Ok(Self::Status499),
1169 490 => Ok(Self::Status490),
1170 404 => Ok(Self::Status404),
1171 486 => Ok(Self::Status486),
1172 _ => Err("status code not in spec"),
1173 }
1174 }
1175}
1176
1177#[derive(Debug, Clone, Serialize, Deserialize)]
1179#[serde(untagged)]
1180pub enum NpcBuyItemError {
1181 Status598,
1183 Status498,
1185 Status497,
1187 Status499,
1189 Status486,
1191 Status492,
1193 Status441,
1195 Status478,
1197 Status404,
1199}
1200
1201impl TryFrom<StatusCode> for NpcBuyItemError {
1202 type Error = &'static str;
1203 #[allow(clippy::match_single_binding)]
1204 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
1205 match status.as_u16() {
1206 598 => Ok(Self::Status598),
1207 498 => Ok(Self::Status498),
1208 497 => Ok(Self::Status497),
1209 499 => Ok(Self::Status499),
1210 486 => Ok(Self::Status486),
1211 492 => Ok(Self::Status492),
1212 441 => Ok(Self::Status441),
1213 478 => Ok(Self::Status478),
1214 404 => Ok(Self::Status404),
1215 _ => Err("status code not in spec"),
1216 }
1217 }
1218}
1219
1220#[derive(Debug, Clone, Serialize, Deserialize)]
1222#[serde(untagged)]
1223pub enum NpcSellItemError {
1224 Status598,
1226 Status498,
1228 Status497,
1230 Status499,
1232 Status486,
1234 Status478,
1236 Status442,
1238 Status404,
1240}
1241
1242impl TryFrom<StatusCode> for NpcSellItemError {
1243 type Error = &'static str;
1244 #[allow(clippy::match_single_binding)]
1245 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
1246 match status.as_u16() {
1247 598 => Ok(Self::Status598),
1248 498 => Ok(Self::Status498),
1249 497 => Ok(Self::Status497),
1250 499 => Ok(Self::Status499),
1251 486 => Ok(Self::Status486),
1252 478 => Ok(Self::Status478),
1253 442 => Ok(Self::Status442),
1254 404 => Ok(Self::Status404),
1255 _ => Err("status code not in spec"),
1256 }
1257 }
1258}
1259
1260#[derive(Debug, Clone, Serialize, Deserialize)]
1262#[serde(untagged)]
1263pub enum RecycleError {
1264 Status404,
1266 Status598,
1268 Status498,
1270 Status497,
1272 Status499,
1274 Status486,
1276 Status493,
1278 Status478,
1280 Status473,
1282}
1283
1284impl TryFrom<StatusCode> for RecycleError {
1285 type Error = &'static str;
1286 #[allow(clippy::match_single_binding)]
1287 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
1288 match status.as_u16() {
1289 404 => Ok(Self::Status404),
1290 598 => Ok(Self::Status598),
1291 498 => Ok(Self::Status498),
1292 497 => Ok(Self::Status497),
1293 499 => Ok(Self::Status499),
1294 486 => Ok(Self::Status486),
1295 493 => Ok(Self::Status493),
1296 478 => Ok(Self::Status478),
1297 473 => Ok(Self::Status473),
1298 _ => Err("status code not in spec"),
1299 }
1300 }
1301}
1302
1303#[derive(Debug, Clone, Serialize, Deserialize)]
1305#[serde(untagged)]
1306pub enum RestCharacterError {
1307 Status498,
1309 Status499,
1311 Status486,
1313}
1314
1315impl TryFrom<StatusCode> for RestCharacterError {
1316 type Error = &'static str;
1317 #[allow(clippy::match_single_binding)]
1318 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
1319 match status.as_u16() {
1320 498 => Ok(Self::Status498),
1321 499 => Ok(Self::Status499),
1322 486 => Ok(Self::Status486),
1323 _ => Err("status code not in spec"),
1324 }
1325 }
1326}
1327
1328#[derive(Debug, Clone, Serialize, Deserialize)]
1330#[serde(untagged)]
1331pub enum TaskExchangeError {
1332 Status498,
1334 Status499,
1336 Status486,
1338 Status598,
1340 Status478,
1342 Status497,
1344}
1345
1346impl TryFrom<StatusCode> for TaskExchangeError {
1347 type Error = &'static str;
1348 #[allow(clippy::match_single_binding)]
1349 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
1350 match status.as_u16() {
1351 498 => Ok(Self::Status498),
1352 499 => Ok(Self::Status499),
1353 486 => Ok(Self::Status486),
1354 598 => Ok(Self::Status598),
1355 478 => Ok(Self::Status478),
1356 497 => Ok(Self::Status497),
1357 _ => Err("status code not in spec"),
1358 }
1359 }
1360}
1361
1362#[derive(Debug, Clone, Serialize, Deserialize)]
1364#[serde(untagged)]
1365pub enum TaskTradeError {
1366 Status498,
1368 Status499,
1370 Status486,
1372 Status598,
1374 Status475,
1376 Status474,
1378 Status478,
1380}
1381
1382impl TryFrom<StatusCode> for TaskTradeError {
1383 type Error = &'static str;
1384 #[allow(clippy::match_single_binding)]
1385 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
1386 match status.as_u16() {
1387 498 => Ok(Self::Status498),
1388 499 => Ok(Self::Status499),
1389 486 => Ok(Self::Status486),
1390 598 => Ok(Self::Status598),
1391 475 => Ok(Self::Status475),
1392 474 => Ok(Self::Status474),
1393 478 => Ok(Self::Status478),
1394 _ => Err("status code not in spec"),
1395 }
1396 }
1397}
1398
1399#[derive(Debug, Clone, Serialize, Deserialize)]
1401#[serde(untagged)]
1402pub enum UnequipItemError {
1403 Status404,
1405 Status498,
1407 Status486,
1409 Status491,
1411 Status497,
1413 Status478,
1415 Status483,
1417 Status499,
1419}
1420
1421impl TryFrom<StatusCode> for UnequipItemError {
1422 type Error = &'static str;
1423 #[allow(clippy::match_single_binding)]
1424 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
1425 match status.as_u16() {
1426 404 => Ok(Self::Status404),
1427 498 => Ok(Self::Status498),
1428 486 => Ok(Self::Status486),
1429 491 => Ok(Self::Status491),
1430 497 => Ok(Self::Status497),
1431 478 => Ok(Self::Status478),
1432 483 => Ok(Self::Status483),
1433 499 => Ok(Self::Status499),
1434 _ => Err("status code not in spec"),
1435 }
1436 }
1437}
1438
1439#[derive(Debug, Clone, Serialize, Deserialize)]
1441#[serde(untagged)]
1442pub enum UseItemError {
1443 Status404,
1445 Status498,
1447 Status499,
1449 Status486,
1451 Status476,
1453 Status478,
1455 Status496,
1457}
1458
1459impl TryFrom<StatusCode> for UseItemError {
1460 type Error = &'static str;
1461 #[allow(clippy::match_single_binding)]
1462 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
1463 match status.as_u16() {
1464 404 => Ok(Self::Status404),
1465 498 => Ok(Self::Status498),
1466 499 => Ok(Self::Status499),
1467 486 => Ok(Self::Status486),
1468 476 => Ok(Self::Status476),
1469 478 => Ok(Self::Status478),
1470 496 => Ok(Self::Status496),
1471 _ => Err("status code not in spec"),
1472 }
1473 }
1474}
1475
1476#[derive(Debug, Clone, Serialize, Deserialize)]
1478#[serde(untagged)]
1479pub enum WithdrawGoldError {
1480 Status498,
1482 Status499,
1484 Status461,
1486 Status486,
1488 Status598,
1490 Status460,
1492}
1493
1494impl TryFrom<StatusCode> for WithdrawGoldError {
1495 type Error = &'static str;
1496 #[allow(clippy::match_single_binding)]
1497 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
1498 match status.as_u16() {
1499 498 => Ok(Self::Status498),
1500 499 => Ok(Self::Status499),
1501 461 => Ok(Self::Status461),
1502 486 => Ok(Self::Status486),
1503 598 => Ok(Self::Status598),
1504 460 => Ok(Self::Status460),
1505 _ => Err("status code not in spec"),
1506 }
1507 }
1508}
1509
1510#[derive(Debug, Clone, Serialize, Deserialize)]
1512#[serde(untagged)]
1513pub enum WithdrawItemError {
1514 Status404,
1516 Status498,
1518 Status499,
1520 Status461,
1522 Status486,
1524 Status497,
1526 Status598,
1528 Status478,
1530}
1531
1532impl TryFrom<StatusCode> for WithdrawItemError {
1533 type Error = &'static str;
1534 #[allow(clippy::match_single_binding)]
1535 fn try_from(status: StatusCode) -> Result<Self, Self::Error> {
1536 match status.as_u16() {
1537 404 => Ok(Self::Status404),
1538 498 => Ok(Self::Status498),
1539 499 => Ok(Self::Status499),
1540 461 => Ok(Self::Status461),
1541 486 => Ok(Self::Status486),
1542 497 => Ok(Self::Status497),
1543 598 => Ok(Self::Status598),
1544 478 => Ok(Self::Status478),
1545 _ => Err("status code not in spec"),
1546 }
1547 }
1548}
1549
1550pub async fn accept_new_task(
1552 configuration: &configuration::Configuration,
1553 params: AcceptNewTaskParams,
1554) -> Result<models::TaskResponseSchema, Error<AcceptNewTaskError>> {
1555 let local_var_configuration = configuration;
1556
1557 let name = params.name;
1559
1560 let local_var_client = &local_var_configuration.client;
1561
1562 let local_var_uri_str = format!(
1563 "{}/my/{name}/action/task/new",
1564 local_var_configuration.base_path,
1565 name = crate::apis::urlencode(name)
1566 );
1567 let mut local_var_req_builder =
1568 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1569
1570 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1571 local_var_req_builder =
1572 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1573 }
1574 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1575 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1576 };
1577
1578 let local_var_req = local_var_req_builder.build()?;
1579 let local_var_resp = local_var_client.execute(local_var_req).await?;
1580
1581 let local_var_status = local_var_resp.status();
1582 let local_var_content = local_var_resp.text().await?;
1583
1584 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1585 serde_json::from_str(&local_var_content).map_err(Error::from)
1586 } else {
1587 let local_var_entity: Option<AcceptNewTaskError> = local_var_status.try_into().ok();
1588 let local_var_error = ResponseContent {
1589 status: local_var_status,
1590 content: local_var_content,
1591 entity: local_var_entity,
1592 };
1593 Err(Error::ResponseError(local_var_error))
1594 }
1595}
1596
1597pub async fn buy_bank_expansion(
1599 configuration: &configuration::Configuration,
1600 params: BuyBankExpansionParams,
1601) -> Result<models::BankExtensionTransactionResponseSchema, Error<BuyBankExpansionError>> {
1602 let local_var_configuration = configuration;
1603
1604 let name = params.name;
1606
1607 let local_var_client = &local_var_configuration.client;
1608
1609 let local_var_uri_str = format!(
1610 "{}/my/{name}/action/bank/buy_expansion",
1611 local_var_configuration.base_path,
1612 name = crate::apis::urlencode(name)
1613 );
1614 let mut local_var_req_builder =
1615 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1616
1617 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1618 local_var_req_builder =
1619 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1620 }
1621 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1622 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1623 };
1624
1625 let local_var_req = local_var_req_builder.build()?;
1626 let local_var_resp = local_var_client.execute(local_var_req).await?;
1627
1628 let local_var_status = local_var_resp.status();
1629 let local_var_content = local_var_resp.text().await?;
1630
1631 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1632 serde_json::from_str(&local_var_content).map_err(Error::from)
1633 } else {
1634 let local_var_entity: Option<BuyBankExpansionError> = local_var_status.try_into().ok();
1635 let local_var_error = ResponseContent {
1636 status: local_var_status,
1637 content: local_var_content,
1638 entity: local_var_entity,
1639 };
1640 Err(Error::ResponseError(local_var_error))
1641 }
1642}
1643
1644pub async fn cancel_task(
1646 configuration: &configuration::Configuration,
1647 params: CancelTaskParams,
1648) -> Result<models::TaskCancelledResponseSchema, Error<CancelTaskError>> {
1649 let local_var_configuration = configuration;
1650
1651 let name = params.name;
1653
1654 let local_var_client = &local_var_configuration.client;
1655
1656 let local_var_uri_str = format!(
1657 "{}/my/{name}/action/task/cancel",
1658 local_var_configuration.base_path,
1659 name = crate::apis::urlencode(name)
1660 );
1661 let mut local_var_req_builder =
1662 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1663
1664 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1665 local_var_req_builder =
1666 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1667 }
1668 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1669 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1670 };
1671
1672 let local_var_req = local_var_req_builder.build()?;
1673 let local_var_resp = local_var_client.execute(local_var_req).await?;
1674
1675 let local_var_status = local_var_resp.status();
1676 let local_var_content = local_var_resp.text().await?;
1677
1678 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1679 serde_json::from_str(&local_var_content).map_err(Error::from)
1680 } else {
1681 let local_var_entity: Option<CancelTaskError> = local_var_status.try_into().ok();
1682 let local_var_error = ResponseContent {
1683 status: local_var_status,
1684 content: local_var_content,
1685 entity: local_var_entity,
1686 };
1687 Err(Error::ResponseError(local_var_error))
1688 }
1689}
1690
1691pub async fn change_skin(
1693 configuration: &configuration::Configuration,
1694 params: ChangeSkinParams,
1695) -> Result<models::ChangeSkinResponseSchema, Error<ChangeSkinError>> {
1696 let local_var_configuration = configuration;
1697
1698 let name = params.name;
1700 let change_skin_character_schema = params.change_skin_character_schema;
1702
1703 let local_var_client = &local_var_configuration.client;
1704
1705 let local_var_uri_str = format!(
1706 "{}/my/{name}/action/change_skin",
1707 local_var_configuration.base_path,
1708 name = crate::apis::urlencode(name)
1709 );
1710 let mut local_var_req_builder =
1711 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1712
1713 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1714 local_var_req_builder =
1715 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1716 }
1717 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1718 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1719 };
1720 local_var_req_builder = local_var_req_builder.json(&change_skin_character_schema);
1721
1722 let local_var_req = local_var_req_builder.build()?;
1723 let local_var_resp = local_var_client.execute(local_var_req).await?;
1724
1725 let local_var_status = local_var_resp.status();
1726 let local_var_content = local_var_resp.text().await?;
1727
1728 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1729 serde_json::from_str(&local_var_content).map_err(Error::from)
1730 } else {
1731 let local_var_entity: Option<ChangeSkinError> = local_var_status.try_into().ok();
1732 let local_var_error = ResponseContent {
1733 status: local_var_status,
1734 content: local_var_content,
1735 entity: local_var_entity,
1736 };
1737 Err(Error::ResponseError(local_var_error))
1738 }
1739}
1740
1741pub async fn complete_task(
1743 configuration: &configuration::Configuration,
1744 params: CompleteTaskParams,
1745) -> Result<models::RewardDataResponseSchema, Error<CompleteTaskError>> {
1746 let local_var_configuration = configuration;
1747
1748 let name = params.name;
1750
1751 let local_var_client = &local_var_configuration.client;
1752
1753 let local_var_uri_str = format!(
1754 "{}/my/{name}/action/task/complete",
1755 local_var_configuration.base_path,
1756 name = crate::apis::urlencode(name)
1757 );
1758 let mut local_var_req_builder =
1759 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1760
1761 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1762 local_var_req_builder =
1763 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1764 }
1765 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1766 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1767 };
1768
1769 let local_var_req = local_var_req_builder.build()?;
1770 let local_var_resp = local_var_client.execute(local_var_req).await?;
1771
1772 let local_var_status = local_var_resp.status();
1773 let local_var_content = local_var_resp.text().await?;
1774
1775 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1776 serde_json::from_str(&local_var_content).map_err(Error::from)
1777 } else {
1778 let local_var_entity: Option<CompleteTaskError> = local_var_status.try_into().ok();
1779 let local_var_error = ResponseContent {
1780 status: local_var_status,
1781 content: local_var_content,
1782 entity: local_var_entity,
1783 };
1784 Err(Error::ResponseError(local_var_error))
1785 }
1786}
1787
1788pub async fn craft(
1790 configuration: &configuration::Configuration,
1791 params: CraftParams,
1792) -> Result<models::SkillResponseSchema, Error<CraftError>> {
1793 let local_var_configuration = configuration;
1794
1795 let name = params.name;
1797 let crafting_schema = params.crafting_schema;
1799
1800 let local_var_client = &local_var_configuration.client;
1801
1802 let local_var_uri_str = format!(
1803 "{}/my/{name}/action/crafting",
1804 local_var_configuration.base_path,
1805 name = crate::apis::urlencode(name)
1806 );
1807 let mut local_var_req_builder =
1808 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1809
1810 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1811 local_var_req_builder =
1812 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1813 }
1814 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1815 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1816 };
1817 local_var_req_builder = local_var_req_builder.json(&crafting_schema);
1818
1819 let local_var_req = local_var_req_builder.build()?;
1820 let local_var_resp = local_var_client.execute(local_var_req).await?;
1821
1822 let local_var_status = local_var_resp.status();
1823 let local_var_content = local_var_resp.text().await?;
1824
1825 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1826 serde_json::from_str(&local_var_content).map_err(Error::from)
1827 } else {
1828 let local_var_entity: Option<CraftError> = local_var_status.try_into().ok();
1829 let local_var_error = ResponseContent {
1830 status: local_var_status,
1831 content: local_var_content,
1832 entity: local_var_entity,
1833 };
1834 Err(Error::ResponseError(local_var_error))
1835 }
1836}
1837
1838pub async fn delete_item(
1840 configuration: &configuration::Configuration,
1841 params: DeleteItemParams,
1842) -> Result<models::DeleteItemResponseSchema, Error<DeleteItemError>> {
1843 let local_var_configuration = configuration;
1844
1845 let name = params.name;
1847 let simple_item_schema = params.simple_item_schema;
1849
1850 let local_var_client = &local_var_configuration.client;
1851
1852 let local_var_uri_str = format!(
1853 "{}/my/{name}/action/delete",
1854 local_var_configuration.base_path,
1855 name = crate::apis::urlencode(name)
1856 );
1857 let mut local_var_req_builder =
1858 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1859
1860 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1861 local_var_req_builder =
1862 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1863 }
1864 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1865 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1866 };
1867 local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
1868
1869 let local_var_req = local_var_req_builder.build()?;
1870 let local_var_resp = local_var_client.execute(local_var_req).await?;
1871
1872 let local_var_status = local_var_resp.status();
1873 let local_var_content = local_var_resp.text().await?;
1874
1875 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1876 serde_json::from_str(&local_var_content).map_err(Error::from)
1877 } else {
1878 let local_var_entity: Option<DeleteItemError> = local_var_status.try_into().ok();
1879 let local_var_error = ResponseContent {
1880 status: local_var_status,
1881 content: local_var_content,
1882 entity: local_var_entity,
1883 };
1884 Err(Error::ResponseError(local_var_error))
1885 }
1886}
1887
1888pub async fn deposit_gold(
1890 configuration: &configuration::Configuration,
1891 params: DepositGoldParams,
1892) -> Result<models::BankGoldTransactionResponseSchema, Error<DepositGoldError>> {
1893 let local_var_configuration = configuration;
1894
1895 let name = params.name;
1897 let deposit_withdraw_gold_schema = params.deposit_withdraw_gold_schema;
1899
1900 let local_var_client = &local_var_configuration.client;
1901
1902 let local_var_uri_str = format!(
1903 "{}/my/{name}/action/bank/deposit/gold",
1904 local_var_configuration.base_path,
1905 name = crate::apis::urlencode(name)
1906 );
1907 let mut local_var_req_builder =
1908 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1909
1910 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1911 local_var_req_builder =
1912 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1913 }
1914 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1915 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1916 };
1917 local_var_req_builder = local_var_req_builder.json(&deposit_withdraw_gold_schema);
1918
1919 let local_var_req = local_var_req_builder.build()?;
1920 let local_var_resp = local_var_client.execute(local_var_req).await?;
1921
1922 let local_var_status = local_var_resp.status();
1923 let local_var_content = local_var_resp.text().await?;
1924
1925 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1926 serde_json::from_str(&local_var_content).map_err(Error::from)
1927 } else {
1928 let local_var_entity: Option<DepositGoldError> = local_var_status.try_into().ok();
1929 let local_var_error = ResponseContent {
1930 status: local_var_status,
1931 content: local_var_content,
1932 entity: local_var_entity,
1933 };
1934 Err(Error::ResponseError(local_var_error))
1935 }
1936}
1937
1938pub async fn deposit_item(
1940 configuration: &configuration::Configuration,
1941 params: DepositItemParams,
1942) -> Result<models::BankItemTransactionResponseSchema, Error<DepositItemError>> {
1943 let local_var_configuration = configuration;
1944
1945 let name = params.name;
1947 let simple_item_schema = params.simple_item_schema;
1949
1950 let local_var_client = &local_var_configuration.client;
1951
1952 let local_var_uri_str = format!(
1953 "{}/my/{name}/action/bank/deposit/item",
1954 local_var_configuration.base_path,
1955 name = crate::apis::urlencode(name)
1956 );
1957 let mut local_var_req_builder =
1958 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1959
1960 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1961 local_var_req_builder =
1962 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1963 }
1964 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1965 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1966 };
1967 local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
1968
1969 let local_var_req = local_var_req_builder.build()?;
1970 let local_var_resp = local_var_client.execute(local_var_req).await?;
1971
1972 let local_var_status = local_var_resp.status();
1973 let local_var_content = local_var_resp.text().await?;
1974
1975 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1976 serde_json::from_str(&local_var_content).map_err(Error::from)
1977 } else {
1978 let local_var_entity: Option<DepositItemError> = local_var_status.try_into().ok();
1979 let local_var_error = ResponseContent {
1980 status: local_var_status,
1981 content: local_var_content,
1982 entity: local_var_entity,
1983 };
1984 Err(Error::ResponseError(local_var_error))
1985 }
1986}
1987
1988pub async fn equip_item(
1990 configuration: &configuration::Configuration,
1991 params: EquipItemParams,
1992) -> Result<models::EquipmentResponseSchema, Error<EquipItemError>> {
1993 let local_var_configuration = configuration;
1994
1995 let name = params.name;
1997 let equip_schema = params.equip_schema;
1999
2000 let local_var_client = &local_var_configuration.client;
2001
2002 let local_var_uri_str = format!(
2003 "{}/my/{name}/action/equip",
2004 local_var_configuration.base_path,
2005 name = crate::apis::urlencode(name)
2006 );
2007 let mut local_var_req_builder =
2008 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2009
2010 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2011 local_var_req_builder =
2012 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2013 }
2014 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2015 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2016 };
2017 local_var_req_builder = local_var_req_builder.json(&equip_schema);
2018
2019 let local_var_req = local_var_req_builder.build()?;
2020 let local_var_resp = local_var_client.execute(local_var_req).await?;
2021
2022 let local_var_status = local_var_resp.status();
2023 let local_var_content = local_var_resp.text().await?;
2024
2025 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2026 serde_json::from_str(&local_var_content).map_err(Error::from)
2027 } else {
2028 let local_var_entity: Option<EquipItemError> = local_var_status.try_into().ok();
2029 let local_var_error = ResponseContent {
2030 status: local_var_status,
2031 content: local_var_content,
2032 entity: local_var_entity,
2033 };
2034 Err(Error::ResponseError(local_var_error))
2035 }
2036}
2037
2038pub async fn fight(
2040 configuration: &configuration::Configuration,
2041 params: FightParams,
2042) -> Result<models::CharacterFightResponseSchema, Error<FightError>> {
2043 let local_var_configuration = configuration;
2044
2045 let name = params.name;
2047
2048 let local_var_client = &local_var_configuration.client;
2049
2050 let local_var_uri_str = format!(
2051 "{}/my/{name}/action/fight",
2052 local_var_configuration.base_path,
2053 name = crate::apis::urlencode(name)
2054 );
2055 let mut local_var_req_builder =
2056 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2057
2058 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2059 local_var_req_builder =
2060 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2061 }
2062 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2063 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2064 };
2065
2066 let local_var_req = local_var_req_builder.build()?;
2067 let local_var_resp = local_var_client.execute(local_var_req).await?;
2068
2069 let local_var_status = local_var_resp.status();
2070 let local_var_content = local_var_resp.text().await?;
2071
2072 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2073 serde_json::from_str(&local_var_content).map_err(Error::from)
2074 } else {
2075 let local_var_entity: Option<FightError> = local_var_status.try_into().ok();
2076 let local_var_error = ResponseContent {
2077 status: local_var_status,
2078 content: local_var_content,
2079 entity: local_var_entity,
2080 };
2081 Err(Error::ResponseError(local_var_error))
2082 }
2083}
2084
2085pub async fn gather(
2087 configuration: &configuration::Configuration,
2088 params: GatherParams,
2089) -> Result<models::SkillResponseSchema, Error<GatherError>> {
2090 let local_var_configuration = configuration;
2091
2092 let name = params.name;
2094
2095 let local_var_client = &local_var_configuration.client;
2096
2097 let local_var_uri_str = format!(
2098 "{}/my/{name}/action/gathering",
2099 local_var_configuration.base_path,
2100 name = crate::apis::urlencode(name)
2101 );
2102 let mut local_var_req_builder =
2103 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2104
2105 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2106 local_var_req_builder =
2107 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2108 }
2109 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2110 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2111 };
2112
2113 let local_var_req = local_var_req_builder.build()?;
2114 let local_var_resp = local_var_client.execute(local_var_req).await?;
2115
2116 let local_var_status = local_var_resp.status();
2117 let local_var_content = local_var_resp.text().await?;
2118
2119 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2120 serde_json::from_str(&local_var_content).map_err(Error::from)
2121 } else {
2122 let local_var_entity: Option<GatherError> = local_var_status.try_into().ok();
2123 let local_var_error = ResponseContent {
2124 status: local_var_status,
2125 content: local_var_content,
2126 entity: local_var_entity,
2127 };
2128 Err(Error::ResponseError(local_var_error))
2129 }
2130}
2131
2132pub async fn ge_buy_item(
2134 configuration: &configuration::Configuration,
2135 params: GeBuyItemParams,
2136) -> Result<models::GeTransactionResponseSchema, Error<GeBuyItemError>> {
2137 let local_var_configuration = configuration;
2138
2139 let name = params.name;
2141 let ge_buy_order_schema = params.ge_buy_order_schema;
2143
2144 let local_var_client = &local_var_configuration.client;
2145
2146 let local_var_uri_str = format!(
2147 "{}/my/{name}/action/grandexchange/buy",
2148 local_var_configuration.base_path,
2149 name = crate::apis::urlencode(name)
2150 );
2151 let mut local_var_req_builder =
2152 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2153
2154 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2155 local_var_req_builder =
2156 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2157 }
2158 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2159 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2160 };
2161 local_var_req_builder = local_var_req_builder.json(&ge_buy_order_schema);
2162
2163 let local_var_req = local_var_req_builder.build()?;
2164 let local_var_resp = local_var_client.execute(local_var_req).await?;
2165
2166 let local_var_status = local_var_resp.status();
2167 let local_var_content = local_var_resp.text().await?;
2168
2169 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2170 serde_json::from_str(&local_var_content).map_err(Error::from)
2171 } else {
2172 let local_var_entity: Option<GeBuyItemError> = local_var_status.try_into().ok();
2173 let local_var_error = ResponseContent {
2174 status: local_var_status,
2175 content: local_var_content,
2176 entity: local_var_entity,
2177 };
2178 Err(Error::ResponseError(local_var_error))
2179 }
2180}
2181
2182pub async fn ge_cancel_sell_order(
2184 configuration: &configuration::Configuration,
2185 params: GeCancelSellOrderParams,
2186) -> Result<models::GeTransactionResponseSchema, Error<GeCancelSellOrderError>> {
2187 let local_var_configuration = configuration;
2188
2189 let name = params.name;
2191 let ge_cancel_order_schema = params.ge_cancel_order_schema;
2193
2194 let local_var_client = &local_var_configuration.client;
2195
2196 let local_var_uri_str = format!(
2197 "{}/my/{name}/action/grandexchange/cancel",
2198 local_var_configuration.base_path,
2199 name = crate::apis::urlencode(name)
2200 );
2201 let mut local_var_req_builder =
2202 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2203
2204 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2205 local_var_req_builder =
2206 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2207 }
2208 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2209 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2210 };
2211 local_var_req_builder = local_var_req_builder.json(&ge_cancel_order_schema);
2212
2213 let local_var_req = local_var_req_builder.build()?;
2214 let local_var_resp = local_var_client.execute(local_var_req).await?;
2215
2216 let local_var_status = local_var_resp.status();
2217 let local_var_content = local_var_resp.text().await?;
2218
2219 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2220 serde_json::from_str(&local_var_content).map_err(Error::from)
2221 } else {
2222 let local_var_entity: Option<GeCancelSellOrderError> = local_var_status.try_into().ok();
2223 let local_var_error = ResponseContent {
2224 status: local_var_status,
2225 content: local_var_content,
2226 entity: local_var_entity,
2227 };
2228 Err(Error::ResponseError(local_var_error))
2229 }
2230}
2231
2232pub async fn ge_create_sell_order(
2234 configuration: &configuration::Configuration,
2235 params: GeCreateSellOrderParams,
2236) -> Result<models::GeCreateOrderTransactionResponseSchema, Error<GeCreateSellOrderError>> {
2237 let local_var_configuration = configuration;
2238
2239 let name = params.name;
2241 let ge_order_creationr_schema = params.ge_order_creationr_schema;
2243
2244 let local_var_client = &local_var_configuration.client;
2245
2246 let local_var_uri_str = format!(
2247 "{}/my/{name}/action/grandexchange/sell",
2248 local_var_configuration.base_path,
2249 name = crate::apis::urlencode(name)
2250 );
2251 let mut local_var_req_builder =
2252 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2253
2254 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2255 local_var_req_builder =
2256 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2257 }
2258 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2259 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2260 };
2261 local_var_req_builder = local_var_req_builder.json(&ge_order_creationr_schema);
2262
2263 let local_var_req = local_var_req_builder.build()?;
2264 let local_var_resp = local_var_client.execute(local_var_req).await?;
2265
2266 let local_var_status = local_var_resp.status();
2267 let local_var_content = local_var_resp.text().await?;
2268
2269 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2270 serde_json::from_str(&local_var_content).map_err(Error::from)
2271 } else {
2272 let local_var_entity: Option<GeCreateSellOrderError> = local_var_status.try_into().ok();
2273 let local_var_error = ResponseContent {
2274 status: local_var_status,
2275 content: local_var_content,
2276 entity: local_var_entity,
2277 };
2278 Err(Error::ResponseError(local_var_error))
2279 }
2280}
2281
2282pub async fn get_all_characters_logs(
2284 configuration: &configuration::Configuration,
2285 params: GetAllCharactersLogsParams,
2286) -> Result<models::DataPageLogSchema, Error<GetAllCharactersLogsError>> {
2287 let local_var_configuration = configuration;
2288
2289 let page = params.page;
2291 let size = params.size;
2293
2294 let local_var_client = &local_var_configuration.client;
2295
2296 let local_var_uri_str = format!("{}/my/logs", local_var_configuration.base_path);
2297 let mut local_var_req_builder =
2298 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2299
2300 if let Some(ref local_var_str) = page {
2301 local_var_req_builder =
2302 local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2303 }
2304 if let Some(ref local_var_str) = size {
2305 local_var_req_builder =
2306 local_var_req_builder.query(&[("size", &local_var_str.to_string())]);
2307 }
2308 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2309 local_var_req_builder =
2310 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2311 }
2312 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2313 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2314 };
2315
2316 let local_var_req = local_var_req_builder.build()?;
2317 let local_var_resp = local_var_client.execute(local_var_req).await?;
2318
2319 let local_var_status = local_var_resp.status();
2320 let local_var_content = local_var_resp.text().await?;
2321
2322 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2323 serde_json::from_str(&local_var_content).map_err(Error::from)
2324 } else {
2325 let local_var_entity: Option<GetAllCharactersLogsError> = local_var_status.try_into().ok();
2326 let local_var_error = ResponseContent {
2327 status: local_var_status,
2328 content: local_var_content,
2329 entity: local_var_entity,
2330 };
2331 Err(Error::ResponseError(local_var_error))
2332 }
2333}
2334
2335pub async fn get_character_logs(
2337 configuration: &configuration::Configuration,
2338 params: GetCharacterLogsParams,
2339) -> Result<models::DataPageLogSchema, Error<GetCharacterLogsError>> {
2340 let local_var_configuration = configuration;
2341
2342 let name = params.name;
2344 let page = params.page;
2346 let size = params.size;
2348
2349 let local_var_client = &local_var_configuration.client;
2350
2351 let local_var_uri_str = format!(
2352 "{}/my/logs/{name}",
2353 local_var_configuration.base_path,
2354 name = crate::apis::urlencode(name)
2355 );
2356 let mut local_var_req_builder =
2357 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2358
2359 if let Some(ref local_var_str) = page {
2360 local_var_req_builder =
2361 local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2362 }
2363 if let Some(ref local_var_str) = size {
2364 local_var_req_builder =
2365 local_var_req_builder.query(&[("size", &local_var_str.to_string())]);
2366 }
2367 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2368 local_var_req_builder =
2369 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2370 }
2371 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2372 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2373 };
2374
2375 let local_var_req = local_var_req_builder.build()?;
2376 let local_var_resp = local_var_client.execute(local_var_req).await?;
2377
2378 let local_var_status = local_var_resp.status();
2379 let local_var_content = local_var_resp.text().await?;
2380
2381 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2382 serde_json::from_str(&local_var_content).map_err(Error::from)
2383 } else {
2384 let local_var_entity: Option<GetCharacterLogsError> = local_var_status.try_into().ok();
2385 let local_var_error = ResponseContent {
2386 status: local_var_status,
2387 content: local_var_content,
2388 entity: local_var_entity,
2389 };
2390 Err(Error::ResponseError(local_var_error))
2391 }
2392}
2393
2394pub async fn get_my_characters(
2396 configuration: &configuration::Configuration,
2397) -> Result<models::MyCharactersListSchema, Error<GetMyCharactersError>> {
2398 let local_var_configuration = configuration;
2399
2400 let local_var_client = &local_var_configuration.client;
2401
2402 let local_var_uri_str = format!("{}/my/characters", local_var_configuration.base_path);
2403 let mut local_var_req_builder =
2404 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2405
2406 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2407 local_var_req_builder =
2408 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2409 }
2410 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2411 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2412 };
2413
2414 let local_var_req = local_var_req_builder.build()?;
2415 let local_var_resp = local_var_client.execute(local_var_req).await?;
2416
2417 let local_var_status = local_var_resp.status();
2418 let local_var_content = local_var_resp.text().await?;
2419
2420 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2421 serde_json::from_str(&local_var_content).map_err(Error::from)
2422 } else {
2423 let local_var_entity: Option<GetMyCharactersError> = local_var_status.try_into().ok();
2424 let local_var_error = ResponseContent {
2425 status: local_var_status,
2426 content: local_var_content,
2427 entity: local_var_entity,
2428 };
2429 Err(Error::ResponseError(local_var_error))
2430 }
2431}
2432
2433pub async fn give_gold(
2435 configuration: &configuration::Configuration,
2436 params: GiveGoldParams,
2437) -> Result<models::GiveGoldReponseSchema, Error<GiveGoldError>> {
2438 let local_var_configuration = configuration;
2439
2440 let name = params.name;
2442 let give_gold_schema = params.give_gold_schema;
2444
2445 let local_var_client = &local_var_configuration.client;
2446
2447 let local_var_uri_str = format!(
2448 "{}/my/{name}/action/give/gold",
2449 local_var_configuration.base_path,
2450 name = crate::apis::urlencode(name)
2451 );
2452 let mut local_var_req_builder =
2453 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2454
2455 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2456 local_var_req_builder =
2457 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2458 }
2459 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2460 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2461 };
2462 local_var_req_builder = local_var_req_builder.json(&give_gold_schema);
2463
2464 let local_var_req = local_var_req_builder.build()?;
2465 let local_var_resp = local_var_client.execute(local_var_req).await?;
2466
2467 let local_var_status = local_var_resp.status();
2468 let local_var_content = local_var_resp.text().await?;
2469
2470 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2471 serde_json::from_str(&local_var_content).map_err(Error::from)
2472 } else {
2473 let local_var_entity: Option<GiveGoldError> = local_var_status.try_into().ok();
2474 let local_var_error = ResponseContent {
2475 status: local_var_status,
2476 content: local_var_content,
2477 entity: local_var_entity,
2478 };
2479 Err(Error::ResponseError(local_var_error))
2480 }
2481}
2482
2483pub async fn give_items(
2485 configuration: &configuration::Configuration,
2486 params: GiveItemsParams,
2487) -> Result<models::GiveItemReponseSchema, Error<GiveItemsError>> {
2488 let local_var_configuration = configuration;
2489
2490 let name = params.name;
2492 let give_items_schema = params.give_items_schema;
2494
2495 let local_var_client = &local_var_configuration.client;
2496
2497 let local_var_uri_str = format!(
2498 "{}/my/{name}/action/give/item",
2499 local_var_configuration.base_path,
2500 name = crate::apis::urlencode(name)
2501 );
2502 let mut local_var_req_builder =
2503 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2504
2505 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2506 local_var_req_builder =
2507 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2508 }
2509 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2510 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2511 };
2512 local_var_req_builder = local_var_req_builder.json(&give_items_schema);
2513
2514 let local_var_req = local_var_req_builder.build()?;
2515 let local_var_resp = local_var_client.execute(local_var_req).await?;
2516
2517 let local_var_status = local_var_resp.status();
2518 let local_var_content = local_var_resp.text().await?;
2519
2520 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2521 serde_json::from_str(&local_var_content).map_err(Error::from)
2522 } else {
2523 let local_var_entity: Option<GiveItemsError> = local_var_status.try_into().ok();
2524 let local_var_error = ResponseContent {
2525 status: local_var_status,
2526 content: local_var_content,
2527 entity: local_var_entity,
2528 };
2529 Err(Error::ResponseError(local_var_error))
2530 }
2531}
2532
2533pub async fn move_character(
2535 configuration: &configuration::Configuration,
2536 params: MoveCharacterParams,
2537) -> Result<models::CharacterMovementResponseSchema, Error<MoveCharacterError>> {
2538 let local_var_configuration = configuration;
2539
2540 let name = params.name;
2542 let destination_schema = params.destination_schema;
2544
2545 let local_var_client = &local_var_configuration.client;
2546
2547 let local_var_uri_str = format!(
2548 "{}/my/{name}/action/move",
2549 local_var_configuration.base_path,
2550 name = crate::apis::urlencode(name)
2551 );
2552 let mut local_var_req_builder =
2553 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2554
2555 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2556 local_var_req_builder =
2557 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2558 }
2559 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2560 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2561 };
2562 local_var_req_builder = local_var_req_builder.json(&destination_schema);
2563
2564 let local_var_req = local_var_req_builder.build()?;
2565 let local_var_resp = local_var_client.execute(local_var_req).await?;
2566
2567 let local_var_status = local_var_resp.status();
2568 let local_var_content = local_var_resp.text().await?;
2569
2570 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2571 serde_json::from_str(&local_var_content).map_err(Error::from)
2572 } else {
2573 let local_var_entity: Option<MoveCharacterError> = local_var_status.try_into().ok();
2574 let local_var_error = ResponseContent {
2575 status: local_var_status,
2576 content: local_var_content,
2577 entity: local_var_entity,
2578 };
2579 Err(Error::ResponseError(local_var_error))
2580 }
2581}
2582
2583pub async fn npc_buy_item(
2585 configuration: &configuration::Configuration,
2586 params: NpcBuyItemParams,
2587) -> Result<models::NpcMerchantTransactionResponseSchema, Error<NpcBuyItemError>> {
2588 let local_var_configuration = configuration;
2589
2590 let name = params.name;
2592 let npc_merchant_buy_schema = params.npc_merchant_buy_schema;
2594
2595 let local_var_client = &local_var_configuration.client;
2596
2597 let local_var_uri_str = format!(
2598 "{}/my/{name}/action/npc/buy",
2599 local_var_configuration.base_path,
2600 name = crate::apis::urlencode(name)
2601 );
2602 let mut local_var_req_builder =
2603 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2604
2605 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2606 local_var_req_builder =
2607 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2608 }
2609 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2610 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2611 };
2612 local_var_req_builder = local_var_req_builder.json(&npc_merchant_buy_schema);
2613
2614 let local_var_req = local_var_req_builder.build()?;
2615 let local_var_resp = local_var_client.execute(local_var_req).await?;
2616
2617 let local_var_status = local_var_resp.status();
2618 let local_var_content = local_var_resp.text().await?;
2619
2620 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2621 serde_json::from_str(&local_var_content).map_err(Error::from)
2622 } else {
2623 let local_var_entity: Option<NpcBuyItemError> = local_var_status.try_into().ok();
2624 let local_var_error = ResponseContent {
2625 status: local_var_status,
2626 content: local_var_content,
2627 entity: local_var_entity,
2628 };
2629 Err(Error::ResponseError(local_var_error))
2630 }
2631}
2632
2633pub async fn npc_sell_item(
2635 configuration: &configuration::Configuration,
2636 params: NpcSellItemParams,
2637) -> Result<models::NpcMerchantTransactionResponseSchema, Error<NpcSellItemError>> {
2638 let local_var_configuration = configuration;
2639
2640 let name = params.name;
2642 let npc_merchant_buy_schema = params.npc_merchant_buy_schema;
2644
2645 let local_var_client = &local_var_configuration.client;
2646
2647 let local_var_uri_str = format!(
2648 "{}/my/{name}/action/npc/sell",
2649 local_var_configuration.base_path,
2650 name = crate::apis::urlencode(name)
2651 );
2652 let mut local_var_req_builder =
2653 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2654
2655 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2656 local_var_req_builder =
2657 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2658 }
2659 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2660 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2661 };
2662 local_var_req_builder = local_var_req_builder.json(&npc_merchant_buy_schema);
2663
2664 let local_var_req = local_var_req_builder.build()?;
2665 let local_var_resp = local_var_client.execute(local_var_req).await?;
2666
2667 let local_var_status = local_var_resp.status();
2668 let local_var_content = local_var_resp.text().await?;
2669
2670 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2671 serde_json::from_str(&local_var_content).map_err(Error::from)
2672 } else {
2673 let local_var_entity: Option<NpcSellItemError> = local_var_status.try_into().ok();
2674 let local_var_error = ResponseContent {
2675 status: local_var_status,
2676 content: local_var_content,
2677 entity: local_var_entity,
2678 };
2679 Err(Error::ResponseError(local_var_error))
2680 }
2681}
2682
2683pub async fn recycle(
2685 configuration: &configuration::Configuration,
2686 params: RecycleParams,
2687) -> Result<models::RecyclingResponseSchema, Error<RecycleError>> {
2688 let local_var_configuration = configuration;
2689
2690 let name = params.name;
2692 let recycling_schema = params.recycling_schema;
2694
2695 let local_var_client = &local_var_configuration.client;
2696
2697 let local_var_uri_str = format!(
2698 "{}/my/{name}/action/recycling",
2699 local_var_configuration.base_path,
2700 name = crate::apis::urlencode(name)
2701 );
2702 let mut local_var_req_builder =
2703 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2704
2705 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2706 local_var_req_builder =
2707 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2708 }
2709 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2710 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2711 };
2712 local_var_req_builder = local_var_req_builder.json(&recycling_schema);
2713
2714 let local_var_req = local_var_req_builder.build()?;
2715 let local_var_resp = local_var_client.execute(local_var_req).await?;
2716
2717 let local_var_status = local_var_resp.status();
2718 let local_var_content = local_var_resp.text().await?;
2719
2720 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2721 serde_json::from_str(&local_var_content).map_err(Error::from)
2722 } else {
2723 let local_var_entity: Option<RecycleError> = local_var_status.try_into().ok();
2724 let local_var_error = ResponseContent {
2725 status: local_var_status,
2726 content: local_var_content,
2727 entity: local_var_entity,
2728 };
2729 Err(Error::ResponseError(local_var_error))
2730 }
2731}
2732
2733pub async fn rest_character(
2735 configuration: &configuration::Configuration,
2736 params: RestCharacterParams,
2737) -> Result<models::CharacterRestResponseSchema, Error<RestCharacterError>> {
2738 let local_var_configuration = configuration;
2739
2740 let name = params.name;
2742
2743 let local_var_client = &local_var_configuration.client;
2744
2745 let local_var_uri_str = format!(
2746 "{}/my/{name}/action/rest",
2747 local_var_configuration.base_path,
2748 name = crate::apis::urlencode(name)
2749 );
2750 let mut local_var_req_builder =
2751 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2752
2753 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2754 local_var_req_builder =
2755 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2756 }
2757 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2758 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2759 };
2760
2761 let local_var_req = local_var_req_builder.build()?;
2762 let local_var_resp = local_var_client.execute(local_var_req).await?;
2763
2764 let local_var_status = local_var_resp.status();
2765 let local_var_content = local_var_resp.text().await?;
2766
2767 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2768 serde_json::from_str(&local_var_content).map_err(Error::from)
2769 } else {
2770 let local_var_entity: Option<RestCharacterError> = local_var_status.try_into().ok();
2771 let local_var_error = ResponseContent {
2772 status: local_var_status,
2773 content: local_var_content,
2774 entity: local_var_entity,
2775 };
2776 Err(Error::ResponseError(local_var_error))
2777 }
2778}
2779
2780pub async fn task_exchange(
2782 configuration: &configuration::Configuration,
2783 params: TaskExchangeParams,
2784) -> Result<models::RewardDataResponseSchema, Error<TaskExchangeError>> {
2785 let local_var_configuration = configuration;
2786
2787 let name = params.name;
2789
2790 let local_var_client = &local_var_configuration.client;
2791
2792 let local_var_uri_str = format!(
2793 "{}/my/{name}/action/task/exchange",
2794 local_var_configuration.base_path,
2795 name = crate::apis::urlencode(name)
2796 );
2797 let mut local_var_req_builder =
2798 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2799
2800 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2801 local_var_req_builder =
2802 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2803 }
2804 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2805 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2806 };
2807
2808 let local_var_req = local_var_req_builder.build()?;
2809 let local_var_resp = local_var_client.execute(local_var_req).await?;
2810
2811 let local_var_status = local_var_resp.status();
2812 let local_var_content = local_var_resp.text().await?;
2813
2814 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2815 serde_json::from_str(&local_var_content).map_err(Error::from)
2816 } else {
2817 let local_var_entity: Option<TaskExchangeError> = local_var_status.try_into().ok();
2818 let local_var_error = ResponseContent {
2819 status: local_var_status,
2820 content: local_var_content,
2821 entity: local_var_entity,
2822 };
2823 Err(Error::ResponseError(local_var_error))
2824 }
2825}
2826
2827pub async fn task_trade(
2829 configuration: &configuration::Configuration,
2830 params: TaskTradeParams,
2831) -> Result<models::TaskTradeResponseSchema, Error<TaskTradeError>> {
2832 let local_var_configuration = configuration;
2833
2834 let name = params.name;
2836 let simple_item_schema = params.simple_item_schema;
2838
2839 let local_var_client = &local_var_configuration.client;
2840
2841 let local_var_uri_str = format!(
2842 "{}/my/{name}/action/task/trade",
2843 local_var_configuration.base_path,
2844 name = crate::apis::urlencode(name)
2845 );
2846 let mut local_var_req_builder =
2847 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2848
2849 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2850 local_var_req_builder =
2851 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2852 }
2853 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2854 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2855 };
2856 local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
2857
2858 let local_var_req = local_var_req_builder.build()?;
2859 let local_var_resp = local_var_client.execute(local_var_req).await?;
2860
2861 let local_var_status = local_var_resp.status();
2862 let local_var_content = local_var_resp.text().await?;
2863
2864 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2865 serde_json::from_str(&local_var_content).map_err(Error::from)
2866 } else {
2867 let local_var_entity: Option<TaskTradeError> = local_var_status.try_into().ok();
2868 let local_var_error = ResponseContent {
2869 status: local_var_status,
2870 content: local_var_content,
2871 entity: local_var_entity,
2872 };
2873 Err(Error::ResponseError(local_var_error))
2874 }
2875}
2876
2877pub async fn unequip_item(
2879 configuration: &configuration::Configuration,
2880 params: UnequipItemParams,
2881) -> Result<models::EquipmentResponseSchema, Error<UnequipItemError>> {
2882 let local_var_configuration = configuration;
2883
2884 let name = params.name;
2886 let unequip_schema = params.unequip_schema;
2888
2889 let local_var_client = &local_var_configuration.client;
2890
2891 let local_var_uri_str = format!(
2892 "{}/my/{name}/action/unequip",
2893 local_var_configuration.base_path,
2894 name = crate::apis::urlencode(name)
2895 );
2896 let mut local_var_req_builder =
2897 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2898
2899 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2900 local_var_req_builder =
2901 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2902 }
2903 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2904 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2905 };
2906 local_var_req_builder = local_var_req_builder.json(&unequip_schema);
2907
2908 let local_var_req = local_var_req_builder.build()?;
2909 let local_var_resp = local_var_client.execute(local_var_req).await?;
2910
2911 let local_var_status = local_var_resp.status();
2912 let local_var_content = local_var_resp.text().await?;
2913
2914 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2915 serde_json::from_str(&local_var_content).map_err(Error::from)
2916 } else {
2917 let local_var_entity: Option<UnequipItemError> = local_var_status.try_into().ok();
2918 let local_var_error = ResponseContent {
2919 status: local_var_status,
2920 content: local_var_content,
2921 entity: local_var_entity,
2922 };
2923 Err(Error::ResponseError(local_var_error))
2924 }
2925}
2926
2927pub async fn use_item(
2929 configuration: &configuration::Configuration,
2930 params: UseItemParams,
2931) -> Result<models::UseItemResponseSchema, Error<UseItemError>> {
2932 let local_var_configuration = configuration;
2933
2934 let name = params.name;
2936 let simple_item_schema = params.simple_item_schema;
2938
2939 let local_var_client = &local_var_configuration.client;
2940
2941 let local_var_uri_str = format!(
2942 "{}/my/{name}/action/use",
2943 local_var_configuration.base_path,
2944 name = crate::apis::urlencode(name)
2945 );
2946 let mut local_var_req_builder =
2947 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2948
2949 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2950 local_var_req_builder =
2951 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2952 }
2953 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2954 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2955 };
2956 local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
2957
2958 let local_var_req = local_var_req_builder.build()?;
2959 let local_var_resp = local_var_client.execute(local_var_req).await?;
2960
2961 let local_var_status = local_var_resp.status();
2962 let local_var_content = local_var_resp.text().await?;
2963
2964 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2965 serde_json::from_str(&local_var_content).map_err(Error::from)
2966 } else {
2967 let local_var_entity: Option<UseItemError> = local_var_status.try_into().ok();
2968 let local_var_error = ResponseContent {
2969 status: local_var_status,
2970 content: local_var_content,
2971 entity: local_var_entity,
2972 };
2973 Err(Error::ResponseError(local_var_error))
2974 }
2975}
2976
2977pub async fn withdraw_gold(
2979 configuration: &configuration::Configuration,
2980 params: WithdrawGoldParams,
2981) -> Result<models::BankGoldTransactionResponseSchema, Error<WithdrawGoldError>> {
2982 let local_var_configuration = configuration;
2983
2984 let name = params.name;
2986 let deposit_withdraw_gold_schema = params.deposit_withdraw_gold_schema;
2988
2989 let local_var_client = &local_var_configuration.client;
2990
2991 let local_var_uri_str = format!(
2992 "{}/my/{name}/action/bank/withdraw/gold",
2993 local_var_configuration.base_path,
2994 name = crate::apis::urlencode(name)
2995 );
2996 let mut local_var_req_builder =
2997 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2998
2999 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3000 local_var_req_builder =
3001 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3002 }
3003 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3004 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3005 };
3006 local_var_req_builder = local_var_req_builder.json(&deposit_withdraw_gold_schema);
3007
3008 let local_var_req = local_var_req_builder.build()?;
3009 let local_var_resp = local_var_client.execute(local_var_req).await?;
3010
3011 let local_var_status = local_var_resp.status();
3012 let local_var_content = local_var_resp.text().await?;
3013
3014 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3015 serde_json::from_str(&local_var_content).map_err(Error::from)
3016 } else {
3017 let local_var_entity: Option<WithdrawGoldError> = local_var_status.try_into().ok();
3018 let local_var_error = ResponseContent {
3019 status: local_var_status,
3020 content: local_var_content,
3021 entity: local_var_entity,
3022 };
3023 Err(Error::ResponseError(local_var_error))
3024 }
3025}
3026
3027pub async fn withdraw_item(
3029 configuration: &configuration::Configuration,
3030 params: WithdrawItemParams,
3031) -> Result<models::BankItemTransactionResponseSchema, Error<WithdrawItemError>> {
3032 let local_var_configuration = configuration;
3033
3034 let name = params.name;
3036 let simple_item_schema = params.simple_item_schema;
3038
3039 let local_var_client = &local_var_configuration.client;
3040
3041 let local_var_uri_str = format!(
3042 "{}/my/{name}/action/bank/withdraw/item",
3043 local_var_configuration.base_path,
3044 name = crate::apis::urlencode(name)
3045 );
3046 let mut local_var_req_builder =
3047 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3048
3049 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3050 local_var_req_builder =
3051 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3052 }
3053 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3054 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3055 };
3056 local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
3057
3058 let local_var_req = local_var_req_builder.build()?;
3059 let local_var_resp = local_var_client.execute(local_var_req).await?;
3060
3061 let local_var_status = local_var_resp.status();
3062 let local_var_content = local_var_resp.text().await?;
3063
3064 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3065 serde_json::from_str(&local_var_content).map_err(Error::from)
3066 } else {
3067 let local_var_entity: Option<WithdrawItemError> = local_var_status.try_into().ok();
3068 let local_var_error = ResponseContent {
3069 status: local_var_status,
3070 content: local_var_content,
3071 entity: local_var_entity,
3072 };
3073 Err(Error::ResponseError(local_var_error))
3074 }
3075}