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 CompleteTaskParams {
81 pub name: String,
83}
84
85impl CompleteTaskParams {
86 pub fn new(name: String) -> Self {
87 Self { name }
88 }
89}
90
91#[derive(Clone, Debug)]
93pub struct CraftParams {
94 pub name: String,
96 pub crafting_schema: models::CraftingSchema,
97}
98
99impl CraftParams {
100 pub fn new(name: String, crafting_schema: models::CraftingSchema) -> Self {
101 Self {
102 name,
103 crafting_schema,
104 }
105 }
106}
107
108#[derive(Clone, Debug)]
110pub struct DeleteItemParams {
111 pub name: String,
113 pub simple_item_schema: models::SimpleItemSchema,
114}
115
116impl DeleteItemParams {
117 pub fn new(name: String, simple_item_schema: models::SimpleItemSchema) -> Self {
118 Self {
119 name,
120 simple_item_schema,
121 }
122 }
123}
124
125#[derive(Clone, Debug)]
127pub struct DepositGoldParams {
128 pub name: String,
130 pub deposit_withdraw_gold_schema: models::DepositWithdrawGoldSchema,
131}
132
133impl DepositGoldParams {
134 pub fn new(
135 name: String,
136 deposit_withdraw_gold_schema: models::DepositWithdrawGoldSchema,
137 ) -> Self {
138 Self {
139 name,
140 deposit_withdraw_gold_schema,
141 }
142 }
143}
144
145#[derive(Clone, Debug)]
147pub struct DepositItemParams {
148 pub name: String,
150 pub simple_item_schema: Vec<models::SimpleItemSchema>,
151}
152
153impl DepositItemParams {
154 pub fn new(name: String, simple_item_schema: Vec<models::SimpleItemSchema>) -> Self {
155 Self {
156 name,
157 simple_item_schema,
158 }
159 }
160}
161
162#[derive(Clone, Debug)]
164pub struct EquipItemParams {
165 pub name: String,
167 pub equip_schema: models::EquipSchema,
168}
169
170impl EquipItemParams {
171 pub fn new(name: String, equip_schema: models::EquipSchema) -> Self {
172 Self { name, equip_schema }
173 }
174}
175
176#[derive(Clone, Debug)]
178pub struct FightParams {
179 pub name: String,
181 pub fight_request_schema: Option<models::FightRequestSchema>,
182}
183
184impl FightParams {
185 pub fn new(name: String, fight_request_schema: Option<models::FightRequestSchema>) -> Self {
186 Self {
187 name,
188 fight_request_schema,
189 }
190 }
191}
192
193#[derive(Clone, Debug)]
195pub struct GatherParams {
196 pub name: String,
198}
199
200impl GatherParams {
201 pub fn new(name: String) -> Self {
202 Self { name }
203 }
204}
205
206#[derive(Clone, Debug)]
208pub struct GeBuyItemParams {
209 pub name: String,
211 pub ge_buy_order_schema: models::GeBuyOrderSchema,
212}
213
214impl GeBuyItemParams {
215 pub fn new(name: String, ge_buy_order_schema: models::GeBuyOrderSchema) -> Self {
216 Self {
217 name,
218 ge_buy_order_schema,
219 }
220 }
221}
222
223#[derive(Clone, Debug)]
225pub struct GeCancelSellOrderParams {
226 pub name: String,
228 pub ge_cancel_order_schema: models::GeCancelOrderSchema,
229}
230
231impl GeCancelSellOrderParams {
232 pub fn new(name: String, ge_cancel_order_schema: models::GeCancelOrderSchema) -> Self {
233 Self {
234 name,
235 ge_cancel_order_schema,
236 }
237 }
238}
239
240#[derive(Clone, Debug)]
242pub struct GeCreateSellOrderParams {
243 pub name: String,
245 pub ge_order_creationr_schema: models::GeOrderCreationrSchema,
246}
247
248impl GeCreateSellOrderParams {
249 pub fn new(name: String, ge_order_creationr_schema: models::GeOrderCreationrSchema) -> Self {
250 Self {
251 name,
252 ge_order_creationr_schema,
253 }
254 }
255}
256
257#[derive(Clone, Debug)]
259pub struct GetAllCharactersLogsParams {
260 pub page: Option<u32>,
262 pub size: Option<u32>,
264}
265
266impl GetAllCharactersLogsParams {
267 pub fn new(page: Option<u32>, size: Option<u32>) -> Self {
268 Self { page, size }
269 }
270}
271
272#[derive(Clone, Debug)]
274pub struct GetCharacterLogsParams {
275 pub name: String,
277 pub page: Option<u32>,
279 pub size: Option<u32>,
281}
282
283impl GetCharacterLogsParams {
284 pub fn new(name: String, page: Option<u32>, size: Option<u32>) -> Self {
285 Self { name, page, size }
286 }
287}
288
289#[derive(Clone, Debug)]
291pub struct GiveGoldParams {
292 pub name: String,
294 pub give_gold_schema: models::GiveGoldSchema,
295}
296
297impl GiveGoldParams {
298 pub fn new(name: String, give_gold_schema: models::GiveGoldSchema) -> Self {
299 Self {
300 name,
301 give_gold_schema,
302 }
303 }
304}
305
306#[derive(Clone, Debug)]
308pub struct GiveItemsParams {
309 pub name: String,
311 pub give_items_schema: models::GiveItemsSchema,
312}
313
314impl GiveItemsParams {
315 pub fn new(name: String, give_items_schema: models::GiveItemsSchema) -> Self {
316 Self {
317 name,
318 give_items_schema,
319 }
320 }
321}
322
323#[derive(Clone, Debug)]
325pub struct MoveCharacterParams {
326 pub name: String,
328 pub destination_schema: models::DestinationSchema,
329}
330
331impl MoveCharacterParams {
332 pub fn new(name: String, destination_schema: models::DestinationSchema) -> Self {
333 Self {
334 name,
335 destination_schema,
336 }
337 }
338}
339
340#[derive(Clone, Debug)]
342pub struct NpcBuyItemParams {
343 pub name: String,
345 pub npc_merchant_buy_schema: models::NpcMerchantBuySchema,
346}
347
348impl NpcBuyItemParams {
349 pub fn new(name: String, npc_merchant_buy_schema: models::NpcMerchantBuySchema) -> Self {
350 Self {
351 name,
352 npc_merchant_buy_schema,
353 }
354 }
355}
356
357#[derive(Clone, Debug)]
359pub struct NpcSellItemParams {
360 pub name: String,
362 pub npc_merchant_buy_schema: models::NpcMerchantBuySchema,
363}
364
365impl NpcSellItemParams {
366 pub fn new(name: String, npc_merchant_buy_schema: models::NpcMerchantBuySchema) -> Self {
367 Self {
368 name,
369 npc_merchant_buy_schema,
370 }
371 }
372}
373
374#[derive(Clone, Debug)]
376pub struct RecycleParams {
377 pub name: String,
379 pub recycling_schema: models::RecyclingSchema,
380}
381
382impl RecycleParams {
383 pub fn new(name: String, recycling_schema: models::RecyclingSchema) -> Self {
384 Self {
385 name,
386 recycling_schema,
387 }
388 }
389}
390
391#[derive(Clone, Debug)]
393pub struct RestCharacterParams {
394 pub name: String,
396}
397
398impl RestCharacterParams {
399 pub fn new(name: String) -> Self {
400 Self { name }
401 }
402}
403
404#[derive(Clone, Debug)]
406pub struct TaskExchangeParams {
407 pub name: String,
409}
410
411impl TaskExchangeParams {
412 pub fn new(name: String) -> Self {
413 Self { name }
414 }
415}
416
417#[derive(Clone, Debug)]
419pub struct TaskTradeParams {
420 pub name: String,
422 pub simple_item_schema: models::SimpleItemSchema,
423}
424
425impl TaskTradeParams {
426 pub fn new(name: String, simple_item_schema: models::SimpleItemSchema) -> Self {
427 Self {
428 name,
429 simple_item_schema,
430 }
431 }
432}
433
434#[derive(Clone, Debug)]
436pub struct UnequipItemParams {
437 pub name: String,
439 pub unequip_schema: models::UnequipSchema,
440}
441
442impl UnequipItemParams {
443 pub fn new(name: String, unequip_schema: models::UnequipSchema) -> Self {
444 Self {
445 name,
446 unequip_schema,
447 }
448 }
449}
450
451#[derive(Clone, Debug)]
453pub struct UseItemParams {
454 pub name: String,
456 pub simple_item_schema: models::SimpleItemSchema,
457}
458
459impl UseItemParams {
460 pub fn new(name: String, simple_item_schema: models::SimpleItemSchema) -> Self {
461 Self {
462 name,
463 simple_item_schema,
464 }
465 }
466}
467
468#[derive(Clone, Debug)]
470pub struct WithdrawGoldParams {
471 pub name: String,
473 pub deposit_withdraw_gold_schema: models::DepositWithdrawGoldSchema,
474}
475
476impl WithdrawGoldParams {
477 pub fn new(
478 name: String,
479 deposit_withdraw_gold_schema: models::DepositWithdrawGoldSchema,
480 ) -> Self {
481 Self {
482 name,
483 deposit_withdraw_gold_schema,
484 }
485 }
486}
487
488#[derive(Clone, Debug)]
490pub struct WithdrawItemParams {
491 pub name: String,
493 pub simple_item_schema: Vec<models::SimpleItemSchema>,
494}
495
496impl WithdrawItemParams {
497 pub fn new(name: String, simple_item_schema: Vec<models::SimpleItemSchema>) -> Self {
498 Self {
499 name,
500 simple_item_schema,
501 }
502 }
503}
504
505#[derive(Debug, Clone, Serialize)]
507#[serde(untagged)]
508pub enum AcceptNewTaskError {
509 Status498(models::ErrorResponseSchema),
511 Status499(models::ErrorResponseSchema),
513 Status486(models::ErrorResponseSchema),
515 Status598(models::ErrorResponseSchema),
517 Status489(models::ErrorResponseSchema),
519 Status422(models::ErrorResponseSchema),
521}
522
523impl<'de> Deserialize<'de> for AcceptNewTaskError {
524 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
525 where
526 D: Deserializer<'de>,
527 {
528 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
529 match raw.error.code {
530 498 => Ok(Self::Status498(raw)),
531 499 => Ok(Self::Status499(raw)),
532 486 => Ok(Self::Status486(raw)),
533 598 => Ok(Self::Status598(raw)),
534 489 => Ok(Self::Status489(raw)),
535 422 => Ok(Self::Status422(raw)),
536 _ => Err(de::Error::custom(format!(
537 "Unexpected error code: {}",
538 raw.error.code
539 ))),
540 }
541 }
542}
543
544#[derive(Debug, Clone, Serialize)]
546#[serde(untagged)]
547pub enum ActionTransitionError {
548 Status498(models::ErrorResponseSchema),
550 Status499(models::ErrorResponseSchema),
552 Status404(models::ErrorResponseSchema),
554 Status492(models::ErrorResponseSchema),
556 Status478(models::ErrorResponseSchema),
558 Status486(models::ErrorResponseSchema),
560 Status496(models::ErrorResponseSchema),
562 Status422(models::ErrorResponseSchema),
564}
565
566impl<'de> Deserialize<'de> for ActionTransitionError {
567 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
568 where
569 D: Deserializer<'de>,
570 {
571 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
572 match raw.error.code {
573 498 => Ok(Self::Status498(raw)),
574 499 => Ok(Self::Status499(raw)),
575 404 => Ok(Self::Status404(raw)),
576 492 => Ok(Self::Status492(raw)),
577 478 => Ok(Self::Status478(raw)),
578 486 => Ok(Self::Status486(raw)),
579 496 => Ok(Self::Status496(raw)),
580 422 => Ok(Self::Status422(raw)),
581 _ => Err(de::Error::custom(format!(
582 "Unexpected error code: {}",
583 raw.error.code
584 ))),
585 }
586 }
587}
588
589#[derive(Debug, Clone, Serialize)]
591#[serde(untagged)]
592pub enum BuyBankExpansionError {
593 Status598(models::ErrorResponseSchema),
595 Status498(models::ErrorResponseSchema),
597 Status499(models::ErrorResponseSchema),
599 Status486(models::ErrorResponseSchema),
601 Status492(models::ErrorResponseSchema),
603 Status422(models::ErrorResponseSchema),
605}
606
607impl<'de> Deserialize<'de> for BuyBankExpansionError {
608 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
609 where
610 D: Deserializer<'de>,
611 {
612 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
613 match raw.error.code {
614 598 => Ok(Self::Status598(raw)),
615 498 => Ok(Self::Status498(raw)),
616 499 => Ok(Self::Status499(raw)),
617 486 => Ok(Self::Status486(raw)),
618 492 => Ok(Self::Status492(raw)),
619 422 => Ok(Self::Status422(raw)),
620 _ => Err(de::Error::custom(format!(
621 "Unexpected error code: {}",
622 raw.error.code
623 ))),
624 }
625 }
626}
627
628#[derive(Debug, Clone, Serialize)]
630#[serde(untagged)]
631pub enum CancelTaskError {
632 Status498(models::ErrorResponseSchema),
634 Status499(models::ErrorResponseSchema),
636 Status486(models::ErrorResponseSchema),
638 Status598(models::ErrorResponseSchema),
640 Status478(models::ErrorResponseSchema),
642 Status422(models::ErrorResponseSchema),
644}
645
646impl<'de> Deserialize<'de> for CancelTaskError {
647 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
648 where
649 D: Deserializer<'de>,
650 {
651 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
652 match raw.error.code {
653 498 => Ok(Self::Status498(raw)),
654 499 => Ok(Self::Status499(raw)),
655 486 => Ok(Self::Status486(raw)),
656 598 => Ok(Self::Status598(raw)),
657 478 => Ok(Self::Status478(raw)),
658 422 => Ok(Self::Status422(raw)),
659 _ => Err(de::Error::custom(format!(
660 "Unexpected error code: {}",
661 raw.error.code
662 ))),
663 }
664 }
665}
666
667#[derive(Debug, Clone, Serialize)]
669#[serde(untagged)]
670pub enum ChangeSkinError {
671 Status499(models::ErrorResponseSchema),
673 Status486(models::ErrorResponseSchema),
675 Status550(models::ErrorResponseSchema),
677 Status422(models::ErrorResponseSchema),
679}
680
681impl<'de> Deserialize<'de> for ChangeSkinError {
682 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
683 where
684 D: Deserializer<'de>,
685 {
686 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
687 match raw.error.code {
688 499 => Ok(Self::Status499(raw)),
689 486 => Ok(Self::Status486(raw)),
690 550 => Ok(Self::Status550(raw)),
691 422 => Ok(Self::Status422(raw)),
692 _ => Err(de::Error::custom(format!(
693 "Unexpected error code: {}",
694 raw.error.code
695 ))),
696 }
697 }
698}
699
700#[derive(Debug, Clone, Serialize)]
702#[serde(untagged)]
703pub enum CompleteTaskError {
704 Status498(models::ErrorResponseSchema),
706 Status499(models::ErrorResponseSchema),
708 Status486(models::ErrorResponseSchema),
710 Status598(models::ErrorResponseSchema),
712 Status488(models::ErrorResponseSchema),
714 Status487(models::ErrorResponseSchema),
716 Status497(models::ErrorResponseSchema),
718 Status422(models::ErrorResponseSchema),
720}
721
722impl<'de> Deserialize<'de> for CompleteTaskError {
723 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
724 where
725 D: Deserializer<'de>,
726 {
727 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
728 match raw.error.code {
729 498 => Ok(Self::Status498(raw)),
730 499 => Ok(Self::Status499(raw)),
731 486 => Ok(Self::Status486(raw)),
732 598 => Ok(Self::Status598(raw)),
733 488 => Ok(Self::Status488(raw)),
734 487 => Ok(Self::Status487(raw)),
735 497 => Ok(Self::Status497(raw)),
736 422 => Ok(Self::Status422(raw)),
737 _ => Err(de::Error::custom(format!(
738 "Unexpected error code: {}",
739 raw.error.code
740 ))),
741 }
742 }
743}
744
745#[derive(Debug, Clone, Serialize)]
747#[serde(untagged)]
748pub enum CraftError {
749 Status404(models::ErrorResponseSchema),
751 Status598(models::ErrorResponseSchema),
753 Status498(models::ErrorResponseSchema),
755 Status497(models::ErrorResponseSchema),
757 Status499(models::ErrorResponseSchema),
759 Status486(models::ErrorResponseSchema),
761 Status493(models::ErrorResponseSchema),
763 Status478(models::ErrorResponseSchema),
765 Status422(models::ErrorResponseSchema),
767}
768
769impl<'de> Deserialize<'de> for CraftError {
770 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
771 where
772 D: Deserializer<'de>,
773 {
774 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
775 match raw.error.code {
776 404 => Ok(Self::Status404(raw)),
777 598 => Ok(Self::Status598(raw)),
778 498 => Ok(Self::Status498(raw)),
779 497 => Ok(Self::Status497(raw)),
780 499 => Ok(Self::Status499(raw)),
781 486 => Ok(Self::Status486(raw)),
782 493 => Ok(Self::Status493(raw)),
783 478 => Ok(Self::Status478(raw)),
784 422 => Ok(Self::Status422(raw)),
785 _ => Err(de::Error::custom(format!(
786 "Unexpected error code: {}",
787 raw.error.code
788 ))),
789 }
790 }
791}
792
793#[derive(Debug, Clone, Serialize)]
795#[serde(untagged)]
796pub enum DeleteItemError {
797 Status498(models::ErrorResponseSchema),
799 Status499(models::ErrorResponseSchema),
801 Status486(models::ErrorResponseSchema),
803 Status478(models::ErrorResponseSchema),
805 Status422(models::ErrorResponseSchema),
807}
808
809impl<'de> Deserialize<'de> for DeleteItemError {
810 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
811 where
812 D: Deserializer<'de>,
813 {
814 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
815 match raw.error.code {
816 498 => Ok(Self::Status498(raw)),
817 499 => Ok(Self::Status499(raw)),
818 486 => Ok(Self::Status486(raw)),
819 478 => Ok(Self::Status478(raw)),
820 422 => Ok(Self::Status422(raw)),
821 _ => Err(de::Error::custom(format!(
822 "Unexpected error code: {}",
823 raw.error.code
824 ))),
825 }
826 }
827}
828
829#[derive(Debug, Clone, Serialize)]
831#[serde(untagged)]
832pub enum DepositGoldError {
833 Status598(models::ErrorResponseSchema),
835 Status492(models::ErrorResponseSchema),
837 Status498(models::ErrorResponseSchema),
839 Status499(models::ErrorResponseSchema),
841 Status461(models::ErrorResponseSchema),
843 Status486(models::ErrorResponseSchema),
845 Status422(models::ErrorResponseSchema),
847}
848
849impl<'de> Deserialize<'de> for DepositGoldError {
850 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
851 where
852 D: Deserializer<'de>,
853 {
854 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
855 match raw.error.code {
856 598 => Ok(Self::Status598(raw)),
857 492 => Ok(Self::Status492(raw)),
858 498 => Ok(Self::Status498(raw)),
859 499 => Ok(Self::Status499(raw)),
860 461 => Ok(Self::Status461(raw)),
861 486 => Ok(Self::Status486(raw)),
862 422 => Ok(Self::Status422(raw)),
863 _ => Err(de::Error::custom(format!(
864 "Unexpected error code: {}",
865 raw.error.code
866 ))),
867 }
868 }
869}
870
871#[derive(Debug, Clone, Serialize)]
873#[serde(untagged)]
874pub enum DepositItemError {
875 Status598(models::ErrorResponseSchema),
877 Status404(models::ErrorResponseSchema),
879 Status461(models::ErrorResponseSchema),
881 Status498(models::ErrorResponseSchema),
883 Status499(models::ErrorResponseSchema),
885 Status486(models::ErrorResponseSchema),
887 Status478(models::ErrorResponseSchema),
889 Status462(models::ErrorResponseSchema),
891 Status422(models::ErrorResponseSchema),
893}
894
895impl<'de> Deserialize<'de> for DepositItemError {
896 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
897 where
898 D: Deserializer<'de>,
899 {
900 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
901 match raw.error.code {
902 598 => Ok(Self::Status598(raw)),
903 404 => Ok(Self::Status404(raw)),
904 461 => Ok(Self::Status461(raw)),
905 498 => Ok(Self::Status498(raw)),
906 499 => Ok(Self::Status499(raw)),
907 486 => Ok(Self::Status486(raw)),
908 478 => Ok(Self::Status478(raw)),
909 462 => Ok(Self::Status462(raw)),
910 422 => Ok(Self::Status422(raw)),
911 _ => Err(de::Error::custom(format!(
912 "Unexpected error code: {}",
913 raw.error.code
914 ))),
915 }
916 }
917}
918
919#[derive(Debug, Clone, Serialize)]
921#[serde(untagged)]
922pub enum EquipItemError {
923 Status404(models::ErrorResponseSchema),
925 Status498(models::ErrorResponseSchema),
927 Status483(models::ErrorResponseSchema),
929 Status499(models::ErrorResponseSchema),
931 Status486(models::ErrorResponseSchema),
933 Status478(models::ErrorResponseSchema),
935 Status496(models::ErrorResponseSchema),
937 Status491(models::ErrorResponseSchema),
939 Status485(models::ErrorResponseSchema),
941 Status484(models::ErrorResponseSchema),
943 Status497(models::ErrorResponseSchema),
945 Status422(models::ErrorResponseSchema),
947}
948
949impl<'de> Deserialize<'de> for EquipItemError {
950 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
951 where
952 D: Deserializer<'de>,
953 {
954 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
955 match raw.error.code {
956 404 => Ok(Self::Status404(raw)),
957 498 => Ok(Self::Status498(raw)),
958 483 => Ok(Self::Status483(raw)),
959 499 => Ok(Self::Status499(raw)),
960 486 => Ok(Self::Status486(raw)),
961 478 => Ok(Self::Status478(raw)),
962 496 => Ok(Self::Status496(raw)),
963 491 => Ok(Self::Status491(raw)),
964 485 => Ok(Self::Status485(raw)),
965 484 => Ok(Self::Status484(raw)),
966 497 => Ok(Self::Status497(raw)),
967 422 => Ok(Self::Status422(raw)),
968 _ => Err(de::Error::custom(format!(
969 "Unexpected error code: {}",
970 raw.error.code
971 ))),
972 }
973 }
974}
975
976#[derive(Debug, Clone, Serialize)]
978#[serde(untagged)]
979pub enum FightError {
980 Status498(models::ErrorResponseSchema),
982 Status499(models::ErrorResponseSchema),
984 Status598(models::ErrorResponseSchema),
986 Status486(models::ErrorResponseSchema),
988 Status497(models::ErrorResponseSchema),
990 Status422(models::ErrorResponseSchema),
992}
993
994impl<'de> Deserialize<'de> for FightError {
995 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
996 where
997 D: Deserializer<'de>,
998 {
999 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1000 match raw.error.code {
1001 498 => Ok(Self::Status498(raw)),
1002 499 => Ok(Self::Status499(raw)),
1003 598 => Ok(Self::Status598(raw)),
1004 486 => Ok(Self::Status486(raw)),
1005 497 => Ok(Self::Status497(raw)),
1006 422 => Ok(Self::Status422(raw)),
1007 _ => Err(de::Error::custom(format!(
1008 "Unexpected error code: {}",
1009 raw.error.code
1010 ))),
1011 }
1012 }
1013}
1014
1015#[derive(Debug, Clone, Serialize)]
1017#[serde(untagged)]
1018pub enum GatherError {
1019 Status498(models::ErrorResponseSchema),
1021 Status499(models::ErrorResponseSchema),
1023 Status598(models::ErrorResponseSchema),
1025 Status486(models::ErrorResponseSchema),
1027 Status493(models::ErrorResponseSchema),
1029 Status497(models::ErrorResponseSchema),
1031 Status422(models::ErrorResponseSchema),
1033}
1034
1035impl<'de> Deserialize<'de> for GatherError {
1036 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1037 where
1038 D: Deserializer<'de>,
1039 {
1040 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1041 match raw.error.code {
1042 498 => Ok(Self::Status498(raw)),
1043 499 => Ok(Self::Status499(raw)),
1044 598 => Ok(Self::Status598(raw)),
1045 486 => Ok(Self::Status486(raw)),
1046 493 => Ok(Self::Status493(raw)),
1047 497 => Ok(Self::Status497(raw)),
1048 422 => Ok(Self::Status422(raw)),
1049 _ => Err(de::Error::custom(format!(
1050 "Unexpected error code: {}",
1051 raw.error.code
1052 ))),
1053 }
1054 }
1055}
1056
1057#[derive(Debug, Clone, Serialize)]
1059#[serde(untagged)]
1060pub enum GeBuyItemError {
1061 Status598(models::ErrorResponseSchema),
1063 Status498(models::ErrorResponseSchema),
1065 Status497(models::ErrorResponseSchema),
1067 Status499(models::ErrorResponseSchema),
1069 Status436(models::ErrorResponseSchema),
1071 Status486(models::ErrorResponseSchema),
1073 Status492(models::ErrorResponseSchema),
1075 Status434(models::ErrorResponseSchema),
1077 Status435(models::ErrorResponseSchema),
1079 Status404(models::ErrorResponseSchema),
1081 Status422(models::ErrorResponseSchema),
1083}
1084
1085impl<'de> Deserialize<'de> for GeBuyItemError {
1086 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1087 where
1088 D: Deserializer<'de>,
1089 {
1090 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1091 match raw.error.code {
1092 598 => Ok(Self::Status598(raw)),
1093 498 => Ok(Self::Status498(raw)),
1094 497 => Ok(Self::Status497(raw)),
1095 499 => Ok(Self::Status499(raw)),
1096 436 => Ok(Self::Status436(raw)),
1097 486 => Ok(Self::Status486(raw)),
1098 492 => Ok(Self::Status492(raw)),
1099 434 => Ok(Self::Status434(raw)),
1100 435 => Ok(Self::Status435(raw)),
1101 404 => Ok(Self::Status404(raw)),
1102 422 => Ok(Self::Status422(raw)),
1103 _ => Err(de::Error::custom(format!(
1104 "Unexpected error code: {}",
1105 raw.error.code
1106 ))),
1107 }
1108 }
1109}
1110
1111#[derive(Debug, Clone, Serialize)]
1113#[serde(untagged)]
1114pub enum GeCancelSellOrderError {
1115 Status598(models::ErrorResponseSchema),
1117 Status498(models::ErrorResponseSchema),
1119 Status497(models::ErrorResponseSchema),
1121 Status499(models::ErrorResponseSchema),
1123 Status436(models::ErrorResponseSchema),
1125 Status486(models::ErrorResponseSchema),
1127 Status438(models::ErrorResponseSchema),
1129 Status404(models::ErrorResponseSchema),
1131 Status422(models::ErrorResponseSchema),
1133}
1134
1135impl<'de> Deserialize<'de> for GeCancelSellOrderError {
1136 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1137 where
1138 D: Deserializer<'de>,
1139 {
1140 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1141 match raw.error.code {
1142 598 => Ok(Self::Status598(raw)),
1143 498 => Ok(Self::Status498(raw)),
1144 497 => Ok(Self::Status497(raw)),
1145 499 => Ok(Self::Status499(raw)),
1146 436 => Ok(Self::Status436(raw)),
1147 486 => Ok(Self::Status486(raw)),
1148 438 => Ok(Self::Status438(raw)),
1149 404 => Ok(Self::Status404(raw)),
1150 422 => Ok(Self::Status422(raw)),
1151 _ => Err(de::Error::custom(format!(
1152 "Unexpected error code: {}",
1153 raw.error.code
1154 ))),
1155 }
1156 }
1157}
1158
1159#[derive(Debug, Clone, Serialize)]
1161#[serde(untagged)]
1162pub enum GeCreateSellOrderError {
1163 Status498(models::ErrorResponseSchema),
1165 Status499(models::ErrorResponseSchema),
1167 Status486(models::ErrorResponseSchema),
1169 Status404(models::ErrorResponseSchema),
1171 Status478(models::ErrorResponseSchema),
1173 Status492(models::ErrorResponseSchema),
1175 Status433(models::ErrorResponseSchema),
1177 Status437(models::ErrorResponseSchema),
1179 Status598(models::ErrorResponseSchema),
1181 Status422(models::ErrorResponseSchema),
1183}
1184
1185impl<'de> Deserialize<'de> for GeCreateSellOrderError {
1186 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1187 where
1188 D: Deserializer<'de>,
1189 {
1190 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1191 match raw.error.code {
1192 498 => Ok(Self::Status498(raw)),
1193 499 => Ok(Self::Status499(raw)),
1194 486 => Ok(Self::Status486(raw)),
1195 404 => Ok(Self::Status404(raw)),
1196 478 => Ok(Self::Status478(raw)),
1197 492 => Ok(Self::Status492(raw)),
1198 433 => Ok(Self::Status433(raw)),
1199 437 => Ok(Self::Status437(raw)),
1200 598 => Ok(Self::Status598(raw)),
1201 422 => Ok(Self::Status422(raw)),
1202 _ => Err(de::Error::custom(format!(
1203 "Unexpected error code: {}",
1204 raw.error.code
1205 ))),
1206 }
1207 }
1208}
1209
1210#[derive(Debug, Clone, Serialize)]
1212#[serde(untagged)]
1213pub enum GetAllCharactersLogsError {
1214 Status404(models::ErrorResponseSchema),
1216 Status498(models::ErrorResponseSchema),
1218}
1219
1220impl<'de> Deserialize<'de> for GetAllCharactersLogsError {
1221 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1222 where
1223 D: Deserializer<'de>,
1224 {
1225 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1226 match raw.error.code {
1227 404 => Ok(Self::Status404(raw)),
1228 498 => Ok(Self::Status498(raw)),
1229 _ => Err(de::Error::custom(format!(
1230 "Unexpected error code: {}",
1231 raw.error.code
1232 ))),
1233 }
1234 }
1235}
1236
1237#[derive(Debug, Clone, Serialize)]
1239#[serde(untagged)]
1240pub enum GetCharacterLogsError {
1241 Status404(models::ErrorResponseSchema),
1243 Status498(models::ErrorResponseSchema),
1245}
1246
1247impl<'de> Deserialize<'de> for GetCharacterLogsError {
1248 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1249 where
1250 D: Deserializer<'de>,
1251 {
1252 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1253 match raw.error.code {
1254 404 => Ok(Self::Status404(raw)),
1255 498 => Ok(Self::Status498(raw)),
1256 _ => Err(de::Error::custom(format!(
1257 "Unexpected error code: {}",
1258 raw.error.code
1259 ))),
1260 }
1261 }
1262}
1263
1264#[derive(Debug, Clone, Serialize)]
1266#[serde(untagged)]
1267pub enum GetMyCharactersError {}
1268
1269impl<'de> Deserialize<'de> for GetMyCharactersError {
1270 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1271 where
1272 D: Deserializer<'de>,
1273 {
1274 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1275 Err(de::Error::custom(format!(
1276 "Unexpected error code: {}",
1277 raw.error.code
1278 )))
1279 }
1280}
1281
1282#[derive(Debug, Clone, Serialize)]
1284#[serde(untagged)]
1285pub enum GiveGoldError {
1286 Status498(models::ErrorResponseSchema),
1288 Status499(models::ErrorResponseSchema),
1290 Status492(models::ErrorResponseSchema),
1292 Status486(models::ErrorResponseSchema),
1294 Status422(models::ErrorResponseSchema),
1296}
1297
1298impl<'de> Deserialize<'de> for GiveGoldError {
1299 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1300 where
1301 D: Deserializer<'de>,
1302 {
1303 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1304 match raw.error.code {
1305 498 => Ok(Self::Status498(raw)),
1306 499 => Ok(Self::Status499(raw)),
1307 492 => Ok(Self::Status492(raw)),
1308 486 => Ok(Self::Status486(raw)),
1309 422 => Ok(Self::Status422(raw)),
1310 _ => Err(de::Error::custom(format!(
1311 "Unexpected error code: {}",
1312 raw.error.code
1313 ))),
1314 }
1315 }
1316}
1317
1318#[derive(Debug, Clone, Serialize)]
1320#[serde(untagged)]
1321pub enum GiveItemsError {
1322 Status404(models::ErrorResponseSchema),
1324 Status498(models::ErrorResponseSchema),
1326 Status499(models::ErrorResponseSchema),
1328 Status497(models::ErrorResponseSchema),
1330 Status486(models::ErrorResponseSchema),
1332 Status478(models::ErrorResponseSchema),
1334 Status422(models::ErrorResponseSchema),
1336}
1337
1338impl<'de> Deserialize<'de> for GiveItemsError {
1339 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1340 where
1341 D: Deserializer<'de>,
1342 {
1343 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1344 match raw.error.code {
1345 404 => Ok(Self::Status404(raw)),
1346 498 => Ok(Self::Status498(raw)),
1347 499 => Ok(Self::Status499(raw)),
1348 497 => Ok(Self::Status497(raw)),
1349 486 => Ok(Self::Status486(raw)),
1350 478 => Ok(Self::Status478(raw)),
1351 422 => Ok(Self::Status422(raw)),
1352 _ => Err(de::Error::custom(format!(
1353 "Unexpected error code: {}",
1354 raw.error.code
1355 ))),
1356 }
1357 }
1358}
1359
1360#[derive(Debug, Clone, Serialize)]
1362#[serde(untagged)]
1363pub enum MoveCharacterError {
1364 Status498(models::ErrorResponseSchema),
1366 Status499(models::ErrorResponseSchema),
1368 Status490(models::ErrorResponseSchema),
1370 Status404(models::ErrorResponseSchema),
1372 Status486(models::ErrorResponseSchema),
1374 Status595(models::ErrorResponseSchema),
1376 Status596(models::ErrorResponseSchema),
1378 Status496(models::ErrorResponseSchema),
1380 Status422(models::ErrorResponseSchema),
1382}
1383
1384impl<'de> Deserialize<'de> for MoveCharacterError {
1385 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1386 where
1387 D: Deserializer<'de>,
1388 {
1389 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1390 match raw.error.code {
1391 498 => Ok(Self::Status498(raw)),
1392 499 => Ok(Self::Status499(raw)),
1393 490 => Ok(Self::Status490(raw)),
1394 404 => Ok(Self::Status404(raw)),
1395 486 => Ok(Self::Status486(raw)),
1396 595 => Ok(Self::Status595(raw)),
1397 596 => Ok(Self::Status596(raw)),
1398 496 => Ok(Self::Status496(raw)),
1399 422 => Ok(Self::Status422(raw)),
1400 _ => Err(de::Error::custom(format!(
1401 "Unexpected error code: {}",
1402 raw.error.code
1403 ))),
1404 }
1405 }
1406}
1407
1408#[derive(Debug, Clone, Serialize)]
1410#[serde(untagged)]
1411pub enum NpcBuyItemError {
1412 Status598(models::ErrorResponseSchema),
1414 Status498(models::ErrorResponseSchema),
1416 Status497(models::ErrorResponseSchema),
1418 Status499(models::ErrorResponseSchema),
1420 Status486(models::ErrorResponseSchema),
1422 Status492(models::ErrorResponseSchema),
1424 Status441(models::ErrorResponseSchema),
1426 Status478(models::ErrorResponseSchema),
1428 Status404(models::ErrorResponseSchema),
1430 Status422(models::ErrorResponseSchema),
1432}
1433
1434impl<'de> Deserialize<'de> for NpcBuyItemError {
1435 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1436 where
1437 D: Deserializer<'de>,
1438 {
1439 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1440 match raw.error.code {
1441 598 => Ok(Self::Status598(raw)),
1442 498 => Ok(Self::Status498(raw)),
1443 497 => Ok(Self::Status497(raw)),
1444 499 => Ok(Self::Status499(raw)),
1445 486 => Ok(Self::Status486(raw)),
1446 492 => Ok(Self::Status492(raw)),
1447 441 => Ok(Self::Status441(raw)),
1448 478 => Ok(Self::Status478(raw)),
1449 404 => Ok(Self::Status404(raw)),
1450 422 => Ok(Self::Status422(raw)),
1451 _ => Err(de::Error::custom(format!(
1452 "Unexpected error code: {}",
1453 raw.error.code
1454 ))),
1455 }
1456 }
1457}
1458
1459#[derive(Debug, Clone, Serialize)]
1461#[serde(untagged)]
1462pub enum NpcSellItemError {
1463 Status598(models::ErrorResponseSchema),
1465 Status498(models::ErrorResponseSchema),
1467 Status497(models::ErrorResponseSchema),
1469 Status499(models::ErrorResponseSchema),
1471 Status486(models::ErrorResponseSchema),
1473 Status478(models::ErrorResponseSchema),
1475 Status442(models::ErrorResponseSchema),
1477 Status404(models::ErrorResponseSchema),
1479 Status422(models::ErrorResponseSchema),
1481}
1482
1483impl<'de> Deserialize<'de> for NpcSellItemError {
1484 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1485 where
1486 D: Deserializer<'de>,
1487 {
1488 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1489 match raw.error.code {
1490 598 => Ok(Self::Status598(raw)),
1491 498 => Ok(Self::Status498(raw)),
1492 497 => Ok(Self::Status497(raw)),
1493 499 => Ok(Self::Status499(raw)),
1494 486 => Ok(Self::Status486(raw)),
1495 478 => Ok(Self::Status478(raw)),
1496 442 => Ok(Self::Status442(raw)),
1497 404 => Ok(Self::Status404(raw)),
1498 422 => Ok(Self::Status422(raw)),
1499 _ => Err(de::Error::custom(format!(
1500 "Unexpected error code: {}",
1501 raw.error.code
1502 ))),
1503 }
1504 }
1505}
1506
1507#[derive(Debug, Clone, Serialize)]
1509#[serde(untagged)]
1510pub enum RecycleError {
1511 Status404(models::ErrorResponseSchema),
1513 Status598(models::ErrorResponseSchema),
1515 Status498(models::ErrorResponseSchema),
1517 Status497(models::ErrorResponseSchema),
1519 Status499(models::ErrorResponseSchema),
1521 Status486(models::ErrorResponseSchema),
1523 Status493(models::ErrorResponseSchema),
1525 Status478(models::ErrorResponseSchema),
1527 Status473(models::ErrorResponseSchema),
1529 Status422(models::ErrorResponseSchema),
1531}
1532
1533impl<'de> Deserialize<'de> for RecycleError {
1534 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1535 where
1536 D: Deserializer<'de>,
1537 {
1538 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1539 match raw.error.code {
1540 404 => Ok(Self::Status404(raw)),
1541 598 => Ok(Self::Status598(raw)),
1542 498 => Ok(Self::Status498(raw)),
1543 497 => Ok(Self::Status497(raw)),
1544 499 => Ok(Self::Status499(raw)),
1545 486 => Ok(Self::Status486(raw)),
1546 493 => Ok(Self::Status493(raw)),
1547 478 => Ok(Self::Status478(raw)),
1548 473 => Ok(Self::Status473(raw)),
1549 422 => Ok(Self::Status422(raw)),
1550 _ => Err(de::Error::custom(format!(
1551 "Unexpected error code: {}",
1552 raw.error.code
1553 ))),
1554 }
1555 }
1556}
1557
1558#[derive(Debug, Clone, Serialize)]
1560#[serde(untagged)]
1561pub enum RestCharacterError {
1562 Status498(models::ErrorResponseSchema),
1564 Status499(models::ErrorResponseSchema),
1566 Status486(models::ErrorResponseSchema),
1568 Status422(models::ErrorResponseSchema),
1570}
1571
1572impl<'de> Deserialize<'de> for RestCharacterError {
1573 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1574 where
1575 D: Deserializer<'de>,
1576 {
1577 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1578 match raw.error.code {
1579 498 => Ok(Self::Status498(raw)),
1580 499 => Ok(Self::Status499(raw)),
1581 486 => Ok(Self::Status486(raw)),
1582 422 => Ok(Self::Status422(raw)),
1583 _ => Err(de::Error::custom(format!(
1584 "Unexpected error code: {}",
1585 raw.error.code
1586 ))),
1587 }
1588 }
1589}
1590
1591#[derive(Debug, Clone, Serialize)]
1593#[serde(untagged)]
1594pub enum TaskExchangeError {
1595 Status498(models::ErrorResponseSchema),
1597 Status499(models::ErrorResponseSchema),
1599 Status486(models::ErrorResponseSchema),
1601 Status598(models::ErrorResponseSchema),
1603 Status478(models::ErrorResponseSchema),
1605 Status497(models::ErrorResponseSchema),
1607 Status422(models::ErrorResponseSchema),
1609}
1610
1611impl<'de> Deserialize<'de> for TaskExchangeError {
1612 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1613 where
1614 D: Deserializer<'de>,
1615 {
1616 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1617 match raw.error.code {
1618 498 => Ok(Self::Status498(raw)),
1619 499 => Ok(Self::Status499(raw)),
1620 486 => Ok(Self::Status486(raw)),
1621 598 => Ok(Self::Status598(raw)),
1622 478 => Ok(Self::Status478(raw)),
1623 497 => Ok(Self::Status497(raw)),
1624 422 => Ok(Self::Status422(raw)),
1625 _ => Err(de::Error::custom(format!(
1626 "Unexpected error code: {}",
1627 raw.error.code
1628 ))),
1629 }
1630 }
1631}
1632
1633#[derive(Debug, Clone, Serialize)]
1635#[serde(untagged)]
1636pub enum TaskTradeError {
1637 Status498(models::ErrorResponseSchema),
1639 Status499(models::ErrorResponseSchema),
1641 Status486(models::ErrorResponseSchema),
1643 Status598(models::ErrorResponseSchema),
1645 Status475(models::ErrorResponseSchema),
1647 Status474(models::ErrorResponseSchema),
1649 Status478(models::ErrorResponseSchema),
1651 Status422(models::ErrorResponseSchema),
1653}
1654
1655impl<'de> Deserialize<'de> for TaskTradeError {
1656 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1657 where
1658 D: Deserializer<'de>,
1659 {
1660 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1661 match raw.error.code {
1662 498 => Ok(Self::Status498(raw)),
1663 499 => Ok(Self::Status499(raw)),
1664 486 => Ok(Self::Status486(raw)),
1665 598 => Ok(Self::Status598(raw)),
1666 475 => Ok(Self::Status475(raw)),
1667 474 => Ok(Self::Status474(raw)),
1668 478 => Ok(Self::Status478(raw)),
1669 422 => Ok(Self::Status422(raw)),
1670 _ => Err(de::Error::custom(format!(
1671 "Unexpected error code: {}",
1672 raw.error.code
1673 ))),
1674 }
1675 }
1676}
1677
1678#[derive(Debug, Clone, Serialize)]
1680#[serde(untagged)]
1681pub enum UnequipItemError {
1682 Status404(models::ErrorResponseSchema),
1684 Status498(models::ErrorResponseSchema),
1686 Status486(models::ErrorResponseSchema),
1688 Status491(models::ErrorResponseSchema),
1690 Status497(models::ErrorResponseSchema),
1692 Status478(models::ErrorResponseSchema),
1694 Status483(models::ErrorResponseSchema),
1696 Status499(models::ErrorResponseSchema),
1698 Status422(models::ErrorResponseSchema),
1700}
1701
1702impl<'de> Deserialize<'de> for UnequipItemError {
1703 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1704 where
1705 D: Deserializer<'de>,
1706 {
1707 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1708 match raw.error.code {
1709 404 => Ok(Self::Status404(raw)),
1710 498 => Ok(Self::Status498(raw)),
1711 486 => Ok(Self::Status486(raw)),
1712 491 => Ok(Self::Status491(raw)),
1713 497 => Ok(Self::Status497(raw)),
1714 478 => Ok(Self::Status478(raw)),
1715 483 => Ok(Self::Status483(raw)),
1716 499 => Ok(Self::Status499(raw)),
1717 422 => Ok(Self::Status422(raw)),
1718 _ => Err(de::Error::custom(format!(
1719 "Unexpected error code: {}",
1720 raw.error.code
1721 ))),
1722 }
1723 }
1724}
1725
1726#[derive(Debug, Clone, Serialize)]
1728#[serde(untagged)]
1729pub enum UseItemError {
1730 Status404(models::ErrorResponseSchema),
1732 Status498(models::ErrorResponseSchema),
1734 Status499(models::ErrorResponseSchema),
1736 Status486(models::ErrorResponseSchema),
1738 Status476(models::ErrorResponseSchema),
1740 Status478(models::ErrorResponseSchema),
1742 Status496(models::ErrorResponseSchema),
1744 Status422(models::ErrorResponseSchema),
1746}
1747
1748impl<'de> Deserialize<'de> for UseItemError {
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 498 => Ok(Self::Status498(raw)),
1757 499 => Ok(Self::Status499(raw)),
1758 486 => Ok(Self::Status486(raw)),
1759 476 => Ok(Self::Status476(raw)),
1760 478 => Ok(Self::Status478(raw)),
1761 496 => Ok(Self::Status496(raw)),
1762 422 => Ok(Self::Status422(raw)),
1763 _ => Err(de::Error::custom(format!(
1764 "Unexpected error code: {}",
1765 raw.error.code
1766 ))),
1767 }
1768 }
1769}
1770
1771#[derive(Debug, Clone, Serialize)]
1773#[serde(untagged)]
1774pub enum WithdrawGoldError {
1775 Status498(models::ErrorResponseSchema),
1777 Status499(models::ErrorResponseSchema),
1779 Status461(models::ErrorResponseSchema),
1781 Status486(models::ErrorResponseSchema),
1783 Status598(models::ErrorResponseSchema),
1785 Status460(models::ErrorResponseSchema),
1787 Status422(models::ErrorResponseSchema),
1789}
1790
1791impl<'de> Deserialize<'de> for WithdrawGoldError {
1792 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1793 where
1794 D: Deserializer<'de>,
1795 {
1796 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1797 match raw.error.code {
1798 498 => Ok(Self::Status498(raw)),
1799 499 => Ok(Self::Status499(raw)),
1800 461 => Ok(Self::Status461(raw)),
1801 486 => Ok(Self::Status486(raw)),
1802 598 => Ok(Self::Status598(raw)),
1803 460 => Ok(Self::Status460(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 WithdrawItemError {
1817 Status404(models::ErrorResponseSchema),
1819 Status498(models::ErrorResponseSchema),
1821 Status499(models::ErrorResponseSchema),
1823 Status461(models::ErrorResponseSchema),
1825 Status486(models::ErrorResponseSchema),
1827 Status497(models::ErrorResponseSchema),
1829 Status598(models::ErrorResponseSchema),
1831 Status478(models::ErrorResponseSchema),
1833 Status422(models::ErrorResponseSchema),
1835}
1836
1837impl<'de> Deserialize<'de> for WithdrawItemError {
1838 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1839 where
1840 D: Deserializer<'de>,
1841 {
1842 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1843 match raw.error.code {
1844 404 => Ok(Self::Status404(raw)),
1845 498 => Ok(Self::Status498(raw)),
1846 499 => Ok(Self::Status499(raw)),
1847 461 => Ok(Self::Status461(raw)),
1848 486 => Ok(Self::Status486(raw)),
1849 497 => Ok(Self::Status497(raw)),
1850 598 => Ok(Self::Status598(raw)),
1851 478 => Ok(Self::Status478(raw)),
1852 422 => Ok(Self::Status422(raw)),
1853 _ => Err(de::Error::custom(format!(
1854 "Unexpected error code: {}",
1855 raw.error.code
1856 ))),
1857 }
1858 }
1859}
1860
1861pub async fn accept_new_task(
1863 configuration: &configuration::Configuration,
1864 params: AcceptNewTaskParams,
1865) -> Result<models::TaskResponseSchema, Error<AcceptNewTaskError>> {
1866 let local_var_configuration = configuration;
1867
1868 let name = params.name;
1870
1871 let local_var_client = &local_var_configuration.client;
1872
1873 let local_var_uri_str = format!(
1874 "{}/my/{name}/action/task/new",
1875 local_var_configuration.base_path,
1876 name = crate::apis::urlencode(name)
1877 );
1878 let mut local_var_req_builder =
1879 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1880
1881 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1882 local_var_req_builder =
1883 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1884 }
1885 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1886 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1887 };
1888
1889 let local_var_req = local_var_req_builder.build()?;
1890 let local_var_resp = local_var_client.execute(local_var_req).await?;
1891
1892 let local_var_status = local_var_resp.status();
1893 let local_var_content = local_var_resp.text().await?;
1894
1895 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1896 serde_json::from_str(&local_var_content).map_err(Error::from)
1897 } else {
1898 let local_var_entity: Option<AcceptNewTaskError> =
1899 serde_json::from_str(&local_var_content).ok();
1900 let local_var_error = ResponseContent {
1901 status: local_var_status,
1902 content: local_var_content,
1903 entity: local_var_entity,
1904 };
1905 Err(Error::ResponseError(local_var_error))
1906 }
1907}
1908
1909pub async fn action_transition(
1911 configuration: &configuration::Configuration,
1912 params: ActionTransitionParams,
1913) -> Result<models::CharacterTransitionResponseSchema, Error<ActionTransitionError>> {
1914 let local_var_configuration = configuration;
1915
1916 let name = params.name;
1918
1919 let local_var_client = &local_var_configuration.client;
1920
1921 let local_var_uri_str = format!(
1922 "{}/my/{name}/action/transition",
1923 local_var_configuration.base_path,
1924 name = crate::apis::urlencode(name)
1925 );
1926 let mut local_var_req_builder =
1927 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1928
1929 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1930 local_var_req_builder =
1931 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1932 }
1933 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1934 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1935 };
1936
1937 let local_var_req = local_var_req_builder.build()?;
1938 let local_var_resp = local_var_client.execute(local_var_req).await?;
1939
1940 let local_var_status = local_var_resp.status();
1941 let local_var_content = local_var_resp.text().await?;
1942
1943 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1944 serde_json::from_str(&local_var_content).map_err(Error::from)
1945 } else {
1946 let local_var_entity: Option<ActionTransitionError> =
1947 serde_json::from_str(&local_var_content).ok();
1948 let local_var_error = ResponseContent {
1949 status: local_var_status,
1950 content: local_var_content,
1951 entity: local_var_entity,
1952 };
1953 Err(Error::ResponseError(local_var_error))
1954 }
1955}
1956
1957pub async fn buy_bank_expansion(
1959 configuration: &configuration::Configuration,
1960 params: BuyBankExpansionParams,
1961) -> Result<models::BankExtensionTransactionResponseSchema, Error<BuyBankExpansionError>> {
1962 let local_var_configuration = configuration;
1963
1964 let name = params.name;
1966
1967 let local_var_client = &local_var_configuration.client;
1968
1969 let local_var_uri_str = format!(
1970 "{}/my/{name}/action/bank/buy_expansion",
1971 local_var_configuration.base_path,
1972 name = crate::apis::urlencode(name)
1973 );
1974 let mut local_var_req_builder =
1975 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1976
1977 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1978 local_var_req_builder =
1979 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1980 }
1981 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1982 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1983 };
1984
1985 let local_var_req = local_var_req_builder.build()?;
1986 let local_var_resp = local_var_client.execute(local_var_req).await?;
1987
1988 let local_var_status = local_var_resp.status();
1989 let local_var_content = local_var_resp.text().await?;
1990
1991 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1992 serde_json::from_str(&local_var_content).map_err(Error::from)
1993 } else {
1994 let local_var_entity: Option<BuyBankExpansionError> =
1995 serde_json::from_str(&local_var_content).ok();
1996 let local_var_error = ResponseContent {
1997 status: local_var_status,
1998 content: local_var_content,
1999 entity: local_var_entity,
2000 };
2001 Err(Error::ResponseError(local_var_error))
2002 }
2003}
2004
2005pub async fn cancel_task(
2007 configuration: &configuration::Configuration,
2008 params: CancelTaskParams,
2009) -> Result<models::TaskCancelledResponseSchema, Error<CancelTaskError>> {
2010 let local_var_configuration = configuration;
2011
2012 let name = params.name;
2014
2015 let local_var_client = &local_var_configuration.client;
2016
2017 let local_var_uri_str = format!(
2018 "{}/my/{name}/action/task/cancel",
2019 local_var_configuration.base_path,
2020 name = crate::apis::urlencode(name)
2021 );
2022 let mut local_var_req_builder =
2023 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2024
2025 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2026 local_var_req_builder =
2027 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2028 }
2029 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2030 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2031 };
2032
2033 let local_var_req = local_var_req_builder.build()?;
2034 let local_var_resp = local_var_client.execute(local_var_req).await?;
2035
2036 let local_var_status = local_var_resp.status();
2037 let local_var_content = local_var_resp.text().await?;
2038
2039 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2040 serde_json::from_str(&local_var_content).map_err(Error::from)
2041 } else {
2042 let local_var_entity: Option<CancelTaskError> =
2043 serde_json::from_str(&local_var_content).ok();
2044 let local_var_error = ResponseContent {
2045 status: local_var_status,
2046 content: local_var_content,
2047 entity: local_var_entity,
2048 };
2049 Err(Error::ResponseError(local_var_error))
2050 }
2051}
2052
2053pub async fn change_skin(
2055 configuration: &configuration::Configuration,
2056 params: ChangeSkinParams,
2057) -> Result<models::ChangeSkinResponseSchema, Error<ChangeSkinError>> {
2058 let local_var_configuration = configuration;
2059
2060 let name = params.name;
2062 let change_skin_character_schema = params.change_skin_character_schema;
2064
2065 let local_var_client = &local_var_configuration.client;
2066
2067 let local_var_uri_str = format!(
2068 "{}/my/{name}/action/change_skin",
2069 local_var_configuration.base_path,
2070 name = crate::apis::urlencode(name)
2071 );
2072 let mut local_var_req_builder =
2073 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2074
2075 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2076 local_var_req_builder =
2077 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2078 }
2079 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2080 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2081 };
2082 local_var_req_builder = local_var_req_builder.json(&change_skin_character_schema);
2083
2084 let local_var_req = local_var_req_builder.build()?;
2085 let local_var_resp = local_var_client.execute(local_var_req).await?;
2086
2087 let local_var_status = local_var_resp.status();
2088 let local_var_content = local_var_resp.text().await?;
2089
2090 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2091 serde_json::from_str(&local_var_content).map_err(Error::from)
2092 } else {
2093 let local_var_entity: Option<ChangeSkinError> =
2094 serde_json::from_str(&local_var_content).ok();
2095 let local_var_error = ResponseContent {
2096 status: local_var_status,
2097 content: local_var_content,
2098 entity: local_var_entity,
2099 };
2100 Err(Error::ResponseError(local_var_error))
2101 }
2102}
2103
2104pub async fn complete_task(
2106 configuration: &configuration::Configuration,
2107 params: CompleteTaskParams,
2108) -> Result<models::RewardDataResponseSchema, Error<CompleteTaskError>> {
2109 let local_var_configuration = configuration;
2110
2111 let name = params.name;
2113
2114 let local_var_client = &local_var_configuration.client;
2115
2116 let local_var_uri_str = format!(
2117 "{}/my/{name}/action/task/complete",
2118 local_var_configuration.base_path,
2119 name = crate::apis::urlencode(name)
2120 );
2121 let mut local_var_req_builder =
2122 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2123
2124 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2125 local_var_req_builder =
2126 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2127 }
2128 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2129 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2130 };
2131
2132 let local_var_req = local_var_req_builder.build()?;
2133 let local_var_resp = local_var_client.execute(local_var_req).await?;
2134
2135 let local_var_status = local_var_resp.status();
2136 let local_var_content = local_var_resp.text().await?;
2137
2138 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2139 serde_json::from_str(&local_var_content).map_err(Error::from)
2140 } else {
2141 let local_var_entity: Option<CompleteTaskError> =
2142 serde_json::from_str(&local_var_content).ok();
2143 let local_var_error = ResponseContent {
2144 status: local_var_status,
2145 content: local_var_content,
2146 entity: local_var_entity,
2147 };
2148 Err(Error::ResponseError(local_var_error))
2149 }
2150}
2151
2152pub async fn craft(
2154 configuration: &configuration::Configuration,
2155 params: CraftParams,
2156) -> Result<models::SkillResponseSchema, Error<CraftError>> {
2157 let local_var_configuration = configuration;
2158
2159 let name = params.name;
2161 let crafting_schema = params.crafting_schema;
2163
2164 let local_var_client = &local_var_configuration.client;
2165
2166 let local_var_uri_str = format!(
2167 "{}/my/{name}/action/crafting",
2168 local_var_configuration.base_path,
2169 name = crate::apis::urlencode(name)
2170 );
2171 let mut local_var_req_builder =
2172 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2173
2174 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2175 local_var_req_builder =
2176 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2177 }
2178 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2179 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2180 };
2181 local_var_req_builder = local_var_req_builder.json(&crafting_schema);
2182
2183 let local_var_req = local_var_req_builder.build()?;
2184 let local_var_resp = local_var_client.execute(local_var_req).await?;
2185
2186 let local_var_status = local_var_resp.status();
2187 let local_var_content = local_var_resp.text().await?;
2188
2189 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2190 serde_json::from_str(&local_var_content).map_err(Error::from)
2191 } else {
2192 let local_var_entity: Option<CraftError> = serde_json::from_str(&local_var_content).ok();
2193 let local_var_error = ResponseContent {
2194 status: local_var_status,
2195 content: local_var_content,
2196 entity: local_var_entity,
2197 };
2198 Err(Error::ResponseError(local_var_error))
2199 }
2200}
2201
2202pub async fn delete_item(
2204 configuration: &configuration::Configuration,
2205 params: DeleteItemParams,
2206) -> Result<models::DeleteItemResponseSchema, Error<DeleteItemError>> {
2207 let local_var_configuration = configuration;
2208
2209 let name = params.name;
2211 let simple_item_schema = params.simple_item_schema;
2213
2214 let local_var_client = &local_var_configuration.client;
2215
2216 let local_var_uri_str = format!(
2217 "{}/my/{name}/action/delete",
2218 local_var_configuration.base_path,
2219 name = crate::apis::urlencode(name)
2220 );
2221 let mut local_var_req_builder =
2222 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2223
2224 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2225 local_var_req_builder =
2226 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2227 }
2228 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2229 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2230 };
2231 local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
2232
2233 let local_var_req = local_var_req_builder.build()?;
2234 let local_var_resp = local_var_client.execute(local_var_req).await?;
2235
2236 let local_var_status = local_var_resp.status();
2237 let local_var_content = local_var_resp.text().await?;
2238
2239 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2240 serde_json::from_str(&local_var_content).map_err(Error::from)
2241 } else {
2242 let local_var_entity: Option<DeleteItemError> =
2243 serde_json::from_str(&local_var_content).ok();
2244 let local_var_error = ResponseContent {
2245 status: local_var_status,
2246 content: local_var_content,
2247 entity: local_var_entity,
2248 };
2249 Err(Error::ResponseError(local_var_error))
2250 }
2251}
2252
2253pub async fn deposit_gold(
2255 configuration: &configuration::Configuration,
2256 params: DepositGoldParams,
2257) -> Result<models::BankGoldTransactionResponseSchema, Error<DepositGoldError>> {
2258 let local_var_configuration = configuration;
2259
2260 let name = params.name;
2262 let deposit_withdraw_gold_schema = params.deposit_withdraw_gold_schema;
2264
2265 let local_var_client = &local_var_configuration.client;
2266
2267 let local_var_uri_str = format!(
2268 "{}/my/{name}/action/bank/deposit/gold",
2269 local_var_configuration.base_path,
2270 name = crate::apis::urlencode(name)
2271 );
2272 let mut local_var_req_builder =
2273 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2274
2275 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2276 local_var_req_builder =
2277 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2278 }
2279 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2280 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2281 };
2282 local_var_req_builder = local_var_req_builder.json(&deposit_withdraw_gold_schema);
2283
2284 let local_var_req = local_var_req_builder.build()?;
2285 let local_var_resp = local_var_client.execute(local_var_req).await?;
2286
2287 let local_var_status = local_var_resp.status();
2288 let local_var_content = local_var_resp.text().await?;
2289
2290 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2291 serde_json::from_str(&local_var_content).map_err(Error::from)
2292 } else {
2293 let local_var_entity: Option<DepositGoldError> =
2294 serde_json::from_str(&local_var_content).ok();
2295 let local_var_error = ResponseContent {
2296 status: local_var_status,
2297 content: local_var_content,
2298 entity: local_var_entity,
2299 };
2300 Err(Error::ResponseError(local_var_error))
2301 }
2302}
2303
2304pub async fn deposit_item(
2306 configuration: &configuration::Configuration,
2307 params: DepositItemParams,
2308) -> Result<models::BankItemTransactionResponseSchema, Error<DepositItemError>> {
2309 let local_var_configuration = configuration;
2310
2311 let name = params.name;
2313 let simple_item_schema = params.simple_item_schema;
2315
2316 let local_var_client = &local_var_configuration.client;
2317
2318 let local_var_uri_str = format!(
2319 "{}/my/{name}/action/bank/deposit/item",
2320 local_var_configuration.base_path,
2321 name = crate::apis::urlencode(name)
2322 );
2323 let mut local_var_req_builder =
2324 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2325
2326 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2327 local_var_req_builder =
2328 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2329 }
2330 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2331 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2332 };
2333 local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
2334
2335 let local_var_req = local_var_req_builder.build()?;
2336 let local_var_resp = local_var_client.execute(local_var_req).await?;
2337
2338 let local_var_status = local_var_resp.status();
2339 let local_var_content = local_var_resp.text().await?;
2340
2341 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2342 serde_json::from_str(&local_var_content).map_err(Error::from)
2343 } else {
2344 let local_var_entity: Option<DepositItemError> =
2345 serde_json::from_str(&local_var_content).ok();
2346 let local_var_error = ResponseContent {
2347 status: local_var_status,
2348 content: local_var_content,
2349 entity: local_var_entity,
2350 };
2351 Err(Error::ResponseError(local_var_error))
2352 }
2353}
2354
2355pub async fn equip_item(
2357 configuration: &configuration::Configuration,
2358 params: EquipItemParams,
2359) -> Result<models::EquipmentResponseSchema, Error<EquipItemError>> {
2360 let local_var_configuration = configuration;
2361
2362 let name = params.name;
2364 let equip_schema = params.equip_schema;
2366
2367 let local_var_client = &local_var_configuration.client;
2368
2369 let local_var_uri_str = format!(
2370 "{}/my/{name}/action/equip",
2371 local_var_configuration.base_path,
2372 name = crate::apis::urlencode(name)
2373 );
2374 let mut local_var_req_builder =
2375 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2376
2377 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2378 local_var_req_builder =
2379 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2380 }
2381 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2382 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2383 };
2384 local_var_req_builder = local_var_req_builder.json(&equip_schema);
2385
2386 let local_var_req = local_var_req_builder.build()?;
2387 let local_var_resp = local_var_client.execute(local_var_req).await?;
2388
2389 let local_var_status = local_var_resp.status();
2390 let local_var_content = local_var_resp.text().await?;
2391
2392 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2393 serde_json::from_str(&local_var_content).map_err(Error::from)
2394 } else {
2395 let local_var_entity: Option<EquipItemError> =
2396 serde_json::from_str(&local_var_content).ok();
2397 let local_var_error = ResponseContent {
2398 status: local_var_status,
2399 content: local_var_content,
2400 entity: local_var_entity,
2401 };
2402 Err(Error::ResponseError(local_var_error))
2403 }
2404}
2405
2406pub async fn fight(
2408 configuration: &configuration::Configuration,
2409 params: FightParams,
2410) -> Result<models::CharacterFightResponseSchema, Error<FightError>> {
2411 let local_var_configuration = configuration;
2412
2413 let name = params.name;
2415 let fight_request_schema = params.fight_request_schema;
2417
2418 let local_var_client = &local_var_configuration.client;
2419
2420 let local_var_uri_str = format!(
2421 "{}/my/{name}/action/fight",
2422 local_var_configuration.base_path,
2423 name = crate::apis::urlencode(name)
2424 );
2425 let mut local_var_req_builder =
2426 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2427
2428 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2429 local_var_req_builder =
2430 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2431 }
2432 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2433 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2434 };
2435 local_var_req_builder = local_var_req_builder.json(&fight_request_schema);
2436
2437 let local_var_req = local_var_req_builder.build()?;
2438 let local_var_resp = local_var_client.execute(local_var_req).await?;
2439
2440 let local_var_status = local_var_resp.status();
2441 let local_var_content = local_var_resp.text().await?;
2442
2443 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2444 serde_json::from_str(&local_var_content).map_err(Error::from)
2445 } else {
2446 let local_var_entity: Option<FightError> = serde_json::from_str(&local_var_content).ok();
2447 let local_var_error = ResponseContent {
2448 status: local_var_status,
2449 content: local_var_content,
2450 entity: local_var_entity,
2451 };
2452 Err(Error::ResponseError(local_var_error))
2453 }
2454}
2455
2456pub async fn gather(
2458 configuration: &configuration::Configuration,
2459 params: GatherParams,
2460) -> Result<models::SkillResponseSchema, Error<GatherError>> {
2461 let local_var_configuration = configuration;
2462
2463 let name = params.name;
2465
2466 let local_var_client = &local_var_configuration.client;
2467
2468 let local_var_uri_str = format!(
2469 "{}/my/{name}/action/gathering",
2470 local_var_configuration.base_path,
2471 name = crate::apis::urlencode(name)
2472 );
2473 let mut local_var_req_builder =
2474 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2475
2476 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2477 local_var_req_builder =
2478 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2479 }
2480 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2481 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2482 };
2483
2484 let local_var_req = local_var_req_builder.build()?;
2485 let local_var_resp = local_var_client.execute(local_var_req).await?;
2486
2487 let local_var_status = local_var_resp.status();
2488 let local_var_content = local_var_resp.text().await?;
2489
2490 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2491 serde_json::from_str(&local_var_content).map_err(Error::from)
2492 } else {
2493 let local_var_entity: Option<GatherError> = serde_json::from_str(&local_var_content).ok();
2494 let local_var_error = ResponseContent {
2495 status: local_var_status,
2496 content: local_var_content,
2497 entity: local_var_entity,
2498 };
2499 Err(Error::ResponseError(local_var_error))
2500 }
2501}
2502
2503pub async fn ge_buy_item(
2505 configuration: &configuration::Configuration,
2506 params: GeBuyItemParams,
2507) -> Result<models::GeTransactionResponseSchema, Error<GeBuyItemError>> {
2508 let local_var_configuration = configuration;
2509
2510 let name = params.name;
2512 let ge_buy_order_schema = params.ge_buy_order_schema;
2514
2515 let local_var_client = &local_var_configuration.client;
2516
2517 let local_var_uri_str = format!(
2518 "{}/my/{name}/action/grandexchange/buy",
2519 local_var_configuration.base_path,
2520 name = crate::apis::urlencode(name)
2521 );
2522 let mut local_var_req_builder =
2523 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2524
2525 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2526 local_var_req_builder =
2527 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2528 }
2529 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2530 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2531 };
2532 local_var_req_builder = local_var_req_builder.json(&ge_buy_order_schema);
2533
2534 let local_var_req = local_var_req_builder.build()?;
2535 let local_var_resp = local_var_client.execute(local_var_req).await?;
2536
2537 let local_var_status = local_var_resp.status();
2538 let local_var_content = local_var_resp.text().await?;
2539
2540 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2541 serde_json::from_str(&local_var_content).map_err(Error::from)
2542 } else {
2543 let local_var_entity: Option<GeBuyItemError> =
2544 serde_json::from_str(&local_var_content).ok();
2545 let local_var_error = ResponseContent {
2546 status: local_var_status,
2547 content: local_var_content,
2548 entity: local_var_entity,
2549 };
2550 Err(Error::ResponseError(local_var_error))
2551 }
2552}
2553
2554pub async fn ge_cancel_sell_order(
2556 configuration: &configuration::Configuration,
2557 params: GeCancelSellOrderParams,
2558) -> Result<models::GeTransactionResponseSchema, Error<GeCancelSellOrderError>> {
2559 let local_var_configuration = configuration;
2560
2561 let name = params.name;
2563 let ge_cancel_order_schema = params.ge_cancel_order_schema;
2565
2566 let local_var_client = &local_var_configuration.client;
2567
2568 let local_var_uri_str = format!(
2569 "{}/my/{name}/action/grandexchange/cancel",
2570 local_var_configuration.base_path,
2571 name = crate::apis::urlencode(name)
2572 );
2573 let mut local_var_req_builder =
2574 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2575
2576 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2577 local_var_req_builder =
2578 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2579 }
2580 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2581 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2582 };
2583 local_var_req_builder = local_var_req_builder.json(&ge_cancel_order_schema);
2584
2585 let local_var_req = local_var_req_builder.build()?;
2586 let local_var_resp = local_var_client.execute(local_var_req).await?;
2587
2588 let local_var_status = local_var_resp.status();
2589 let local_var_content = local_var_resp.text().await?;
2590
2591 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2592 serde_json::from_str(&local_var_content).map_err(Error::from)
2593 } else {
2594 let local_var_entity: Option<GeCancelSellOrderError> =
2595 serde_json::from_str(&local_var_content).ok();
2596 let local_var_error = ResponseContent {
2597 status: local_var_status,
2598 content: local_var_content,
2599 entity: local_var_entity,
2600 };
2601 Err(Error::ResponseError(local_var_error))
2602 }
2603}
2604
2605pub async fn ge_create_sell_order(
2607 configuration: &configuration::Configuration,
2608 params: GeCreateSellOrderParams,
2609) -> Result<models::GeCreateOrderTransactionResponseSchema, Error<GeCreateSellOrderError>> {
2610 let local_var_configuration = configuration;
2611
2612 let name = params.name;
2614 let ge_order_creationr_schema = params.ge_order_creationr_schema;
2616
2617 let local_var_client = &local_var_configuration.client;
2618
2619 let local_var_uri_str = format!(
2620 "{}/my/{name}/action/grandexchange/sell",
2621 local_var_configuration.base_path,
2622 name = crate::apis::urlencode(name)
2623 );
2624 let mut local_var_req_builder =
2625 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2626
2627 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2628 local_var_req_builder =
2629 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2630 }
2631 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2632 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2633 };
2634 local_var_req_builder = local_var_req_builder.json(&ge_order_creationr_schema);
2635
2636 let local_var_req = local_var_req_builder.build()?;
2637 let local_var_resp = local_var_client.execute(local_var_req).await?;
2638
2639 let local_var_status = local_var_resp.status();
2640 let local_var_content = local_var_resp.text().await?;
2641
2642 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2643 serde_json::from_str(&local_var_content).map_err(Error::from)
2644 } else {
2645 let local_var_entity: Option<GeCreateSellOrderError> =
2646 serde_json::from_str(&local_var_content).ok();
2647 let local_var_error = ResponseContent {
2648 status: local_var_status,
2649 content: local_var_content,
2650 entity: local_var_entity,
2651 };
2652 Err(Error::ResponseError(local_var_error))
2653 }
2654}
2655
2656pub async fn get_all_characters_logs(
2658 configuration: &configuration::Configuration,
2659 params: GetAllCharactersLogsParams,
2660) -> Result<models::DataPageLogSchema, Error<GetAllCharactersLogsError>> {
2661 let local_var_configuration = configuration;
2662
2663 let page = params.page;
2665 let size = params.size;
2667
2668 let local_var_client = &local_var_configuration.client;
2669
2670 let local_var_uri_str = format!("{}/my/logs", local_var_configuration.base_path);
2671 let mut local_var_req_builder =
2672 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2673
2674 if let Some(ref local_var_str) = page {
2675 local_var_req_builder =
2676 local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2677 }
2678 if let Some(ref local_var_str) = size {
2679 local_var_req_builder =
2680 local_var_req_builder.query(&[("size", &local_var_str.to_string())]);
2681 }
2682 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2683 local_var_req_builder =
2684 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2685 }
2686 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2687 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2688 };
2689
2690 let local_var_req = local_var_req_builder.build()?;
2691 let local_var_resp = local_var_client.execute(local_var_req).await?;
2692
2693 let local_var_status = local_var_resp.status();
2694 let local_var_content = local_var_resp.text().await?;
2695
2696 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2697 serde_json::from_str(&local_var_content).map_err(Error::from)
2698 } else {
2699 let local_var_entity: Option<GetAllCharactersLogsError> =
2700 serde_json::from_str(&local_var_content).ok();
2701 let local_var_error = ResponseContent {
2702 status: local_var_status,
2703 content: local_var_content,
2704 entity: local_var_entity,
2705 };
2706 Err(Error::ResponseError(local_var_error))
2707 }
2708}
2709
2710pub async fn get_character_logs(
2712 configuration: &configuration::Configuration,
2713 params: GetCharacterLogsParams,
2714) -> Result<models::DataPageLogSchema, Error<GetCharacterLogsError>> {
2715 let local_var_configuration = configuration;
2716
2717 let name = params.name;
2719 let page = params.page;
2721 let size = params.size;
2723
2724 let local_var_client = &local_var_configuration.client;
2725
2726 let local_var_uri_str = format!(
2727 "{}/my/logs/{name}",
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::GET, local_var_uri_str.as_str());
2733
2734 if let Some(ref local_var_str) = page {
2735 local_var_req_builder =
2736 local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2737 }
2738 if let Some(ref local_var_str) = size {
2739 local_var_req_builder =
2740 local_var_req_builder.query(&[("size", &local_var_str.to_string())]);
2741 }
2742 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2743 local_var_req_builder =
2744 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2745 }
2746 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2747 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2748 };
2749
2750 let local_var_req = local_var_req_builder.build()?;
2751 let local_var_resp = local_var_client.execute(local_var_req).await?;
2752
2753 let local_var_status = local_var_resp.status();
2754 let local_var_content = local_var_resp.text().await?;
2755
2756 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2757 serde_json::from_str(&local_var_content).map_err(Error::from)
2758 } else {
2759 let local_var_entity: Option<GetCharacterLogsError> =
2760 serde_json::from_str(&local_var_content).ok();
2761 let local_var_error = ResponseContent {
2762 status: local_var_status,
2763 content: local_var_content,
2764 entity: local_var_entity,
2765 };
2766 Err(Error::ResponseError(local_var_error))
2767 }
2768}
2769
2770pub async fn get_my_characters(
2772 configuration: &configuration::Configuration,
2773) -> Result<models::MyCharactersListSchema, Error<GetMyCharactersError>> {
2774 let local_var_configuration = configuration;
2775
2776 let local_var_client = &local_var_configuration.client;
2777
2778 let local_var_uri_str = format!("{}/my/characters", local_var_configuration.base_path);
2779 let mut local_var_req_builder =
2780 local_var_client.request(reqwest::Method::GET, 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<GetMyCharactersError> =
2800 serde_json::from_str(&local_var_content).ok();
2801 let local_var_error = ResponseContent {
2802 status: local_var_status,
2803 content: local_var_content,
2804 entity: local_var_entity,
2805 };
2806 Err(Error::ResponseError(local_var_error))
2807 }
2808}
2809
2810pub async fn give_gold(
2812 configuration: &configuration::Configuration,
2813 params: GiveGoldParams,
2814) -> Result<models::GiveGoldResponseSchema, Error<GiveGoldError>> {
2815 let local_var_configuration = configuration;
2816
2817 let name = params.name;
2819 let give_gold_schema = params.give_gold_schema;
2821
2822 let local_var_client = &local_var_configuration.client;
2823
2824 let local_var_uri_str = format!(
2825 "{}/my/{name}/action/give/gold",
2826 local_var_configuration.base_path,
2827 name = crate::apis::urlencode(name)
2828 );
2829 let mut local_var_req_builder =
2830 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2831
2832 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2833 local_var_req_builder =
2834 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2835 }
2836 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2837 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2838 };
2839 local_var_req_builder = local_var_req_builder.json(&give_gold_schema);
2840
2841 let local_var_req = local_var_req_builder.build()?;
2842 let local_var_resp = local_var_client.execute(local_var_req).await?;
2843
2844 let local_var_status = local_var_resp.status();
2845 let local_var_content = local_var_resp.text().await?;
2846
2847 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2848 serde_json::from_str(&local_var_content).map_err(Error::from)
2849 } else {
2850 let local_var_entity: Option<GiveGoldError> = 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 give_items(
2862 configuration: &configuration::Configuration,
2863 params: GiveItemsParams,
2864) -> Result<models::GiveItemResponseSchema, Error<GiveItemsError>> {
2865 let local_var_configuration = configuration;
2866
2867 let name = params.name;
2869 let give_items_schema = params.give_items_schema;
2871
2872 let local_var_client = &local_var_configuration.client;
2873
2874 let local_var_uri_str = format!(
2875 "{}/my/{name}/action/give/item",
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(&give_items_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<GiveItemsError> =
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 move_character(
2913 configuration: &configuration::Configuration,
2914 params: MoveCharacterParams,
2915) -> Result<models::CharacterMovementResponseSchema, Error<MoveCharacterError>> {
2916 let local_var_configuration = configuration;
2917
2918 let name = params.name;
2920 let destination_schema = params.destination_schema;
2922
2923 let local_var_client = &local_var_configuration.client;
2924
2925 let local_var_uri_str = format!(
2926 "{}/my/{name}/action/move",
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(&destination_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<MoveCharacterError> =
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 npc_buy_item(
2964 configuration: &configuration::Configuration,
2965 params: NpcBuyItemParams,
2966) -> Result<models::NpcMerchantTransactionResponseSchema, Error<NpcBuyItemError>> {
2967 let local_var_configuration = configuration;
2968
2969 let name = params.name;
2971 let npc_merchant_buy_schema = params.npc_merchant_buy_schema;
2973
2974 let local_var_client = &local_var_configuration.client;
2975
2976 let local_var_uri_str = format!(
2977 "{}/my/{name}/action/npc/buy",
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(&npc_merchant_buy_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<NpcBuyItemError> =
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 npc_sell_item(
3015 configuration: &configuration::Configuration,
3016 params: NpcSellItemParams,
3017) -> Result<models::NpcMerchantTransactionResponseSchema, Error<NpcSellItemError>> {
3018 let local_var_configuration = configuration;
3019
3020 let name = params.name;
3022 let npc_merchant_buy_schema = params.npc_merchant_buy_schema;
3024
3025 let local_var_client = &local_var_configuration.client;
3026
3027 let local_var_uri_str = format!(
3028 "{}/my/{name}/action/npc/sell",
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(&npc_merchant_buy_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<NpcSellItemError> =
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 recycle(
3066 configuration: &configuration::Configuration,
3067 params: RecycleParams,
3068) -> Result<models::RecyclingResponseSchema, Error<RecycleError>> {
3069 let local_var_configuration = configuration;
3070
3071 let name = params.name;
3073 let recycling_schema = params.recycling_schema;
3075
3076 let local_var_client = &local_var_configuration.client;
3077
3078 let local_var_uri_str = format!(
3079 "{}/my/{name}/action/recycling",
3080 local_var_configuration.base_path,
3081 name = crate::apis::urlencode(name)
3082 );
3083 let mut local_var_req_builder =
3084 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3085
3086 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3087 local_var_req_builder =
3088 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3089 }
3090 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3091 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3092 };
3093 local_var_req_builder = local_var_req_builder.json(&recycling_schema);
3094
3095 let local_var_req = local_var_req_builder.build()?;
3096 let local_var_resp = local_var_client.execute(local_var_req).await?;
3097
3098 let local_var_status = local_var_resp.status();
3099 let local_var_content = local_var_resp.text().await?;
3100
3101 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3102 serde_json::from_str(&local_var_content).map_err(Error::from)
3103 } else {
3104 let local_var_entity: Option<RecycleError> = serde_json::from_str(&local_var_content).ok();
3105 let local_var_error = ResponseContent {
3106 status: local_var_status,
3107 content: local_var_content,
3108 entity: local_var_entity,
3109 };
3110 Err(Error::ResponseError(local_var_error))
3111 }
3112}
3113
3114pub async fn rest_character(
3116 configuration: &configuration::Configuration,
3117 params: RestCharacterParams,
3118) -> Result<models::CharacterRestResponseSchema, Error<RestCharacterError>> {
3119 let local_var_configuration = configuration;
3120
3121 let name = params.name;
3123
3124 let local_var_client = &local_var_configuration.client;
3125
3126 let local_var_uri_str = format!(
3127 "{}/my/{name}/action/rest",
3128 local_var_configuration.base_path,
3129 name = crate::apis::urlencode(name)
3130 );
3131 let mut local_var_req_builder =
3132 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3133
3134 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3135 local_var_req_builder =
3136 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3137 }
3138 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3139 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3140 };
3141
3142 let local_var_req = local_var_req_builder.build()?;
3143 let local_var_resp = local_var_client.execute(local_var_req).await?;
3144
3145 let local_var_status = local_var_resp.status();
3146 let local_var_content = local_var_resp.text().await?;
3147
3148 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3149 serde_json::from_str(&local_var_content).map_err(Error::from)
3150 } else {
3151 let local_var_entity: Option<RestCharacterError> =
3152 serde_json::from_str(&local_var_content).ok();
3153 let local_var_error = ResponseContent {
3154 status: local_var_status,
3155 content: local_var_content,
3156 entity: local_var_entity,
3157 };
3158 Err(Error::ResponseError(local_var_error))
3159 }
3160}
3161
3162pub async fn task_exchange(
3164 configuration: &configuration::Configuration,
3165 params: TaskExchangeParams,
3166) -> Result<models::RewardDataResponseSchema, Error<TaskExchangeError>> {
3167 let local_var_configuration = configuration;
3168
3169 let name = params.name;
3171
3172 let local_var_client = &local_var_configuration.client;
3173
3174 let local_var_uri_str = format!(
3175 "{}/my/{name}/action/task/exchange",
3176 local_var_configuration.base_path,
3177 name = crate::apis::urlencode(name)
3178 );
3179 let mut local_var_req_builder =
3180 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3181
3182 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3183 local_var_req_builder =
3184 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3185 }
3186 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3187 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3188 };
3189
3190 let local_var_req = local_var_req_builder.build()?;
3191 let local_var_resp = local_var_client.execute(local_var_req).await?;
3192
3193 let local_var_status = local_var_resp.status();
3194 let local_var_content = local_var_resp.text().await?;
3195
3196 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3197 serde_json::from_str(&local_var_content).map_err(Error::from)
3198 } else {
3199 let local_var_entity: Option<TaskExchangeError> =
3200 serde_json::from_str(&local_var_content).ok();
3201 let local_var_error = ResponseContent {
3202 status: local_var_status,
3203 content: local_var_content,
3204 entity: local_var_entity,
3205 };
3206 Err(Error::ResponseError(local_var_error))
3207 }
3208}
3209
3210pub async fn task_trade(
3212 configuration: &configuration::Configuration,
3213 params: TaskTradeParams,
3214) -> Result<models::TaskTradeResponseSchema, Error<TaskTradeError>> {
3215 let local_var_configuration = configuration;
3216
3217 let name = params.name;
3219 let simple_item_schema = params.simple_item_schema;
3221
3222 let local_var_client = &local_var_configuration.client;
3223
3224 let local_var_uri_str = format!(
3225 "{}/my/{name}/action/task/trade",
3226 local_var_configuration.base_path,
3227 name = crate::apis::urlencode(name)
3228 );
3229 let mut local_var_req_builder =
3230 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3231
3232 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3233 local_var_req_builder =
3234 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3235 }
3236 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3237 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3238 };
3239 local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
3240
3241 let local_var_req = local_var_req_builder.build()?;
3242 let local_var_resp = local_var_client.execute(local_var_req).await?;
3243
3244 let local_var_status = local_var_resp.status();
3245 let local_var_content = local_var_resp.text().await?;
3246
3247 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3248 serde_json::from_str(&local_var_content).map_err(Error::from)
3249 } else {
3250 let local_var_entity: Option<TaskTradeError> =
3251 serde_json::from_str(&local_var_content).ok();
3252 let local_var_error = ResponseContent {
3253 status: local_var_status,
3254 content: local_var_content,
3255 entity: local_var_entity,
3256 };
3257 Err(Error::ResponseError(local_var_error))
3258 }
3259}
3260
3261pub async fn unequip_item(
3263 configuration: &configuration::Configuration,
3264 params: UnequipItemParams,
3265) -> Result<models::EquipmentResponseSchema, Error<UnequipItemError>> {
3266 let local_var_configuration = configuration;
3267
3268 let name = params.name;
3270 let unequip_schema = params.unequip_schema;
3272
3273 let local_var_client = &local_var_configuration.client;
3274
3275 let local_var_uri_str = format!(
3276 "{}/my/{name}/action/unequip",
3277 local_var_configuration.base_path,
3278 name = crate::apis::urlencode(name)
3279 );
3280 let mut local_var_req_builder =
3281 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3282
3283 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3284 local_var_req_builder =
3285 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3286 }
3287 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3288 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3289 };
3290 local_var_req_builder = local_var_req_builder.json(&unequip_schema);
3291
3292 let local_var_req = local_var_req_builder.build()?;
3293 let local_var_resp = local_var_client.execute(local_var_req).await?;
3294
3295 let local_var_status = local_var_resp.status();
3296 let local_var_content = local_var_resp.text().await?;
3297
3298 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3299 serde_json::from_str(&local_var_content).map_err(Error::from)
3300 } else {
3301 let local_var_entity: Option<UnequipItemError> =
3302 serde_json::from_str(&local_var_content).ok();
3303 let local_var_error = ResponseContent {
3304 status: local_var_status,
3305 content: local_var_content,
3306 entity: local_var_entity,
3307 };
3308 Err(Error::ResponseError(local_var_error))
3309 }
3310}
3311
3312pub async fn use_item(
3314 configuration: &configuration::Configuration,
3315 params: UseItemParams,
3316) -> Result<models::UseItemResponseSchema, Error<UseItemError>> {
3317 let local_var_configuration = configuration;
3318
3319 let name = params.name;
3321 let simple_item_schema = params.simple_item_schema;
3323
3324 let local_var_client = &local_var_configuration.client;
3325
3326 let local_var_uri_str = format!(
3327 "{}/my/{name}/action/use",
3328 local_var_configuration.base_path,
3329 name = crate::apis::urlencode(name)
3330 );
3331 let mut local_var_req_builder =
3332 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3333
3334 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3335 local_var_req_builder =
3336 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3337 }
3338 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3339 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3340 };
3341 local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
3342
3343 let local_var_req = local_var_req_builder.build()?;
3344 let local_var_resp = local_var_client.execute(local_var_req).await?;
3345
3346 let local_var_status = local_var_resp.status();
3347 let local_var_content = local_var_resp.text().await?;
3348
3349 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3350 serde_json::from_str(&local_var_content).map_err(Error::from)
3351 } else {
3352 let local_var_entity: Option<UseItemError> = serde_json::from_str(&local_var_content).ok();
3353 let local_var_error = ResponseContent {
3354 status: local_var_status,
3355 content: local_var_content,
3356 entity: local_var_entity,
3357 };
3358 Err(Error::ResponseError(local_var_error))
3359 }
3360}
3361
3362pub async fn withdraw_gold(
3364 configuration: &configuration::Configuration,
3365 params: WithdrawGoldParams,
3366) -> Result<models::BankGoldTransactionResponseSchema, Error<WithdrawGoldError>> {
3367 let local_var_configuration = configuration;
3368
3369 let name = params.name;
3371 let deposit_withdraw_gold_schema = params.deposit_withdraw_gold_schema;
3373
3374 let local_var_client = &local_var_configuration.client;
3375
3376 let local_var_uri_str = format!(
3377 "{}/my/{name}/action/bank/withdraw/gold",
3378 local_var_configuration.base_path,
3379 name = crate::apis::urlencode(name)
3380 );
3381 let mut local_var_req_builder =
3382 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3383
3384 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3385 local_var_req_builder =
3386 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3387 }
3388 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3389 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3390 };
3391 local_var_req_builder = local_var_req_builder.json(&deposit_withdraw_gold_schema);
3392
3393 let local_var_req = local_var_req_builder.build()?;
3394 let local_var_resp = local_var_client.execute(local_var_req).await?;
3395
3396 let local_var_status = local_var_resp.status();
3397 let local_var_content = local_var_resp.text().await?;
3398
3399 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3400 serde_json::from_str(&local_var_content).map_err(Error::from)
3401 } else {
3402 let local_var_entity: Option<WithdrawGoldError> =
3403 serde_json::from_str(&local_var_content).ok();
3404 let local_var_error = ResponseContent {
3405 status: local_var_status,
3406 content: local_var_content,
3407 entity: local_var_entity,
3408 };
3409 Err(Error::ResponseError(local_var_error))
3410 }
3411}
3412
3413pub async fn withdraw_item(
3415 configuration: &configuration::Configuration,
3416 params: WithdrawItemParams,
3417) -> Result<models::BankItemTransactionResponseSchema, Error<WithdrawItemError>> {
3418 let local_var_configuration = configuration;
3419
3420 let name = params.name;
3422 let simple_item_schema = params.simple_item_schema;
3424
3425 let local_var_client = &local_var_configuration.client;
3426
3427 let local_var_uri_str = format!(
3428 "{}/my/{name}/action/bank/withdraw/item",
3429 local_var_configuration.base_path,
3430 name = crate::apis::urlencode(name)
3431 );
3432 let mut local_var_req_builder =
3433 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3434
3435 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3436 local_var_req_builder =
3437 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3438 }
3439 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3440 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3441 };
3442 local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
3443
3444 let local_var_req = local_var_req_builder.build()?;
3445 let local_var_resp = local_var_client.execute(local_var_req).await?;
3446
3447 let local_var_status = local_var_resp.status();
3448 let local_var_content = local_var_resp.text().await?;
3449
3450 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3451 serde_json::from_str(&local_var_content).map_err(Error::from)
3452 } else {
3453 let local_var_entity: Option<WithdrawItemError> =
3454 serde_json::from_str(&local_var_content).ok();
3455 let local_var_error = ResponseContent {
3456 status: local_var_status,
3457 content: local_var_content,
3458 entity: local_var_entity,
3459 };
3460 Err(Error::ResponseError(local_var_error))
3461 }
3462}