1use super::{configuration, Error};
2use crate::{apis::ResponseContent, models};
3use reqwest::StatusCode;
4use serde::{de, Deserialize, Deserializer, Serialize};
5
6#[derive(Clone, Debug)]
8pub struct AcceptNewTaskParams {
9 pub name: String,
11}
12
13impl AcceptNewTaskParams {
14 pub fn new(name: String) -> Self {
15 Self { name }
16 }
17}
18
19#[derive(Clone, Debug)]
21pub struct ActionTransitionParams {
22 pub name: String,
24}
25
26impl ActionTransitionParams {
27 pub fn new(name: String) -> Self {
28 Self { name }
29 }
30}
31
32#[derive(Clone, Debug)]
34pub struct BuyBankExpansionParams {
35 pub name: String,
37}
38
39impl BuyBankExpansionParams {
40 pub fn new(name: String) -> Self {
41 Self { name }
42 }
43}
44
45#[derive(Clone, Debug)]
47pub struct CancelTaskParams {
48 pub name: String,
50}
51
52impl CancelTaskParams {
53 pub fn new(name: String) -> Self {
54 Self { name }
55 }
56}
57
58#[derive(Clone, Debug)]
60pub struct ChangeSkinParams {
61 pub name: String,
63 pub change_skin_character_schema: models::ChangeSkinCharacterSchema,
64}
65
66impl ChangeSkinParams {
67 pub fn new(
68 name: String,
69 change_skin_character_schema: models::ChangeSkinCharacterSchema,
70 ) -> Self {
71 Self {
72 name,
73 change_skin_character_schema,
74 }
75 }
76}
77
78#[derive(Clone, Debug)]
80pub struct ClaimPendingItemParams {
81 pub name: String,
83 pub id: String,
85}
86
87impl ClaimPendingItemParams {
88 pub fn new(name: String, id: String) -> Self {
89 Self { name, id }
90 }
91}
92
93#[derive(Clone, Debug)]
95pub struct CompleteTaskParams {
96 pub name: String,
98}
99
100impl CompleteTaskParams {
101 pub fn new(name: String) -> Self {
102 Self { name }
103 }
104}
105
106#[derive(Clone, Debug)]
108pub struct CraftParams {
109 pub name: String,
111 pub crafting_schema: models::CraftingSchema,
112}
113
114impl CraftParams {
115 pub fn new(name: String, crafting_schema: models::CraftingSchema) -> Self {
116 Self {
117 name,
118 crafting_schema,
119 }
120 }
121}
122
123#[derive(Clone, Debug)]
125pub struct DeleteItemParams {
126 pub name: String,
128 pub simple_item_schema: models::SimpleItemSchema,
129}
130
131impl DeleteItemParams {
132 pub fn new(name: String, simple_item_schema: models::SimpleItemSchema) -> Self {
133 Self {
134 name,
135 simple_item_schema,
136 }
137 }
138}
139
140#[derive(Clone, Debug)]
142pub struct DepositGoldParams {
143 pub name: String,
145 pub deposit_withdraw_gold_schema: models::DepositWithdrawGoldSchema,
146}
147
148impl DepositGoldParams {
149 pub fn new(
150 name: String,
151 deposit_withdraw_gold_schema: models::DepositWithdrawGoldSchema,
152 ) -> Self {
153 Self {
154 name,
155 deposit_withdraw_gold_schema,
156 }
157 }
158}
159
160#[derive(Clone, Debug)]
162pub struct DepositItemParams {
163 pub name: String,
165 pub simple_item_schema: Vec<models::SimpleItemSchema>,
166}
167
168impl DepositItemParams {
169 pub fn new(name: String, simple_item_schema: Vec<models::SimpleItemSchema>) -> Self {
170 Self {
171 name,
172 simple_item_schema,
173 }
174 }
175}
176
177#[derive(Clone, Debug)]
179pub struct EquipItemParams {
180 pub name: String,
182 pub equip_schema: Vec<models::EquipSchema>,
183}
184
185impl EquipItemParams {
186 pub fn new(name: String, equip_schema: Vec<models::EquipSchema>) -> Self {
187 Self { name, equip_schema }
188 }
189}
190
191#[derive(Clone, Debug)]
193pub struct FightParams {
194 pub name: String,
196 pub fight_request_schema: Option<models::FightRequestSchema>,
197}
198
199impl FightParams {
200 pub fn new(name: String, fight_request_schema: Option<models::FightRequestSchema>) -> Self {
201 Self {
202 name,
203 fight_request_schema,
204 }
205 }
206}
207
208#[derive(Clone, Debug)]
210pub struct GatherParams {
211 pub name: String,
213}
214
215impl GatherParams {
216 pub fn new(name: String) -> Self {
217 Self { name }
218 }
219}
220
221#[derive(Clone, Debug)]
223pub struct GeBuyItemParams {
224 pub name: String,
226 pub ge_buy_order_schema: models::GeBuyOrderSchema,
227}
228
229impl GeBuyItemParams {
230 pub fn new(name: String, ge_buy_order_schema: models::GeBuyOrderSchema) -> Self {
231 Self {
232 name,
233 ge_buy_order_schema,
234 }
235 }
236}
237
238#[derive(Clone, Debug)]
240pub struct GeCancelOrderParams {
241 pub name: String,
243 pub ge_cancel_order_schema: models::GeCancelOrderSchema,
244}
245
246impl GeCancelOrderParams {
247 pub fn new(name: String, ge_cancel_order_schema: models::GeCancelOrderSchema) -> Self {
248 Self {
249 name,
250 ge_cancel_order_schema,
251 }
252 }
253}
254
255#[derive(Clone, Debug)]
257pub struct GeCreateBuyOrderParams {
258 pub name: String,
260 pub ge_buy_order_creation_schema: models::GeBuyOrderCreationSchema,
261}
262
263impl GeCreateBuyOrderParams {
264 pub fn new(
265 name: String,
266 ge_buy_order_creation_schema: models::GeBuyOrderCreationSchema,
267 ) -> Self {
268 Self {
269 name,
270 ge_buy_order_creation_schema,
271 }
272 }
273}
274
275#[derive(Clone, Debug)]
277pub struct GeCreateSellOrderParams {
278 pub name: String,
280 pub ge_order_creation_schema: models::GeOrderCreationSchema,
281}
282
283impl GeCreateSellOrderParams {
284 pub fn new(name: String, ge_order_creation_schema: models::GeOrderCreationSchema) -> Self {
285 Self {
286 name,
287 ge_order_creation_schema,
288 }
289 }
290}
291
292#[derive(Clone, Debug)]
294pub struct GeFillOrderParams {
295 pub name: String,
297 pub ge_fill_buy_order_schema: models::GeFillBuyOrderSchema,
298}
299
300impl GeFillOrderParams {
301 pub fn new(name: String, ge_fill_buy_order_schema: models::GeFillBuyOrderSchema) -> Self {
302 Self {
303 name,
304 ge_fill_buy_order_schema,
305 }
306 }
307}
308
309#[derive(Clone, Debug)]
311pub struct GetAllCharactersLogsParams {
312 pub page: Option<u32>,
314 pub size: Option<u32>,
316}
317
318impl GetAllCharactersLogsParams {
319 pub fn new(page: Option<u32>, size: Option<u32>) -> Self {
320 Self { page, size }
321 }
322}
323
324#[derive(Clone, Debug)]
326pub struct GetCharacterLogsParams {
327 pub name: String,
329 pub page: Option<u32>,
331 pub size: Option<u32>,
333}
334
335impl GetCharacterLogsParams {
336 pub fn new(name: String, page: Option<u32>, size: Option<u32>) -> Self {
337 Self { name, page, size }
338 }
339}
340
341#[derive(Clone, Debug)]
343pub struct GiveGoldParams {
344 pub name: String,
346 pub give_gold_schema: models::GiveGoldSchema,
347}
348
349impl GiveGoldParams {
350 pub fn new(name: String, give_gold_schema: models::GiveGoldSchema) -> Self {
351 Self {
352 name,
353 give_gold_schema,
354 }
355 }
356}
357
358#[derive(Clone, Debug)]
360pub struct GiveItemsParams {
361 pub name: String,
363 pub give_items_schema: models::GiveItemsSchema,
364}
365
366impl GiveItemsParams {
367 pub fn new(name: String, give_items_schema: models::GiveItemsSchema) -> Self {
368 Self {
369 name,
370 give_items_schema,
371 }
372 }
373}
374
375#[derive(Clone, Debug)]
377pub struct MoveCharacterParams {
378 pub name: String,
380 pub destination_schema: models::DestinationSchema,
381}
382
383impl MoveCharacterParams {
384 pub fn new(name: String, destination_schema: models::DestinationSchema) -> Self {
385 Self {
386 name,
387 destination_schema,
388 }
389 }
390}
391
392#[derive(Clone, Debug)]
394pub struct NpcBuyItemParams {
395 pub name: String,
397 pub npc_merchant_buy_schema: models::NpcMerchantBuySchema,
398}
399
400impl NpcBuyItemParams {
401 pub fn new(name: String, npc_merchant_buy_schema: models::NpcMerchantBuySchema) -> Self {
402 Self {
403 name,
404 npc_merchant_buy_schema,
405 }
406 }
407}
408
409#[derive(Clone, Debug)]
411pub struct NpcSellItemParams {
412 pub name: String,
414 pub npc_merchant_buy_schema: models::NpcMerchantBuySchema,
415}
416
417impl NpcSellItemParams {
418 pub fn new(name: String, npc_merchant_buy_schema: models::NpcMerchantBuySchema) -> Self {
419 Self {
420 name,
421 npc_merchant_buy_schema,
422 }
423 }
424}
425
426#[derive(Clone, Debug)]
428pub struct RecycleParams {
429 pub name: String,
431 pub recycling_schema: models::RecyclingSchema,
432}
433
434impl RecycleParams {
435 pub fn new(name: String, recycling_schema: models::RecyclingSchema) -> Self {
436 Self {
437 name,
438 recycling_schema,
439 }
440 }
441}
442
443#[derive(Clone, Debug)]
445pub struct RestCharacterParams {
446 pub name: String,
448}
449
450impl RestCharacterParams {
451 pub fn new(name: String) -> Self {
452 Self { name }
453 }
454}
455
456#[derive(Clone, Debug)]
458pub struct TaskExchangeParams {
459 pub name: String,
461}
462
463impl TaskExchangeParams {
464 pub fn new(name: String) -> Self {
465 Self { name }
466 }
467}
468
469#[derive(Clone, Debug)]
471pub struct TaskTradeParams {
472 pub name: String,
474 pub simple_item_schema: models::SimpleItemSchema,
475}
476
477impl TaskTradeParams {
478 pub fn new(name: String, simple_item_schema: models::SimpleItemSchema) -> Self {
479 Self {
480 name,
481 simple_item_schema,
482 }
483 }
484}
485
486#[derive(Clone, Debug)]
488pub struct UnequipItemParams {
489 pub name: String,
491 pub unequip_schema: Vec<models::UnequipSchema>,
492}
493
494impl UnequipItemParams {
495 pub fn new(name: String, unequip_schema: Vec<models::UnequipSchema>) -> Self {
496 Self {
497 name,
498 unequip_schema,
499 }
500 }
501}
502
503#[derive(Clone, Debug)]
505pub struct UseItemParams {
506 pub name: String,
508 pub simple_item_schema: models::SimpleItemSchema,
509}
510
511impl UseItemParams {
512 pub fn new(name: String, simple_item_schema: models::SimpleItemSchema) -> Self {
513 Self {
514 name,
515 simple_item_schema,
516 }
517 }
518}
519
520#[derive(Clone, Debug)]
522pub struct WithdrawGoldParams {
523 pub name: String,
525 pub deposit_withdraw_gold_schema: models::DepositWithdrawGoldSchema,
526}
527
528impl WithdrawGoldParams {
529 pub fn new(
530 name: String,
531 deposit_withdraw_gold_schema: models::DepositWithdrawGoldSchema,
532 ) -> Self {
533 Self {
534 name,
535 deposit_withdraw_gold_schema,
536 }
537 }
538}
539
540#[derive(Clone, Debug)]
542pub struct WithdrawItemParams {
543 pub name: String,
545 pub simple_item_schema: Vec<models::SimpleItemSchema>,
546}
547
548impl WithdrawItemParams {
549 pub fn new(name: String, simple_item_schema: Vec<models::SimpleItemSchema>) -> Self {
550 Self {
551 name,
552 simple_item_schema,
553 }
554 }
555}
556
557#[derive(Debug, Clone, Serialize)]
559#[serde(untagged)]
560pub enum AcceptNewTaskError {
561 Status498(models::ErrorResponseSchema),
563 Status499(models::ErrorResponseSchema),
565 Status486(models::ErrorResponseSchema),
567 Status598(models::ErrorResponseSchema),
569 Status489(models::ErrorResponseSchema),
571 Status422(models::ErrorResponseSchema),
573}
574
575impl<'de> Deserialize<'de> for AcceptNewTaskError {
576 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
577 where
578 D: Deserializer<'de>,
579 {
580 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
581 match raw.error.code {
582 498 => Ok(Self::Status498(raw)),
583 499 => Ok(Self::Status499(raw)),
584 486 => Ok(Self::Status486(raw)),
585 598 => Ok(Self::Status598(raw)),
586 489 => Ok(Self::Status489(raw)),
587 422 => Ok(Self::Status422(raw)),
588 _ => Err(de::Error::custom(format!(
589 "Unexpected error code: {}",
590 raw.error.code
591 ))),
592 }
593 }
594}
595
596#[derive(Debug, Clone, Serialize)]
598#[serde(untagged)]
599pub enum ActionTransitionError {
600 Status498(models::ErrorResponseSchema),
602 Status499(models::ErrorResponseSchema),
604 Status404(models::ErrorResponseSchema),
606 Status492(models::ErrorResponseSchema),
608 Status478(models::ErrorResponseSchema),
610 Status486(models::ErrorResponseSchema),
612 Status496(models::ErrorResponseSchema),
614 Status422(models::ErrorResponseSchema),
616}
617
618impl<'de> Deserialize<'de> for ActionTransitionError {
619 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
620 where
621 D: Deserializer<'de>,
622 {
623 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
624 match raw.error.code {
625 498 => Ok(Self::Status498(raw)),
626 499 => Ok(Self::Status499(raw)),
627 404 => Ok(Self::Status404(raw)),
628 492 => Ok(Self::Status492(raw)),
629 478 => Ok(Self::Status478(raw)),
630 486 => Ok(Self::Status486(raw)),
631 496 => Ok(Self::Status496(raw)),
632 422 => Ok(Self::Status422(raw)),
633 _ => Err(de::Error::custom(format!(
634 "Unexpected error code: {}",
635 raw.error.code
636 ))),
637 }
638 }
639}
640
641#[derive(Debug, Clone, Serialize)]
643#[serde(untagged)]
644pub enum BuyBankExpansionError {
645 Status598(models::ErrorResponseSchema),
647 Status498(models::ErrorResponseSchema),
649 Status499(models::ErrorResponseSchema),
651 Status486(models::ErrorResponseSchema),
653 Status492(models::ErrorResponseSchema),
655 Status422(models::ErrorResponseSchema),
657}
658
659impl<'de> Deserialize<'de> for BuyBankExpansionError {
660 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
661 where
662 D: Deserializer<'de>,
663 {
664 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
665 match raw.error.code {
666 598 => Ok(Self::Status598(raw)),
667 498 => Ok(Self::Status498(raw)),
668 499 => Ok(Self::Status499(raw)),
669 486 => Ok(Self::Status486(raw)),
670 492 => Ok(Self::Status492(raw)),
671 422 => Ok(Self::Status422(raw)),
672 _ => Err(de::Error::custom(format!(
673 "Unexpected error code: {}",
674 raw.error.code
675 ))),
676 }
677 }
678}
679
680#[derive(Debug, Clone, Serialize)]
682#[serde(untagged)]
683pub enum CancelTaskError {
684 Status498(models::ErrorResponseSchema),
686 Status499(models::ErrorResponseSchema),
688 Status486(models::ErrorResponseSchema),
690 Status487(models::ErrorResponseSchema),
692 Status598(models::ErrorResponseSchema),
694 Status478(models::ErrorResponseSchema),
696 Status422(models::ErrorResponseSchema),
698}
699
700impl<'de> Deserialize<'de> for CancelTaskError {
701 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
702 where
703 D: Deserializer<'de>,
704 {
705 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
706 match raw.error.code {
707 498 => Ok(Self::Status498(raw)),
708 499 => Ok(Self::Status499(raw)),
709 486 => Ok(Self::Status486(raw)),
710 487 => Ok(Self::Status487(raw)),
711 598 => Ok(Self::Status598(raw)),
712 478 => Ok(Self::Status478(raw)),
713 422 => Ok(Self::Status422(raw)),
714 _ => Err(de::Error::custom(format!(
715 "Unexpected error code: {}",
716 raw.error.code
717 ))),
718 }
719 }
720}
721
722#[derive(Debug, Clone, Serialize)]
724#[serde(untagged)]
725pub enum ChangeSkinError {
726 Status499(models::ErrorResponseSchema),
728 Status486(models::ErrorResponseSchema),
730 Status550(models::ErrorResponseSchema),
732 Status404(models::ErrorResponseSchema),
734 Status422(models::ErrorResponseSchema),
736}
737
738impl<'de> Deserialize<'de> for ChangeSkinError {
739 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
740 where
741 D: Deserializer<'de>,
742 {
743 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
744 match raw.error.code {
745 499 => Ok(Self::Status499(raw)),
746 486 => Ok(Self::Status486(raw)),
747 550 => Ok(Self::Status550(raw)),
748 404 => Ok(Self::Status404(raw)),
749 422 => Ok(Self::Status422(raw)),
750 _ => Err(de::Error::custom(format!(
751 "Unexpected error code: {}",
752 raw.error.code
753 ))),
754 }
755 }
756}
757
758#[derive(Debug, Clone, Serialize)]
760#[serde(untagged)]
761pub enum ClaimPendingItemError {
762 Status404(models::ErrorResponseSchema),
764 Status498(models::ErrorResponseSchema),
766 Status497(models::ErrorResponseSchema),
768 Status499(models::ErrorResponseSchema),
770 Status486(models::ErrorResponseSchema),
772 Status422(models::ErrorResponseSchema),
774}
775
776impl<'de> Deserialize<'de> for ClaimPendingItemError {
777 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
778 where
779 D: Deserializer<'de>,
780 {
781 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
782 match raw.error.code {
783 404 => Ok(Self::Status404(raw)),
784 498 => Ok(Self::Status498(raw)),
785 497 => Ok(Self::Status497(raw)),
786 499 => Ok(Self::Status499(raw)),
787 486 => Ok(Self::Status486(raw)),
788 422 => Ok(Self::Status422(raw)),
789 _ => Err(de::Error::custom(format!(
790 "Unexpected error code: {}",
791 raw.error.code
792 ))),
793 }
794 }
795}
796
797#[derive(Debug, Clone, Serialize)]
799#[serde(untagged)]
800pub enum CompleteTaskError {
801 Status498(models::ErrorResponseSchema),
803 Status499(models::ErrorResponseSchema),
805 Status486(models::ErrorResponseSchema),
807 Status598(models::ErrorResponseSchema),
809 Status488(models::ErrorResponseSchema),
811 Status487(models::ErrorResponseSchema),
813 Status497(models::ErrorResponseSchema),
815 Status422(models::ErrorResponseSchema),
817}
818
819impl<'de> Deserialize<'de> for CompleteTaskError {
820 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
821 where
822 D: Deserializer<'de>,
823 {
824 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
825 match raw.error.code {
826 498 => Ok(Self::Status498(raw)),
827 499 => Ok(Self::Status499(raw)),
828 486 => Ok(Self::Status486(raw)),
829 598 => Ok(Self::Status598(raw)),
830 488 => Ok(Self::Status488(raw)),
831 487 => Ok(Self::Status487(raw)),
832 497 => Ok(Self::Status497(raw)),
833 422 => Ok(Self::Status422(raw)),
834 _ => Err(de::Error::custom(format!(
835 "Unexpected error code: {}",
836 raw.error.code
837 ))),
838 }
839 }
840}
841
842#[derive(Debug, Clone, Serialize)]
844#[serde(untagged)]
845pub enum CraftError {
846 Status404(models::ErrorResponseSchema),
848 Status598(models::ErrorResponseSchema),
850 Status498(models::ErrorResponseSchema),
852 Status497(models::ErrorResponseSchema),
854 Status499(models::ErrorResponseSchema),
856 Status486(models::ErrorResponseSchema),
858 Status493(models::ErrorResponseSchema),
860 Status478(models::ErrorResponseSchema),
862 Status422(models::ErrorResponseSchema),
864}
865
866impl<'de> Deserialize<'de> for CraftError {
867 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
868 where
869 D: Deserializer<'de>,
870 {
871 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
872 match raw.error.code {
873 404 => Ok(Self::Status404(raw)),
874 598 => Ok(Self::Status598(raw)),
875 498 => Ok(Self::Status498(raw)),
876 497 => Ok(Self::Status497(raw)),
877 499 => Ok(Self::Status499(raw)),
878 486 => Ok(Self::Status486(raw)),
879 493 => Ok(Self::Status493(raw)),
880 478 => Ok(Self::Status478(raw)),
881 422 => Ok(Self::Status422(raw)),
882 _ => Err(de::Error::custom(format!(
883 "Unexpected error code: {}",
884 raw.error.code
885 ))),
886 }
887 }
888}
889
890#[derive(Debug, Clone, Serialize)]
892#[serde(untagged)]
893pub enum DeleteItemError {
894 Status498(models::ErrorResponseSchema),
896 Status499(models::ErrorResponseSchema),
898 Status486(models::ErrorResponseSchema),
900 Status478(models::ErrorResponseSchema),
902 Status422(models::ErrorResponseSchema),
904}
905
906impl<'de> Deserialize<'de> for DeleteItemError {
907 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
908 where
909 D: Deserializer<'de>,
910 {
911 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
912 match raw.error.code {
913 498 => Ok(Self::Status498(raw)),
914 499 => Ok(Self::Status499(raw)),
915 486 => Ok(Self::Status486(raw)),
916 478 => Ok(Self::Status478(raw)),
917 422 => Ok(Self::Status422(raw)),
918 _ => Err(de::Error::custom(format!(
919 "Unexpected error code: {}",
920 raw.error.code
921 ))),
922 }
923 }
924}
925
926#[derive(Debug, Clone, Serialize)]
928#[serde(untagged)]
929pub enum DepositGoldError {
930 Status598(models::ErrorResponseSchema),
932 Status492(models::ErrorResponseSchema),
934 Status498(models::ErrorResponseSchema),
936 Status499(models::ErrorResponseSchema),
938 Status461(models::ErrorResponseSchema),
940 Status486(models::ErrorResponseSchema),
942 Status422(models::ErrorResponseSchema),
944}
945
946impl<'de> Deserialize<'de> for DepositGoldError {
947 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
948 where
949 D: Deserializer<'de>,
950 {
951 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
952 match raw.error.code {
953 598 => Ok(Self::Status598(raw)),
954 492 => Ok(Self::Status492(raw)),
955 498 => Ok(Self::Status498(raw)),
956 499 => Ok(Self::Status499(raw)),
957 461 => Ok(Self::Status461(raw)),
958 486 => Ok(Self::Status486(raw)),
959 422 => Ok(Self::Status422(raw)),
960 _ => Err(de::Error::custom(format!(
961 "Unexpected error code: {}",
962 raw.error.code
963 ))),
964 }
965 }
966}
967
968#[derive(Debug, Clone, Serialize)]
970#[serde(untagged)]
971pub enum DepositItemError {
972 Status598(models::ErrorResponseSchema),
974 Status404(models::ErrorResponseSchema),
976 Status461(models::ErrorResponseSchema),
978 Status498(models::ErrorResponseSchema),
980 Status499(models::ErrorResponseSchema),
982 Status486(models::ErrorResponseSchema),
984 Status478(models::ErrorResponseSchema),
986 Status462(models::ErrorResponseSchema),
988 Status422(models::ErrorResponseSchema),
990}
991
992impl<'de> Deserialize<'de> for DepositItemError {
993 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
994 where
995 D: Deserializer<'de>,
996 {
997 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
998 match raw.error.code {
999 598 => Ok(Self::Status598(raw)),
1000 404 => Ok(Self::Status404(raw)),
1001 461 => Ok(Self::Status461(raw)),
1002 498 => Ok(Self::Status498(raw)),
1003 499 => Ok(Self::Status499(raw)),
1004 486 => Ok(Self::Status486(raw)),
1005 478 => Ok(Self::Status478(raw)),
1006 462 => Ok(Self::Status462(raw)),
1007 422 => Ok(Self::Status422(raw)),
1008 _ => Err(de::Error::custom(format!(
1009 "Unexpected error code: {}",
1010 raw.error.code
1011 ))),
1012 }
1013 }
1014}
1015
1016#[derive(Debug, Clone, Serialize)]
1018#[serde(untagged)]
1019pub enum EquipItemError {
1020 Status404(models::ErrorResponseSchema),
1022 Status498(models::ErrorResponseSchema),
1024 Status483(models::ErrorResponseSchema),
1026 Status499(models::ErrorResponseSchema),
1028 Status486(models::ErrorResponseSchema),
1030 Status478(models::ErrorResponseSchema),
1032 Status496(models::ErrorResponseSchema),
1034 Status491(models::ErrorResponseSchema),
1036 Status485(models::ErrorResponseSchema),
1038 Status484(models::ErrorResponseSchema),
1040 Status497(models::ErrorResponseSchema),
1042 Status422(models::ErrorResponseSchema),
1044}
1045
1046impl<'de> Deserialize<'de> for EquipItemError {
1047 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1048 where
1049 D: Deserializer<'de>,
1050 {
1051 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1052 match raw.error.code {
1053 404 => Ok(Self::Status404(raw)),
1054 498 => Ok(Self::Status498(raw)),
1055 483 => Ok(Self::Status483(raw)),
1056 499 => Ok(Self::Status499(raw)),
1057 486 => Ok(Self::Status486(raw)),
1058 478 => Ok(Self::Status478(raw)),
1059 496 => Ok(Self::Status496(raw)),
1060 491 => Ok(Self::Status491(raw)),
1061 485 => Ok(Self::Status485(raw)),
1062 484 => Ok(Self::Status484(raw)),
1063 497 => Ok(Self::Status497(raw)),
1064 422 => Ok(Self::Status422(raw)),
1065 _ => Err(de::Error::custom(format!(
1066 "Unexpected error code: {}",
1067 raw.error.code
1068 ))),
1069 }
1070 }
1071}
1072
1073#[derive(Debug, Clone, Serialize)]
1075#[serde(untagged)]
1076pub enum FightError {
1077 Status498(models::ErrorResponseSchema),
1079 Status499(models::ErrorResponseSchema),
1081 Status598(models::ErrorResponseSchema),
1083 Status486(models::ErrorResponseSchema),
1085 Status497(models::ErrorResponseSchema),
1087 Status567(models::ErrorResponseSchema),
1089 Status422(models::ErrorResponseSchema),
1091}
1092
1093impl<'de> Deserialize<'de> for FightError {
1094 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1095 where
1096 D: Deserializer<'de>,
1097 {
1098 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1099 match raw.error.code {
1100 498 => Ok(Self::Status498(raw)),
1101 499 => Ok(Self::Status499(raw)),
1102 598 => Ok(Self::Status598(raw)),
1103 486 => Ok(Self::Status486(raw)),
1104 497 => Ok(Self::Status497(raw)),
1105 567 => Ok(Self::Status567(raw)),
1106 422 => Ok(Self::Status422(raw)),
1107 _ => Err(de::Error::custom(format!(
1108 "Unexpected error code: {}",
1109 raw.error.code
1110 ))),
1111 }
1112 }
1113}
1114
1115#[derive(Debug, Clone, Serialize)]
1117#[serde(untagged)]
1118pub enum GatherError {
1119 Status498(models::ErrorResponseSchema),
1121 Status499(models::ErrorResponseSchema),
1123 Status598(models::ErrorResponseSchema),
1125 Status486(models::ErrorResponseSchema),
1127 Status493(models::ErrorResponseSchema),
1129 Status497(models::ErrorResponseSchema),
1131 Status422(models::ErrorResponseSchema),
1133}
1134
1135impl<'de> Deserialize<'de> for GatherError {
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 498 => Ok(Self::Status498(raw)),
1143 499 => Ok(Self::Status499(raw)),
1144 598 => Ok(Self::Status598(raw)),
1145 486 => Ok(Self::Status486(raw)),
1146 493 => Ok(Self::Status493(raw)),
1147 497 => Ok(Self::Status497(raw)),
1148 422 => Ok(Self::Status422(raw)),
1149 _ => Err(de::Error::custom(format!(
1150 "Unexpected error code: {}",
1151 raw.error.code
1152 ))),
1153 }
1154 }
1155}
1156
1157#[derive(Debug, Clone, Serialize)]
1159#[serde(untagged)]
1160pub enum GeBuyItemError {
1161 Status598(models::ErrorResponseSchema),
1163 Status498(models::ErrorResponseSchema),
1165 Status497(models::ErrorResponseSchema),
1167 Status499(models::ErrorResponseSchema),
1169 Status436(models::ErrorResponseSchema),
1171 Status486(models::ErrorResponseSchema),
1173 Status492(models::ErrorResponseSchema),
1175 Status434(models::ErrorResponseSchema),
1177 Status435(models::ErrorResponseSchema),
1179 Status404(models::ErrorResponseSchema),
1181 Status422(models::ErrorResponseSchema),
1183}
1184
1185impl<'de> Deserialize<'de> for GeBuyItemError {
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 598 => Ok(Self::Status598(raw)),
1193 498 => Ok(Self::Status498(raw)),
1194 497 => Ok(Self::Status497(raw)),
1195 499 => Ok(Self::Status499(raw)),
1196 436 => Ok(Self::Status436(raw)),
1197 486 => Ok(Self::Status486(raw)),
1198 492 => Ok(Self::Status492(raw)),
1199 434 => Ok(Self::Status434(raw)),
1200 435 => Ok(Self::Status435(raw)),
1201 404 => Ok(Self::Status404(raw)),
1202 422 => Ok(Self::Status422(raw)),
1203 _ => Err(de::Error::custom(format!(
1204 "Unexpected error code: {}",
1205 raw.error.code
1206 ))),
1207 }
1208 }
1209}
1210
1211#[derive(Debug, Clone, Serialize)]
1213#[serde(untagged)]
1214pub enum GeCancelOrderError {
1215 Status598(models::ErrorResponseSchema),
1217 Status498(models::ErrorResponseSchema),
1219 Status497(models::ErrorResponseSchema),
1221 Status499(models::ErrorResponseSchema),
1223 Status436(models::ErrorResponseSchema),
1225 Status486(models::ErrorResponseSchema),
1227 Status438(models::ErrorResponseSchema),
1229 Status404(models::ErrorResponseSchema),
1231 Status422(models::ErrorResponseSchema),
1233}
1234
1235impl<'de> Deserialize<'de> for GeCancelOrderError {
1236 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1237 where
1238 D: Deserializer<'de>,
1239 {
1240 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1241 match raw.error.code {
1242 598 => Ok(Self::Status598(raw)),
1243 498 => Ok(Self::Status498(raw)),
1244 497 => Ok(Self::Status497(raw)),
1245 499 => Ok(Self::Status499(raw)),
1246 436 => Ok(Self::Status436(raw)),
1247 486 => Ok(Self::Status486(raw)),
1248 438 => Ok(Self::Status438(raw)),
1249 404 => Ok(Self::Status404(raw)),
1250 422 => Ok(Self::Status422(raw)),
1251 _ => Err(de::Error::custom(format!(
1252 "Unexpected error code: {}",
1253 raw.error.code
1254 ))),
1255 }
1256 }
1257}
1258
1259#[derive(Debug, Clone, Serialize)]
1261#[serde(untagged)]
1262pub enum GeCreateBuyOrderError {
1263 Status498(models::ErrorResponseSchema),
1265 Status499(models::ErrorResponseSchema),
1267 Status486(models::ErrorResponseSchema),
1269 Status404(models::ErrorResponseSchema),
1271 Status492(models::ErrorResponseSchema),
1273 Status433(models::ErrorResponseSchema),
1275 Status437(models::ErrorResponseSchema),
1277 Status598(models::ErrorResponseSchema),
1279 Status422(models::ErrorResponseSchema),
1281}
1282
1283impl<'de> Deserialize<'de> for GeCreateBuyOrderError {
1284 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1285 where
1286 D: Deserializer<'de>,
1287 {
1288 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1289 match raw.error.code {
1290 498 => Ok(Self::Status498(raw)),
1291 499 => Ok(Self::Status499(raw)),
1292 486 => Ok(Self::Status486(raw)),
1293 404 => Ok(Self::Status404(raw)),
1294 492 => Ok(Self::Status492(raw)),
1295 433 => Ok(Self::Status433(raw)),
1296 437 => Ok(Self::Status437(raw)),
1297 598 => Ok(Self::Status598(raw)),
1298 422 => Ok(Self::Status422(raw)),
1299 _ => Err(de::Error::custom(format!(
1300 "Unexpected error code: {}",
1301 raw.error.code
1302 ))),
1303 }
1304 }
1305}
1306
1307#[derive(Debug, Clone, Serialize)]
1309#[serde(untagged)]
1310pub enum GeCreateSellOrderError {
1311 Status498(models::ErrorResponseSchema),
1313 Status499(models::ErrorResponseSchema),
1315 Status486(models::ErrorResponseSchema),
1317 Status404(models::ErrorResponseSchema),
1319 Status478(models::ErrorResponseSchema),
1321 Status433(models::ErrorResponseSchema),
1323 Status437(models::ErrorResponseSchema),
1325 Status598(models::ErrorResponseSchema),
1327 Status422(models::ErrorResponseSchema),
1329}
1330
1331impl<'de> Deserialize<'de> for GeCreateSellOrderError {
1332 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1333 where
1334 D: Deserializer<'de>,
1335 {
1336 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1337 match raw.error.code {
1338 498 => Ok(Self::Status498(raw)),
1339 499 => Ok(Self::Status499(raw)),
1340 486 => Ok(Self::Status486(raw)),
1341 404 => Ok(Self::Status404(raw)),
1342 478 => Ok(Self::Status478(raw)),
1343 433 => Ok(Self::Status433(raw)),
1344 437 => Ok(Self::Status437(raw)),
1345 598 => Ok(Self::Status598(raw)),
1346 422 => Ok(Self::Status422(raw)),
1347 _ => Err(de::Error::custom(format!(
1348 "Unexpected error code: {}",
1349 raw.error.code
1350 ))),
1351 }
1352 }
1353}
1354
1355#[derive(Debug, Clone, Serialize)]
1357#[serde(untagged)]
1358pub enum GeFillOrderError {
1359 Status598(models::ErrorResponseSchema),
1361 Status498(models::ErrorResponseSchema),
1363 Status499(models::ErrorResponseSchema),
1365 Status436(models::ErrorResponseSchema),
1367 Status486(models::ErrorResponseSchema),
1369 Status478(models::ErrorResponseSchema),
1371 Status434(models::ErrorResponseSchema),
1373 Status435(models::ErrorResponseSchema),
1375 Status404(models::ErrorResponseSchema),
1377 Status422(models::ErrorResponseSchema),
1379}
1380
1381impl<'de> Deserialize<'de> for GeFillOrderError {
1382 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1383 where
1384 D: Deserializer<'de>,
1385 {
1386 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1387 match raw.error.code {
1388 598 => Ok(Self::Status598(raw)),
1389 498 => Ok(Self::Status498(raw)),
1390 499 => Ok(Self::Status499(raw)),
1391 436 => Ok(Self::Status436(raw)),
1392 486 => Ok(Self::Status486(raw)),
1393 478 => Ok(Self::Status478(raw)),
1394 434 => Ok(Self::Status434(raw)),
1395 435 => Ok(Self::Status435(raw)),
1396 404 => Ok(Self::Status404(raw)),
1397 422 => Ok(Self::Status422(raw)),
1398 _ => Err(de::Error::custom(format!(
1399 "Unexpected error code: {}",
1400 raw.error.code
1401 ))),
1402 }
1403 }
1404}
1405
1406#[derive(Debug, Clone, Serialize)]
1408#[serde(untagged)]
1409pub enum GetAllCharactersLogsError {
1410 Status404(models::ErrorResponseSchema),
1412 Status498(models::ErrorResponseSchema),
1414}
1415
1416impl<'de> Deserialize<'de> for GetAllCharactersLogsError {
1417 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1418 where
1419 D: Deserializer<'de>,
1420 {
1421 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1422 match raw.error.code {
1423 404 => Ok(Self::Status404(raw)),
1424 498 => Ok(Self::Status498(raw)),
1425 _ => Err(de::Error::custom(format!(
1426 "Unexpected error code: {}",
1427 raw.error.code
1428 ))),
1429 }
1430 }
1431}
1432
1433#[derive(Debug, Clone, Serialize)]
1435#[serde(untagged)]
1436pub enum GetCharacterLogsError {
1437 Status404(models::ErrorResponseSchema),
1439 Status498(models::ErrorResponseSchema),
1441}
1442
1443impl<'de> Deserialize<'de> for GetCharacterLogsError {
1444 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1445 where
1446 D: Deserializer<'de>,
1447 {
1448 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1449 match raw.error.code {
1450 404 => Ok(Self::Status404(raw)),
1451 498 => Ok(Self::Status498(raw)),
1452 _ => Err(de::Error::custom(format!(
1453 "Unexpected error code: {}",
1454 raw.error.code
1455 ))),
1456 }
1457 }
1458}
1459
1460#[derive(Debug, Clone, Serialize)]
1462#[serde(untagged)]
1463pub enum GetMyCharactersError {}
1464
1465impl<'de> Deserialize<'de> for GetMyCharactersError {
1466 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1467 where
1468 D: Deserializer<'de>,
1469 {
1470 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1471 Err(de::Error::custom(format!(
1472 "Unexpected error code: {}",
1473 raw.error.code
1474 )))
1475 }
1476}
1477
1478#[derive(Debug, Clone, Serialize)]
1480#[serde(untagged)]
1481pub enum GiveGoldError {
1482 Status498(models::ErrorResponseSchema),
1484 Status499(models::ErrorResponseSchema),
1486 Status492(models::ErrorResponseSchema),
1488 Status486(models::ErrorResponseSchema),
1490 Status422(models::ErrorResponseSchema),
1492}
1493
1494impl<'de> Deserialize<'de> for GiveGoldError {
1495 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1496 where
1497 D: Deserializer<'de>,
1498 {
1499 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1500 match raw.error.code {
1501 498 => Ok(Self::Status498(raw)),
1502 499 => Ok(Self::Status499(raw)),
1503 492 => Ok(Self::Status492(raw)),
1504 486 => Ok(Self::Status486(raw)),
1505 422 => Ok(Self::Status422(raw)),
1506 _ => Err(de::Error::custom(format!(
1507 "Unexpected error code: {}",
1508 raw.error.code
1509 ))),
1510 }
1511 }
1512}
1513
1514#[derive(Debug, Clone, Serialize)]
1516#[serde(untagged)]
1517pub enum GiveItemsError {
1518 Status404(models::ErrorResponseSchema),
1520 Status498(models::ErrorResponseSchema),
1522 Status499(models::ErrorResponseSchema),
1524 Status497(models::ErrorResponseSchema),
1526 Status486(models::ErrorResponseSchema),
1528 Status478(models::ErrorResponseSchema),
1530 Status422(models::ErrorResponseSchema),
1532}
1533
1534impl<'de> Deserialize<'de> for GiveItemsError {
1535 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1536 where
1537 D: Deserializer<'de>,
1538 {
1539 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1540 match raw.error.code {
1541 404 => Ok(Self::Status404(raw)),
1542 498 => Ok(Self::Status498(raw)),
1543 499 => Ok(Self::Status499(raw)),
1544 497 => Ok(Self::Status497(raw)),
1545 486 => Ok(Self::Status486(raw)),
1546 478 => Ok(Self::Status478(raw)),
1547 422 => Ok(Self::Status422(raw)),
1548 _ => Err(de::Error::custom(format!(
1549 "Unexpected error code: {}",
1550 raw.error.code
1551 ))),
1552 }
1553 }
1554}
1555
1556#[derive(Debug, Clone, Serialize)]
1558#[serde(untagged)]
1559pub enum MoveCharacterError {
1560 Status498(models::ErrorResponseSchema),
1562 Status499(models::ErrorResponseSchema),
1564 Status490(models::ErrorResponseSchema),
1566 Status404(models::ErrorResponseSchema),
1568 Status486(models::ErrorResponseSchema),
1570 Status595(models::ErrorResponseSchema),
1572 Status596(models::ErrorResponseSchema),
1574 Status496(models::ErrorResponseSchema),
1576 Status422(models::ErrorResponseSchema),
1578}
1579
1580impl<'de> Deserialize<'de> for MoveCharacterError {
1581 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1582 where
1583 D: Deserializer<'de>,
1584 {
1585 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1586 match raw.error.code {
1587 498 => Ok(Self::Status498(raw)),
1588 499 => Ok(Self::Status499(raw)),
1589 490 => Ok(Self::Status490(raw)),
1590 404 => Ok(Self::Status404(raw)),
1591 486 => Ok(Self::Status486(raw)),
1592 595 => Ok(Self::Status595(raw)),
1593 596 => Ok(Self::Status596(raw)),
1594 496 => Ok(Self::Status496(raw)),
1595 422 => Ok(Self::Status422(raw)),
1596 _ => Err(de::Error::custom(format!(
1597 "Unexpected error code: {}",
1598 raw.error.code
1599 ))),
1600 }
1601 }
1602}
1603
1604#[derive(Debug, Clone, Serialize)]
1606#[serde(untagged)]
1607pub enum NpcBuyItemError {
1608 Status598(models::ErrorResponseSchema),
1610 Status498(models::ErrorResponseSchema),
1612 Status497(models::ErrorResponseSchema),
1614 Status499(models::ErrorResponseSchema),
1616 Status486(models::ErrorResponseSchema),
1618 Status492(models::ErrorResponseSchema),
1620 Status441(models::ErrorResponseSchema),
1622 Status478(models::ErrorResponseSchema),
1624 Status404(models::ErrorResponseSchema),
1626 Status422(models::ErrorResponseSchema),
1628}
1629
1630impl<'de> Deserialize<'de> for NpcBuyItemError {
1631 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1632 where
1633 D: Deserializer<'de>,
1634 {
1635 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1636 match raw.error.code {
1637 598 => Ok(Self::Status598(raw)),
1638 498 => Ok(Self::Status498(raw)),
1639 497 => Ok(Self::Status497(raw)),
1640 499 => Ok(Self::Status499(raw)),
1641 486 => Ok(Self::Status486(raw)),
1642 492 => Ok(Self::Status492(raw)),
1643 441 => Ok(Self::Status441(raw)),
1644 478 => Ok(Self::Status478(raw)),
1645 404 => Ok(Self::Status404(raw)),
1646 422 => Ok(Self::Status422(raw)),
1647 _ => Err(de::Error::custom(format!(
1648 "Unexpected error code: {}",
1649 raw.error.code
1650 ))),
1651 }
1652 }
1653}
1654
1655#[derive(Debug, Clone, Serialize)]
1657#[serde(untagged)]
1658pub enum NpcSellItemError {
1659 Status598(models::ErrorResponseSchema),
1661 Status498(models::ErrorResponseSchema),
1663 Status497(models::ErrorResponseSchema),
1665 Status499(models::ErrorResponseSchema),
1667 Status486(models::ErrorResponseSchema),
1669 Status478(models::ErrorResponseSchema),
1671 Status442(models::ErrorResponseSchema),
1673 Status404(models::ErrorResponseSchema),
1675 Status422(models::ErrorResponseSchema),
1677}
1678
1679impl<'de> Deserialize<'de> for NpcSellItemError {
1680 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1681 where
1682 D: Deserializer<'de>,
1683 {
1684 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1685 match raw.error.code {
1686 598 => Ok(Self::Status598(raw)),
1687 498 => Ok(Self::Status498(raw)),
1688 497 => Ok(Self::Status497(raw)),
1689 499 => Ok(Self::Status499(raw)),
1690 486 => Ok(Self::Status486(raw)),
1691 478 => Ok(Self::Status478(raw)),
1692 442 => Ok(Self::Status442(raw)),
1693 404 => Ok(Self::Status404(raw)),
1694 422 => Ok(Self::Status422(raw)),
1695 _ => Err(de::Error::custom(format!(
1696 "Unexpected error code: {}",
1697 raw.error.code
1698 ))),
1699 }
1700 }
1701}
1702
1703#[derive(Debug, Clone, Serialize)]
1705#[serde(untagged)]
1706pub enum RecycleError {
1707 Status404(models::ErrorResponseSchema),
1709 Status598(models::ErrorResponseSchema),
1711 Status498(models::ErrorResponseSchema),
1713 Status497(models::ErrorResponseSchema),
1715 Status499(models::ErrorResponseSchema),
1717 Status486(models::ErrorResponseSchema),
1719 Status493(models::ErrorResponseSchema),
1721 Status478(models::ErrorResponseSchema),
1723 Status492(models::ErrorResponseSchema),
1725 Status473(models::ErrorResponseSchema),
1727 Status422(models::ErrorResponseSchema),
1729}
1730
1731impl<'de> Deserialize<'de> for RecycleError {
1732 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1733 where
1734 D: Deserializer<'de>,
1735 {
1736 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1737 match raw.error.code {
1738 404 => Ok(Self::Status404(raw)),
1739 598 => Ok(Self::Status598(raw)),
1740 498 => Ok(Self::Status498(raw)),
1741 497 => Ok(Self::Status497(raw)),
1742 499 => Ok(Self::Status499(raw)),
1743 486 => Ok(Self::Status486(raw)),
1744 493 => Ok(Self::Status493(raw)),
1745 478 => Ok(Self::Status478(raw)),
1746 492 => Ok(Self::Status492(raw)),
1747 473 => Ok(Self::Status473(raw)),
1748 422 => Ok(Self::Status422(raw)),
1749 _ => Err(de::Error::custom(format!(
1750 "Unexpected error code: {}",
1751 raw.error.code
1752 ))),
1753 }
1754 }
1755}
1756
1757#[derive(Debug, Clone, Serialize)]
1759#[serde(untagged)]
1760pub enum RestCharacterError {
1761 Status498(models::ErrorResponseSchema),
1763 Status499(models::ErrorResponseSchema),
1765 Status486(models::ErrorResponseSchema),
1767 Status422(models::ErrorResponseSchema),
1769}
1770
1771impl<'de> Deserialize<'de> for RestCharacterError {
1772 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1773 where
1774 D: Deserializer<'de>,
1775 {
1776 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1777 match raw.error.code {
1778 498 => Ok(Self::Status498(raw)),
1779 499 => Ok(Self::Status499(raw)),
1780 486 => Ok(Self::Status486(raw)),
1781 422 => Ok(Self::Status422(raw)),
1782 _ => Err(de::Error::custom(format!(
1783 "Unexpected error code: {}",
1784 raw.error.code
1785 ))),
1786 }
1787 }
1788}
1789
1790#[derive(Debug, Clone, Serialize)]
1792#[serde(untagged)]
1793pub enum TaskExchangeError {
1794 Status498(models::ErrorResponseSchema),
1796 Status499(models::ErrorResponseSchema),
1798 Status486(models::ErrorResponseSchema),
1800 Status598(models::ErrorResponseSchema),
1802 Status478(models::ErrorResponseSchema),
1804 Status497(models::ErrorResponseSchema),
1806 Status422(models::ErrorResponseSchema),
1808}
1809
1810impl<'de> Deserialize<'de> for TaskExchangeError {
1811 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1812 where
1813 D: Deserializer<'de>,
1814 {
1815 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1816 match raw.error.code {
1817 498 => Ok(Self::Status498(raw)),
1818 499 => Ok(Self::Status499(raw)),
1819 486 => Ok(Self::Status486(raw)),
1820 598 => Ok(Self::Status598(raw)),
1821 478 => Ok(Self::Status478(raw)),
1822 497 => Ok(Self::Status497(raw)),
1823 422 => Ok(Self::Status422(raw)),
1824 _ => Err(de::Error::custom(format!(
1825 "Unexpected error code: {}",
1826 raw.error.code
1827 ))),
1828 }
1829 }
1830}
1831
1832#[derive(Debug, Clone, Serialize)]
1834#[serde(untagged)]
1835pub enum TaskTradeError {
1836 Status498(models::ErrorResponseSchema),
1838 Status499(models::ErrorResponseSchema),
1840 Status486(models::ErrorResponseSchema),
1842 Status598(models::ErrorResponseSchema),
1844 Status475(models::ErrorResponseSchema),
1846 Status474(models::ErrorResponseSchema),
1848 Status478(models::ErrorResponseSchema),
1850 Status422(models::ErrorResponseSchema),
1852}
1853
1854impl<'de> Deserialize<'de> for TaskTradeError {
1855 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1856 where
1857 D: Deserializer<'de>,
1858 {
1859 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1860 match raw.error.code {
1861 498 => Ok(Self::Status498(raw)),
1862 499 => Ok(Self::Status499(raw)),
1863 486 => Ok(Self::Status486(raw)),
1864 598 => Ok(Self::Status598(raw)),
1865 475 => Ok(Self::Status475(raw)),
1866 474 => Ok(Self::Status474(raw)),
1867 478 => Ok(Self::Status478(raw)),
1868 422 => Ok(Self::Status422(raw)),
1869 _ => Err(de::Error::custom(format!(
1870 "Unexpected error code: {}",
1871 raw.error.code
1872 ))),
1873 }
1874 }
1875}
1876
1877#[derive(Debug, Clone, Serialize)]
1879#[serde(untagged)]
1880pub enum UnequipItemError {
1881 Status404(models::ErrorResponseSchema),
1883 Status498(models::ErrorResponseSchema),
1885 Status486(models::ErrorResponseSchema),
1887 Status491(models::ErrorResponseSchema),
1889 Status497(models::ErrorResponseSchema),
1891 Status478(models::ErrorResponseSchema),
1893 Status483(models::ErrorResponseSchema),
1895 Status499(models::ErrorResponseSchema),
1897 Status422(models::ErrorResponseSchema),
1899}
1900
1901impl<'de> Deserialize<'de> for UnequipItemError {
1902 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1903 where
1904 D: Deserializer<'de>,
1905 {
1906 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1907 match raw.error.code {
1908 404 => Ok(Self::Status404(raw)),
1909 498 => Ok(Self::Status498(raw)),
1910 486 => Ok(Self::Status486(raw)),
1911 491 => Ok(Self::Status491(raw)),
1912 497 => Ok(Self::Status497(raw)),
1913 478 => Ok(Self::Status478(raw)),
1914 483 => Ok(Self::Status483(raw)),
1915 499 => Ok(Self::Status499(raw)),
1916 422 => Ok(Self::Status422(raw)),
1917 _ => Err(de::Error::custom(format!(
1918 "Unexpected error code: {}",
1919 raw.error.code
1920 ))),
1921 }
1922 }
1923}
1924
1925#[derive(Debug, Clone, Serialize)]
1927#[serde(untagged)]
1928pub enum UseItemError {
1929 Status404(models::ErrorResponseSchema),
1931 Status498(models::ErrorResponseSchema),
1933 Status499(models::ErrorResponseSchema),
1935 Status486(models::ErrorResponseSchema),
1937 Status476(models::ErrorResponseSchema),
1939 Status478(models::ErrorResponseSchema),
1941 Status496(models::ErrorResponseSchema),
1943 Status422(models::ErrorResponseSchema),
1945}
1946
1947impl<'de> Deserialize<'de> for UseItemError {
1948 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1949 where
1950 D: Deserializer<'de>,
1951 {
1952 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1953 match raw.error.code {
1954 404 => Ok(Self::Status404(raw)),
1955 498 => Ok(Self::Status498(raw)),
1956 499 => Ok(Self::Status499(raw)),
1957 486 => Ok(Self::Status486(raw)),
1958 476 => Ok(Self::Status476(raw)),
1959 478 => Ok(Self::Status478(raw)),
1960 496 => Ok(Self::Status496(raw)),
1961 422 => Ok(Self::Status422(raw)),
1962 _ => Err(de::Error::custom(format!(
1963 "Unexpected error code: {}",
1964 raw.error.code
1965 ))),
1966 }
1967 }
1968}
1969
1970#[derive(Debug, Clone, Serialize)]
1972#[serde(untagged)]
1973pub enum WithdrawGoldError {
1974 Status498(models::ErrorResponseSchema),
1976 Status499(models::ErrorResponseSchema),
1978 Status461(models::ErrorResponseSchema),
1980 Status486(models::ErrorResponseSchema),
1982 Status598(models::ErrorResponseSchema),
1984 Status460(models::ErrorResponseSchema),
1986 Status422(models::ErrorResponseSchema),
1988}
1989
1990impl<'de> Deserialize<'de> for WithdrawGoldError {
1991 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1992 where
1993 D: Deserializer<'de>,
1994 {
1995 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1996 match raw.error.code {
1997 498 => Ok(Self::Status498(raw)),
1998 499 => Ok(Self::Status499(raw)),
1999 461 => Ok(Self::Status461(raw)),
2000 486 => Ok(Self::Status486(raw)),
2001 598 => Ok(Self::Status598(raw)),
2002 460 => Ok(Self::Status460(raw)),
2003 422 => Ok(Self::Status422(raw)),
2004 _ => Err(de::Error::custom(format!(
2005 "Unexpected error code: {}",
2006 raw.error.code
2007 ))),
2008 }
2009 }
2010}
2011
2012#[derive(Debug, Clone, Serialize)]
2014#[serde(untagged)]
2015pub enum WithdrawItemError {
2016 Status404(models::ErrorResponseSchema),
2018 Status498(models::ErrorResponseSchema),
2020 Status499(models::ErrorResponseSchema),
2022 Status461(models::ErrorResponseSchema),
2024 Status486(models::ErrorResponseSchema),
2026 Status497(models::ErrorResponseSchema),
2028 Status598(models::ErrorResponseSchema),
2030 Status478(models::ErrorResponseSchema),
2032 Status422(models::ErrorResponseSchema),
2034}
2035
2036impl<'de> Deserialize<'de> for WithdrawItemError {
2037 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2038 where
2039 D: Deserializer<'de>,
2040 {
2041 let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
2042 match raw.error.code {
2043 404 => Ok(Self::Status404(raw)),
2044 498 => Ok(Self::Status498(raw)),
2045 499 => Ok(Self::Status499(raw)),
2046 461 => Ok(Self::Status461(raw)),
2047 486 => Ok(Self::Status486(raw)),
2048 497 => Ok(Self::Status497(raw)),
2049 598 => Ok(Self::Status598(raw)),
2050 478 => Ok(Self::Status478(raw)),
2051 422 => Ok(Self::Status422(raw)),
2052 _ => Err(de::Error::custom(format!(
2053 "Unexpected error code: {}",
2054 raw.error.code
2055 ))),
2056 }
2057 }
2058}
2059
2060pub async fn accept_new_task(
2062 configuration: &configuration::Configuration,
2063 params: AcceptNewTaskParams,
2064) -> Result<models::TaskResponseSchema, Error<AcceptNewTaskError>> {
2065 let local_var_configuration = configuration;
2066
2067 let name = params.name;
2069
2070 let local_var_client = &local_var_configuration.client;
2071
2072 let local_var_uri_str = format!(
2073 "{}/my/{name}/action/task/new",
2074 local_var_configuration.base_path,
2075 name = crate::apis::urlencode(name)
2076 );
2077 let mut local_var_req_builder =
2078 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2079
2080 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2081 local_var_req_builder =
2082 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2083 }
2084 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2085 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2086 };
2087
2088 let local_var_req = local_var_req_builder.build()?;
2089 let local_var_resp = local_var_client.execute(local_var_req).await?;
2090
2091 let local_var_status = local_var_resp.status();
2092 let local_var_content = local_var_resp.text().await?;
2093
2094 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2095 serde_json::from_str(&local_var_content).map_err(Error::from)
2096 } else {
2097 let local_var_entity: Option<AcceptNewTaskError> =
2098 serde_json::from_str(&local_var_content).ok();
2099 let local_var_error = ResponseContent {
2100 status: local_var_status,
2101 content: local_var_content,
2102 entity: local_var_entity,
2103 };
2104 Err(Error::ResponseError(local_var_error))
2105 }
2106}
2107
2108pub async fn action_transition(
2110 configuration: &configuration::Configuration,
2111 params: ActionTransitionParams,
2112) -> Result<models::CharacterTransitionResponseSchema, Error<ActionTransitionError>> {
2113 let local_var_configuration = configuration;
2114
2115 let name = params.name;
2117
2118 let local_var_client = &local_var_configuration.client;
2119
2120 let local_var_uri_str = format!(
2121 "{}/my/{name}/action/transition",
2122 local_var_configuration.base_path,
2123 name = crate::apis::urlencode(name)
2124 );
2125 let mut local_var_req_builder =
2126 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2127
2128 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2129 local_var_req_builder =
2130 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2131 }
2132 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2133 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2134 };
2135
2136 let local_var_req = local_var_req_builder.build()?;
2137 let local_var_resp = local_var_client.execute(local_var_req).await?;
2138
2139 let local_var_status = local_var_resp.status();
2140 let local_var_content = local_var_resp.text().await?;
2141
2142 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2143 serde_json::from_str(&local_var_content).map_err(Error::from)
2144 } else {
2145 let local_var_entity: Option<ActionTransitionError> =
2146 serde_json::from_str(&local_var_content).ok();
2147 let local_var_error = ResponseContent {
2148 status: local_var_status,
2149 content: local_var_content,
2150 entity: local_var_entity,
2151 };
2152 Err(Error::ResponseError(local_var_error))
2153 }
2154}
2155
2156pub async fn buy_bank_expansion(
2158 configuration: &configuration::Configuration,
2159 params: BuyBankExpansionParams,
2160) -> Result<models::BankExtensionTransactionResponseSchema, Error<BuyBankExpansionError>> {
2161 let local_var_configuration = configuration;
2162
2163 let name = params.name;
2165
2166 let local_var_client = &local_var_configuration.client;
2167
2168 let local_var_uri_str = format!(
2169 "{}/my/{name}/action/bank/buy_expansion",
2170 local_var_configuration.base_path,
2171 name = crate::apis::urlencode(name)
2172 );
2173 let mut local_var_req_builder =
2174 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2175
2176 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2177 local_var_req_builder =
2178 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2179 }
2180 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2181 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2182 };
2183
2184 let local_var_req = local_var_req_builder.build()?;
2185 let local_var_resp = local_var_client.execute(local_var_req).await?;
2186
2187 let local_var_status = local_var_resp.status();
2188 let local_var_content = local_var_resp.text().await?;
2189
2190 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2191 serde_json::from_str(&local_var_content).map_err(Error::from)
2192 } else {
2193 let local_var_entity: Option<BuyBankExpansionError> =
2194 serde_json::from_str(&local_var_content).ok();
2195 let local_var_error = ResponseContent {
2196 status: local_var_status,
2197 content: local_var_content,
2198 entity: local_var_entity,
2199 };
2200 Err(Error::ResponseError(local_var_error))
2201 }
2202}
2203
2204pub async fn cancel_task(
2206 configuration: &configuration::Configuration,
2207 params: CancelTaskParams,
2208) -> Result<models::TaskCancelledResponseSchema, Error<CancelTaskError>> {
2209 let local_var_configuration = configuration;
2210
2211 let name = params.name;
2213
2214 let local_var_client = &local_var_configuration.client;
2215
2216 let local_var_uri_str = format!(
2217 "{}/my/{name}/action/task/cancel",
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
2232 let local_var_req = local_var_req_builder.build()?;
2233 let local_var_resp = local_var_client.execute(local_var_req).await?;
2234
2235 let local_var_status = local_var_resp.status();
2236 let local_var_content = local_var_resp.text().await?;
2237
2238 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2239 serde_json::from_str(&local_var_content).map_err(Error::from)
2240 } else {
2241 let local_var_entity: Option<CancelTaskError> =
2242 serde_json::from_str(&local_var_content).ok();
2243 let local_var_error = ResponseContent {
2244 status: local_var_status,
2245 content: local_var_content,
2246 entity: local_var_entity,
2247 };
2248 Err(Error::ResponseError(local_var_error))
2249 }
2250}
2251
2252pub async fn change_skin(
2254 configuration: &configuration::Configuration,
2255 params: ChangeSkinParams,
2256) -> Result<models::ChangeSkinResponseSchema, Error<ChangeSkinError>> {
2257 let local_var_configuration = configuration;
2258
2259 let name = params.name;
2261 let change_skin_character_schema = params.change_skin_character_schema;
2263
2264 let local_var_client = &local_var_configuration.client;
2265
2266 let local_var_uri_str = format!(
2267 "{}/my/{name}/action/change_skin",
2268 local_var_configuration.base_path,
2269 name = crate::apis::urlencode(name)
2270 );
2271 let mut local_var_req_builder =
2272 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2273
2274 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2275 local_var_req_builder =
2276 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2277 }
2278 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2279 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2280 };
2281 local_var_req_builder = local_var_req_builder.json(&change_skin_character_schema);
2282
2283 let local_var_req = local_var_req_builder.build()?;
2284 let local_var_resp = local_var_client.execute(local_var_req).await?;
2285
2286 let local_var_status = local_var_resp.status();
2287 let local_var_content = local_var_resp.text().await?;
2288
2289 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2290 serde_json::from_str(&local_var_content).map_err(Error::from)
2291 } else {
2292 let local_var_entity: Option<ChangeSkinError> =
2293 serde_json::from_str(&local_var_content).ok();
2294 let local_var_error = ResponseContent {
2295 status: local_var_status,
2296 content: local_var_content,
2297 entity: local_var_entity,
2298 };
2299 Err(Error::ResponseError(local_var_error))
2300 }
2301}
2302
2303pub async fn claim_pending_item(
2305 configuration: &configuration::Configuration,
2306 params: ClaimPendingItemParams,
2307) -> Result<models::ClaimPendingItemResponseSchema, Error<ClaimPendingItemError>> {
2308 let local_var_configuration = configuration;
2309
2310 let name = params.name;
2312 let id = params.id;
2314
2315 let local_var_client = &local_var_configuration.client;
2316
2317 let local_var_uri_str = format!(
2318 "{}/my/{name}/action/claim_item/{id}",
2319 local_var_configuration.base_path,
2320 name = crate::apis::urlencode(name),
2321 id = crate::apis::urlencode(id)
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
2334 let local_var_req = local_var_req_builder.build()?;
2335 let local_var_resp = local_var_client.execute(local_var_req).await?;
2336
2337 let local_var_status = local_var_resp.status();
2338 let local_var_content = local_var_resp.text().await?;
2339
2340 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2341 serde_json::from_str(&local_var_content).map_err(Error::from)
2342 } else {
2343 let local_var_entity: Option<ClaimPendingItemError> =
2344 serde_json::from_str(&local_var_content).ok();
2345 let local_var_error = ResponseContent {
2346 status: local_var_status,
2347 content: local_var_content,
2348 entity: local_var_entity,
2349 };
2350 Err(Error::ResponseError(local_var_error))
2351 }
2352}
2353
2354pub async fn complete_task(
2356 configuration: &configuration::Configuration,
2357 params: CompleteTaskParams,
2358) -> Result<models::RewardDataResponseSchema, Error<CompleteTaskError>> {
2359 let local_var_configuration = configuration;
2360
2361 let name = params.name;
2363
2364 let local_var_client = &local_var_configuration.client;
2365
2366 let local_var_uri_str = format!(
2367 "{}/my/{name}/action/task/complete",
2368 local_var_configuration.base_path,
2369 name = crate::apis::urlencode(name)
2370 );
2371 let mut local_var_req_builder =
2372 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2373
2374 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2375 local_var_req_builder =
2376 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2377 }
2378 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2379 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2380 };
2381
2382 let local_var_req = local_var_req_builder.build()?;
2383 let local_var_resp = local_var_client.execute(local_var_req).await?;
2384
2385 let local_var_status = local_var_resp.status();
2386 let local_var_content = local_var_resp.text().await?;
2387
2388 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2389 serde_json::from_str(&local_var_content).map_err(Error::from)
2390 } else {
2391 let local_var_entity: Option<CompleteTaskError> =
2392 serde_json::from_str(&local_var_content).ok();
2393 let local_var_error = ResponseContent {
2394 status: local_var_status,
2395 content: local_var_content,
2396 entity: local_var_entity,
2397 };
2398 Err(Error::ResponseError(local_var_error))
2399 }
2400}
2401
2402pub async fn craft(
2404 configuration: &configuration::Configuration,
2405 params: CraftParams,
2406) -> Result<models::SkillResponseSchema, Error<CraftError>> {
2407 let local_var_configuration = configuration;
2408
2409 let name = params.name;
2411 let crafting_schema = params.crafting_schema;
2413
2414 let local_var_client = &local_var_configuration.client;
2415
2416 let local_var_uri_str = format!(
2417 "{}/my/{name}/action/crafting",
2418 local_var_configuration.base_path,
2419 name = crate::apis::urlencode(name)
2420 );
2421 let mut local_var_req_builder =
2422 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2423
2424 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2425 local_var_req_builder =
2426 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2427 }
2428 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2429 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2430 };
2431 local_var_req_builder = local_var_req_builder.json(&crafting_schema);
2432
2433 let local_var_req = local_var_req_builder.build()?;
2434 let local_var_resp = local_var_client.execute(local_var_req).await?;
2435
2436 let local_var_status = local_var_resp.status();
2437 let local_var_content = local_var_resp.text().await?;
2438
2439 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2440 serde_json::from_str(&local_var_content).map_err(Error::from)
2441 } else {
2442 let local_var_entity: Option<CraftError> = serde_json::from_str(&local_var_content).ok();
2443 let local_var_error = ResponseContent {
2444 status: local_var_status,
2445 content: local_var_content,
2446 entity: local_var_entity,
2447 };
2448 Err(Error::ResponseError(local_var_error))
2449 }
2450}
2451
2452pub async fn delete_item(
2454 configuration: &configuration::Configuration,
2455 params: DeleteItemParams,
2456) -> Result<models::DeleteItemResponseSchema, Error<DeleteItemError>> {
2457 let local_var_configuration = configuration;
2458
2459 let name = params.name;
2461 let simple_item_schema = params.simple_item_schema;
2463
2464 let local_var_client = &local_var_configuration.client;
2465
2466 let local_var_uri_str = format!(
2467 "{}/my/{name}/action/delete",
2468 local_var_configuration.base_path,
2469 name = crate::apis::urlencode(name)
2470 );
2471 let mut local_var_req_builder =
2472 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2473
2474 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2475 local_var_req_builder =
2476 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2477 }
2478 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2479 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2480 };
2481 local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
2482
2483 let local_var_req = local_var_req_builder.build()?;
2484 let local_var_resp = local_var_client.execute(local_var_req).await?;
2485
2486 let local_var_status = local_var_resp.status();
2487 let local_var_content = local_var_resp.text().await?;
2488
2489 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2490 serde_json::from_str(&local_var_content).map_err(Error::from)
2491 } else {
2492 let local_var_entity: Option<DeleteItemError> =
2493 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 deposit_gold(
2505 configuration: &configuration::Configuration,
2506 params: DepositGoldParams,
2507) -> Result<models::BankGoldTransactionResponseSchema, Error<DepositGoldError>> {
2508 let local_var_configuration = configuration;
2509
2510 let name = params.name;
2512 let deposit_withdraw_gold_schema = params.deposit_withdraw_gold_schema;
2514
2515 let local_var_client = &local_var_configuration.client;
2516
2517 let local_var_uri_str = format!(
2518 "{}/my/{name}/action/bank/deposit/gold",
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(&deposit_withdraw_gold_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<DepositGoldError> =
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 deposit_item(
2556 configuration: &configuration::Configuration,
2557 params: DepositItemParams,
2558) -> Result<models::BankItemTransactionResponseSchema, Error<DepositItemError>> {
2559 let local_var_configuration = configuration;
2560
2561 let name = params.name;
2563 let simple_item_schema = params.simple_item_schema;
2565
2566 let local_var_client = &local_var_configuration.client;
2567
2568 let local_var_uri_str = format!(
2569 "{}/my/{name}/action/bank/deposit/item",
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(&simple_item_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<DepositItemError> =
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 equip_item(
2607 configuration: &configuration::Configuration,
2608 params: EquipItemParams,
2609) -> Result<models::EquipmentResponseSchema, Error<EquipItemError>> {
2610 let local_var_configuration = configuration;
2611
2612 let name = params.name;
2614 let equip_schema = params.equip_schema;
2616
2617 let local_var_client = &local_var_configuration.client;
2618
2619 let local_var_uri_str = format!(
2620 "{}/my/{name}/action/equip",
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(&equip_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<EquipItemError> =
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 fight(
2658 configuration: &configuration::Configuration,
2659 params: FightParams,
2660) -> Result<models::CharacterFightResponseSchema, Error<FightError>> {
2661 let local_var_configuration = configuration;
2662
2663 let name = params.name;
2665 let fight_request_schema = params.fight_request_schema;
2667
2668 let local_var_client = &local_var_configuration.client;
2669
2670 let local_var_uri_str = format!(
2671 "{}/my/{name}/action/fight",
2672 local_var_configuration.base_path,
2673 name = crate::apis::urlencode(name)
2674 );
2675 let mut local_var_req_builder =
2676 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2677
2678 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2679 local_var_req_builder =
2680 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2681 }
2682 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2683 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2684 };
2685 local_var_req_builder = local_var_req_builder.json(&fight_request_schema);
2686
2687 let local_var_req = local_var_req_builder.build()?;
2688 let local_var_resp = local_var_client.execute(local_var_req).await?;
2689
2690 let local_var_status = local_var_resp.status();
2691 let local_var_content = local_var_resp.text().await?;
2692
2693 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2694 serde_json::from_str(&local_var_content).map_err(Error::from)
2695 } else {
2696 let local_var_entity: Option<FightError> = serde_json::from_str(&local_var_content).ok();
2697 let local_var_error = ResponseContent {
2698 status: local_var_status,
2699 content: local_var_content,
2700 entity: local_var_entity,
2701 };
2702 Err(Error::ResponseError(local_var_error))
2703 }
2704}
2705
2706pub async fn gather(
2708 configuration: &configuration::Configuration,
2709 params: GatherParams,
2710) -> Result<models::SkillResponseSchema, Error<GatherError>> {
2711 let local_var_configuration = configuration;
2712
2713 let name = params.name;
2715
2716 let local_var_client = &local_var_configuration.client;
2717
2718 let local_var_uri_str = format!(
2719 "{}/my/{name}/action/gathering",
2720 local_var_configuration.base_path,
2721 name = crate::apis::urlencode(name)
2722 );
2723 let mut local_var_req_builder =
2724 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2725
2726 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2727 local_var_req_builder =
2728 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2729 }
2730 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2731 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2732 };
2733
2734 let local_var_req = local_var_req_builder.build()?;
2735 let local_var_resp = local_var_client.execute(local_var_req).await?;
2736
2737 let local_var_status = local_var_resp.status();
2738 let local_var_content = local_var_resp.text().await?;
2739
2740 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2741 serde_json::from_str(&local_var_content).map_err(Error::from)
2742 } else {
2743 let local_var_entity: Option<GatherError> = serde_json::from_str(&local_var_content).ok();
2744 let local_var_error = ResponseContent {
2745 status: local_var_status,
2746 content: local_var_content,
2747 entity: local_var_entity,
2748 };
2749 Err(Error::ResponseError(local_var_error))
2750 }
2751}
2752
2753pub async fn ge_buy_item(
2755 configuration: &configuration::Configuration,
2756 params: GeBuyItemParams,
2757) -> Result<models::GeTransactionResponseSchema, Error<GeBuyItemError>> {
2758 let local_var_configuration = configuration;
2759
2760 let name = params.name;
2762 let ge_buy_order_schema = params.ge_buy_order_schema;
2764
2765 let local_var_client = &local_var_configuration.client;
2766
2767 let local_var_uri_str = format!(
2768 "{}/my/{name}/action/grandexchange/buy",
2769 local_var_configuration.base_path,
2770 name = crate::apis::urlencode(name)
2771 );
2772 let mut local_var_req_builder =
2773 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2774
2775 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2776 local_var_req_builder =
2777 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2778 }
2779 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2780 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2781 };
2782 local_var_req_builder = local_var_req_builder.json(&ge_buy_order_schema);
2783
2784 let local_var_req = local_var_req_builder.build()?;
2785 let local_var_resp = local_var_client.execute(local_var_req).await?;
2786
2787 let local_var_status = local_var_resp.status();
2788 let local_var_content = local_var_resp.text().await?;
2789
2790 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2791 serde_json::from_str(&local_var_content).map_err(Error::from)
2792 } else {
2793 let local_var_entity: Option<GeBuyItemError> =
2794 serde_json::from_str(&local_var_content).ok();
2795 let local_var_error = ResponseContent {
2796 status: local_var_status,
2797 content: local_var_content,
2798 entity: local_var_entity,
2799 };
2800 Err(Error::ResponseError(local_var_error))
2801 }
2802}
2803
2804pub async fn ge_cancel_order(
2806 configuration: &configuration::Configuration,
2807 params: GeCancelOrderParams,
2808) -> Result<models::GeTransactionResponseSchema, Error<GeCancelOrderError>> {
2809 let local_var_configuration = configuration;
2810
2811 let name = params.name;
2813 let ge_cancel_order_schema = params.ge_cancel_order_schema;
2815
2816 let local_var_client = &local_var_configuration.client;
2817
2818 let local_var_uri_str = format!(
2819 "{}/my/{name}/action/grandexchange/cancel",
2820 local_var_configuration.base_path,
2821 name = crate::apis::urlencode(name)
2822 );
2823 let mut local_var_req_builder =
2824 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2825
2826 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2827 local_var_req_builder =
2828 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2829 }
2830 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2831 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2832 };
2833 local_var_req_builder = local_var_req_builder.json(&ge_cancel_order_schema);
2834
2835 let local_var_req = local_var_req_builder.build()?;
2836 let local_var_resp = local_var_client.execute(local_var_req).await?;
2837
2838 let local_var_status = local_var_resp.status();
2839 let local_var_content = local_var_resp.text().await?;
2840
2841 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2842 serde_json::from_str(&local_var_content).map_err(Error::from)
2843 } else {
2844 let local_var_entity: Option<GeCancelOrderError> =
2845 serde_json::from_str(&local_var_content).ok();
2846 let local_var_error = ResponseContent {
2847 status: local_var_status,
2848 content: local_var_content,
2849 entity: local_var_entity,
2850 };
2851 Err(Error::ResponseError(local_var_error))
2852 }
2853}
2854
2855pub async fn ge_create_buy_order(
2857 configuration: &configuration::Configuration,
2858 params: GeCreateBuyOrderParams,
2859) -> Result<models::GeCreateOrderTransactionResponseSchema, Error<GeCreateBuyOrderError>> {
2860 let local_var_configuration = configuration;
2861
2862 let name = params.name;
2864 let ge_buy_order_creation_schema = params.ge_buy_order_creation_schema;
2866
2867 let local_var_client = &local_var_configuration.client;
2868
2869 let local_var_uri_str = format!(
2870 "{}/my/{name}/action/grandexchange/create_buy_order",
2871 local_var_configuration.base_path,
2872 name = crate::apis::urlencode(name)
2873 );
2874 let mut local_var_req_builder =
2875 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2876
2877 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2878 local_var_req_builder =
2879 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2880 }
2881 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2882 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2883 };
2884 local_var_req_builder = local_var_req_builder.json(&ge_buy_order_creation_schema);
2885
2886 let local_var_req = local_var_req_builder.build()?;
2887 let local_var_resp = local_var_client.execute(local_var_req).await?;
2888
2889 let local_var_status = local_var_resp.status();
2890 let local_var_content = local_var_resp.text().await?;
2891
2892 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2893 serde_json::from_str(&local_var_content).map_err(Error::from)
2894 } else {
2895 let local_var_entity: Option<GeCreateBuyOrderError> =
2896 serde_json::from_str(&local_var_content).ok();
2897 let local_var_error = ResponseContent {
2898 status: local_var_status,
2899 content: local_var_content,
2900 entity: local_var_entity,
2901 };
2902 Err(Error::ResponseError(local_var_error))
2903 }
2904}
2905
2906pub async fn ge_create_sell_order(
2908 configuration: &configuration::Configuration,
2909 params: GeCreateSellOrderParams,
2910) -> Result<models::GeCreateOrderTransactionResponseSchema, Error<GeCreateSellOrderError>> {
2911 let local_var_configuration = configuration;
2912
2913 let name = params.name;
2915 let ge_order_creation_schema = params.ge_order_creation_schema;
2917
2918 let local_var_client = &local_var_configuration.client;
2919
2920 let local_var_uri_str = format!(
2921 "{}/my/{name}/action/grandexchange/create_sell_order",
2922 local_var_configuration.base_path,
2923 name = crate::apis::urlencode(name)
2924 );
2925 let mut local_var_req_builder =
2926 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2927
2928 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2929 local_var_req_builder =
2930 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2931 }
2932 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2933 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2934 };
2935 local_var_req_builder = local_var_req_builder.json(&ge_order_creation_schema);
2936
2937 let local_var_req = local_var_req_builder.build()?;
2938 let local_var_resp = local_var_client.execute(local_var_req).await?;
2939
2940 let local_var_status = local_var_resp.status();
2941 let local_var_content = local_var_resp.text().await?;
2942
2943 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2944 serde_json::from_str(&local_var_content).map_err(Error::from)
2945 } else {
2946 let local_var_entity: Option<GeCreateSellOrderError> =
2947 serde_json::from_str(&local_var_content).ok();
2948 let local_var_error = ResponseContent {
2949 status: local_var_status,
2950 content: local_var_content,
2951 entity: local_var_entity,
2952 };
2953 Err(Error::ResponseError(local_var_error))
2954 }
2955}
2956
2957pub async fn ge_fill_order(
2959 configuration: &configuration::Configuration,
2960 params: GeFillOrderParams,
2961) -> Result<models::GeTransactionResponseSchema, Error<GeFillOrderError>> {
2962 let local_var_configuration = configuration;
2963
2964 let name = params.name;
2966 let ge_fill_buy_order_schema = params.ge_fill_buy_order_schema;
2968
2969 let local_var_client = &local_var_configuration.client;
2970
2971 let local_var_uri_str = format!(
2972 "{}/my/{name}/action/grandexchange/fill",
2973 local_var_configuration.base_path,
2974 name = crate::apis::urlencode(name)
2975 );
2976 let mut local_var_req_builder =
2977 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2978
2979 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2980 local_var_req_builder =
2981 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2982 }
2983 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2984 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2985 };
2986 local_var_req_builder = local_var_req_builder.json(&ge_fill_buy_order_schema);
2987
2988 let local_var_req = local_var_req_builder.build()?;
2989 let local_var_resp = local_var_client.execute(local_var_req).await?;
2990
2991 let local_var_status = local_var_resp.status();
2992 let local_var_content = local_var_resp.text().await?;
2993
2994 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2995 serde_json::from_str(&local_var_content).map_err(Error::from)
2996 } else {
2997 let local_var_entity: Option<GeFillOrderError> =
2998 serde_json::from_str(&local_var_content).ok();
2999 let local_var_error = ResponseContent {
3000 status: local_var_status,
3001 content: local_var_content,
3002 entity: local_var_entity,
3003 };
3004 Err(Error::ResponseError(local_var_error))
3005 }
3006}
3007
3008pub async fn get_all_characters_logs(
3010 configuration: &configuration::Configuration,
3011 params: GetAllCharactersLogsParams,
3012) -> Result<models::DataPageLogSchema, Error<GetAllCharactersLogsError>> {
3013 let local_var_configuration = configuration;
3014
3015 let page = params.page;
3017 let size = params.size;
3019
3020 let local_var_client = &local_var_configuration.client;
3021
3022 let local_var_uri_str = format!("{}/my/logs", local_var_configuration.base_path);
3023 let mut local_var_req_builder =
3024 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3025
3026 if let Some(ref local_var_str) = page {
3027 local_var_req_builder =
3028 local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
3029 }
3030 if let Some(ref local_var_str) = size {
3031 local_var_req_builder =
3032 local_var_req_builder.query(&[("size", &local_var_str.to_string())]);
3033 }
3034 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3035 local_var_req_builder =
3036 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3037 }
3038 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3039 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3040 };
3041
3042 let local_var_req = local_var_req_builder.build()?;
3043 let local_var_resp = local_var_client.execute(local_var_req).await?;
3044
3045 let local_var_status = local_var_resp.status();
3046 let local_var_content = local_var_resp.text().await?;
3047
3048 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3049 serde_json::from_str(&local_var_content).map_err(Error::from)
3050 } else {
3051 let local_var_entity: Option<GetAllCharactersLogsError> =
3052 serde_json::from_str(&local_var_content).ok();
3053 let local_var_error = ResponseContent {
3054 status: local_var_status,
3055 content: local_var_content,
3056 entity: local_var_entity,
3057 };
3058 Err(Error::ResponseError(local_var_error))
3059 }
3060}
3061
3062pub async fn get_character_logs(
3064 configuration: &configuration::Configuration,
3065 params: GetCharacterLogsParams,
3066) -> Result<models::DataPageLogSchema, Error<GetCharacterLogsError>> {
3067 let local_var_configuration = configuration;
3068
3069 let name = params.name;
3071 let page = params.page;
3073 let size = params.size;
3075
3076 let local_var_client = &local_var_configuration.client;
3077
3078 let local_var_uri_str = format!(
3079 "{}/my/logs/{name}",
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::GET, local_var_uri_str.as_str());
3085
3086 if let Some(ref local_var_str) = page {
3087 local_var_req_builder =
3088 local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
3089 }
3090 if let Some(ref local_var_str) = size {
3091 local_var_req_builder =
3092 local_var_req_builder.query(&[("size", &local_var_str.to_string())]);
3093 }
3094 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3095 local_var_req_builder =
3096 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3097 }
3098 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3099 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3100 };
3101
3102 let local_var_req = local_var_req_builder.build()?;
3103 let local_var_resp = local_var_client.execute(local_var_req).await?;
3104
3105 let local_var_status = local_var_resp.status();
3106 let local_var_content = local_var_resp.text().await?;
3107
3108 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3109 serde_json::from_str(&local_var_content).map_err(Error::from)
3110 } else {
3111 let local_var_entity: Option<GetCharacterLogsError> =
3112 serde_json::from_str(&local_var_content).ok();
3113 let local_var_error = ResponseContent {
3114 status: local_var_status,
3115 content: local_var_content,
3116 entity: local_var_entity,
3117 };
3118 Err(Error::ResponseError(local_var_error))
3119 }
3120}
3121
3122pub async fn get_my_characters(
3124 configuration: &configuration::Configuration,
3125) -> Result<models::MyCharactersListSchema, Error<GetMyCharactersError>> {
3126 let local_var_configuration = configuration;
3127
3128 let local_var_client = &local_var_configuration.client;
3129
3130 let local_var_uri_str = format!("{}/my/characters", local_var_configuration.base_path);
3131 let mut local_var_req_builder =
3132 local_var_client.request(reqwest::Method::GET, 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<GetMyCharactersError> =
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 give_gold(
3164 configuration: &configuration::Configuration,
3165 params: GiveGoldParams,
3166) -> Result<models::GiveGoldResponseSchema, Error<GiveGoldError>> {
3167 let local_var_configuration = configuration;
3168
3169 let name = params.name;
3171 let give_gold_schema = params.give_gold_schema;
3173
3174 let local_var_client = &local_var_configuration.client;
3175
3176 let local_var_uri_str = format!(
3177 "{}/my/{name}/action/give/gold",
3178 local_var_configuration.base_path,
3179 name = crate::apis::urlencode(name)
3180 );
3181 let mut local_var_req_builder =
3182 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3183
3184 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3185 local_var_req_builder =
3186 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3187 }
3188 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3189 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3190 };
3191 local_var_req_builder = local_var_req_builder.json(&give_gold_schema);
3192
3193 let local_var_req = local_var_req_builder.build()?;
3194 let local_var_resp = local_var_client.execute(local_var_req).await?;
3195
3196 let local_var_status = local_var_resp.status();
3197 let local_var_content = local_var_resp.text().await?;
3198
3199 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3200 serde_json::from_str(&local_var_content).map_err(Error::from)
3201 } else {
3202 let local_var_entity: Option<GiveGoldError> = serde_json::from_str(&local_var_content).ok();
3203 let local_var_error = ResponseContent {
3204 status: local_var_status,
3205 content: local_var_content,
3206 entity: local_var_entity,
3207 };
3208 Err(Error::ResponseError(local_var_error))
3209 }
3210}
3211
3212pub async fn give_items(
3214 configuration: &configuration::Configuration,
3215 params: GiveItemsParams,
3216) -> Result<models::GiveItemResponseSchema, Error<GiveItemsError>> {
3217 let local_var_configuration = configuration;
3218
3219 let name = params.name;
3221 let give_items_schema = params.give_items_schema;
3223
3224 let local_var_client = &local_var_configuration.client;
3225
3226 let local_var_uri_str = format!(
3227 "{}/my/{name}/action/give/item",
3228 local_var_configuration.base_path,
3229 name = crate::apis::urlencode(name)
3230 );
3231 let mut local_var_req_builder =
3232 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3233
3234 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3235 local_var_req_builder =
3236 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3237 }
3238 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3239 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3240 };
3241 local_var_req_builder = local_var_req_builder.json(&give_items_schema);
3242
3243 let local_var_req = local_var_req_builder.build()?;
3244 let local_var_resp = local_var_client.execute(local_var_req).await?;
3245
3246 let local_var_status = local_var_resp.status();
3247 let local_var_content = local_var_resp.text().await?;
3248
3249 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3250 serde_json::from_str(&local_var_content).map_err(Error::from)
3251 } else {
3252 let local_var_entity: Option<GiveItemsError> =
3253 serde_json::from_str(&local_var_content).ok();
3254 let local_var_error = ResponseContent {
3255 status: local_var_status,
3256 content: local_var_content,
3257 entity: local_var_entity,
3258 };
3259 Err(Error::ResponseError(local_var_error))
3260 }
3261}
3262
3263pub async fn move_character(
3265 configuration: &configuration::Configuration,
3266 params: MoveCharacterParams,
3267) -> Result<models::CharacterMovementResponseSchema, Error<MoveCharacterError>> {
3268 let local_var_configuration = configuration;
3269
3270 let name = params.name;
3272 let destination_schema = params.destination_schema;
3274
3275 let local_var_client = &local_var_configuration.client;
3276
3277 let local_var_uri_str = format!(
3278 "{}/my/{name}/action/move",
3279 local_var_configuration.base_path,
3280 name = crate::apis::urlencode(name)
3281 );
3282 let mut local_var_req_builder =
3283 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3284
3285 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3286 local_var_req_builder =
3287 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3288 }
3289 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3290 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3291 };
3292 local_var_req_builder = local_var_req_builder.json(&destination_schema);
3293
3294 let local_var_req = local_var_req_builder.build()?;
3295 let local_var_resp = local_var_client.execute(local_var_req).await?;
3296
3297 let local_var_status = local_var_resp.status();
3298 let local_var_content = local_var_resp.text().await?;
3299
3300 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3301 serde_json::from_str(&local_var_content).map_err(Error::from)
3302 } else {
3303 let local_var_entity: Option<MoveCharacterError> =
3304 serde_json::from_str(&local_var_content).ok();
3305 let local_var_error = ResponseContent {
3306 status: local_var_status,
3307 content: local_var_content,
3308 entity: local_var_entity,
3309 };
3310 Err(Error::ResponseError(local_var_error))
3311 }
3312}
3313
3314pub async fn npc_buy_item(
3316 configuration: &configuration::Configuration,
3317 params: NpcBuyItemParams,
3318) -> Result<models::NpcMerchantTransactionResponseSchema, Error<NpcBuyItemError>> {
3319 let local_var_configuration = configuration;
3320
3321 let name = params.name;
3323 let npc_merchant_buy_schema = params.npc_merchant_buy_schema;
3325
3326 let local_var_client = &local_var_configuration.client;
3327
3328 let local_var_uri_str = format!(
3329 "{}/my/{name}/action/npc/buy",
3330 local_var_configuration.base_path,
3331 name = crate::apis::urlencode(name)
3332 );
3333 let mut local_var_req_builder =
3334 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3335
3336 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3337 local_var_req_builder =
3338 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3339 }
3340 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3341 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3342 };
3343 local_var_req_builder = local_var_req_builder.json(&npc_merchant_buy_schema);
3344
3345 let local_var_req = local_var_req_builder.build()?;
3346 let local_var_resp = local_var_client.execute(local_var_req).await?;
3347
3348 let local_var_status = local_var_resp.status();
3349 let local_var_content = local_var_resp.text().await?;
3350
3351 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3352 serde_json::from_str(&local_var_content).map_err(Error::from)
3353 } else {
3354 let local_var_entity: Option<NpcBuyItemError> =
3355 serde_json::from_str(&local_var_content).ok();
3356 let local_var_error = ResponseContent {
3357 status: local_var_status,
3358 content: local_var_content,
3359 entity: local_var_entity,
3360 };
3361 Err(Error::ResponseError(local_var_error))
3362 }
3363}
3364
3365pub async fn npc_sell_item(
3367 configuration: &configuration::Configuration,
3368 params: NpcSellItemParams,
3369) -> Result<models::NpcMerchantTransactionResponseSchema, Error<NpcSellItemError>> {
3370 let local_var_configuration = configuration;
3371
3372 let name = params.name;
3374 let npc_merchant_buy_schema = params.npc_merchant_buy_schema;
3376
3377 let local_var_client = &local_var_configuration.client;
3378
3379 let local_var_uri_str = format!(
3380 "{}/my/{name}/action/npc/sell",
3381 local_var_configuration.base_path,
3382 name = crate::apis::urlencode(name)
3383 );
3384 let mut local_var_req_builder =
3385 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3386
3387 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3388 local_var_req_builder =
3389 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3390 }
3391 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3392 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3393 };
3394 local_var_req_builder = local_var_req_builder.json(&npc_merchant_buy_schema);
3395
3396 let local_var_req = local_var_req_builder.build()?;
3397 let local_var_resp = local_var_client.execute(local_var_req).await?;
3398
3399 let local_var_status = local_var_resp.status();
3400 let local_var_content = local_var_resp.text().await?;
3401
3402 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3403 serde_json::from_str(&local_var_content).map_err(Error::from)
3404 } else {
3405 let local_var_entity: Option<NpcSellItemError> =
3406 serde_json::from_str(&local_var_content).ok();
3407 let local_var_error = ResponseContent {
3408 status: local_var_status,
3409 content: local_var_content,
3410 entity: local_var_entity,
3411 };
3412 Err(Error::ResponseError(local_var_error))
3413 }
3414}
3415
3416pub async fn recycle(
3418 configuration: &configuration::Configuration,
3419 params: RecycleParams,
3420) -> Result<models::RecyclingResponseSchema, Error<RecycleError>> {
3421 let local_var_configuration = configuration;
3422
3423 let name = params.name;
3425 let recycling_schema = params.recycling_schema;
3427
3428 let local_var_client = &local_var_configuration.client;
3429
3430 let local_var_uri_str = format!(
3431 "{}/my/{name}/action/recycling",
3432 local_var_configuration.base_path,
3433 name = crate::apis::urlencode(name)
3434 );
3435 let mut local_var_req_builder =
3436 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3437
3438 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3439 local_var_req_builder =
3440 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3441 }
3442 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3443 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3444 };
3445 local_var_req_builder = local_var_req_builder.json(&recycling_schema);
3446
3447 let local_var_req = local_var_req_builder.build()?;
3448 let local_var_resp = local_var_client.execute(local_var_req).await?;
3449
3450 let local_var_status = local_var_resp.status();
3451 let local_var_content = local_var_resp.text().await?;
3452
3453 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3454 serde_json::from_str(&local_var_content).map_err(Error::from)
3455 } else {
3456 let local_var_entity: Option<RecycleError> = serde_json::from_str(&local_var_content).ok();
3457 let local_var_error = ResponseContent {
3458 status: local_var_status,
3459 content: local_var_content,
3460 entity: local_var_entity,
3461 };
3462 Err(Error::ResponseError(local_var_error))
3463 }
3464}
3465
3466pub async fn rest_character(
3468 configuration: &configuration::Configuration,
3469 params: RestCharacterParams,
3470) -> Result<models::CharacterRestResponseSchema, Error<RestCharacterError>> {
3471 let local_var_configuration = configuration;
3472
3473 let name = params.name;
3475
3476 let local_var_client = &local_var_configuration.client;
3477
3478 let local_var_uri_str = format!(
3479 "{}/my/{name}/action/rest",
3480 local_var_configuration.base_path,
3481 name = crate::apis::urlencode(name)
3482 );
3483 let mut local_var_req_builder =
3484 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3485
3486 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3487 local_var_req_builder =
3488 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3489 }
3490 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3491 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3492 };
3493
3494 let local_var_req = local_var_req_builder.build()?;
3495 let local_var_resp = local_var_client.execute(local_var_req).await?;
3496
3497 let local_var_status = local_var_resp.status();
3498 let local_var_content = local_var_resp.text().await?;
3499
3500 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3501 serde_json::from_str(&local_var_content).map_err(Error::from)
3502 } else {
3503 let local_var_entity: Option<RestCharacterError> =
3504 serde_json::from_str(&local_var_content).ok();
3505 let local_var_error = ResponseContent {
3506 status: local_var_status,
3507 content: local_var_content,
3508 entity: local_var_entity,
3509 };
3510 Err(Error::ResponseError(local_var_error))
3511 }
3512}
3513
3514pub async fn task_exchange(
3516 configuration: &configuration::Configuration,
3517 params: TaskExchangeParams,
3518) -> Result<models::RewardDataResponseSchema, Error<TaskExchangeError>> {
3519 let local_var_configuration = configuration;
3520
3521 let name = params.name;
3523
3524 let local_var_client = &local_var_configuration.client;
3525
3526 let local_var_uri_str = format!(
3527 "{}/my/{name}/action/task/exchange",
3528 local_var_configuration.base_path,
3529 name = crate::apis::urlencode(name)
3530 );
3531 let mut local_var_req_builder =
3532 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3533
3534 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3535 local_var_req_builder =
3536 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3537 }
3538 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3539 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3540 };
3541
3542 let local_var_req = local_var_req_builder.build()?;
3543 let local_var_resp = local_var_client.execute(local_var_req).await?;
3544
3545 let local_var_status = local_var_resp.status();
3546 let local_var_content = local_var_resp.text().await?;
3547
3548 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3549 serde_json::from_str(&local_var_content).map_err(Error::from)
3550 } else {
3551 let local_var_entity: Option<TaskExchangeError> =
3552 serde_json::from_str(&local_var_content).ok();
3553 let local_var_error = ResponseContent {
3554 status: local_var_status,
3555 content: local_var_content,
3556 entity: local_var_entity,
3557 };
3558 Err(Error::ResponseError(local_var_error))
3559 }
3560}
3561
3562pub async fn task_trade(
3564 configuration: &configuration::Configuration,
3565 params: TaskTradeParams,
3566) -> Result<models::TaskTradeResponseSchema, Error<TaskTradeError>> {
3567 let local_var_configuration = configuration;
3568
3569 let name = params.name;
3571 let simple_item_schema = params.simple_item_schema;
3573
3574 let local_var_client = &local_var_configuration.client;
3575
3576 let local_var_uri_str = format!(
3577 "{}/my/{name}/action/task/trade",
3578 local_var_configuration.base_path,
3579 name = crate::apis::urlencode(name)
3580 );
3581 let mut local_var_req_builder =
3582 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3583
3584 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3585 local_var_req_builder =
3586 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3587 }
3588 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3589 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3590 };
3591 local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
3592
3593 let local_var_req = local_var_req_builder.build()?;
3594 let local_var_resp = local_var_client.execute(local_var_req).await?;
3595
3596 let local_var_status = local_var_resp.status();
3597 let local_var_content = local_var_resp.text().await?;
3598
3599 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3600 serde_json::from_str(&local_var_content).map_err(Error::from)
3601 } else {
3602 let local_var_entity: Option<TaskTradeError> =
3603 serde_json::from_str(&local_var_content).ok();
3604 let local_var_error = ResponseContent {
3605 status: local_var_status,
3606 content: local_var_content,
3607 entity: local_var_entity,
3608 };
3609 Err(Error::ResponseError(local_var_error))
3610 }
3611}
3612
3613pub async fn unequip_item(
3615 configuration: &configuration::Configuration,
3616 params: UnequipItemParams,
3617) -> Result<models::EquipmentResponseSchema, Error<UnequipItemError>> {
3618 let local_var_configuration = configuration;
3619
3620 let name = params.name;
3622 let unequip_schema = params.unequip_schema;
3624
3625 let local_var_client = &local_var_configuration.client;
3626
3627 let local_var_uri_str = format!(
3628 "{}/my/{name}/action/unequip",
3629 local_var_configuration.base_path,
3630 name = crate::apis::urlencode(name)
3631 );
3632 let mut local_var_req_builder =
3633 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3634
3635 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3636 local_var_req_builder =
3637 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3638 }
3639 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3640 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3641 };
3642 local_var_req_builder = local_var_req_builder.json(&unequip_schema);
3643
3644 let local_var_req = local_var_req_builder.build()?;
3645 let local_var_resp = local_var_client.execute(local_var_req).await?;
3646
3647 let local_var_status = local_var_resp.status();
3648 let local_var_content = local_var_resp.text().await?;
3649
3650 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3651 serde_json::from_str(&local_var_content).map_err(Error::from)
3652 } else {
3653 let local_var_entity: Option<UnequipItemError> =
3654 serde_json::from_str(&local_var_content).ok();
3655 let local_var_error = ResponseContent {
3656 status: local_var_status,
3657 content: local_var_content,
3658 entity: local_var_entity,
3659 };
3660 Err(Error::ResponseError(local_var_error))
3661 }
3662}
3663
3664pub async fn use_item(
3666 configuration: &configuration::Configuration,
3667 params: UseItemParams,
3668) -> Result<models::UseItemResponseSchema, Error<UseItemError>> {
3669 let local_var_configuration = configuration;
3670
3671 let name = params.name;
3673 let simple_item_schema = params.simple_item_schema;
3675
3676 let local_var_client = &local_var_configuration.client;
3677
3678 let local_var_uri_str = format!(
3679 "{}/my/{name}/action/use",
3680 local_var_configuration.base_path,
3681 name = crate::apis::urlencode(name)
3682 );
3683 let mut local_var_req_builder =
3684 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3685
3686 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3687 local_var_req_builder =
3688 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3689 }
3690 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3691 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3692 };
3693 local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
3694
3695 let local_var_req = local_var_req_builder.build()?;
3696 let local_var_resp = local_var_client.execute(local_var_req).await?;
3697
3698 let local_var_status = local_var_resp.status();
3699 let local_var_content = local_var_resp.text().await?;
3700
3701 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3702 serde_json::from_str(&local_var_content).map_err(Error::from)
3703 } else {
3704 let local_var_entity: Option<UseItemError> = serde_json::from_str(&local_var_content).ok();
3705 let local_var_error = ResponseContent {
3706 status: local_var_status,
3707 content: local_var_content,
3708 entity: local_var_entity,
3709 };
3710 Err(Error::ResponseError(local_var_error))
3711 }
3712}
3713
3714pub async fn withdraw_gold(
3716 configuration: &configuration::Configuration,
3717 params: WithdrawGoldParams,
3718) -> Result<models::BankGoldTransactionResponseSchema, Error<WithdrawGoldError>> {
3719 let local_var_configuration = configuration;
3720
3721 let name = params.name;
3723 let deposit_withdraw_gold_schema = params.deposit_withdraw_gold_schema;
3725
3726 let local_var_client = &local_var_configuration.client;
3727
3728 let local_var_uri_str = format!(
3729 "{}/my/{name}/action/bank/withdraw/gold",
3730 local_var_configuration.base_path,
3731 name = crate::apis::urlencode(name)
3732 );
3733 let mut local_var_req_builder =
3734 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3735
3736 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3737 local_var_req_builder =
3738 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3739 }
3740 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3741 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3742 };
3743 local_var_req_builder = local_var_req_builder.json(&deposit_withdraw_gold_schema);
3744
3745 let local_var_req = local_var_req_builder.build()?;
3746 let local_var_resp = local_var_client.execute(local_var_req).await?;
3747
3748 let local_var_status = local_var_resp.status();
3749 let local_var_content = local_var_resp.text().await?;
3750
3751 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3752 serde_json::from_str(&local_var_content).map_err(Error::from)
3753 } else {
3754 let local_var_entity: Option<WithdrawGoldError> =
3755 serde_json::from_str(&local_var_content).ok();
3756 let local_var_error = ResponseContent {
3757 status: local_var_status,
3758 content: local_var_content,
3759 entity: local_var_entity,
3760 };
3761 Err(Error::ResponseError(local_var_error))
3762 }
3763}
3764
3765pub async fn withdraw_item(
3767 configuration: &configuration::Configuration,
3768 params: WithdrawItemParams,
3769) -> Result<models::BankItemTransactionResponseSchema, Error<WithdrawItemError>> {
3770 let local_var_configuration = configuration;
3771
3772 let name = params.name;
3774 let simple_item_schema = params.simple_item_schema;
3776
3777 let local_var_client = &local_var_configuration.client;
3778
3779 let local_var_uri_str = format!(
3780 "{}/my/{name}/action/bank/withdraw/item",
3781 local_var_configuration.base_path,
3782 name = crate::apis::urlencode(name)
3783 );
3784 let mut local_var_req_builder =
3785 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3786
3787 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3788 local_var_req_builder =
3789 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3790 }
3791 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3792 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3793 };
3794 local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
3795
3796 let local_var_req = local_var_req_builder.build()?;
3797 let local_var_resp = local_var_client.execute(local_var_req).await?;
3798
3799 let local_var_status = local_var_resp.status();
3800 let local_var_content = local_var_resp.text().await?;
3801
3802 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3803 serde_json::from_str(&local_var_content).map_err(Error::from)
3804 } else {
3805 let local_var_entity: Option<WithdrawItemError> =
3806 serde_json::from_str(&local_var_content).ok();
3807 let local_var_error = ResponseContent {
3808 status: local_var_status,
3809 content: local_var_content,
3810 entity: local_var_entity,
3811 };
3812 Err(Error::ResponseError(local_var_error))
3813 }
3814}