1use super::{configuration, Error};
2use crate::{apis::ResponseContent, models};
3use reqwest::StatusCode;
4use serde::{de, Deserialize, Deserializer, 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 ActionTransitionParams {
22 pub name: String,
24}
25
26impl ActionTransitionParams {
27 pub fn new(name: String) -> Self {
28 Self { name }
29 }
30}
31
32#[derive(Clone, Debug)]
34pub struct BuyBankExpansionParams {
35 pub name: String,
37}
38
39impl BuyBankExpansionParams {
40 pub fn new(name: String) -> Self {
41 Self { name }
42 }
43}
44
45#[derive(Clone, Debug)]
47pub struct CancelTaskParams {
48 pub name: String,
50}
51
52impl CancelTaskParams {
53 pub fn new(name: String) -> Self {
54 Self { name }
55 }
56}
57
58#[derive(Clone, Debug)]
60pub struct ChangeSkinParams {
61 pub name: String,
63 pub change_skin_character_schema: models::ChangeSkinCharacterSchema,
64}
65
66impl ChangeSkinParams {
67 pub fn new(
68 name: String,
69 change_skin_character_schema: models::ChangeSkinCharacterSchema,
70 ) -> Self {
71 Self {
72 name,
73 change_skin_character_schema,
74 }
75 }
76}
77
78#[derive(Clone, Debug)]
80pub struct ClaimPendingItemParams {
81 pub name: String,
83 pub id: String,
85}
86
87impl ClaimPendingItemParams {
88 pub fn new(name: String, id: String) -> Self {
89 Self { name, id }
90 }
91}
92
93#[derive(Clone, Debug)]
95pub struct CompleteTaskParams {
96 pub name: String,
98}
99
100impl CompleteTaskParams {
101 pub fn new(name: String) -> Self {
102 Self { name }
103 }
104}
105
106#[derive(Clone, Debug)]
108pub struct CraftParams {
109 pub name: String,
111 pub crafting_schema: models::CraftingSchema,
112}
113
114impl CraftParams {
115 pub fn new(name: String, crafting_schema: models::CraftingSchema) -> Self {
116 Self {
117 name,
118 crafting_schema,
119 }
120 }
121}
122
123#[derive(Clone, Debug)]
125pub struct DeleteItemParams {
126 pub name: String,
128 pub simple_item_schema: models::SimpleItemSchema,
129}
130
131impl DeleteItemParams {
132 pub fn new(name: String, simple_item_schema: models::SimpleItemSchema) -> Self {
133 Self {
134 name,
135 simple_item_schema,
136 }
137 }
138}
139
140#[derive(Clone, Debug)]
142pub struct DepositGoldParams {
143 pub name: String,
145 pub deposit_withdraw_gold_schema: models::DepositWithdrawGoldSchema,
146}
147
148impl DepositGoldParams {
149 pub fn new(
150 name: String,
151 deposit_withdraw_gold_schema: models::DepositWithdrawGoldSchema,
152 ) -> Self {
153 Self {
154 name,
155 deposit_withdraw_gold_schema,
156 }
157 }
158}
159
160#[derive(Clone, Debug)]
162pub struct DepositItemParams {
163 pub name: String,
165 pub simple_item_schema: Vec<models::SimpleItemSchema>,
166}
167
168impl DepositItemParams {
169 pub fn new(name: String, simple_item_schema: Vec<models::SimpleItemSchema>) -> Self {
170 Self {
171 name,
172 simple_item_schema,
173 }
174 }
175}
176
177#[derive(Clone, Debug)]
179pub struct EquipItemParams {
180 pub name: String,
182 pub equip_schema: Vec<models::EquipSchema>,
183}
184
185impl EquipItemParams {
186 pub fn new(name: String, equip_schema: Vec<models::EquipSchema>) -> Self {
187 Self { name, equip_schema }
188 }
189}
190
191#[derive(Clone, Debug)]
193pub struct FightParams {
194 pub name: String,
196 pub fight_request_schema: Option<models::FightRequestSchema>,
197}
198
199impl FightParams {
200 pub fn new(name: String, fight_request_schema: Option<models::FightRequestSchema>) -> Self {
201 Self {
202 name,
203 fight_request_schema,
204 }
205 }
206}
207
208#[derive(Clone, Debug)]
210pub struct GatherParams {
211 pub name: String,
213}
214
215impl GatherParams {
216 pub fn new(name: String) -> Self {
217 Self { name }
218 }
219}
220
221#[derive(Clone, Debug)]
223pub struct GeBuyItemParams {
224 pub name: String,
226 pub ge_buy_order_schema: models::GeBuyOrderSchema,
227}
228
229impl GeBuyItemParams {
230 pub fn new(name: String, ge_buy_order_schema: models::GeBuyOrderSchema) -> Self {
231 Self {
232 name,
233 ge_buy_order_schema,
234 }
235 }
236}
237
238#[derive(Clone, Debug)]
240pub struct GeCancelOrderParams {
241 pub name: String,
243 pub ge_cancel_order_schema: models::GeCancelOrderSchema,
244}
245
246impl GeCancelOrderParams {
247 pub fn new(name: String, ge_cancel_order_schema: models::GeCancelOrderSchema) -> Self {
248 Self {
249 name,
250 ge_cancel_order_schema,
251 }
252 }
253}
254
255#[derive(Clone, Debug)]
257pub struct GeCreateBuyOrderParams {
258 pub name: String,
260 pub ge_buy_order_creation_schema: models::GeBuyOrderCreationSchema,
261}
262
263impl GeCreateBuyOrderParams {
264 pub fn new(
265 name: String,
266 ge_buy_order_creation_schema: models::GeBuyOrderCreationSchema,
267 ) -> Self {
268 Self {
269 name,
270 ge_buy_order_creation_schema,
271 }
272 }
273}
274
275#[derive(Clone, Debug)]
277pub struct GeCreateSellOrderParams {
278 pub name: String,
280 pub ge_order_creation_schema: models::GeOrderCreationSchema,
281}
282
283impl GeCreateSellOrderParams {
284 pub fn new(name: String, ge_order_creation_schema: models::GeOrderCreationSchema) -> Self {
285 Self {
286 name,
287 ge_order_creation_schema,
288 }
289 }
290}
291
292#[derive(Clone, Debug)]
294pub struct GeFillOrderParams {
295 pub name: String,
297 pub ge_fill_buy_order_schema: models::GeFillBuyOrderSchema,
298}
299
300impl GeFillOrderParams {
301 pub fn new(name: String, ge_fill_buy_order_schema: models::GeFillBuyOrderSchema) -> Self {
302 Self {
303 name,
304 ge_fill_buy_order_schema,
305 }
306 }
307}
308
309#[derive(Clone, Debug)]
311pub struct GetAllCharactersLogsParams {
312 pub page: Option<u32>,
314 pub size: Option<u32>,
316}
317
318impl GetAllCharactersLogsParams {
319 pub fn new(page: Option<u32>, size: Option<u32>) -> Self {
320 Self { page, size }
321 }
322}
323
324#[derive(Clone, Debug)]
326pub struct GetCharacterLogsParams {
327 pub name: String,
329 pub page: Option<u32>,
331 pub size: Option<u32>,
333}
334
335impl GetCharacterLogsParams {
336 pub fn new(name: String, page: Option<u32>, size: Option<u32>) -> Self {
337 Self { name, page, size }
338 }
339}
340
341#[derive(Clone, Debug)]
343pub struct GiveGoldParams {
344 pub name: String,
346 pub give_gold_schema: models::GiveGoldSchema,
347}
348
349impl GiveGoldParams {
350 pub fn new(name: String, give_gold_schema: models::GiveGoldSchema) -> Self {
351 Self {
352 name,
353 give_gold_schema,
354 }
355 }
356}
357
358#[derive(Clone, Debug)]
360pub struct GiveItemsParams {
361 pub name: String,
363 pub give_items_schema: models::GiveItemsSchema,
364}
365
366impl GiveItemsParams {
367 pub fn new(name: String, give_items_schema: models::GiveItemsSchema) -> Self {
368 Self {
369 name,
370 give_items_schema,
371 }
372 }
373}
374
375#[derive(Clone, Debug)]
377pub struct MoveCharacterParams {
378 pub name: String,
380 pub destination_schema: models::DestinationSchema,
381}
382
383impl MoveCharacterParams {
384 pub fn new(name: String, destination_schema: models::DestinationSchema) -> Self {
385 Self {
386 name,
387 destination_schema,
388 }
389 }
390}
391
392#[derive(Clone, Debug)]
394pub struct NpcBuyItemParams {
395 pub name: String,
397 pub npc_merchant_buy_schema: models::NpcMerchantBuySchema,
398}
399
400impl NpcBuyItemParams {
401 pub fn new(name: String, npc_merchant_buy_schema: models::NpcMerchantBuySchema) -> Self {
402 Self {
403 name,
404 npc_merchant_buy_schema,
405 }
406 }
407}
408
409#[derive(Clone, Debug)]
411pub struct NpcSellItemParams {
412 pub name: String,
414 pub npc_merchant_buy_schema: models::NpcMerchantBuySchema,
415}
416
417impl NpcSellItemParams {
418 pub fn new(name: String, npc_merchant_buy_schema: models::NpcMerchantBuySchema) -> Self {
419 Self {
420 name,
421 npc_merchant_buy_schema,
422 }
423 }
424}
425
426#[derive(Clone, Debug)]
428pub struct RecycleParams {
429 pub name: String,
431 pub recycling_schema: models::RecyclingSchema,
432}
433
434impl RecycleParams {
435 pub fn new(name: String, recycling_schema: models::RecyclingSchema) -> Self {
436 Self {
437 name,
438 recycling_schema,
439 }
440 }
441}
442
443#[derive(Clone, Debug)]
445pub struct RenameCharacterParams {
446 pub name: String,
448 pub rename_character_schema: models::RenameCharacterSchema,
449}
450
451impl RenameCharacterParams {
452 pub fn new(name: String, rename_character_schema: models::RenameCharacterSchema) -> Self {
453 Self {
454 name,
455 rename_character_schema,
456 }
457 }
458}
459
460#[derive(Clone, Debug)]
462pub struct RestCharacterParams {
463 pub name: String,
465}
466
467impl RestCharacterParams {
468 pub fn new(name: String) -> Self {
469 Self { name }
470 }
471}
472
473#[derive(Clone, Debug)]
475pub struct TaskExchangeParams {
476 pub name: String,
478}
479
480impl TaskExchangeParams {
481 pub fn new(name: String) -> Self {
482 Self { name }
483 }
484}
485
486#[derive(Clone, Debug)]
488pub struct TaskTradeParams {
489 pub name: String,
491 pub simple_item_schema: models::SimpleItemSchema,
492}
493
494impl TaskTradeParams {
495 pub fn new(name: String, simple_item_schema: models::SimpleItemSchema) -> Self {
496 Self {
497 name,
498 simple_item_schema,
499 }
500 }
501}
502
503#[derive(Clone, Debug)]
505pub struct UnequipItemParams {
506 pub name: String,
508 pub unequip_schema: Vec<models::UnequipSchema>,
509}
510
511impl UnequipItemParams {
512 pub fn new(name: String, unequip_schema: Vec<models::UnequipSchema>) -> Self {
513 Self {
514 name,
515 unequip_schema,
516 }
517 }
518}
519
520#[derive(Clone, Debug)]
522pub struct UseItemParams {
523 pub name: String,
525 pub simple_item_schema: models::SimpleItemSchema,
526}
527
528impl UseItemParams {
529 pub fn new(name: String, simple_item_schema: models::SimpleItemSchema) -> Self {
530 Self {
531 name,
532 simple_item_schema,
533 }
534 }
535}
536
537#[derive(Clone, Debug)]
539pub struct WithdrawGoldParams {
540 pub name: String,
542 pub deposit_withdraw_gold_schema: models::DepositWithdrawGoldSchema,
543}
544
545impl WithdrawGoldParams {
546 pub fn new(
547 name: String,
548 deposit_withdraw_gold_schema: models::DepositWithdrawGoldSchema,
549 ) -> Self {
550 Self {
551 name,
552 deposit_withdraw_gold_schema,
553 }
554 }
555}
556
557#[derive(Clone, Debug)]
559pub struct WithdrawItemParams {
560 pub name: String,
562 pub simple_item_schema: Vec<models::SimpleItemSchema>,
563}
564
565impl WithdrawItemParams {
566 pub fn new(name: String, simple_item_schema: Vec<models::SimpleItemSchema>) -> Self {
567 Self {
568 name,
569 simple_item_schema,
570 }
571 }
572}
573
574#[derive(Debug, Clone, Serialize)]
576#[serde(untagged)]
577pub enum AcceptNewTaskError {
578 Status498(models::ErrorResponseSchema),
580 Status499(models::ErrorResponseSchema),
582 Status486(models::ErrorResponseSchema),
584 Status598(models::ErrorResponseSchema),
586 Status489(models::ErrorResponseSchema),
588 Status422(models::ErrorResponseSchema),
590}
591
592impl<'de> Deserialize<'de> for AcceptNewTaskError {
593 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
594 where
595 D: Deserializer<'de>,
596 {
597 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
598 match raw.error.code {
599 498 => Ok(Self::Status498(raw)),
600 499 => Ok(Self::Status499(raw)),
601 486 => Ok(Self::Status486(raw)),
602 598 => Ok(Self::Status598(raw)),
603 489 => Ok(Self::Status489(raw)),
604 422 => Ok(Self::Status422(raw)),
605 _ => Err(de::Error::custom(format!(
606 "Unexpected error code: {}",
607 raw.error.code
608 ))),
609 }
610 }
611}
612
613#[derive(Debug, Clone, Serialize)]
615#[serde(untagged)]
616pub enum ActionTransitionError {
617 Status498(models::ErrorResponseSchema),
619 Status499(models::ErrorResponseSchema),
621 Status404(models::ErrorResponseSchema),
623 Status492(models::ErrorResponseSchema),
625 Status478(models::ErrorResponseSchema),
627 Status486(models::ErrorResponseSchema),
629 Status496(models::ErrorResponseSchema),
631 Status422(models::ErrorResponseSchema),
633}
634
635impl<'de> Deserialize<'de> for ActionTransitionError {
636 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
637 where
638 D: Deserializer<'de>,
639 {
640 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
641 match raw.error.code {
642 498 => Ok(Self::Status498(raw)),
643 499 => Ok(Self::Status499(raw)),
644 404 => Ok(Self::Status404(raw)),
645 492 => Ok(Self::Status492(raw)),
646 478 => Ok(Self::Status478(raw)),
647 486 => Ok(Self::Status486(raw)),
648 496 => Ok(Self::Status496(raw)),
649 422 => Ok(Self::Status422(raw)),
650 _ => Err(de::Error::custom(format!(
651 "Unexpected error code: {}",
652 raw.error.code
653 ))),
654 }
655 }
656}
657
658#[derive(Debug, Clone, Serialize)]
660#[serde(untagged)]
661pub enum BuyBankExpansionError {
662 Status598(models::ErrorResponseSchema),
664 Status498(models::ErrorResponseSchema),
666 Status499(models::ErrorResponseSchema),
668 Status486(models::ErrorResponseSchema),
670 Status492(models::ErrorResponseSchema),
672 Status422(models::ErrorResponseSchema),
674}
675
676impl<'de> Deserialize<'de> for BuyBankExpansionError {
677 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
678 where
679 D: Deserializer<'de>,
680 {
681 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
682 match raw.error.code {
683 598 => Ok(Self::Status598(raw)),
684 498 => Ok(Self::Status498(raw)),
685 499 => Ok(Self::Status499(raw)),
686 486 => Ok(Self::Status486(raw)),
687 492 => Ok(Self::Status492(raw)),
688 422 => Ok(Self::Status422(raw)),
689 _ => Err(de::Error::custom(format!(
690 "Unexpected error code: {}",
691 raw.error.code
692 ))),
693 }
694 }
695}
696
697#[derive(Debug, Clone, Serialize)]
699#[serde(untagged)]
700pub enum CancelTaskError {
701 Status498(models::ErrorResponseSchema),
703 Status499(models::ErrorResponseSchema),
705 Status486(models::ErrorResponseSchema),
707 Status487(models::ErrorResponseSchema),
709 Status598(models::ErrorResponseSchema),
711 Status478(models::ErrorResponseSchema),
713 Status422(models::ErrorResponseSchema),
715}
716
717impl<'de> Deserialize<'de> for CancelTaskError {
718 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
719 where
720 D: Deserializer<'de>,
721 {
722 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
723 match raw.error.code {
724 498 => Ok(Self::Status498(raw)),
725 499 => Ok(Self::Status499(raw)),
726 486 => Ok(Self::Status486(raw)),
727 487 => Ok(Self::Status487(raw)),
728 598 => Ok(Self::Status598(raw)),
729 478 => Ok(Self::Status478(raw)),
730 422 => Ok(Self::Status422(raw)),
731 _ => Err(de::Error::custom(format!(
732 "Unexpected error code: {}",
733 raw.error.code
734 ))),
735 }
736 }
737}
738
739#[derive(Debug, Clone, Serialize)]
741#[serde(untagged)]
742pub enum ChangeSkinError {
743 Status499(models::ErrorResponseSchema),
745 Status486(models::ErrorResponseSchema),
747 Status550(models::ErrorResponseSchema),
749 Status404(models::ErrorResponseSchema),
751 Status422(models::ErrorResponseSchema),
753}
754
755impl<'de> Deserialize<'de> for ChangeSkinError {
756 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
757 where
758 D: Deserializer<'de>,
759 {
760 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
761 match raw.error.code {
762 499 => Ok(Self::Status499(raw)),
763 486 => Ok(Self::Status486(raw)),
764 550 => Ok(Self::Status550(raw)),
765 404 => Ok(Self::Status404(raw)),
766 422 => Ok(Self::Status422(raw)),
767 _ => Err(de::Error::custom(format!(
768 "Unexpected error code: {}",
769 raw.error.code
770 ))),
771 }
772 }
773}
774
775#[derive(Debug, Clone, Serialize)]
777#[serde(untagged)]
778pub enum ClaimPendingItemError {
779 Status404(models::ErrorResponseSchema),
781 Status498(models::ErrorResponseSchema),
783 Status497(models::ErrorResponseSchema),
785 Status499(models::ErrorResponseSchema),
787 Status486(models::ErrorResponseSchema),
789 Status422(models::ErrorResponseSchema),
791}
792
793impl<'de> Deserialize<'de> for ClaimPendingItemError {
794 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
795 where
796 D: Deserializer<'de>,
797 {
798 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
799 match raw.error.code {
800 404 => Ok(Self::Status404(raw)),
801 498 => Ok(Self::Status498(raw)),
802 497 => Ok(Self::Status497(raw)),
803 499 => Ok(Self::Status499(raw)),
804 486 => Ok(Self::Status486(raw)),
805 422 => Ok(Self::Status422(raw)),
806 _ => Err(de::Error::custom(format!(
807 "Unexpected error code: {}",
808 raw.error.code
809 ))),
810 }
811 }
812}
813
814#[derive(Debug, Clone, Serialize)]
816#[serde(untagged)]
817pub enum CompleteTaskError {
818 Status498(models::ErrorResponseSchema),
820 Status499(models::ErrorResponseSchema),
822 Status486(models::ErrorResponseSchema),
824 Status598(models::ErrorResponseSchema),
826 Status488(models::ErrorResponseSchema),
828 Status487(models::ErrorResponseSchema),
830 Status497(models::ErrorResponseSchema),
832 Status422(models::ErrorResponseSchema),
834}
835
836impl<'de> Deserialize<'de> for CompleteTaskError {
837 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
838 where
839 D: Deserializer<'de>,
840 {
841 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
842 match raw.error.code {
843 498 => Ok(Self::Status498(raw)),
844 499 => Ok(Self::Status499(raw)),
845 486 => Ok(Self::Status486(raw)),
846 598 => Ok(Self::Status598(raw)),
847 488 => Ok(Self::Status488(raw)),
848 487 => Ok(Self::Status487(raw)),
849 497 => Ok(Self::Status497(raw)),
850 422 => Ok(Self::Status422(raw)),
851 _ => Err(de::Error::custom(format!(
852 "Unexpected error code: {}",
853 raw.error.code
854 ))),
855 }
856 }
857}
858
859#[derive(Debug, Clone, Serialize)]
861#[serde(untagged)]
862pub enum CraftError {
863 Status404(models::ErrorResponseSchema),
865 Status598(models::ErrorResponseSchema),
867 Status498(models::ErrorResponseSchema),
869 Status497(models::ErrorResponseSchema),
871 Status499(models::ErrorResponseSchema),
873 Status486(models::ErrorResponseSchema),
875 Status493(models::ErrorResponseSchema),
877 Status478(models::ErrorResponseSchema),
879 Status422(models::ErrorResponseSchema),
881}
882
883impl<'de> Deserialize<'de> for CraftError {
884 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
885 where
886 D: Deserializer<'de>,
887 {
888 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
889 match raw.error.code {
890 404 => Ok(Self::Status404(raw)),
891 598 => Ok(Self::Status598(raw)),
892 498 => Ok(Self::Status498(raw)),
893 497 => Ok(Self::Status497(raw)),
894 499 => Ok(Self::Status499(raw)),
895 486 => Ok(Self::Status486(raw)),
896 493 => Ok(Self::Status493(raw)),
897 478 => Ok(Self::Status478(raw)),
898 422 => Ok(Self::Status422(raw)),
899 _ => Err(de::Error::custom(format!(
900 "Unexpected error code: {}",
901 raw.error.code
902 ))),
903 }
904 }
905}
906
907#[derive(Debug, Clone, Serialize)]
909#[serde(untagged)]
910pub enum DeleteItemError {
911 Status498(models::ErrorResponseSchema),
913 Status499(models::ErrorResponseSchema),
915 Status486(models::ErrorResponseSchema),
917 Status478(models::ErrorResponseSchema),
919 Status422(models::ErrorResponseSchema),
921}
922
923impl<'de> Deserialize<'de> for DeleteItemError {
924 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
925 where
926 D: Deserializer<'de>,
927 {
928 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
929 match raw.error.code {
930 498 => Ok(Self::Status498(raw)),
931 499 => Ok(Self::Status499(raw)),
932 486 => Ok(Self::Status486(raw)),
933 478 => Ok(Self::Status478(raw)),
934 422 => Ok(Self::Status422(raw)),
935 _ => Err(de::Error::custom(format!(
936 "Unexpected error code: {}",
937 raw.error.code
938 ))),
939 }
940 }
941}
942
943#[derive(Debug, Clone, Serialize)]
945#[serde(untagged)]
946pub enum DepositGoldError {
947 Status598(models::ErrorResponseSchema),
949 Status492(models::ErrorResponseSchema),
951 Status498(models::ErrorResponseSchema),
953 Status499(models::ErrorResponseSchema),
955 Status461(models::ErrorResponseSchema),
957 Status486(models::ErrorResponseSchema),
959 Status422(models::ErrorResponseSchema),
961}
962
963impl<'de> Deserialize<'de> for DepositGoldError {
964 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
965 where
966 D: Deserializer<'de>,
967 {
968 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
969 match raw.error.code {
970 598 => Ok(Self::Status598(raw)),
971 492 => Ok(Self::Status492(raw)),
972 498 => Ok(Self::Status498(raw)),
973 499 => Ok(Self::Status499(raw)),
974 461 => Ok(Self::Status461(raw)),
975 486 => Ok(Self::Status486(raw)),
976 422 => Ok(Self::Status422(raw)),
977 _ => Err(de::Error::custom(format!(
978 "Unexpected error code: {}",
979 raw.error.code
980 ))),
981 }
982 }
983}
984
985#[derive(Debug, Clone, Serialize)]
987#[serde(untagged)]
988pub enum DepositItemError {
989 Status598(models::ErrorResponseSchema),
991 Status404(models::ErrorResponseSchema),
993 Status461(models::ErrorResponseSchema),
995 Status498(models::ErrorResponseSchema),
997 Status499(models::ErrorResponseSchema),
999 Status486(models::ErrorResponseSchema),
1001 Status478(models::ErrorResponseSchema),
1003 Status462(models::ErrorResponseSchema),
1005 Status422(models::ErrorResponseSchema),
1007}
1008
1009impl<'de> Deserialize<'de> for DepositItemError {
1010 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1011 where
1012 D: Deserializer<'de>,
1013 {
1014 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1015 match raw.error.code {
1016 598 => Ok(Self::Status598(raw)),
1017 404 => Ok(Self::Status404(raw)),
1018 461 => Ok(Self::Status461(raw)),
1019 498 => Ok(Self::Status498(raw)),
1020 499 => Ok(Self::Status499(raw)),
1021 486 => Ok(Self::Status486(raw)),
1022 478 => Ok(Self::Status478(raw)),
1023 462 => Ok(Self::Status462(raw)),
1024 422 => Ok(Self::Status422(raw)),
1025 _ => Err(de::Error::custom(format!(
1026 "Unexpected error code: {}",
1027 raw.error.code
1028 ))),
1029 }
1030 }
1031}
1032
1033#[derive(Debug, Clone, Serialize)]
1035#[serde(untagged)]
1036pub enum EquipItemError {
1037 Status404(models::ErrorResponseSchema),
1039 Status498(models::ErrorResponseSchema),
1041 Status483(models::ErrorResponseSchema),
1043 Status499(models::ErrorResponseSchema),
1045 Status486(models::ErrorResponseSchema),
1047 Status478(models::ErrorResponseSchema),
1049 Status496(models::ErrorResponseSchema),
1051 Status491(models::ErrorResponseSchema),
1053 Status485(models::ErrorResponseSchema),
1055 Status484(models::ErrorResponseSchema),
1057 Status497(models::ErrorResponseSchema),
1059 Status422(models::ErrorResponseSchema),
1061}
1062
1063impl<'de> Deserialize<'de> for EquipItemError {
1064 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1065 where
1066 D: Deserializer<'de>,
1067 {
1068 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1069 match raw.error.code {
1070 404 => Ok(Self::Status404(raw)),
1071 498 => Ok(Self::Status498(raw)),
1072 483 => Ok(Self::Status483(raw)),
1073 499 => Ok(Self::Status499(raw)),
1074 486 => Ok(Self::Status486(raw)),
1075 478 => Ok(Self::Status478(raw)),
1076 496 => Ok(Self::Status496(raw)),
1077 491 => Ok(Self::Status491(raw)),
1078 485 => Ok(Self::Status485(raw)),
1079 484 => Ok(Self::Status484(raw)),
1080 497 => Ok(Self::Status497(raw)),
1081 422 => Ok(Self::Status422(raw)),
1082 _ => Err(de::Error::custom(format!(
1083 "Unexpected error code: {}",
1084 raw.error.code
1085 ))),
1086 }
1087 }
1088}
1089
1090#[derive(Debug, Clone, Serialize)]
1092#[serde(untagged)]
1093pub enum FightError {
1094 Status498(models::ErrorResponseSchema),
1096 Status499(models::ErrorResponseSchema),
1098 Status598(models::ErrorResponseSchema),
1100 Status486(models::ErrorResponseSchema),
1102 Status497(models::ErrorResponseSchema),
1104 Status567(models::ErrorResponseSchema),
1106 Status422(models::ErrorResponseSchema),
1108}
1109
1110impl<'de> Deserialize<'de> for FightError {
1111 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1112 where
1113 D: Deserializer<'de>,
1114 {
1115 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1116 match raw.error.code {
1117 498 => Ok(Self::Status498(raw)),
1118 499 => Ok(Self::Status499(raw)),
1119 598 => Ok(Self::Status598(raw)),
1120 486 => Ok(Self::Status486(raw)),
1121 497 => Ok(Self::Status497(raw)),
1122 567 => Ok(Self::Status567(raw)),
1123 422 => Ok(Self::Status422(raw)),
1124 _ => Err(de::Error::custom(format!(
1125 "Unexpected error code: {}",
1126 raw.error.code
1127 ))),
1128 }
1129 }
1130}
1131
1132#[derive(Debug, Clone, Serialize)]
1134#[serde(untagged)]
1135pub enum GatherError {
1136 Status498(models::ErrorResponseSchema),
1138 Status499(models::ErrorResponseSchema),
1140 Status598(models::ErrorResponseSchema),
1142 Status486(models::ErrorResponseSchema),
1144 Status493(models::ErrorResponseSchema),
1146 Status497(models::ErrorResponseSchema),
1148 Status422(models::ErrorResponseSchema),
1150}
1151
1152impl<'de> Deserialize<'de> for GatherError {
1153 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1154 where
1155 D: Deserializer<'de>,
1156 {
1157 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1158 match raw.error.code {
1159 498 => Ok(Self::Status498(raw)),
1160 499 => Ok(Self::Status499(raw)),
1161 598 => Ok(Self::Status598(raw)),
1162 486 => Ok(Self::Status486(raw)),
1163 493 => Ok(Self::Status493(raw)),
1164 497 => Ok(Self::Status497(raw)),
1165 422 => Ok(Self::Status422(raw)),
1166 _ => Err(de::Error::custom(format!(
1167 "Unexpected error code: {}",
1168 raw.error.code
1169 ))),
1170 }
1171 }
1172}
1173
1174#[derive(Debug, Clone, Serialize)]
1176#[serde(untagged)]
1177pub enum GeBuyItemError {
1178 Status598(models::ErrorResponseSchema),
1180 Status498(models::ErrorResponseSchema),
1182 Status497(models::ErrorResponseSchema),
1184 Status499(models::ErrorResponseSchema),
1186 Status436(models::ErrorResponseSchema),
1188 Status486(models::ErrorResponseSchema),
1190 Status492(models::ErrorResponseSchema),
1192 Status434(models::ErrorResponseSchema),
1194 Status435(models::ErrorResponseSchema),
1196 Status404(models::ErrorResponseSchema),
1198 Status422(models::ErrorResponseSchema),
1200}
1201
1202impl<'de> Deserialize<'de> for GeBuyItemError {
1203 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1204 where
1205 D: Deserializer<'de>,
1206 {
1207 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1208 match raw.error.code {
1209 598 => Ok(Self::Status598(raw)),
1210 498 => Ok(Self::Status498(raw)),
1211 497 => Ok(Self::Status497(raw)),
1212 499 => Ok(Self::Status499(raw)),
1213 436 => Ok(Self::Status436(raw)),
1214 486 => Ok(Self::Status486(raw)),
1215 492 => Ok(Self::Status492(raw)),
1216 434 => Ok(Self::Status434(raw)),
1217 435 => Ok(Self::Status435(raw)),
1218 404 => Ok(Self::Status404(raw)),
1219 422 => Ok(Self::Status422(raw)),
1220 _ => Err(de::Error::custom(format!(
1221 "Unexpected error code: {}",
1222 raw.error.code
1223 ))),
1224 }
1225 }
1226}
1227
1228#[derive(Debug, Clone, Serialize)]
1230#[serde(untagged)]
1231pub enum GeCancelOrderError {
1232 Status598(models::ErrorResponseSchema),
1234 Status498(models::ErrorResponseSchema),
1236 Status497(models::ErrorResponseSchema),
1238 Status499(models::ErrorResponseSchema),
1240 Status436(models::ErrorResponseSchema),
1242 Status486(models::ErrorResponseSchema),
1244 Status438(models::ErrorResponseSchema),
1246 Status404(models::ErrorResponseSchema),
1248 Status422(models::ErrorResponseSchema),
1250}
1251
1252impl<'de> Deserialize<'de> for GeCancelOrderError {
1253 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1254 where
1255 D: Deserializer<'de>,
1256 {
1257 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1258 match raw.error.code {
1259 598 => Ok(Self::Status598(raw)),
1260 498 => Ok(Self::Status498(raw)),
1261 497 => Ok(Self::Status497(raw)),
1262 499 => Ok(Self::Status499(raw)),
1263 436 => Ok(Self::Status436(raw)),
1264 486 => Ok(Self::Status486(raw)),
1265 438 => Ok(Self::Status438(raw)),
1266 404 => Ok(Self::Status404(raw)),
1267 422 => Ok(Self::Status422(raw)),
1268 _ => Err(de::Error::custom(format!(
1269 "Unexpected error code: {}",
1270 raw.error.code
1271 ))),
1272 }
1273 }
1274}
1275
1276#[derive(Debug, Clone, Serialize)]
1278#[serde(untagged)]
1279pub enum GeCreateBuyOrderError {
1280 Status498(models::ErrorResponseSchema),
1282 Status499(models::ErrorResponseSchema),
1284 Status486(models::ErrorResponseSchema),
1286 Status404(models::ErrorResponseSchema),
1288 Status492(models::ErrorResponseSchema),
1290 Status433(models::ErrorResponseSchema),
1292 Status437(models::ErrorResponseSchema),
1294 Status598(models::ErrorResponseSchema),
1296 Status422(models::ErrorResponseSchema),
1298}
1299
1300impl<'de> Deserialize<'de> for GeCreateBuyOrderError {
1301 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1302 where
1303 D: Deserializer<'de>,
1304 {
1305 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1306 match raw.error.code {
1307 498 => Ok(Self::Status498(raw)),
1308 499 => Ok(Self::Status499(raw)),
1309 486 => Ok(Self::Status486(raw)),
1310 404 => Ok(Self::Status404(raw)),
1311 492 => Ok(Self::Status492(raw)),
1312 433 => Ok(Self::Status433(raw)),
1313 437 => Ok(Self::Status437(raw)),
1314 598 => Ok(Self::Status598(raw)),
1315 422 => Ok(Self::Status422(raw)),
1316 _ => Err(de::Error::custom(format!(
1317 "Unexpected error code: {}",
1318 raw.error.code
1319 ))),
1320 }
1321 }
1322}
1323
1324#[derive(Debug, Clone, Serialize)]
1326#[serde(untagged)]
1327pub enum GeCreateSellOrderError {
1328 Status498(models::ErrorResponseSchema),
1330 Status499(models::ErrorResponseSchema),
1332 Status486(models::ErrorResponseSchema),
1334 Status404(models::ErrorResponseSchema),
1336 Status478(models::ErrorResponseSchema),
1338 Status433(models::ErrorResponseSchema),
1340 Status437(models::ErrorResponseSchema),
1342 Status598(models::ErrorResponseSchema),
1344 Status422(models::ErrorResponseSchema),
1346}
1347
1348impl<'de> Deserialize<'de> for GeCreateSellOrderError {
1349 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1350 where
1351 D: Deserializer<'de>,
1352 {
1353 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1354 match raw.error.code {
1355 498 => Ok(Self::Status498(raw)),
1356 499 => Ok(Self::Status499(raw)),
1357 486 => Ok(Self::Status486(raw)),
1358 404 => Ok(Self::Status404(raw)),
1359 478 => Ok(Self::Status478(raw)),
1360 433 => Ok(Self::Status433(raw)),
1361 437 => Ok(Self::Status437(raw)),
1362 598 => Ok(Self::Status598(raw)),
1363 422 => Ok(Self::Status422(raw)),
1364 _ => Err(de::Error::custom(format!(
1365 "Unexpected error code: {}",
1366 raw.error.code
1367 ))),
1368 }
1369 }
1370}
1371
1372#[derive(Debug, Clone, Serialize)]
1374#[serde(untagged)]
1375pub enum GeFillOrderError {
1376 Status598(models::ErrorResponseSchema),
1378 Status498(models::ErrorResponseSchema),
1380 Status499(models::ErrorResponseSchema),
1382 Status436(models::ErrorResponseSchema),
1384 Status486(models::ErrorResponseSchema),
1386 Status478(models::ErrorResponseSchema),
1388 Status434(models::ErrorResponseSchema),
1390 Status435(models::ErrorResponseSchema),
1392 Status404(models::ErrorResponseSchema),
1394 Status422(models::ErrorResponseSchema),
1396}
1397
1398impl<'de> Deserialize<'de> for GeFillOrderError {
1399 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1400 where
1401 D: Deserializer<'de>,
1402 {
1403 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1404 match raw.error.code {
1405 598 => Ok(Self::Status598(raw)),
1406 498 => Ok(Self::Status498(raw)),
1407 499 => Ok(Self::Status499(raw)),
1408 436 => Ok(Self::Status436(raw)),
1409 486 => Ok(Self::Status486(raw)),
1410 478 => Ok(Self::Status478(raw)),
1411 434 => Ok(Self::Status434(raw)),
1412 435 => Ok(Self::Status435(raw)),
1413 404 => Ok(Self::Status404(raw)),
1414 422 => Ok(Self::Status422(raw)),
1415 _ => Err(de::Error::custom(format!(
1416 "Unexpected error code: {}",
1417 raw.error.code
1418 ))),
1419 }
1420 }
1421}
1422
1423#[derive(Debug, Clone, Serialize)]
1425#[serde(untagged)]
1426pub enum GetAllCharactersLogsError {
1427 Status404(models::ErrorResponseSchema),
1429 Status498(models::ErrorResponseSchema),
1431}
1432
1433impl<'de> Deserialize<'de> for GetAllCharactersLogsError {
1434 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1435 where
1436 D: Deserializer<'de>,
1437 {
1438 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1439 match raw.error.code {
1440 404 => Ok(Self::Status404(raw)),
1441 498 => Ok(Self::Status498(raw)),
1442 _ => Err(de::Error::custom(format!(
1443 "Unexpected error code: {}",
1444 raw.error.code
1445 ))),
1446 }
1447 }
1448}
1449
1450#[derive(Debug, Clone, Serialize)]
1452#[serde(untagged)]
1453pub enum GetCharacterLogsError {
1454 Status404(models::ErrorResponseSchema),
1456 Status498(models::ErrorResponseSchema),
1458}
1459
1460impl<'de> Deserialize<'de> for GetCharacterLogsError {
1461 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1462 where
1463 D: Deserializer<'de>,
1464 {
1465 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1466 match raw.error.code {
1467 404 => Ok(Self::Status404(raw)),
1468 498 => Ok(Self::Status498(raw)),
1469 _ => Err(de::Error::custom(format!(
1470 "Unexpected error code: {}",
1471 raw.error.code
1472 ))),
1473 }
1474 }
1475}
1476
1477#[derive(Debug, Clone, Serialize)]
1479#[serde(untagged)]
1480pub enum GetMyCharactersError {}
1481
1482impl<'de> Deserialize<'de> for GetMyCharactersError {
1483 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1484 where
1485 D: Deserializer<'de>,
1486 {
1487 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1488 Err(de::Error::custom(format!(
1489 "Unexpected error code: {}",
1490 raw.error.code
1491 )))
1492 }
1493}
1494
1495#[derive(Debug, Clone, Serialize)]
1497#[serde(untagged)]
1498pub enum GiveGoldError {
1499 Status498(models::ErrorResponseSchema),
1501 Status499(models::ErrorResponseSchema),
1503 Status492(models::ErrorResponseSchema),
1505 Status486(models::ErrorResponseSchema),
1507 Status422(models::ErrorResponseSchema),
1509}
1510
1511impl<'de> Deserialize<'de> for GiveGoldError {
1512 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1513 where
1514 D: Deserializer<'de>,
1515 {
1516 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1517 match raw.error.code {
1518 498 => Ok(Self::Status498(raw)),
1519 499 => Ok(Self::Status499(raw)),
1520 492 => Ok(Self::Status492(raw)),
1521 486 => Ok(Self::Status486(raw)),
1522 422 => Ok(Self::Status422(raw)),
1523 _ => Err(de::Error::custom(format!(
1524 "Unexpected error code: {}",
1525 raw.error.code
1526 ))),
1527 }
1528 }
1529}
1530
1531#[derive(Debug, Clone, Serialize)]
1533#[serde(untagged)]
1534pub enum GiveItemsError {
1535 Status404(models::ErrorResponseSchema),
1537 Status498(models::ErrorResponseSchema),
1539 Status499(models::ErrorResponseSchema),
1541 Status497(models::ErrorResponseSchema),
1543 Status486(models::ErrorResponseSchema),
1545 Status478(models::ErrorResponseSchema),
1547 Status422(models::ErrorResponseSchema),
1549}
1550
1551impl<'de> Deserialize<'de> for GiveItemsError {
1552 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1553 where
1554 D: Deserializer<'de>,
1555 {
1556 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1557 match raw.error.code {
1558 404 => Ok(Self::Status404(raw)),
1559 498 => Ok(Self::Status498(raw)),
1560 499 => Ok(Self::Status499(raw)),
1561 497 => Ok(Self::Status497(raw)),
1562 486 => Ok(Self::Status486(raw)),
1563 478 => Ok(Self::Status478(raw)),
1564 422 => Ok(Self::Status422(raw)),
1565 _ => Err(de::Error::custom(format!(
1566 "Unexpected error code: {}",
1567 raw.error.code
1568 ))),
1569 }
1570 }
1571}
1572
1573#[derive(Debug, Clone, Serialize)]
1575#[serde(untagged)]
1576pub enum MoveCharacterError {
1577 Status498(models::ErrorResponseSchema),
1579 Status499(models::ErrorResponseSchema),
1581 Status490(models::ErrorResponseSchema),
1583 Status404(models::ErrorResponseSchema),
1585 Status486(models::ErrorResponseSchema),
1587 Status595(models::ErrorResponseSchema),
1589 Status596(models::ErrorResponseSchema),
1591 Status496(models::ErrorResponseSchema),
1593 Status422(models::ErrorResponseSchema),
1595}
1596
1597impl<'de> Deserialize<'de> for MoveCharacterError {
1598 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1599 where
1600 D: Deserializer<'de>,
1601 {
1602 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1603 match raw.error.code {
1604 498 => Ok(Self::Status498(raw)),
1605 499 => Ok(Self::Status499(raw)),
1606 490 => Ok(Self::Status490(raw)),
1607 404 => Ok(Self::Status404(raw)),
1608 486 => Ok(Self::Status486(raw)),
1609 595 => Ok(Self::Status595(raw)),
1610 596 => Ok(Self::Status596(raw)),
1611 496 => Ok(Self::Status496(raw)),
1612 422 => Ok(Self::Status422(raw)),
1613 _ => Err(de::Error::custom(format!(
1614 "Unexpected error code: {}",
1615 raw.error.code
1616 ))),
1617 }
1618 }
1619}
1620
1621#[derive(Debug, Clone, Serialize)]
1623#[serde(untagged)]
1624pub enum NpcBuyItemError {
1625 Status598(models::ErrorResponseSchema),
1627 Status498(models::ErrorResponseSchema),
1629 Status497(models::ErrorResponseSchema),
1631 Status499(models::ErrorResponseSchema),
1633 Status486(models::ErrorResponseSchema),
1635 Status492(models::ErrorResponseSchema),
1637 Status441(models::ErrorResponseSchema),
1639 Status478(models::ErrorResponseSchema),
1641 Status404(models::ErrorResponseSchema),
1643 Status422(models::ErrorResponseSchema),
1645}
1646
1647impl<'de> Deserialize<'de> for NpcBuyItemError {
1648 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1649 where
1650 D: Deserializer<'de>,
1651 {
1652 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1653 match raw.error.code {
1654 598 => Ok(Self::Status598(raw)),
1655 498 => Ok(Self::Status498(raw)),
1656 497 => Ok(Self::Status497(raw)),
1657 499 => Ok(Self::Status499(raw)),
1658 486 => Ok(Self::Status486(raw)),
1659 492 => Ok(Self::Status492(raw)),
1660 441 => Ok(Self::Status441(raw)),
1661 478 => Ok(Self::Status478(raw)),
1662 404 => Ok(Self::Status404(raw)),
1663 422 => Ok(Self::Status422(raw)),
1664 _ => Err(de::Error::custom(format!(
1665 "Unexpected error code: {}",
1666 raw.error.code
1667 ))),
1668 }
1669 }
1670}
1671
1672#[derive(Debug, Clone, Serialize)]
1674#[serde(untagged)]
1675pub enum NpcSellItemError {
1676 Status598(models::ErrorResponseSchema),
1678 Status498(models::ErrorResponseSchema),
1680 Status497(models::ErrorResponseSchema),
1682 Status499(models::ErrorResponseSchema),
1684 Status486(models::ErrorResponseSchema),
1686 Status478(models::ErrorResponseSchema),
1688 Status442(models::ErrorResponseSchema),
1690 Status404(models::ErrorResponseSchema),
1692 Status422(models::ErrorResponseSchema),
1694}
1695
1696impl<'de> Deserialize<'de> for NpcSellItemError {
1697 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1698 where
1699 D: Deserializer<'de>,
1700 {
1701 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1702 match raw.error.code {
1703 598 => Ok(Self::Status598(raw)),
1704 498 => Ok(Self::Status498(raw)),
1705 497 => Ok(Self::Status497(raw)),
1706 499 => Ok(Self::Status499(raw)),
1707 486 => Ok(Self::Status486(raw)),
1708 478 => Ok(Self::Status478(raw)),
1709 442 => Ok(Self::Status442(raw)),
1710 404 => Ok(Self::Status404(raw)),
1711 422 => Ok(Self::Status422(raw)),
1712 _ => Err(de::Error::custom(format!(
1713 "Unexpected error code: {}",
1714 raw.error.code
1715 ))),
1716 }
1717 }
1718}
1719
1720#[derive(Debug, Clone, Serialize)]
1722#[serde(untagged)]
1723pub enum RecycleError {
1724 Status404(models::ErrorResponseSchema),
1726 Status598(models::ErrorResponseSchema),
1728 Status498(models::ErrorResponseSchema),
1730 Status497(models::ErrorResponseSchema),
1732 Status499(models::ErrorResponseSchema),
1734 Status486(models::ErrorResponseSchema),
1736 Status493(models::ErrorResponseSchema),
1738 Status478(models::ErrorResponseSchema),
1740 Status492(models::ErrorResponseSchema),
1742 Status473(models::ErrorResponseSchema),
1744 Status422(models::ErrorResponseSchema),
1746}
1747
1748impl<'de> Deserialize<'de> for RecycleError {
1749 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1750 where
1751 D: Deserializer<'de>,
1752 {
1753 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1754 match raw.error.code {
1755 404 => Ok(Self::Status404(raw)),
1756 598 => Ok(Self::Status598(raw)),
1757 498 => Ok(Self::Status498(raw)),
1758 497 => Ok(Self::Status497(raw)),
1759 499 => Ok(Self::Status499(raw)),
1760 486 => Ok(Self::Status486(raw)),
1761 493 => Ok(Self::Status493(raw)),
1762 478 => Ok(Self::Status478(raw)),
1763 492 => Ok(Self::Status492(raw)),
1764 473 => Ok(Self::Status473(raw)),
1765 422 => Ok(Self::Status422(raw)),
1766 _ => Err(de::Error::custom(format!(
1767 "Unexpected error code: {}",
1768 raw.error.code
1769 ))),
1770 }
1771 }
1772}
1773
1774#[derive(Debug, Clone, Serialize)]
1776#[serde(untagged)]
1777pub enum RenameCharacterError {
1778 Status451(models::ErrorResponseSchema),
1780 Status499(models::ErrorResponseSchema),
1782 Status486(models::ErrorResponseSchema),
1784 Status494(models::ErrorResponseSchema),
1786 Status404(models::ErrorResponseSchema),
1788 Status422(models::ErrorResponseSchema),
1790}
1791
1792impl<'de> Deserialize<'de> for RenameCharacterError {
1793 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1794 where
1795 D: Deserializer<'de>,
1796 {
1797 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1798 match raw.error.code {
1799 451 => Ok(Self::Status451(raw)),
1800 499 => Ok(Self::Status499(raw)),
1801 486 => Ok(Self::Status486(raw)),
1802 494 => Ok(Self::Status494(raw)),
1803 404 => Ok(Self::Status404(raw)),
1804 422 => Ok(Self::Status422(raw)),
1805 _ => Err(de::Error::custom(format!(
1806 "Unexpected error code: {}",
1807 raw.error.code
1808 ))),
1809 }
1810 }
1811}
1812
1813#[derive(Debug, Clone, Serialize)]
1815#[serde(untagged)]
1816pub enum RestCharacterError {
1817 Status498(models::ErrorResponseSchema),
1819 Status499(models::ErrorResponseSchema),
1821 Status486(models::ErrorResponseSchema),
1823 Status422(models::ErrorResponseSchema),
1825}
1826
1827impl<'de> Deserialize<'de> for RestCharacterError {
1828 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1829 where
1830 D: Deserializer<'de>,
1831 {
1832 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1833 match raw.error.code {
1834 498 => Ok(Self::Status498(raw)),
1835 499 => Ok(Self::Status499(raw)),
1836 486 => Ok(Self::Status486(raw)),
1837 422 => Ok(Self::Status422(raw)),
1838 _ => Err(de::Error::custom(format!(
1839 "Unexpected error code: {}",
1840 raw.error.code
1841 ))),
1842 }
1843 }
1844}
1845
1846#[derive(Debug, Clone, Serialize)]
1848#[serde(untagged)]
1849pub enum TaskExchangeError {
1850 Status498(models::ErrorResponseSchema),
1852 Status499(models::ErrorResponseSchema),
1854 Status486(models::ErrorResponseSchema),
1856 Status598(models::ErrorResponseSchema),
1858 Status478(models::ErrorResponseSchema),
1860 Status497(models::ErrorResponseSchema),
1862 Status422(models::ErrorResponseSchema),
1864}
1865
1866impl<'de> Deserialize<'de> for TaskExchangeError {
1867 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1868 where
1869 D: Deserializer<'de>,
1870 {
1871 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1872 match raw.error.code {
1873 498 => Ok(Self::Status498(raw)),
1874 499 => Ok(Self::Status499(raw)),
1875 486 => Ok(Self::Status486(raw)),
1876 598 => Ok(Self::Status598(raw)),
1877 478 => Ok(Self::Status478(raw)),
1878 497 => Ok(Self::Status497(raw)),
1879 422 => Ok(Self::Status422(raw)),
1880 _ => Err(de::Error::custom(format!(
1881 "Unexpected error code: {}",
1882 raw.error.code
1883 ))),
1884 }
1885 }
1886}
1887
1888#[derive(Debug, Clone, Serialize)]
1890#[serde(untagged)]
1891pub enum TaskTradeError {
1892 Status498(models::ErrorResponseSchema),
1894 Status499(models::ErrorResponseSchema),
1896 Status486(models::ErrorResponseSchema),
1898 Status598(models::ErrorResponseSchema),
1900 Status475(models::ErrorResponseSchema),
1902 Status474(models::ErrorResponseSchema),
1904 Status478(models::ErrorResponseSchema),
1906 Status422(models::ErrorResponseSchema),
1908}
1909
1910impl<'de> Deserialize<'de> for TaskTradeError {
1911 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1912 where
1913 D: Deserializer<'de>,
1914 {
1915 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1916 match raw.error.code {
1917 498 => Ok(Self::Status498(raw)),
1918 499 => Ok(Self::Status499(raw)),
1919 486 => Ok(Self::Status486(raw)),
1920 598 => Ok(Self::Status598(raw)),
1921 475 => Ok(Self::Status475(raw)),
1922 474 => Ok(Self::Status474(raw)),
1923 478 => Ok(Self::Status478(raw)),
1924 422 => Ok(Self::Status422(raw)),
1925 _ => Err(de::Error::custom(format!(
1926 "Unexpected error code: {}",
1927 raw.error.code
1928 ))),
1929 }
1930 }
1931}
1932
1933#[derive(Debug, Clone, Serialize)]
1935#[serde(untagged)]
1936pub enum UnequipItemError {
1937 Status404(models::ErrorResponseSchema),
1939 Status498(models::ErrorResponseSchema),
1941 Status486(models::ErrorResponseSchema),
1943 Status491(models::ErrorResponseSchema),
1945 Status497(models::ErrorResponseSchema),
1947 Status478(models::ErrorResponseSchema),
1949 Status483(models::ErrorResponseSchema),
1951 Status499(models::ErrorResponseSchema),
1953 Status422(models::ErrorResponseSchema),
1955}
1956
1957impl<'de> Deserialize<'de> for UnequipItemError {
1958 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1959 where
1960 D: Deserializer<'de>,
1961 {
1962 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1963 match raw.error.code {
1964 404 => Ok(Self::Status404(raw)),
1965 498 => Ok(Self::Status498(raw)),
1966 486 => Ok(Self::Status486(raw)),
1967 491 => Ok(Self::Status491(raw)),
1968 497 => Ok(Self::Status497(raw)),
1969 478 => Ok(Self::Status478(raw)),
1970 483 => Ok(Self::Status483(raw)),
1971 499 => Ok(Self::Status499(raw)),
1972 422 => Ok(Self::Status422(raw)),
1973 _ => Err(de::Error::custom(format!(
1974 "Unexpected error code: {}",
1975 raw.error.code
1976 ))),
1977 }
1978 }
1979}
1980
1981#[derive(Debug, Clone, Serialize)]
1983#[serde(untagged)]
1984pub enum UseItemError {
1985 Status404(models::ErrorResponseSchema),
1987 Status498(models::ErrorResponseSchema),
1989 Status499(models::ErrorResponseSchema),
1991 Status486(models::ErrorResponseSchema),
1993 Status476(models::ErrorResponseSchema),
1995 Status478(models::ErrorResponseSchema),
1997 Status496(models::ErrorResponseSchema),
1999 Status422(models::ErrorResponseSchema),
2001}
2002
2003impl<'de> Deserialize<'de> for UseItemError {
2004 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2005 where
2006 D: Deserializer<'de>,
2007 {
2008 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
2009 match raw.error.code {
2010 404 => Ok(Self::Status404(raw)),
2011 498 => Ok(Self::Status498(raw)),
2012 499 => Ok(Self::Status499(raw)),
2013 486 => Ok(Self::Status486(raw)),
2014 476 => Ok(Self::Status476(raw)),
2015 478 => Ok(Self::Status478(raw)),
2016 496 => Ok(Self::Status496(raw)),
2017 422 => Ok(Self::Status422(raw)),
2018 _ => Err(de::Error::custom(format!(
2019 "Unexpected error code: {}",
2020 raw.error.code
2021 ))),
2022 }
2023 }
2024}
2025
2026#[derive(Debug, Clone, Serialize)]
2028#[serde(untagged)]
2029pub enum WithdrawGoldError {
2030 Status498(models::ErrorResponseSchema),
2032 Status499(models::ErrorResponseSchema),
2034 Status461(models::ErrorResponseSchema),
2036 Status486(models::ErrorResponseSchema),
2038 Status598(models::ErrorResponseSchema),
2040 Status460(models::ErrorResponseSchema),
2042 Status422(models::ErrorResponseSchema),
2044}
2045
2046impl<'de> Deserialize<'de> for WithdrawGoldError {
2047 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2048 where
2049 D: Deserializer<'de>,
2050 {
2051 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
2052 match raw.error.code {
2053 498 => Ok(Self::Status498(raw)),
2054 499 => Ok(Self::Status499(raw)),
2055 461 => Ok(Self::Status461(raw)),
2056 486 => Ok(Self::Status486(raw)),
2057 598 => Ok(Self::Status598(raw)),
2058 460 => Ok(Self::Status460(raw)),
2059 422 => Ok(Self::Status422(raw)),
2060 _ => Err(de::Error::custom(format!(
2061 "Unexpected error code: {}",
2062 raw.error.code
2063 ))),
2064 }
2065 }
2066}
2067
2068#[derive(Debug, Clone, Serialize)]
2070#[serde(untagged)]
2071pub enum WithdrawItemError {
2072 Status404(models::ErrorResponseSchema),
2074 Status498(models::ErrorResponseSchema),
2076 Status499(models::ErrorResponseSchema),
2078 Status461(models::ErrorResponseSchema),
2080 Status486(models::ErrorResponseSchema),
2082 Status497(models::ErrorResponseSchema),
2084 Status598(models::ErrorResponseSchema),
2086 Status478(models::ErrorResponseSchema),
2088 Status422(models::ErrorResponseSchema),
2090}
2091
2092impl<'de> Deserialize<'de> for WithdrawItemError {
2093 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2094 where
2095 D: Deserializer<'de>,
2096 {
2097 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
2098 match raw.error.code {
2099 404 => Ok(Self::Status404(raw)),
2100 498 => Ok(Self::Status498(raw)),
2101 499 => Ok(Self::Status499(raw)),
2102 461 => Ok(Self::Status461(raw)),
2103 486 => Ok(Self::Status486(raw)),
2104 497 => Ok(Self::Status497(raw)),
2105 598 => Ok(Self::Status598(raw)),
2106 478 => Ok(Self::Status478(raw)),
2107 422 => Ok(Self::Status422(raw)),
2108 _ => Err(de::Error::custom(format!(
2109 "Unexpected error code: {}",
2110 raw.error.code
2111 ))),
2112 }
2113 }
2114}
2115
2116pub async fn accept_new_task(
2118 configuration: &configuration::Configuration,
2119 params: AcceptNewTaskParams,
2120) -> Result<models::TaskResponseSchema, Error<AcceptNewTaskError>> {
2121 let local_var_configuration = configuration;
2122
2123 let name = params.name;
2125
2126 let local_var_client = &local_var_configuration.client;
2127
2128 let local_var_uri_str = format!(
2129 "{}/my/{name}/action/task/new",
2130 local_var_configuration.base_path,
2131 name = crate::apis::urlencode(name)
2132 );
2133 let mut local_var_req_builder =
2134 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2135
2136 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2137 local_var_req_builder =
2138 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2139 }
2140 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2141 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2142 };
2143
2144 let local_var_req = local_var_req_builder.build()?;
2145 let local_var_resp = local_var_client.execute(local_var_req).await?;
2146
2147 let local_var_status = local_var_resp.status();
2148 let local_var_content = local_var_resp.text().await?;
2149
2150 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2151 serde_json::from_str(&local_var_content).map_err(Error::from)
2152 } else {
2153 let local_var_entity: Option<AcceptNewTaskError> =
2154 serde_json::from_str(&local_var_content).ok();
2155 let local_var_error = ResponseContent {
2156 status: local_var_status,
2157 content: local_var_content,
2158 entity: local_var_entity,
2159 };
2160 Err(Error::ResponseError(local_var_error))
2161 }
2162}
2163
2164pub async fn action_transition(
2166 configuration: &configuration::Configuration,
2167 params: ActionTransitionParams,
2168) -> Result<models::CharacterTransitionResponseSchema, Error<ActionTransitionError>> {
2169 let local_var_configuration = configuration;
2170
2171 let name = params.name;
2173
2174 let local_var_client = &local_var_configuration.client;
2175
2176 let local_var_uri_str = format!(
2177 "{}/my/{name}/action/transition",
2178 local_var_configuration.base_path,
2179 name = crate::apis::urlencode(name)
2180 );
2181 let mut local_var_req_builder =
2182 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2183
2184 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2185 local_var_req_builder =
2186 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2187 }
2188 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2189 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2190 };
2191
2192 let local_var_req = local_var_req_builder.build()?;
2193 let local_var_resp = local_var_client.execute(local_var_req).await?;
2194
2195 let local_var_status = local_var_resp.status();
2196 let local_var_content = local_var_resp.text().await?;
2197
2198 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2199 serde_json::from_str(&local_var_content).map_err(Error::from)
2200 } else {
2201 let local_var_entity: Option<ActionTransitionError> =
2202 serde_json::from_str(&local_var_content).ok();
2203 let local_var_error = ResponseContent {
2204 status: local_var_status,
2205 content: local_var_content,
2206 entity: local_var_entity,
2207 };
2208 Err(Error::ResponseError(local_var_error))
2209 }
2210}
2211
2212pub async fn buy_bank_expansion(
2214 configuration: &configuration::Configuration,
2215 params: BuyBankExpansionParams,
2216) -> Result<models::BankExtensionTransactionResponseSchema, Error<BuyBankExpansionError>> {
2217 let local_var_configuration = configuration;
2218
2219 let name = params.name;
2221
2222 let local_var_client = &local_var_configuration.client;
2223
2224 let local_var_uri_str = format!(
2225 "{}/my/{name}/action/bank/buy_expansion",
2226 local_var_configuration.base_path,
2227 name = crate::apis::urlencode(name)
2228 );
2229 let mut local_var_req_builder =
2230 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2231
2232 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2233 local_var_req_builder =
2234 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2235 }
2236 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2237 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2238 };
2239
2240 let local_var_req = local_var_req_builder.build()?;
2241 let local_var_resp = local_var_client.execute(local_var_req).await?;
2242
2243 let local_var_status = local_var_resp.status();
2244 let local_var_content = local_var_resp.text().await?;
2245
2246 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2247 serde_json::from_str(&local_var_content).map_err(Error::from)
2248 } else {
2249 let local_var_entity: Option<BuyBankExpansionError> =
2250 serde_json::from_str(&local_var_content).ok();
2251 let local_var_error = ResponseContent {
2252 status: local_var_status,
2253 content: local_var_content,
2254 entity: local_var_entity,
2255 };
2256 Err(Error::ResponseError(local_var_error))
2257 }
2258}
2259
2260pub async fn cancel_task(
2262 configuration: &configuration::Configuration,
2263 params: CancelTaskParams,
2264) -> Result<models::TaskCancelledResponseSchema, Error<CancelTaskError>> {
2265 let local_var_configuration = configuration;
2266
2267 let name = params.name;
2269
2270 let local_var_client = &local_var_configuration.client;
2271
2272 let local_var_uri_str = format!(
2273 "{}/my/{name}/action/task/cancel",
2274 local_var_configuration.base_path,
2275 name = crate::apis::urlencode(name)
2276 );
2277 let mut local_var_req_builder =
2278 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2279
2280 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2281 local_var_req_builder =
2282 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2283 }
2284 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2285 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2286 };
2287
2288 let local_var_req = local_var_req_builder.build()?;
2289 let local_var_resp = local_var_client.execute(local_var_req).await?;
2290
2291 let local_var_status = local_var_resp.status();
2292 let local_var_content = local_var_resp.text().await?;
2293
2294 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2295 serde_json::from_str(&local_var_content).map_err(Error::from)
2296 } else {
2297 let local_var_entity: Option<CancelTaskError> =
2298 serde_json::from_str(&local_var_content).ok();
2299 let local_var_error = ResponseContent {
2300 status: local_var_status,
2301 content: local_var_content,
2302 entity: local_var_entity,
2303 };
2304 Err(Error::ResponseError(local_var_error))
2305 }
2306}
2307
2308pub async fn change_skin(
2310 configuration: &configuration::Configuration,
2311 params: ChangeSkinParams,
2312) -> Result<models::ChangeSkinResponseSchema, Error<ChangeSkinError>> {
2313 let local_var_configuration = configuration;
2314
2315 let name = params.name;
2317 let change_skin_character_schema = params.change_skin_character_schema;
2319
2320 let local_var_client = &local_var_configuration.client;
2321
2322 let local_var_uri_str = format!(
2323 "{}/my/{name}/action/change_skin",
2324 local_var_configuration.base_path,
2325 name = crate::apis::urlencode(name)
2326 );
2327 let mut local_var_req_builder =
2328 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2329
2330 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2331 local_var_req_builder =
2332 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2333 }
2334 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2335 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2336 };
2337 local_var_req_builder = local_var_req_builder.json(&change_skin_character_schema);
2338
2339 let local_var_req = local_var_req_builder.build()?;
2340 let local_var_resp = local_var_client.execute(local_var_req).await?;
2341
2342 let local_var_status = local_var_resp.status();
2343 let local_var_content = local_var_resp.text().await?;
2344
2345 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2346 serde_json::from_str(&local_var_content).map_err(Error::from)
2347 } else {
2348 let local_var_entity: Option<ChangeSkinError> =
2349 serde_json::from_str(&local_var_content).ok();
2350 let local_var_error = ResponseContent {
2351 status: local_var_status,
2352 content: local_var_content,
2353 entity: local_var_entity,
2354 };
2355 Err(Error::ResponseError(local_var_error))
2356 }
2357}
2358
2359pub async fn claim_pending_item(
2361 configuration: &configuration::Configuration,
2362 params: ClaimPendingItemParams,
2363) -> Result<models::ClaimPendingItemResponseSchema, Error<ClaimPendingItemError>> {
2364 let local_var_configuration = configuration;
2365
2366 let name = params.name;
2368 let id = params.id;
2370
2371 let local_var_client = &local_var_configuration.client;
2372
2373 let local_var_uri_str = format!(
2374 "{}/my/{name}/action/claim_item/{id}",
2375 local_var_configuration.base_path,
2376 name = crate::apis::urlencode(name),
2377 id = crate::apis::urlencode(id)
2378 );
2379 let mut local_var_req_builder =
2380 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2381
2382 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2383 local_var_req_builder =
2384 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2385 }
2386 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2387 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2388 };
2389
2390 let local_var_req = local_var_req_builder.build()?;
2391 let local_var_resp = local_var_client.execute(local_var_req).await?;
2392
2393 let local_var_status = local_var_resp.status();
2394 let local_var_content = local_var_resp.text().await?;
2395
2396 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2397 serde_json::from_str(&local_var_content).map_err(Error::from)
2398 } else {
2399 let local_var_entity: Option<ClaimPendingItemError> =
2400 serde_json::from_str(&local_var_content).ok();
2401 let local_var_error = ResponseContent {
2402 status: local_var_status,
2403 content: local_var_content,
2404 entity: local_var_entity,
2405 };
2406 Err(Error::ResponseError(local_var_error))
2407 }
2408}
2409
2410pub async fn complete_task(
2412 configuration: &configuration::Configuration,
2413 params: CompleteTaskParams,
2414) -> Result<models::RewardDataResponseSchema, Error<CompleteTaskError>> {
2415 let local_var_configuration = configuration;
2416
2417 let name = params.name;
2419
2420 let local_var_client = &local_var_configuration.client;
2421
2422 let local_var_uri_str = format!(
2423 "{}/my/{name}/action/task/complete",
2424 local_var_configuration.base_path,
2425 name = crate::apis::urlencode(name)
2426 );
2427 let mut local_var_req_builder =
2428 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2429
2430 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2431 local_var_req_builder =
2432 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2433 }
2434 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2435 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2436 };
2437
2438 let local_var_req = local_var_req_builder.build()?;
2439 let local_var_resp = local_var_client.execute(local_var_req).await?;
2440
2441 let local_var_status = local_var_resp.status();
2442 let local_var_content = local_var_resp.text().await?;
2443
2444 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2445 serde_json::from_str(&local_var_content).map_err(Error::from)
2446 } else {
2447 let local_var_entity: Option<CompleteTaskError> =
2448 serde_json::from_str(&local_var_content).ok();
2449 let local_var_error = ResponseContent {
2450 status: local_var_status,
2451 content: local_var_content,
2452 entity: local_var_entity,
2453 };
2454 Err(Error::ResponseError(local_var_error))
2455 }
2456}
2457
2458pub async fn craft(
2460 configuration: &configuration::Configuration,
2461 params: CraftParams,
2462) -> Result<models::SkillResponseSchema, Error<CraftError>> {
2463 let local_var_configuration = configuration;
2464
2465 let name = params.name;
2467 let crafting_schema = params.crafting_schema;
2469
2470 let local_var_client = &local_var_configuration.client;
2471
2472 let local_var_uri_str = format!(
2473 "{}/my/{name}/action/crafting",
2474 local_var_configuration.base_path,
2475 name = crate::apis::urlencode(name)
2476 );
2477 let mut local_var_req_builder =
2478 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2479
2480 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2481 local_var_req_builder =
2482 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2483 }
2484 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2485 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2486 };
2487 local_var_req_builder = local_var_req_builder.json(&crafting_schema);
2488
2489 let local_var_req = local_var_req_builder.build()?;
2490 let local_var_resp = local_var_client.execute(local_var_req).await?;
2491
2492 let local_var_status = local_var_resp.status();
2493 let local_var_content = local_var_resp.text().await?;
2494
2495 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2496 serde_json::from_str(&local_var_content).map_err(Error::from)
2497 } else {
2498 let local_var_entity: Option<CraftError> = serde_json::from_str(&local_var_content).ok();
2499 let local_var_error = ResponseContent {
2500 status: local_var_status,
2501 content: local_var_content,
2502 entity: local_var_entity,
2503 };
2504 Err(Error::ResponseError(local_var_error))
2505 }
2506}
2507
2508pub async fn delete_item(
2510 configuration: &configuration::Configuration,
2511 params: DeleteItemParams,
2512) -> Result<models::DeleteItemResponseSchema, Error<DeleteItemError>> {
2513 let local_var_configuration = configuration;
2514
2515 let name = params.name;
2517 let simple_item_schema = params.simple_item_schema;
2519
2520 let local_var_client = &local_var_configuration.client;
2521
2522 let local_var_uri_str = format!(
2523 "{}/my/{name}/action/delete",
2524 local_var_configuration.base_path,
2525 name = crate::apis::urlencode(name)
2526 );
2527 let mut local_var_req_builder =
2528 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2529
2530 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2531 local_var_req_builder =
2532 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2533 }
2534 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2535 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2536 };
2537 local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
2538
2539 let local_var_req = local_var_req_builder.build()?;
2540 let local_var_resp = local_var_client.execute(local_var_req).await?;
2541
2542 let local_var_status = local_var_resp.status();
2543 let local_var_content = local_var_resp.text().await?;
2544
2545 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2546 serde_json::from_str(&local_var_content).map_err(Error::from)
2547 } else {
2548 let local_var_entity: Option<DeleteItemError> =
2549 serde_json::from_str(&local_var_content).ok();
2550 let local_var_error = ResponseContent {
2551 status: local_var_status,
2552 content: local_var_content,
2553 entity: local_var_entity,
2554 };
2555 Err(Error::ResponseError(local_var_error))
2556 }
2557}
2558
2559pub async fn deposit_gold(
2561 configuration: &configuration::Configuration,
2562 params: DepositGoldParams,
2563) -> Result<models::BankGoldTransactionResponseSchema, Error<DepositGoldError>> {
2564 let local_var_configuration = configuration;
2565
2566 let name = params.name;
2568 let deposit_withdraw_gold_schema = params.deposit_withdraw_gold_schema;
2570
2571 let local_var_client = &local_var_configuration.client;
2572
2573 let local_var_uri_str = format!(
2574 "{}/my/{name}/action/bank/deposit/gold",
2575 local_var_configuration.base_path,
2576 name = crate::apis::urlencode(name)
2577 );
2578 let mut local_var_req_builder =
2579 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2580
2581 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2582 local_var_req_builder =
2583 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2584 }
2585 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2586 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2587 };
2588 local_var_req_builder = local_var_req_builder.json(&deposit_withdraw_gold_schema);
2589
2590 let local_var_req = local_var_req_builder.build()?;
2591 let local_var_resp = local_var_client.execute(local_var_req).await?;
2592
2593 let local_var_status = local_var_resp.status();
2594 let local_var_content = local_var_resp.text().await?;
2595
2596 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2597 serde_json::from_str(&local_var_content).map_err(Error::from)
2598 } else {
2599 let local_var_entity: Option<DepositGoldError> =
2600 serde_json::from_str(&local_var_content).ok();
2601 let local_var_error = ResponseContent {
2602 status: local_var_status,
2603 content: local_var_content,
2604 entity: local_var_entity,
2605 };
2606 Err(Error::ResponseError(local_var_error))
2607 }
2608}
2609
2610pub async fn deposit_item(
2612 configuration: &configuration::Configuration,
2613 params: DepositItemParams,
2614) -> Result<models::BankItemTransactionResponseSchema, Error<DepositItemError>> {
2615 let local_var_configuration = configuration;
2616
2617 let name = params.name;
2619 let simple_item_schema = params.simple_item_schema;
2621
2622 let local_var_client = &local_var_configuration.client;
2623
2624 let local_var_uri_str = format!(
2625 "{}/my/{name}/action/bank/deposit/item",
2626 local_var_configuration.base_path,
2627 name = crate::apis::urlencode(name)
2628 );
2629 let mut local_var_req_builder =
2630 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2631
2632 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2633 local_var_req_builder =
2634 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2635 }
2636 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2637 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2638 };
2639 local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
2640
2641 let local_var_req = local_var_req_builder.build()?;
2642 let local_var_resp = local_var_client.execute(local_var_req).await?;
2643
2644 let local_var_status = local_var_resp.status();
2645 let local_var_content = local_var_resp.text().await?;
2646
2647 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2648 serde_json::from_str(&local_var_content).map_err(Error::from)
2649 } else {
2650 let local_var_entity: Option<DepositItemError> =
2651 serde_json::from_str(&local_var_content).ok();
2652 let local_var_error = ResponseContent {
2653 status: local_var_status,
2654 content: local_var_content,
2655 entity: local_var_entity,
2656 };
2657 Err(Error::ResponseError(local_var_error))
2658 }
2659}
2660
2661pub async fn equip_item(
2663 configuration: &configuration::Configuration,
2664 params: EquipItemParams,
2665) -> Result<models::EquipmentResponseSchema, Error<EquipItemError>> {
2666 let local_var_configuration = configuration;
2667
2668 let name = params.name;
2670 let equip_schema = params.equip_schema;
2672
2673 let local_var_client = &local_var_configuration.client;
2674
2675 let local_var_uri_str = format!(
2676 "{}/my/{name}/action/equip",
2677 local_var_configuration.base_path,
2678 name = crate::apis::urlencode(name)
2679 );
2680 let mut local_var_req_builder =
2681 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2682
2683 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2684 local_var_req_builder =
2685 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2686 }
2687 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2688 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2689 };
2690 local_var_req_builder = local_var_req_builder.json(&equip_schema);
2691
2692 let local_var_req = local_var_req_builder.build()?;
2693 let local_var_resp = local_var_client.execute(local_var_req).await?;
2694
2695 let local_var_status = local_var_resp.status();
2696 let local_var_content = local_var_resp.text().await?;
2697
2698 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2699 serde_json::from_str(&local_var_content).map_err(Error::from)
2700 } else {
2701 let local_var_entity: Option<EquipItemError> =
2702 serde_json::from_str(&local_var_content).ok();
2703 let local_var_error = ResponseContent {
2704 status: local_var_status,
2705 content: local_var_content,
2706 entity: local_var_entity,
2707 };
2708 Err(Error::ResponseError(local_var_error))
2709 }
2710}
2711
2712pub async fn fight(
2714 configuration: &configuration::Configuration,
2715 params: FightParams,
2716) -> Result<models::CharacterFightResponseSchema, Error<FightError>> {
2717 let local_var_configuration = configuration;
2718
2719 let name = params.name;
2721 let fight_request_schema = params.fight_request_schema;
2723
2724 let local_var_client = &local_var_configuration.client;
2725
2726 let local_var_uri_str = format!(
2727 "{}/my/{name}/action/fight",
2728 local_var_configuration.base_path,
2729 name = crate::apis::urlencode(name)
2730 );
2731 let mut local_var_req_builder =
2732 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2733
2734 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2735 local_var_req_builder =
2736 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2737 }
2738 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2739 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2740 };
2741 local_var_req_builder = local_var_req_builder.json(&fight_request_schema);
2742
2743 let local_var_req = local_var_req_builder.build()?;
2744 let local_var_resp = local_var_client.execute(local_var_req).await?;
2745
2746 let local_var_status = local_var_resp.status();
2747 let local_var_content = local_var_resp.text().await?;
2748
2749 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2750 serde_json::from_str(&local_var_content).map_err(Error::from)
2751 } else {
2752 let local_var_entity: Option<FightError> = serde_json::from_str(&local_var_content).ok();
2753 let local_var_error = ResponseContent {
2754 status: local_var_status,
2755 content: local_var_content,
2756 entity: local_var_entity,
2757 };
2758 Err(Error::ResponseError(local_var_error))
2759 }
2760}
2761
2762pub async fn gather(
2764 configuration: &configuration::Configuration,
2765 params: GatherParams,
2766) -> Result<models::SkillResponseSchema, Error<GatherError>> {
2767 let local_var_configuration = configuration;
2768
2769 let name = params.name;
2771
2772 let local_var_client = &local_var_configuration.client;
2773
2774 let local_var_uri_str = format!(
2775 "{}/my/{name}/action/gathering",
2776 local_var_configuration.base_path,
2777 name = crate::apis::urlencode(name)
2778 );
2779 let mut local_var_req_builder =
2780 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2781
2782 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2783 local_var_req_builder =
2784 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2785 }
2786 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2787 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2788 };
2789
2790 let local_var_req = local_var_req_builder.build()?;
2791 let local_var_resp = local_var_client.execute(local_var_req).await?;
2792
2793 let local_var_status = local_var_resp.status();
2794 let local_var_content = local_var_resp.text().await?;
2795
2796 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2797 serde_json::from_str(&local_var_content).map_err(Error::from)
2798 } else {
2799 let local_var_entity: Option<GatherError> = serde_json::from_str(&local_var_content).ok();
2800 let local_var_error = ResponseContent {
2801 status: local_var_status,
2802 content: local_var_content,
2803 entity: local_var_entity,
2804 };
2805 Err(Error::ResponseError(local_var_error))
2806 }
2807}
2808
2809pub async fn ge_buy_item(
2811 configuration: &configuration::Configuration,
2812 params: GeBuyItemParams,
2813) -> Result<models::GeTransactionResponseSchema, Error<GeBuyItemError>> {
2814 let local_var_configuration = configuration;
2815
2816 let name = params.name;
2818 let ge_buy_order_schema = params.ge_buy_order_schema;
2820
2821 let local_var_client = &local_var_configuration.client;
2822
2823 let local_var_uri_str = format!(
2824 "{}/my/{name}/action/grandexchange/buy",
2825 local_var_configuration.base_path,
2826 name = crate::apis::urlencode(name)
2827 );
2828 let mut local_var_req_builder =
2829 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2830
2831 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2832 local_var_req_builder =
2833 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2834 }
2835 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2836 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2837 };
2838 local_var_req_builder = local_var_req_builder.json(&ge_buy_order_schema);
2839
2840 let local_var_req = local_var_req_builder.build()?;
2841 let local_var_resp = local_var_client.execute(local_var_req).await?;
2842
2843 let local_var_status = local_var_resp.status();
2844 let local_var_content = local_var_resp.text().await?;
2845
2846 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2847 serde_json::from_str(&local_var_content).map_err(Error::from)
2848 } else {
2849 let local_var_entity: Option<GeBuyItemError> =
2850 serde_json::from_str(&local_var_content).ok();
2851 let local_var_error = ResponseContent {
2852 status: local_var_status,
2853 content: local_var_content,
2854 entity: local_var_entity,
2855 };
2856 Err(Error::ResponseError(local_var_error))
2857 }
2858}
2859
2860pub async fn ge_cancel_order(
2862 configuration: &configuration::Configuration,
2863 params: GeCancelOrderParams,
2864) -> Result<models::GeTransactionResponseSchema, Error<GeCancelOrderError>> {
2865 let local_var_configuration = configuration;
2866
2867 let name = params.name;
2869 let ge_cancel_order_schema = params.ge_cancel_order_schema;
2871
2872 let local_var_client = &local_var_configuration.client;
2873
2874 let local_var_uri_str = format!(
2875 "{}/my/{name}/action/grandexchange/cancel",
2876 local_var_configuration.base_path,
2877 name = crate::apis::urlencode(name)
2878 );
2879 let mut local_var_req_builder =
2880 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2881
2882 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2883 local_var_req_builder =
2884 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2885 }
2886 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2887 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2888 };
2889 local_var_req_builder = local_var_req_builder.json(&ge_cancel_order_schema);
2890
2891 let local_var_req = local_var_req_builder.build()?;
2892 let local_var_resp = local_var_client.execute(local_var_req).await?;
2893
2894 let local_var_status = local_var_resp.status();
2895 let local_var_content = local_var_resp.text().await?;
2896
2897 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2898 serde_json::from_str(&local_var_content).map_err(Error::from)
2899 } else {
2900 let local_var_entity: Option<GeCancelOrderError> =
2901 serde_json::from_str(&local_var_content).ok();
2902 let local_var_error = ResponseContent {
2903 status: local_var_status,
2904 content: local_var_content,
2905 entity: local_var_entity,
2906 };
2907 Err(Error::ResponseError(local_var_error))
2908 }
2909}
2910
2911pub async fn ge_create_buy_order(
2913 configuration: &configuration::Configuration,
2914 params: GeCreateBuyOrderParams,
2915) -> Result<models::GeCreateOrderTransactionResponseSchema, Error<GeCreateBuyOrderError>> {
2916 let local_var_configuration = configuration;
2917
2918 let name = params.name;
2920 let ge_buy_order_creation_schema = params.ge_buy_order_creation_schema;
2922
2923 let local_var_client = &local_var_configuration.client;
2924
2925 let local_var_uri_str = format!(
2926 "{}/my/{name}/action/grandexchange/create_buy_order",
2927 local_var_configuration.base_path,
2928 name = crate::apis::urlencode(name)
2929 );
2930 let mut local_var_req_builder =
2931 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2932
2933 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2934 local_var_req_builder =
2935 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2936 }
2937 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2938 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2939 };
2940 local_var_req_builder = local_var_req_builder.json(&ge_buy_order_creation_schema);
2941
2942 let local_var_req = local_var_req_builder.build()?;
2943 let local_var_resp = local_var_client.execute(local_var_req).await?;
2944
2945 let local_var_status = local_var_resp.status();
2946 let local_var_content = local_var_resp.text().await?;
2947
2948 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2949 serde_json::from_str(&local_var_content).map_err(Error::from)
2950 } else {
2951 let local_var_entity: Option<GeCreateBuyOrderError> =
2952 serde_json::from_str(&local_var_content).ok();
2953 let local_var_error = ResponseContent {
2954 status: local_var_status,
2955 content: local_var_content,
2956 entity: local_var_entity,
2957 };
2958 Err(Error::ResponseError(local_var_error))
2959 }
2960}
2961
2962pub async fn ge_create_sell_order(
2964 configuration: &configuration::Configuration,
2965 params: GeCreateSellOrderParams,
2966) -> Result<models::GeCreateOrderTransactionResponseSchema, Error<GeCreateSellOrderError>> {
2967 let local_var_configuration = configuration;
2968
2969 let name = params.name;
2971 let ge_order_creation_schema = params.ge_order_creation_schema;
2973
2974 let local_var_client = &local_var_configuration.client;
2975
2976 let local_var_uri_str = format!(
2977 "{}/my/{name}/action/grandexchange/create_sell_order",
2978 local_var_configuration.base_path,
2979 name = crate::apis::urlencode(name)
2980 );
2981 let mut local_var_req_builder =
2982 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2983
2984 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2985 local_var_req_builder =
2986 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2987 }
2988 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2989 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2990 };
2991 local_var_req_builder = local_var_req_builder.json(&ge_order_creation_schema);
2992
2993 let local_var_req = local_var_req_builder.build()?;
2994 let local_var_resp = local_var_client.execute(local_var_req).await?;
2995
2996 let local_var_status = local_var_resp.status();
2997 let local_var_content = local_var_resp.text().await?;
2998
2999 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3000 serde_json::from_str(&local_var_content).map_err(Error::from)
3001 } else {
3002 let local_var_entity: Option<GeCreateSellOrderError> =
3003 serde_json::from_str(&local_var_content).ok();
3004 let local_var_error = ResponseContent {
3005 status: local_var_status,
3006 content: local_var_content,
3007 entity: local_var_entity,
3008 };
3009 Err(Error::ResponseError(local_var_error))
3010 }
3011}
3012
3013pub async fn ge_fill_order(
3015 configuration: &configuration::Configuration,
3016 params: GeFillOrderParams,
3017) -> Result<models::GeTransactionResponseSchema, Error<GeFillOrderError>> {
3018 let local_var_configuration = configuration;
3019
3020 let name = params.name;
3022 let ge_fill_buy_order_schema = params.ge_fill_buy_order_schema;
3024
3025 let local_var_client = &local_var_configuration.client;
3026
3027 let local_var_uri_str = format!(
3028 "{}/my/{name}/action/grandexchange/fill",
3029 local_var_configuration.base_path,
3030 name = crate::apis::urlencode(name)
3031 );
3032 let mut local_var_req_builder =
3033 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3034
3035 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3036 local_var_req_builder =
3037 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3038 }
3039 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3040 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3041 };
3042 local_var_req_builder = local_var_req_builder.json(&ge_fill_buy_order_schema);
3043
3044 let local_var_req = local_var_req_builder.build()?;
3045 let local_var_resp = local_var_client.execute(local_var_req).await?;
3046
3047 let local_var_status = local_var_resp.status();
3048 let local_var_content = local_var_resp.text().await?;
3049
3050 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3051 serde_json::from_str(&local_var_content).map_err(Error::from)
3052 } else {
3053 let local_var_entity: Option<GeFillOrderError> =
3054 serde_json::from_str(&local_var_content).ok();
3055 let local_var_error = ResponseContent {
3056 status: local_var_status,
3057 content: local_var_content,
3058 entity: local_var_entity,
3059 };
3060 Err(Error::ResponseError(local_var_error))
3061 }
3062}
3063
3064pub async fn get_all_characters_logs(
3066 configuration: &configuration::Configuration,
3067 params: GetAllCharactersLogsParams,
3068) -> Result<models::DataPageLogSchema, Error<GetAllCharactersLogsError>> {
3069 let local_var_configuration = configuration;
3070
3071 let page = params.page;
3073 let size = params.size;
3075
3076 let local_var_client = &local_var_configuration.client;
3077
3078 let local_var_uri_str = format!("{}/my/logs", local_var_configuration.base_path);
3079 let mut local_var_req_builder =
3080 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3081
3082 if let Some(ref local_var_str) = page {
3083 local_var_req_builder =
3084 local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
3085 }
3086 if let Some(ref local_var_str) = size {
3087 local_var_req_builder =
3088 local_var_req_builder.query(&[("size", &local_var_str.to_string())]);
3089 }
3090 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3091 local_var_req_builder =
3092 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3093 }
3094 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3095 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3096 };
3097
3098 let local_var_req = local_var_req_builder.build()?;
3099 let local_var_resp = local_var_client.execute(local_var_req).await?;
3100
3101 let local_var_status = local_var_resp.status();
3102 let local_var_content = local_var_resp.text().await?;
3103
3104 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3105 serde_json::from_str(&local_var_content).map_err(Error::from)
3106 } else {
3107 let local_var_entity: Option<GetAllCharactersLogsError> =
3108 serde_json::from_str(&local_var_content).ok();
3109 let local_var_error = ResponseContent {
3110 status: local_var_status,
3111 content: local_var_content,
3112 entity: local_var_entity,
3113 };
3114 Err(Error::ResponseError(local_var_error))
3115 }
3116}
3117
3118pub async fn get_character_logs(
3120 configuration: &configuration::Configuration,
3121 params: GetCharacterLogsParams,
3122) -> Result<models::DataPageLogSchema, Error<GetCharacterLogsError>> {
3123 let local_var_configuration = configuration;
3124
3125 let name = params.name;
3127 let page = params.page;
3129 let size = params.size;
3131
3132 let local_var_client = &local_var_configuration.client;
3133
3134 let local_var_uri_str = format!(
3135 "{}/my/logs/{name}",
3136 local_var_configuration.base_path,
3137 name = crate::apis::urlencode(name)
3138 );
3139 let mut local_var_req_builder =
3140 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3141
3142 if let Some(ref local_var_str) = page {
3143 local_var_req_builder =
3144 local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
3145 }
3146 if let Some(ref local_var_str) = size {
3147 local_var_req_builder =
3148 local_var_req_builder.query(&[("size", &local_var_str.to_string())]);
3149 }
3150 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3151 local_var_req_builder =
3152 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3153 }
3154 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3155 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3156 };
3157
3158 let local_var_req = local_var_req_builder.build()?;
3159 let local_var_resp = local_var_client.execute(local_var_req).await?;
3160
3161 let local_var_status = local_var_resp.status();
3162 let local_var_content = local_var_resp.text().await?;
3163
3164 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3165 serde_json::from_str(&local_var_content).map_err(Error::from)
3166 } else {
3167 let local_var_entity: Option<GetCharacterLogsError> =
3168 serde_json::from_str(&local_var_content).ok();
3169 let local_var_error = ResponseContent {
3170 status: local_var_status,
3171 content: local_var_content,
3172 entity: local_var_entity,
3173 };
3174 Err(Error::ResponseError(local_var_error))
3175 }
3176}
3177
3178pub async fn get_my_characters(
3180 configuration: &configuration::Configuration,
3181) -> Result<models::MyCharactersListSchema, Error<GetMyCharactersError>> {
3182 let local_var_configuration = configuration;
3183
3184 let local_var_client = &local_var_configuration.client;
3185
3186 let local_var_uri_str = format!("{}/my/characters", local_var_configuration.base_path);
3187 let mut local_var_req_builder =
3188 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3189
3190 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3191 local_var_req_builder =
3192 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3193 }
3194 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3195 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3196 };
3197
3198 let local_var_req = local_var_req_builder.build()?;
3199 let local_var_resp = local_var_client.execute(local_var_req).await?;
3200
3201 let local_var_status = local_var_resp.status();
3202 let local_var_content = local_var_resp.text().await?;
3203
3204 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3205 serde_json::from_str(&local_var_content).map_err(Error::from)
3206 } else {
3207 let local_var_entity: Option<GetMyCharactersError> =
3208 serde_json::from_str(&local_var_content).ok();
3209 let local_var_error = ResponseContent {
3210 status: local_var_status,
3211 content: local_var_content,
3212 entity: local_var_entity,
3213 };
3214 Err(Error::ResponseError(local_var_error))
3215 }
3216}
3217
3218pub async fn give_gold(
3220 configuration: &configuration::Configuration,
3221 params: GiveGoldParams,
3222) -> Result<models::GiveGoldResponseSchema, Error<GiveGoldError>> {
3223 let local_var_configuration = configuration;
3224
3225 let name = params.name;
3227 let give_gold_schema = params.give_gold_schema;
3229
3230 let local_var_client = &local_var_configuration.client;
3231
3232 let local_var_uri_str = format!(
3233 "{}/my/{name}/action/give/gold",
3234 local_var_configuration.base_path,
3235 name = crate::apis::urlencode(name)
3236 );
3237 let mut local_var_req_builder =
3238 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3239
3240 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3241 local_var_req_builder =
3242 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3243 }
3244 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3245 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3246 };
3247 local_var_req_builder = local_var_req_builder.json(&give_gold_schema);
3248
3249 let local_var_req = local_var_req_builder.build()?;
3250 let local_var_resp = local_var_client.execute(local_var_req).await?;
3251
3252 let local_var_status = local_var_resp.status();
3253 let local_var_content = local_var_resp.text().await?;
3254
3255 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3256 serde_json::from_str(&local_var_content).map_err(Error::from)
3257 } else {
3258 let local_var_entity: Option<GiveGoldError> = serde_json::from_str(&local_var_content).ok();
3259 let local_var_error = ResponseContent {
3260 status: local_var_status,
3261 content: local_var_content,
3262 entity: local_var_entity,
3263 };
3264 Err(Error::ResponseError(local_var_error))
3265 }
3266}
3267
3268pub async fn give_items(
3270 configuration: &configuration::Configuration,
3271 params: GiveItemsParams,
3272) -> Result<models::GiveItemResponseSchema, Error<GiveItemsError>> {
3273 let local_var_configuration = configuration;
3274
3275 let name = params.name;
3277 let give_items_schema = params.give_items_schema;
3279
3280 let local_var_client = &local_var_configuration.client;
3281
3282 let local_var_uri_str = format!(
3283 "{}/my/{name}/action/give/item",
3284 local_var_configuration.base_path,
3285 name = crate::apis::urlencode(name)
3286 );
3287 let mut local_var_req_builder =
3288 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3289
3290 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3291 local_var_req_builder =
3292 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3293 }
3294 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3295 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3296 };
3297 local_var_req_builder = local_var_req_builder.json(&give_items_schema);
3298
3299 let local_var_req = local_var_req_builder.build()?;
3300 let local_var_resp = local_var_client.execute(local_var_req).await?;
3301
3302 let local_var_status = local_var_resp.status();
3303 let local_var_content = local_var_resp.text().await?;
3304
3305 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3306 serde_json::from_str(&local_var_content).map_err(Error::from)
3307 } else {
3308 let local_var_entity: Option<GiveItemsError> =
3309 serde_json::from_str(&local_var_content).ok();
3310 let local_var_error = ResponseContent {
3311 status: local_var_status,
3312 content: local_var_content,
3313 entity: local_var_entity,
3314 };
3315 Err(Error::ResponseError(local_var_error))
3316 }
3317}
3318
3319pub async fn move_character(
3321 configuration: &configuration::Configuration,
3322 params: MoveCharacterParams,
3323) -> Result<models::CharacterMovementResponseSchema, Error<MoveCharacterError>> {
3324 let local_var_configuration = configuration;
3325
3326 let name = params.name;
3328 let destination_schema = params.destination_schema;
3330
3331 let local_var_client = &local_var_configuration.client;
3332
3333 let local_var_uri_str = format!(
3334 "{}/my/{name}/action/move",
3335 local_var_configuration.base_path,
3336 name = crate::apis::urlencode(name)
3337 );
3338 let mut local_var_req_builder =
3339 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3340
3341 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3342 local_var_req_builder =
3343 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3344 }
3345 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3346 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3347 };
3348 local_var_req_builder = local_var_req_builder.json(&destination_schema);
3349
3350 let local_var_req = local_var_req_builder.build()?;
3351 let local_var_resp = local_var_client.execute(local_var_req).await?;
3352
3353 let local_var_status = local_var_resp.status();
3354 let local_var_content = local_var_resp.text().await?;
3355
3356 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3357 serde_json::from_str(&local_var_content).map_err(Error::from)
3358 } else {
3359 let local_var_entity: Option<MoveCharacterError> =
3360 serde_json::from_str(&local_var_content).ok();
3361 let local_var_error = ResponseContent {
3362 status: local_var_status,
3363 content: local_var_content,
3364 entity: local_var_entity,
3365 };
3366 Err(Error::ResponseError(local_var_error))
3367 }
3368}
3369
3370pub async fn npc_buy_item(
3372 configuration: &configuration::Configuration,
3373 params: NpcBuyItemParams,
3374) -> Result<models::NpcMerchantTransactionResponseSchema, Error<NpcBuyItemError>> {
3375 let local_var_configuration = configuration;
3376
3377 let name = params.name;
3379 let npc_merchant_buy_schema = params.npc_merchant_buy_schema;
3381
3382 let local_var_client = &local_var_configuration.client;
3383
3384 let local_var_uri_str = format!(
3385 "{}/my/{name}/action/npc/buy",
3386 local_var_configuration.base_path,
3387 name = crate::apis::urlencode(name)
3388 );
3389 let mut local_var_req_builder =
3390 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3391
3392 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3393 local_var_req_builder =
3394 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3395 }
3396 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3397 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3398 };
3399 local_var_req_builder = local_var_req_builder.json(&npc_merchant_buy_schema);
3400
3401 let local_var_req = local_var_req_builder.build()?;
3402 let local_var_resp = local_var_client.execute(local_var_req).await?;
3403
3404 let local_var_status = local_var_resp.status();
3405 let local_var_content = local_var_resp.text().await?;
3406
3407 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3408 serde_json::from_str(&local_var_content).map_err(Error::from)
3409 } else {
3410 let local_var_entity: Option<NpcBuyItemError> =
3411 serde_json::from_str(&local_var_content).ok();
3412 let local_var_error = ResponseContent {
3413 status: local_var_status,
3414 content: local_var_content,
3415 entity: local_var_entity,
3416 };
3417 Err(Error::ResponseError(local_var_error))
3418 }
3419}
3420
3421pub async fn npc_sell_item(
3423 configuration: &configuration::Configuration,
3424 params: NpcSellItemParams,
3425) -> Result<models::NpcMerchantTransactionResponseSchema, Error<NpcSellItemError>> {
3426 let local_var_configuration = configuration;
3427
3428 let name = params.name;
3430 let npc_merchant_buy_schema = params.npc_merchant_buy_schema;
3432
3433 let local_var_client = &local_var_configuration.client;
3434
3435 let local_var_uri_str = format!(
3436 "{}/my/{name}/action/npc/sell",
3437 local_var_configuration.base_path,
3438 name = crate::apis::urlencode(name)
3439 );
3440 let mut local_var_req_builder =
3441 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3442
3443 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3444 local_var_req_builder =
3445 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3446 }
3447 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3448 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3449 };
3450 local_var_req_builder = local_var_req_builder.json(&npc_merchant_buy_schema);
3451
3452 let local_var_req = local_var_req_builder.build()?;
3453 let local_var_resp = local_var_client.execute(local_var_req).await?;
3454
3455 let local_var_status = local_var_resp.status();
3456 let local_var_content = local_var_resp.text().await?;
3457
3458 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3459 serde_json::from_str(&local_var_content).map_err(Error::from)
3460 } else {
3461 let local_var_entity: Option<NpcSellItemError> =
3462 serde_json::from_str(&local_var_content).ok();
3463 let local_var_error = ResponseContent {
3464 status: local_var_status,
3465 content: local_var_content,
3466 entity: local_var_entity,
3467 };
3468 Err(Error::ResponseError(local_var_error))
3469 }
3470}
3471
3472pub async fn recycle(
3474 configuration: &configuration::Configuration,
3475 params: RecycleParams,
3476) -> Result<models::RecyclingResponseSchema, Error<RecycleError>> {
3477 let local_var_configuration = configuration;
3478
3479 let name = params.name;
3481 let recycling_schema = params.recycling_schema;
3483
3484 let local_var_client = &local_var_configuration.client;
3485
3486 let local_var_uri_str = format!(
3487 "{}/my/{name}/action/recycling",
3488 local_var_configuration.base_path,
3489 name = crate::apis::urlencode(name)
3490 );
3491 let mut local_var_req_builder =
3492 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3493
3494 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3495 local_var_req_builder =
3496 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3497 }
3498 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3499 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3500 };
3501 local_var_req_builder = local_var_req_builder.json(&recycling_schema);
3502
3503 let local_var_req = local_var_req_builder.build()?;
3504 let local_var_resp = local_var_client.execute(local_var_req).await?;
3505
3506 let local_var_status = local_var_resp.status();
3507 let local_var_content = local_var_resp.text().await?;
3508
3509 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3510 serde_json::from_str(&local_var_content).map_err(Error::from)
3511 } else {
3512 let local_var_entity: Option<RecycleError> = serde_json::from_str(&local_var_content).ok();
3513 let local_var_error = ResponseContent {
3514 status: local_var_status,
3515 content: local_var_content,
3516 entity: local_var_entity,
3517 };
3518 Err(Error::ResponseError(local_var_error))
3519 }
3520}
3521
3522pub async fn rename_character(
3524 configuration: &configuration::Configuration,
3525 params: RenameCharacterParams,
3526) -> Result<models::RenameResponseSchema, Error<RenameCharacterError>> {
3527 let local_var_configuration = configuration;
3528
3529 let name = params.name;
3531 let rename_character_schema = params.rename_character_schema;
3533
3534 let local_var_client = &local_var_configuration.client;
3535
3536 let local_var_uri_str = format!(
3537 "{}/my/{name}/action/rename",
3538 local_var_configuration.base_path,
3539 name = crate::apis::urlencode(name)
3540 );
3541 let mut local_var_req_builder =
3542 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3543
3544 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3545 local_var_req_builder =
3546 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3547 }
3548 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3549 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3550 };
3551 local_var_req_builder = local_var_req_builder.json(&rename_character_schema);
3552
3553 let local_var_req = local_var_req_builder.build()?;
3554 let local_var_resp = local_var_client.execute(local_var_req).await?;
3555
3556 let local_var_status = local_var_resp.status();
3557 let local_var_content = local_var_resp.text().await?;
3558
3559 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3560 serde_json::from_str(&local_var_content).map_err(Error::from)
3561 } else {
3562 let local_var_entity: Option<RenameCharacterError> =
3563 serde_json::from_str(&local_var_content).ok();
3564 let local_var_error = ResponseContent {
3565 status: local_var_status,
3566 content: local_var_content,
3567 entity: local_var_entity,
3568 };
3569 Err(Error::ResponseError(local_var_error))
3570 }
3571}
3572
3573pub async fn rest_character(
3575 configuration: &configuration::Configuration,
3576 params: RestCharacterParams,
3577) -> Result<models::CharacterRestResponseSchema, Error<RestCharacterError>> {
3578 let local_var_configuration = configuration;
3579
3580 let name = params.name;
3582
3583 let local_var_client = &local_var_configuration.client;
3584
3585 let local_var_uri_str = format!(
3586 "{}/my/{name}/action/rest",
3587 local_var_configuration.base_path,
3588 name = crate::apis::urlencode(name)
3589 );
3590 let mut local_var_req_builder =
3591 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3592
3593 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3594 local_var_req_builder =
3595 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3596 }
3597 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3598 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3599 };
3600
3601 let local_var_req = local_var_req_builder.build()?;
3602 let local_var_resp = local_var_client.execute(local_var_req).await?;
3603
3604 let local_var_status = local_var_resp.status();
3605 let local_var_content = local_var_resp.text().await?;
3606
3607 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3608 serde_json::from_str(&local_var_content).map_err(Error::from)
3609 } else {
3610 let local_var_entity: Option<RestCharacterError> =
3611 serde_json::from_str(&local_var_content).ok();
3612 let local_var_error = ResponseContent {
3613 status: local_var_status,
3614 content: local_var_content,
3615 entity: local_var_entity,
3616 };
3617 Err(Error::ResponseError(local_var_error))
3618 }
3619}
3620
3621pub async fn task_exchange(
3623 configuration: &configuration::Configuration,
3624 params: TaskExchangeParams,
3625) -> Result<models::RewardDataResponseSchema, Error<TaskExchangeError>> {
3626 let local_var_configuration = configuration;
3627
3628 let name = params.name;
3630
3631 let local_var_client = &local_var_configuration.client;
3632
3633 let local_var_uri_str = format!(
3634 "{}/my/{name}/action/task/exchange",
3635 local_var_configuration.base_path,
3636 name = crate::apis::urlencode(name)
3637 );
3638 let mut local_var_req_builder =
3639 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3640
3641 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3642 local_var_req_builder =
3643 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3644 }
3645 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3646 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3647 };
3648
3649 let local_var_req = local_var_req_builder.build()?;
3650 let local_var_resp = local_var_client.execute(local_var_req).await?;
3651
3652 let local_var_status = local_var_resp.status();
3653 let local_var_content = local_var_resp.text().await?;
3654
3655 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3656 serde_json::from_str(&local_var_content).map_err(Error::from)
3657 } else {
3658 let local_var_entity: Option<TaskExchangeError> =
3659 serde_json::from_str(&local_var_content).ok();
3660 let local_var_error = ResponseContent {
3661 status: local_var_status,
3662 content: local_var_content,
3663 entity: local_var_entity,
3664 };
3665 Err(Error::ResponseError(local_var_error))
3666 }
3667}
3668
3669pub async fn task_trade(
3671 configuration: &configuration::Configuration,
3672 params: TaskTradeParams,
3673) -> Result<models::TaskTradeResponseSchema, Error<TaskTradeError>> {
3674 let local_var_configuration = configuration;
3675
3676 let name = params.name;
3678 let simple_item_schema = params.simple_item_schema;
3680
3681 let local_var_client = &local_var_configuration.client;
3682
3683 let local_var_uri_str = format!(
3684 "{}/my/{name}/action/task/trade",
3685 local_var_configuration.base_path,
3686 name = crate::apis::urlencode(name)
3687 );
3688 let mut local_var_req_builder =
3689 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3690
3691 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3692 local_var_req_builder =
3693 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3694 }
3695 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3696 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3697 };
3698 local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
3699
3700 let local_var_req = local_var_req_builder.build()?;
3701 let local_var_resp = local_var_client.execute(local_var_req).await?;
3702
3703 let local_var_status = local_var_resp.status();
3704 let local_var_content = local_var_resp.text().await?;
3705
3706 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3707 serde_json::from_str(&local_var_content).map_err(Error::from)
3708 } else {
3709 let local_var_entity: Option<TaskTradeError> =
3710 serde_json::from_str(&local_var_content).ok();
3711 let local_var_error = ResponseContent {
3712 status: local_var_status,
3713 content: local_var_content,
3714 entity: local_var_entity,
3715 };
3716 Err(Error::ResponseError(local_var_error))
3717 }
3718}
3719
3720pub async fn unequip_item(
3722 configuration: &configuration::Configuration,
3723 params: UnequipItemParams,
3724) -> Result<models::EquipmentResponseSchema, Error<UnequipItemError>> {
3725 let local_var_configuration = configuration;
3726
3727 let name = params.name;
3729 let unequip_schema = params.unequip_schema;
3731
3732 let local_var_client = &local_var_configuration.client;
3733
3734 let local_var_uri_str = format!(
3735 "{}/my/{name}/action/unequip",
3736 local_var_configuration.base_path,
3737 name = crate::apis::urlencode(name)
3738 );
3739 let mut local_var_req_builder =
3740 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3741
3742 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3743 local_var_req_builder =
3744 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3745 }
3746 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3747 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3748 };
3749 local_var_req_builder = local_var_req_builder.json(&unequip_schema);
3750
3751 let local_var_req = local_var_req_builder.build()?;
3752 let local_var_resp = local_var_client.execute(local_var_req).await?;
3753
3754 let local_var_status = local_var_resp.status();
3755 let local_var_content = local_var_resp.text().await?;
3756
3757 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3758 serde_json::from_str(&local_var_content).map_err(Error::from)
3759 } else {
3760 let local_var_entity: Option<UnequipItemError> =
3761 serde_json::from_str(&local_var_content).ok();
3762 let local_var_error = ResponseContent {
3763 status: local_var_status,
3764 content: local_var_content,
3765 entity: local_var_entity,
3766 };
3767 Err(Error::ResponseError(local_var_error))
3768 }
3769}
3770
3771pub async fn use_item(
3773 configuration: &configuration::Configuration,
3774 params: UseItemParams,
3775) -> Result<models::UseItemResponseSchema, Error<UseItemError>> {
3776 let local_var_configuration = configuration;
3777
3778 let name = params.name;
3780 let simple_item_schema = params.simple_item_schema;
3782
3783 let local_var_client = &local_var_configuration.client;
3784
3785 let local_var_uri_str = format!(
3786 "{}/my/{name}/action/use",
3787 local_var_configuration.base_path,
3788 name = crate::apis::urlencode(name)
3789 );
3790 let mut local_var_req_builder =
3791 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3792
3793 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3794 local_var_req_builder =
3795 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3796 }
3797 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3798 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3799 };
3800 local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
3801
3802 let local_var_req = local_var_req_builder.build()?;
3803 let local_var_resp = local_var_client.execute(local_var_req).await?;
3804
3805 let local_var_status = local_var_resp.status();
3806 let local_var_content = local_var_resp.text().await?;
3807
3808 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3809 serde_json::from_str(&local_var_content).map_err(Error::from)
3810 } else {
3811 let local_var_entity: Option<UseItemError> = serde_json::from_str(&local_var_content).ok();
3812 let local_var_error = ResponseContent {
3813 status: local_var_status,
3814 content: local_var_content,
3815 entity: local_var_entity,
3816 };
3817 Err(Error::ResponseError(local_var_error))
3818 }
3819}
3820
3821pub async fn withdraw_gold(
3823 configuration: &configuration::Configuration,
3824 params: WithdrawGoldParams,
3825) -> Result<models::BankGoldTransactionResponseSchema, Error<WithdrawGoldError>> {
3826 let local_var_configuration = configuration;
3827
3828 let name = params.name;
3830 let deposit_withdraw_gold_schema = params.deposit_withdraw_gold_schema;
3832
3833 let local_var_client = &local_var_configuration.client;
3834
3835 let local_var_uri_str = format!(
3836 "{}/my/{name}/action/bank/withdraw/gold",
3837 local_var_configuration.base_path,
3838 name = crate::apis::urlencode(name)
3839 );
3840 let mut local_var_req_builder =
3841 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3842
3843 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3844 local_var_req_builder =
3845 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3846 }
3847 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3848 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3849 };
3850 local_var_req_builder = local_var_req_builder.json(&deposit_withdraw_gold_schema);
3851
3852 let local_var_req = local_var_req_builder.build()?;
3853 let local_var_resp = local_var_client.execute(local_var_req).await?;
3854
3855 let local_var_status = local_var_resp.status();
3856 let local_var_content = local_var_resp.text().await?;
3857
3858 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3859 serde_json::from_str(&local_var_content).map_err(Error::from)
3860 } else {
3861 let local_var_entity: Option<WithdrawGoldError> =
3862 serde_json::from_str(&local_var_content).ok();
3863 let local_var_error = ResponseContent {
3864 status: local_var_status,
3865 content: local_var_content,
3866 entity: local_var_entity,
3867 };
3868 Err(Error::ResponseError(local_var_error))
3869 }
3870}
3871
3872pub async fn withdraw_item(
3874 configuration: &configuration::Configuration,
3875 params: WithdrawItemParams,
3876) -> Result<models::BankItemTransactionResponseSchema, Error<WithdrawItemError>> {
3877 let local_var_configuration = configuration;
3878
3879 let name = params.name;
3881 let simple_item_schema = params.simple_item_schema;
3883
3884 let local_var_client = &local_var_configuration.client;
3885
3886 let local_var_uri_str = format!(
3887 "{}/my/{name}/action/bank/withdraw/item",
3888 local_var_configuration.base_path,
3889 name = crate::apis::urlencode(name)
3890 );
3891 let mut local_var_req_builder =
3892 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3893
3894 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3895 local_var_req_builder =
3896 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3897 }
3898 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3899 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3900 };
3901 local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
3902
3903 let local_var_req = local_var_req_builder.build()?;
3904 let local_var_resp = local_var_client.execute(local_var_req).await?;
3905
3906 let local_var_status = local_var_resp.status();
3907 let local_var_content = local_var_resp.text().await?;
3908
3909 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3910 serde_json::from_str(&local_var_content).map_err(Error::from)
3911 } else {
3912 let local_var_entity: Option<WithdrawItemError> =
3913 serde_json::from_str(&local_var_content).ok();
3914 let local_var_error = ResponseContent {
3915 status: local_var_status,
3916 content: local_var_content,
3917 entity: local_var_entity,
3918 };
3919 Err(Error::ResponseError(local_var_error))
3920 }
3921}