Skip to main content

artifacts/apis/
my_characters_api.rs

1use super::{configuration, Error};
2use crate::{apis::ResponseContent, models};
3use reqwest::StatusCode;
4use serde::{de, Deserialize, Deserializer, Serialize};
5
6/// struct for passing parameters to the method [`accept_new_task`]
7#[derive(Clone, Debug)]
8pub struct AcceptNewTaskParams {
9    /// Name of your character.
10    pub name: String,
11}
12
13impl AcceptNewTaskParams {
14    pub fn new(name: String) -> Self {
15        Self { name }
16    }
17}
18
19/// struct for passing parameters to the method [`action_transition`]
20#[derive(Clone, Debug)]
21pub struct ActionTransitionParams {
22    /// Name of your character.
23    pub name: String,
24}
25
26impl ActionTransitionParams {
27    pub fn new(name: String) -> Self {
28        Self { name }
29    }
30}
31
32/// struct for passing parameters to the method [`buy_bank_expansion`]
33#[derive(Clone, Debug)]
34pub struct BuyBankExpansionParams {
35    /// Name of your character.
36    pub name: String,
37}
38
39impl BuyBankExpansionParams {
40    pub fn new(name: String) -> Self {
41        Self { name }
42    }
43}
44
45/// struct for passing parameters to the method [`cancel_task`]
46#[derive(Clone, Debug)]
47pub struct CancelTaskParams {
48    /// Name of your character.
49    pub name: String,
50}
51
52impl CancelTaskParams {
53    pub fn new(name: String) -> Self {
54        Self { name }
55    }
56}
57
58/// struct for passing parameters to the method [`change_skin`]
59#[derive(Clone, Debug)]
60pub struct ChangeSkinParams {
61    /// Name of your character.
62    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/// struct for passing parameters to the method [`claim_pending_item`]
79#[derive(Clone, Debug)]
80pub struct ClaimPendingItemParams {
81    /// Name of your character.
82    pub name: String,
83    /// The ID of the pending item to claim.
84    pub id: String,
85}
86
87impl ClaimPendingItemParams {
88    pub fn new(name: String, id: String) -> Self {
89        Self { name, id }
90    }
91}
92
93/// struct for passing parameters to the method [`complete_task`]
94#[derive(Clone, Debug)]
95pub struct CompleteTaskParams {
96    /// Name of your character.
97    pub name: String,
98}
99
100impl CompleteTaskParams {
101    pub fn new(name: String) -> Self {
102        Self { name }
103    }
104}
105
106/// struct for passing parameters to the method [`craft`]
107#[derive(Clone, Debug)]
108pub struct CraftParams {
109    /// Name of your character.
110    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/// struct for passing parameters to the method [`delete_item`]
124#[derive(Clone, Debug)]
125pub struct DeleteItemParams {
126    /// Name of your character.
127    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/// struct for passing parameters to the method [`deposit_gold`]
141#[derive(Clone, Debug)]
142pub struct DepositGoldParams {
143    /// Name of your character.
144    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/// struct for passing parameters to the method [`deposit_item`]
161#[derive(Clone, Debug)]
162pub struct DepositItemParams {
163    /// Name of your character.
164    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/// struct for passing parameters to the method [`equip_item`]
178#[derive(Clone, Debug)]
179pub struct EquipItemParams {
180    /// Name of your character.
181    pub name: String,
182    pub equip_schema: models::EquipSchema,
183}
184
185impl EquipItemParams {
186    pub fn new(name: String, equip_schema: models::EquipSchema) -> Self {
187        Self { name, equip_schema }
188    }
189}
190
191/// struct for passing parameters to the method [`fight`]
192#[derive(Clone, Debug)]
193pub struct FightParams {
194    /// Name of your character.
195    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/// struct for passing parameters to the method [`gather`]
209#[derive(Clone, Debug)]
210pub struct GatherParams {
211    /// Name of your character.
212    pub name: String,
213}
214
215impl GatherParams {
216    pub fn new(name: String) -> Self {
217        Self { name }
218    }
219}
220
221/// struct for passing parameters to the method [`ge_buy_item`]
222#[derive(Clone, Debug)]
223pub struct GeBuyItemParams {
224    /// Name of your character.
225    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/// struct for passing parameters to the method [`ge_cancel_order`]
239#[derive(Clone, Debug)]
240pub struct GeCancelOrderParams {
241    /// Name of your character.
242    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/// struct for passing parameters to the method [`ge_create_buy_order`]
256#[derive(Clone, Debug)]
257pub struct GeCreateBuyOrderParams {
258    /// Name of your character.
259    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/// struct for passing parameters to the method [`ge_create_sell_order`]
276#[derive(Clone, Debug)]
277pub struct GeCreateSellOrderParams {
278    /// Name of your character.
279    pub name: String,
280    pub ge_order_creationr_schema: models::GeOrderCreationrSchema,
281}
282
283impl GeCreateSellOrderParams {
284    pub fn new(name: String, ge_order_creationr_schema: models::GeOrderCreationrSchema) -> Self {
285        Self {
286            name,
287            ge_order_creationr_schema,
288        }
289    }
290}
291
292/// struct for passing parameters to the method [`ge_fill_order`]
293#[derive(Clone, Debug)]
294pub struct GeFillOrderParams {
295    /// Name of your character.
296    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/// struct for passing parameters to the method [`get_all_characters_logs`]
310#[derive(Clone, Debug)]
311pub struct GetAllCharactersLogsParams {
312    /// Page number
313    pub page: Option<u32>,
314    /// Page size
315    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/// struct for passing parameters to the method [`get_character_logs`]
325#[derive(Clone, Debug)]
326pub struct GetCharacterLogsParams {
327    /// Name of your character.
328    pub name: String,
329    /// Page number
330    pub page: Option<u32>,
331    /// Page size
332    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/// struct for passing parameters to the method [`give_gold`]
342#[derive(Clone, Debug)]
343pub struct GiveGoldParams {
344    /// Name of your character.
345    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/// struct for passing parameters to the method [`give_items`]
359#[derive(Clone, Debug)]
360pub struct GiveItemsParams {
361    /// Name of your character.
362    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/// struct for passing parameters to the method [`move_character`]
376#[derive(Clone, Debug)]
377pub struct MoveCharacterParams {
378    /// Name of your character.
379    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/// struct for passing parameters to the method [`npc_buy_item`]
393#[derive(Clone, Debug)]
394pub struct NpcBuyItemParams {
395    /// Name of your character.
396    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/// struct for passing parameters to the method [`npc_sell_item`]
410#[derive(Clone, Debug)]
411pub struct NpcSellItemParams {
412    /// Name of your character.
413    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/// struct for passing parameters to the method [`recycle`]
427#[derive(Clone, Debug)]
428pub struct RecycleParams {
429    /// Name of your character.
430    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/// struct for passing parameters to the method [`rest_character`]
444#[derive(Clone, Debug)]
445pub struct RestCharacterParams {
446    /// Name of your character.
447    pub name: String,
448}
449
450impl RestCharacterParams {
451    pub fn new(name: String) -> Self {
452        Self { name }
453    }
454}
455
456/// struct for passing parameters to the method [`task_exchange`]
457#[derive(Clone, Debug)]
458pub struct TaskExchangeParams {
459    /// Name of your character.
460    pub name: String,
461}
462
463impl TaskExchangeParams {
464    pub fn new(name: String) -> Self {
465        Self { name }
466    }
467}
468
469/// struct for passing parameters to the method [`task_trade`]
470#[derive(Clone, Debug)]
471pub struct TaskTradeParams {
472    /// Name of your character.
473    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/// struct for passing parameters to the method [`unequip_item`]
487#[derive(Clone, Debug)]
488pub struct UnequipItemParams {
489    /// Name of your character.
490    pub name: String,
491    pub unequip_schema: models::UnequipSchema,
492}
493
494impl UnequipItemParams {
495    pub fn new(name: String, unequip_schema: models::UnequipSchema) -> Self {
496        Self {
497            name,
498            unequip_schema,
499        }
500    }
501}
502
503/// struct for passing parameters to the method [`use_item`]
504#[derive(Clone, Debug)]
505pub struct UseItemParams {
506    /// Name of your character.
507    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/// struct for passing parameters to the method [`withdraw_gold`]
521#[derive(Clone, Debug)]
522pub struct WithdrawGoldParams {
523    /// Name of your character.
524    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/// struct for passing parameters to the method [`withdraw_item`]
541#[derive(Clone, Debug)]
542pub struct WithdrawItemParams {
543    /// Name of your character.
544    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/// struct for typed errors of method [`accept_new_task`]
558#[derive(Debug, Clone, Serialize)]
559#[serde(untagged)]
560pub enum AcceptNewTaskError {
561    /// Character not found.
562    Status498(models::ErrorResponseSchema),
563    /// The character is in cooldown.
564    Status499(models::ErrorResponseSchema),
565    /// An action is already in progress for this character.
566    Status486(models::ErrorResponseSchema),
567    /// Tasks Master not found on this map.
568    Status598(models::ErrorResponseSchema),
569    /// The character already has an assigned task.
570    Status489(models::ErrorResponseSchema),
571    /// Request could not be processed due to an invalid payload.
572    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/// struct for typed errors of method [`action_transition`]
597#[derive(Debug, Clone, Serialize)]
598#[serde(untagged)]
599pub enum ActionTransitionError {
600    /// Character not found.
601    Status498(models::ErrorResponseSchema),
602    /// The character is in cooldown.
603    Status499(models::ErrorResponseSchema),
604    /// Transition not found.
605    Status404(models::ErrorResponseSchema),
606    /// Insufficient gold for this transition.
607    Status492(models::ErrorResponseSchema),
608    /// Missing required item(s).
609    Status478(models::ErrorResponseSchema),
610    /// An action is already in progress for this character.
611    Status486(models::ErrorResponseSchema),
612    /// Conditions not met.
613    Status496(models::ErrorResponseSchema),
614    /// Request could not be processed due to an invalid payload.
615    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/// struct for typed errors of method [`buy_bank_expansion`]
642#[derive(Debug, Clone, Serialize)]
643#[serde(untagged)]
644pub enum BuyBankExpansionError {
645    /// Bank not found on this map.
646    Status598(models::ErrorResponseSchema),
647    /// Character not found.
648    Status498(models::ErrorResponseSchema),
649    /// The character is in cooldown.
650    Status499(models::ErrorResponseSchema),
651    /// An action is already in progress for this character.
652    Status486(models::ErrorResponseSchema),
653    /// The character does not have enough gold.
654    Status492(models::ErrorResponseSchema),
655    /// Request could not be processed due to an invalid payload.
656    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/// struct for typed errors of method [`cancel_task`]
681#[derive(Debug, Clone, Serialize)]
682#[serde(untagged)]
683pub enum CancelTaskError {
684    /// Character not found.
685    Status498(models::ErrorResponseSchema),
686    /// The character is in cooldown.
687    Status499(models::ErrorResponseSchema),
688    /// An action is already in progress for this character.
689    Status486(models::ErrorResponseSchema),
690    /// The character has no task assigned.
691    Status487(models::ErrorResponseSchema),
692    /// Tasks Master not found on this map.
693    Status598(models::ErrorResponseSchema),
694    /// Missing required item(s).
695    Status478(models::ErrorResponseSchema),
696    /// Request could not be processed due to an invalid payload.
697    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/// struct for typed errors of method [`change_skin`]
723#[derive(Debug, Clone, Serialize)]
724#[serde(untagged)]
725pub enum ChangeSkinError {
726    /// The character is in cooldown.
727    Status499(models::ErrorResponseSchema),
728    /// An action is already in progress for this character.
729    Status486(models::ErrorResponseSchema),
730    /// You cannot choose this skin because you do not own it.
731    Status550(models::ErrorResponseSchema),
732    /// Request could not be processed due to an invalid payload.
733    Status422(models::ErrorResponseSchema),
734}
735
736impl<'de> Deserialize<'de> for ChangeSkinError {
737    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
738    where
739        D: Deserializer<'de>,
740    {
741        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
742        match raw.error.code {
743            499 => Ok(Self::Status499(raw)),
744            486 => Ok(Self::Status486(raw)),
745            550 => Ok(Self::Status550(raw)),
746            422 => Ok(Self::Status422(raw)),
747            _ => Err(de::Error::custom(format!(
748                "Unexpected error code: {}",
749                raw.error.code
750            ))),
751        }
752    }
753}
754
755/// struct for typed errors of method [`claim_pending_item`]
756#[derive(Debug, Clone, Serialize)]
757#[serde(untagged)]
758pub enum ClaimPendingItemError {
759    /// Pending item not found.
760    Status404(models::ErrorResponseSchema),
761    /// Character not found.
762    Status498(models::ErrorResponseSchema),
763    /// The character&#39;s inventory is full.
764    Status497(models::ErrorResponseSchema),
765    /// The character is in cooldown.
766    Status499(models::ErrorResponseSchema),
767    /// An action is already in progress for this character.
768    Status486(models::ErrorResponseSchema),
769    /// Request could not be processed due to an invalid payload.
770    Status422(models::ErrorResponseSchema),
771}
772
773impl<'de> Deserialize<'de> for ClaimPendingItemError {
774    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
775    where
776        D: Deserializer<'de>,
777    {
778        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
779        match raw.error.code {
780            404 => Ok(Self::Status404(raw)),
781            498 => Ok(Self::Status498(raw)),
782            497 => Ok(Self::Status497(raw)),
783            499 => Ok(Self::Status499(raw)),
784            486 => Ok(Self::Status486(raw)),
785            422 => Ok(Self::Status422(raw)),
786            _ => Err(de::Error::custom(format!(
787                "Unexpected error code: {}",
788                raw.error.code
789            ))),
790        }
791    }
792}
793
794/// struct for typed errors of method [`complete_task`]
795#[derive(Debug, Clone, Serialize)]
796#[serde(untagged)]
797pub enum CompleteTaskError {
798    /// Character not found.
799    Status498(models::ErrorResponseSchema),
800    /// The character is in cooldown.
801    Status499(models::ErrorResponseSchema),
802    /// An action is already in progress for this character.
803    Status486(models::ErrorResponseSchema),
804    /// Tasks Master not found on this map.
805    Status598(models::ErrorResponseSchema),
806    /// The character has not completed the task.
807    Status488(models::ErrorResponseSchema),
808    /// The character has no task assigned.
809    Status487(models::ErrorResponseSchema),
810    /// The character&#39;s inventory is full.
811    Status497(models::ErrorResponseSchema),
812    /// Request could not be processed due to an invalid payload.
813    Status422(models::ErrorResponseSchema),
814}
815
816impl<'de> Deserialize<'de> for CompleteTaskError {
817    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
818    where
819        D: Deserializer<'de>,
820    {
821        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
822        match raw.error.code {
823            498 => Ok(Self::Status498(raw)),
824            499 => Ok(Self::Status499(raw)),
825            486 => Ok(Self::Status486(raw)),
826            598 => Ok(Self::Status598(raw)),
827            488 => Ok(Self::Status488(raw)),
828            487 => Ok(Self::Status487(raw)),
829            497 => Ok(Self::Status497(raw)),
830            422 => Ok(Self::Status422(raw)),
831            _ => Err(de::Error::custom(format!(
832                "Unexpected error code: {}",
833                raw.error.code
834            ))),
835        }
836    }
837}
838
839/// struct for typed errors of method [`craft`]
840#[derive(Debug, Clone, Serialize)]
841#[serde(untagged)]
842pub enum CraftError {
843    /// Craft not found.
844    Status404(models::ErrorResponseSchema),
845    /// Workshop not found on this map.
846    Status598(models::ErrorResponseSchema),
847    /// Character not found.
848    Status498(models::ErrorResponseSchema),
849    /// The character&#39;s inventory is full.
850    Status497(models::ErrorResponseSchema),
851    /// The character is in cooldown.
852    Status499(models::ErrorResponseSchema),
853    /// An action is already in progress for this character.
854    Status486(models::ErrorResponseSchema),
855    /// The character&#39;s skill level is too low.
856    Status493(models::ErrorResponseSchema),
857    /// Missing required item(s).
858    Status478(models::ErrorResponseSchema),
859    /// Request could not be processed due to an invalid payload.
860    Status422(models::ErrorResponseSchema),
861}
862
863impl<'de> Deserialize<'de> for CraftError {
864    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
865    where
866        D: Deserializer<'de>,
867    {
868        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
869        match raw.error.code {
870            404 => Ok(Self::Status404(raw)),
871            598 => Ok(Self::Status598(raw)),
872            498 => Ok(Self::Status498(raw)),
873            497 => Ok(Self::Status497(raw)),
874            499 => Ok(Self::Status499(raw)),
875            486 => Ok(Self::Status486(raw)),
876            493 => Ok(Self::Status493(raw)),
877            478 => Ok(Self::Status478(raw)),
878            422 => Ok(Self::Status422(raw)),
879            _ => Err(de::Error::custom(format!(
880                "Unexpected error code: {}",
881                raw.error.code
882            ))),
883        }
884    }
885}
886
887/// struct for typed errors of method [`delete_item`]
888#[derive(Debug, Clone, Serialize)]
889#[serde(untagged)]
890pub enum DeleteItemError {
891    /// Character not found.
892    Status498(models::ErrorResponseSchema),
893    /// The character is in cooldown.
894    Status499(models::ErrorResponseSchema),
895    /// An action is already in progress for this character.
896    Status486(models::ErrorResponseSchema),
897    /// Missing required item(s).
898    Status478(models::ErrorResponseSchema),
899    /// Request could not be processed due to an invalid payload.
900    Status422(models::ErrorResponseSchema),
901}
902
903impl<'de> Deserialize<'de> for DeleteItemError {
904    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
905    where
906        D: Deserializer<'de>,
907    {
908        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
909        match raw.error.code {
910            498 => Ok(Self::Status498(raw)),
911            499 => Ok(Self::Status499(raw)),
912            486 => Ok(Self::Status486(raw)),
913            478 => Ok(Self::Status478(raw)),
914            422 => Ok(Self::Status422(raw)),
915            _ => Err(de::Error::custom(format!(
916                "Unexpected error code: {}",
917                raw.error.code
918            ))),
919        }
920    }
921}
922
923/// struct for typed errors of method [`deposit_gold`]
924#[derive(Debug, Clone, Serialize)]
925#[serde(untagged)]
926pub enum DepositGoldError {
927    /// Bank not found on this map.
928    Status598(models::ErrorResponseSchema),
929    /// The character does not have enough gold.
930    Status492(models::ErrorResponseSchema),
931    /// Character not found.
932    Status498(models::ErrorResponseSchema),
933    /// The character is in cooldown.
934    Status499(models::ErrorResponseSchema),
935    /// Some of your items or your gold in the bank are already part of an ongoing transaction.
936    Status461(models::ErrorResponseSchema),
937    /// An action is already in progress for this character.
938    Status486(models::ErrorResponseSchema),
939    /// Request could not be processed due to an invalid payload.
940    Status422(models::ErrorResponseSchema),
941}
942
943impl<'de> Deserialize<'de> for DepositGoldError {
944    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
945    where
946        D: Deserializer<'de>,
947    {
948        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
949        match raw.error.code {
950            598 => Ok(Self::Status598(raw)),
951            492 => Ok(Self::Status492(raw)),
952            498 => Ok(Self::Status498(raw)),
953            499 => Ok(Self::Status499(raw)),
954            461 => Ok(Self::Status461(raw)),
955            486 => Ok(Self::Status486(raw)),
956            422 => Ok(Self::Status422(raw)),
957            _ => Err(de::Error::custom(format!(
958                "Unexpected error code: {}",
959                raw.error.code
960            ))),
961        }
962    }
963}
964
965/// struct for typed errors of method [`deposit_item`]
966#[derive(Debug, Clone, Serialize)]
967#[serde(untagged)]
968pub enum DepositItemError {
969    /// Bank not found on this map.
970    Status598(models::ErrorResponseSchema),
971    /// Item not found.
972    Status404(models::ErrorResponseSchema),
973    /// Some of your items or your gold in the bank are already part of an ongoing transaction.
974    Status461(models::ErrorResponseSchema),
975    /// Character not found.
976    Status498(models::ErrorResponseSchema),
977    /// The character is in cooldown.
978    Status499(models::ErrorResponseSchema),
979    /// An action is already in progress for this character.
980    Status486(models::ErrorResponseSchema),
981    /// Missing required item(s).
982    Status478(models::ErrorResponseSchema),
983    /// Your bank is full.
984    Status462(models::ErrorResponseSchema),
985    /// Request could not be processed due to an invalid payload.
986    Status422(models::ErrorResponseSchema),
987}
988
989impl<'de> Deserialize<'de> for DepositItemError {
990    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
991    where
992        D: Deserializer<'de>,
993    {
994        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
995        match raw.error.code {
996            598 => Ok(Self::Status598(raw)),
997            404 => Ok(Self::Status404(raw)),
998            461 => Ok(Self::Status461(raw)),
999            498 => Ok(Self::Status498(raw)),
1000            499 => Ok(Self::Status499(raw)),
1001            486 => Ok(Self::Status486(raw)),
1002            478 => Ok(Self::Status478(raw)),
1003            462 => Ok(Self::Status462(raw)),
1004            422 => Ok(Self::Status422(raw)),
1005            _ => Err(de::Error::custom(format!(
1006                "Unexpected error code: {}",
1007                raw.error.code
1008            ))),
1009        }
1010    }
1011}
1012
1013/// struct for typed errors of method [`equip_item`]
1014#[derive(Debug, Clone, Serialize)]
1015#[serde(untagged)]
1016pub enum EquipItemError {
1017    /// Item not found.
1018    Status404(models::ErrorResponseSchema),
1019    /// Character not found.
1020    Status498(models::ErrorResponseSchema),
1021    /// The character does not have enough HP to unequip this item.
1022    Status483(models::ErrorResponseSchema),
1023    /// The character is in cooldown.
1024    Status499(models::ErrorResponseSchema),
1025    /// An action is already in progress for this character.
1026    Status486(models::ErrorResponseSchema),
1027    /// Missing required item(s).
1028    Status478(models::ErrorResponseSchema),
1029    /// Conditions not met.
1030    Status496(models::ErrorResponseSchema),
1031    /// The equipment slot is not empty.
1032    Status491(models::ErrorResponseSchema),
1033    /// This item is already equipped.
1034    Status485(models::ErrorResponseSchema),
1035    /// The character cannot equip more than 100 utilities in the same slot.
1036    Status484(models::ErrorResponseSchema),
1037    /// The character&#39;s inventory is full.
1038    Status497(models::ErrorResponseSchema),
1039    /// Request could not be processed due to an invalid payload.
1040    Status422(models::ErrorResponseSchema),
1041}
1042
1043impl<'de> Deserialize<'de> for EquipItemError {
1044    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1045    where
1046        D: Deserializer<'de>,
1047    {
1048        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1049        match raw.error.code {
1050            404 => Ok(Self::Status404(raw)),
1051            498 => Ok(Self::Status498(raw)),
1052            483 => Ok(Self::Status483(raw)),
1053            499 => Ok(Self::Status499(raw)),
1054            486 => Ok(Self::Status486(raw)),
1055            478 => Ok(Self::Status478(raw)),
1056            496 => Ok(Self::Status496(raw)),
1057            491 => Ok(Self::Status491(raw)),
1058            485 => Ok(Self::Status485(raw)),
1059            484 => Ok(Self::Status484(raw)),
1060            497 => Ok(Self::Status497(raw)),
1061            422 => Ok(Self::Status422(raw)),
1062            _ => Err(de::Error::custom(format!(
1063                "Unexpected error code: {}",
1064                raw.error.code
1065            ))),
1066        }
1067    }
1068}
1069
1070/// struct for typed errors of method [`fight`]
1071#[derive(Debug, Clone, Serialize)]
1072#[serde(untagged)]
1073pub enum FightError {
1074    /// Character not found.
1075    Status498(models::ErrorResponseSchema),
1076    /// The character is in cooldown.
1077    Status499(models::ErrorResponseSchema),
1078    /// Monster not found on this map.
1079    Status598(models::ErrorResponseSchema),
1080    /// Only boss monsters can be fought by multiple characters.
1081    Status486(models::ErrorResponseSchema),
1082    /// The character&#39;s inventory is full.
1083    Status497(models::ErrorResponseSchema),
1084    /// Request could not be processed due to an invalid payload.
1085    Status422(models::ErrorResponseSchema),
1086}
1087
1088impl<'de> Deserialize<'de> for FightError {
1089    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1090    where
1091        D: Deserializer<'de>,
1092    {
1093        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1094        match raw.error.code {
1095            498 => Ok(Self::Status498(raw)),
1096            499 => Ok(Self::Status499(raw)),
1097            598 => Ok(Self::Status598(raw)),
1098            486 => Ok(Self::Status486(raw)),
1099            497 => Ok(Self::Status497(raw)),
1100            422 => Ok(Self::Status422(raw)),
1101            _ => Err(de::Error::custom(format!(
1102                "Unexpected error code: {}",
1103                raw.error.code
1104            ))),
1105        }
1106    }
1107}
1108
1109/// struct for typed errors of method [`gather`]
1110#[derive(Debug, Clone, Serialize)]
1111#[serde(untagged)]
1112pub enum GatherError {
1113    /// Character not found.
1114    Status498(models::ErrorResponseSchema),
1115    /// The character is in cooldown.
1116    Status499(models::ErrorResponseSchema),
1117    /// Resource not found on this map.
1118    Status598(models::ErrorResponseSchema),
1119    /// An action is already in progress for this character.
1120    Status486(models::ErrorResponseSchema),
1121    /// The character&#39;s skill level is too low.
1122    Status493(models::ErrorResponseSchema),
1123    /// The character&#39;s inventory is full.
1124    Status497(models::ErrorResponseSchema),
1125    /// Request could not be processed due to an invalid payload.
1126    Status422(models::ErrorResponseSchema),
1127}
1128
1129impl<'de> Deserialize<'de> for GatherError {
1130    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1131    where
1132        D: Deserializer<'de>,
1133    {
1134        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1135        match raw.error.code {
1136            498 => Ok(Self::Status498(raw)),
1137            499 => Ok(Self::Status499(raw)),
1138            598 => Ok(Self::Status598(raw)),
1139            486 => Ok(Self::Status486(raw)),
1140            493 => Ok(Self::Status493(raw)),
1141            497 => Ok(Self::Status497(raw)),
1142            422 => Ok(Self::Status422(raw)),
1143            _ => Err(de::Error::custom(format!(
1144                "Unexpected error code: {}",
1145                raw.error.code
1146            ))),
1147        }
1148    }
1149}
1150
1151/// struct for typed errors of method [`ge_buy_item`]
1152#[derive(Debug, Clone, Serialize)]
1153#[serde(untagged)]
1154pub enum GeBuyItemError {
1155    /// Grand Exchange not found on this map.
1156    Status598(models::ErrorResponseSchema),
1157    /// Character not found.
1158    Status498(models::ErrorResponseSchema),
1159    /// The character&#39;s inventory is full.
1160    Status497(models::ErrorResponseSchema),
1161    /// The character is in cooldown.
1162    Status499(models::ErrorResponseSchema),
1163    /// A transaction is already in progress for this order by another character.
1164    Status436(models::ErrorResponseSchema),
1165    /// An action is already in progress for this character.
1166    Status486(models::ErrorResponseSchema),
1167    /// The character does not have enough gold.
1168    Status492(models::ErrorResponseSchema),
1169    /// This offer does not contain that many items.
1170    Status434(models::ErrorResponseSchema),
1171    /// You cannot trade with yourself.
1172    Status435(models::ErrorResponseSchema),
1173    /// Order not found.
1174    Status404(models::ErrorResponseSchema),
1175    /// Request could not be processed due to an invalid payload.
1176    Status422(models::ErrorResponseSchema),
1177}
1178
1179impl<'de> Deserialize<'de> for GeBuyItemError {
1180    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1181    where
1182        D: Deserializer<'de>,
1183    {
1184        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1185        match raw.error.code {
1186            598 => Ok(Self::Status598(raw)),
1187            498 => Ok(Self::Status498(raw)),
1188            497 => Ok(Self::Status497(raw)),
1189            499 => Ok(Self::Status499(raw)),
1190            436 => Ok(Self::Status436(raw)),
1191            486 => Ok(Self::Status486(raw)),
1192            492 => Ok(Self::Status492(raw)),
1193            434 => Ok(Self::Status434(raw)),
1194            435 => Ok(Self::Status435(raw)),
1195            404 => Ok(Self::Status404(raw)),
1196            422 => Ok(Self::Status422(raw)),
1197            _ => Err(de::Error::custom(format!(
1198                "Unexpected error code: {}",
1199                raw.error.code
1200            ))),
1201        }
1202    }
1203}
1204
1205/// struct for typed errors of method [`ge_cancel_order`]
1206#[derive(Debug, Clone, Serialize)]
1207#[serde(untagged)]
1208pub enum GeCancelOrderError {
1209    /// Grand Exchange not found on this map.
1210    Status598(models::ErrorResponseSchema),
1211    /// Character not found.
1212    Status498(models::ErrorResponseSchema),
1213    /// The character&#39;s inventory is full.
1214    Status497(models::ErrorResponseSchema),
1215    /// The character is in cooldown.
1216    Status499(models::ErrorResponseSchema),
1217    /// A transaction is already in progress for this order by another character.
1218    Status436(models::ErrorResponseSchema),
1219    /// An action is already in progress for this character.
1220    Status486(models::ErrorResponseSchema),
1221    /// You cannot cancel an order that is not yours.
1222    Status438(models::ErrorResponseSchema),
1223    /// Order not found.
1224    Status404(models::ErrorResponseSchema),
1225    /// Request could not be processed due to an invalid payload.
1226    Status422(models::ErrorResponseSchema),
1227}
1228
1229impl<'de> Deserialize<'de> for GeCancelOrderError {
1230    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1231    where
1232        D: Deserializer<'de>,
1233    {
1234        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1235        match raw.error.code {
1236            598 => Ok(Self::Status598(raw)),
1237            498 => Ok(Self::Status498(raw)),
1238            497 => Ok(Self::Status497(raw)),
1239            499 => Ok(Self::Status499(raw)),
1240            436 => Ok(Self::Status436(raw)),
1241            486 => Ok(Self::Status486(raw)),
1242            438 => Ok(Self::Status438(raw)),
1243            404 => Ok(Self::Status404(raw)),
1244            422 => Ok(Self::Status422(raw)),
1245            _ => Err(de::Error::custom(format!(
1246                "Unexpected error code: {}",
1247                raw.error.code
1248            ))),
1249        }
1250    }
1251}
1252
1253/// struct for typed errors of method [`ge_create_buy_order`]
1254#[derive(Debug, Clone, Serialize)]
1255#[serde(untagged)]
1256pub enum GeCreateBuyOrderError {
1257    /// Character not found.
1258    Status498(models::ErrorResponseSchema),
1259    /// The character is in cooldown.
1260    Status499(models::ErrorResponseSchema),
1261    /// An action is already in progress for this character.
1262    Status486(models::ErrorResponseSchema),
1263    /// Item not found.
1264    Status404(models::ErrorResponseSchema),
1265    /// The character does not have enough gold.
1266    Status492(models::ErrorResponseSchema),
1267    /// You cannot create more than 100 orders at the same time.
1268    Status433(models::ErrorResponseSchema),
1269    /// This item cannot be sold.
1270    Status437(models::ErrorResponseSchema),
1271    /// Grand Exchange not found on this map.
1272    Status598(models::ErrorResponseSchema),
1273    /// Request could not be processed due to an invalid payload.
1274    Status422(models::ErrorResponseSchema),
1275}
1276
1277impl<'de> Deserialize<'de> for GeCreateBuyOrderError {
1278    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1279    where
1280        D: Deserializer<'de>,
1281    {
1282        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1283        match raw.error.code {
1284            498 => Ok(Self::Status498(raw)),
1285            499 => Ok(Self::Status499(raw)),
1286            486 => Ok(Self::Status486(raw)),
1287            404 => Ok(Self::Status404(raw)),
1288            492 => Ok(Self::Status492(raw)),
1289            433 => Ok(Self::Status433(raw)),
1290            437 => Ok(Self::Status437(raw)),
1291            598 => Ok(Self::Status598(raw)),
1292            422 => Ok(Self::Status422(raw)),
1293            _ => Err(de::Error::custom(format!(
1294                "Unexpected error code: {}",
1295                raw.error.code
1296            ))),
1297        }
1298    }
1299}
1300
1301/// struct for typed errors of method [`ge_create_sell_order`]
1302#[derive(Debug, Clone, Serialize)]
1303#[serde(untagged)]
1304pub enum GeCreateSellOrderError {
1305    /// Character not found.
1306    Status498(models::ErrorResponseSchema),
1307    /// The character is in cooldown.
1308    Status499(models::ErrorResponseSchema),
1309    /// An action is already in progress for this character.
1310    Status486(models::ErrorResponseSchema),
1311    /// Item not found.
1312    Status404(models::ErrorResponseSchema),
1313    /// Missing required item(s).
1314    Status478(models::ErrorResponseSchema),
1315    /// You cannot create more than 100 orders at the same time.
1316    Status433(models::ErrorResponseSchema),
1317    /// This item cannot be sold.
1318    Status437(models::ErrorResponseSchema),
1319    /// Grand Exchange not found on this map.
1320    Status598(models::ErrorResponseSchema),
1321    /// Request could not be processed due to an invalid payload.
1322    Status422(models::ErrorResponseSchema),
1323}
1324
1325impl<'de> Deserialize<'de> for GeCreateSellOrderError {
1326    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1327    where
1328        D: Deserializer<'de>,
1329    {
1330        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1331        match raw.error.code {
1332            498 => Ok(Self::Status498(raw)),
1333            499 => Ok(Self::Status499(raw)),
1334            486 => Ok(Self::Status486(raw)),
1335            404 => Ok(Self::Status404(raw)),
1336            478 => Ok(Self::Status478(raw)),
1337            433 => Ok(Self::Status433(raw)),
1338            437 => Ok(Self::Status437(raw)),
1339            598 => Ok(Self::Status598(raw)),
1340            422 => Ok(Self::Status422(raw)),
1341            _ => Err(de::Error::custom(format!(
1342                "Unexpected error code: {}",
1343                raw.error.code
1344            ))),
1345        }
1346    }
1347}
1348
1349/// struct for typed errors of method [`ge_fill_order`]
1350#[derive(Debug, Clone, Serialize)]
1351#[serde(untagged)]
1352pub enum GeFillOrderError {
1353    /// Grand Exchange not found on this map.
1354    Status598(models::ErrorResponseSchema),
1355    /// Character not found.
1356    Status498(models::ErrorResponseSchema),
1357    /// The character is in cooldown.
1358    Status499(models::ErrorResponseSchema),
1359    /// A transaction is already in progress for this order by another character.
1360    Status436(models::ErrorResponseSchema),
1361    /// An action is already in progress for this character.
1362    Status486(models::ErrorResponseSchema),
1363    /// Missing required item(s).
1364    Status478(models::ErrorResponseSchema),
1365    /// This offer does not contain that many items.
1366    Status434(models::ErrorResponseSchema),
1367    /// You cannot trade with yourself.
1368    Status435(models::ErrorResponseSchema),
1369    /// Buy order not found.
1370    Status404(models::ErrorResponseSchema),
1371    /// Request could not be processed due to an invalid payload.
1372    Status422(models::ErrorResponseSchema),
1373}
1374
1375impl<'de> Deserialize<'de> for GeFillOrderError {
1376    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1377    where
1378        D: Deserializer<'de>,
1379    {
1380        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1381        match raw.error.code {
1382            598 => Ok(Self::Status598(raw)),
1383            498 => Ok(Self::Status498(raw)),
1384            499 => Ok(Self::Status499(raw)),
1385            436 => Ok(Self::Status436(raw)),
1386            486 => Ok(Self::Status486(raw)),
1387            478 => Ok(Self::Status478(raw)),
1388            434 => Ok(Self::Status434(raw)),
1389            435 => Ok(Self::Status435(raw)),
1390            404 => Ok(Self::Status404(raw)),
1391            422 => Ok(Self::Status422(raw)),
1392            _ => Err(de::Error::custom(format!(
1393                "Unexpected error code: {}",
1394                raw.error.code
1395            ))),
1396        }
1397    }
1398}
1399
1400/// struct for typed errors of method [`get_all_characters_logs`]
1401#[derive(Debug, Clone, Serialize)]
1402#[serde(untagged)]
1403pub enum GetAllCharactersLogsError {
1404    /// Logs not found.
1405    Status404(models::ErrorResponseSchema),
1406    /// Character not found.
1407    Status498(models::ErrorResponseSchema),
1408}
1409
1410impl<'de> Deserialize<'de> for GetAllCharactersLogsError {
1411    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1412    where
1413        D: Deserializer<'de>,
1414    {
1415        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1416        match raw.error.code {
1417            404 => Ok(Self::Status404(raw)),
1418            498 => Ok(Self::Status498(raw)),
1419            _ => Err(de::Error::custom(format!(
1420                "Unexpected error code: {}",
1421                raw.error.code
1422            ))),
1423        }
1424    }
1425}
1426
1427/// struct for typed errors of method [`get_character_logs`]
1428#[derive(Debug, Clone, Serialize)]
1429#[serde(untagged)]
1430pub enum GetCharacterLogsError {
1431    /// Logs not found.
1432    Status404(models::ErrorResponseSchema),
1433    /// Character not found.
1434    Status498(models::ErrorResponseSchema),
1435}
1436
1437impl<'de> Deserialize<'de> for GetCharacterLogsError {
1438    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1439    where
1440        D: Deserializer<'de>,
1441    {
1442        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1443        match raw.error.code {
1444            404 => Ok(Self::Status404(raw)),
1445            498 => Ok(Self::Status498(raw)),
1446            _ => Err(de::Error::custom(format!(
1447                "Unexpected error code: {}",
1448                raw.error.code
1449            ))),
1450        }
1451    }
1452}
1453
1454/// struct for typed errors of method [`get_my_characters`]
1455#[derive(Debug, Clone, Serialize)]
1456#[serde(untagged)]
1457pub enum GetMyCharactersError {}
1458
1459impl<'de> Deserialize<'de> for GetMyCharactersError {
1460    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1461    where
1462        D: Deserializer<'de>,
1463    {
1464        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1465        Err(de::Error::custom(format!(
1466            "Unexpected error code: {}",
1467            raw.error.code
1468        )))
1469    }
1470}
1471
1472/// struct for typed errors of method [`give_gold`]
1473#[derive(Debug, Clone, Serialize)]
1474#[serde(untagged)]
1475pub enum GiveGoldError {
1476    /// Character not found.
1477    Status498(models::ErrorResponseSchema),
1478    /// The character is in cooldown.
1479    Status499(models::ErrorResponseSchema),
1480    /// The character does not have enough gold.
1481    Status492(models::ErrorResponseSchema),
1482    /// An action is already in progress for this character.
1483    Status486(models::ErrorResponseSchema),
1484    /// Request could not be processed due to an invalid payload.
1485    Status422(models::ErrorResponseSchema),
1486}
1487
1488impl<'de> Deserialize<'de> for GiveGoldError {
1489    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1490    where
1491        D: Deserializer<'de>,
1492    {
1493        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1494        match raw.error.code {
1495            498 => Ok(Self::Status498(raw)),
1496            499 => Ok(Self::Status499(raw)),
1497            492 => Ok(Self::Status492(raw)),
1498            486 => Ok(Self::Status486(raw)),
1499            422 => Ok(Self::Status422(raw)),
1500            _ => Err(de::Error::custom(format!(
1501                "Unexpected error code: {}",
1502                raw.error.code
1503            ))),
1504        }
1505    }
1506}
1507
1508/// struct for typed errors of method [`give_items`]
1509#[derive(Debug, Clone, Serialize)]
1510#[serde(untagged)]
1511pub enum GiveItemsError {
1512    /// Item not found.
1513    Status404(models::ErrorResponseSchema),
1514    /// Character not found.
1515    Status498(models::ErrorResponseSchema),
1516    /// The character is in cooldown.
1517    Status499(models::ErrorResponseSchema),
1518    /// The character&#39;s inventory is full.
1519    Status497(models::ErrorResponseSchema),
1520    /// An action is already in progress for this character.
1521    Status486(models::ErrorResponseSchema),
1522    /// Missing required item(s).
1523    Status478(models::ErrorResponseSchema),
1524    /// Request could not be processed due to an invalid payload.
1525    Status422(models::ErrorResponseSchema),
1526}
1527
1528impl<'de> Deserialize<'de> for GiveItemsError {
1529    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1530    where
1531        D: Deserializer<'de>,
1532    {
1533        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1534        match raw.error.code {
1535            404 => Ok(Self::Status404(raw)),
1536            498 => Ok(Self::Status498(raw)),
1537            499 => Ok(Self::Status499(raw)),
1538            497 => Ok(Self::Status497(raw)),
1539            486 => Ok(Self::Status486(raw)),
1540            478 => Ok(Self::Status478(raw)),
1541            422 => Ok(Self::Status422(raw)),
1542            _ => Err(de::Error::custom(format!(
1543                "Unexpected error code: {}",
1544                raw.error.code
1545            ))),
1546        }
1547    }
1548}
1549
1550/// struct for typed errors of method [`move_character`]
1551#[derive(Debug, Clone, Serialize)]
1552#[serde(untagged)]
1553pub enum MoveCharacterError {
1554    /// Character not found.
1555    Status498(models::ErrorResponseSchema),
1556    /// The character is in cooldown.
1557    Status499(models::ErrorResponseSchema),
1558    /// The character is already at the destination.
1559    Status490(models::ErrorResponseSchema),
1560    /// Map not found.
1561    Status404(models::ErrorResponseSchema),
1562    /// An action is already in progress for this character.
1563    Status486(models::ErrorResponseSchema),
1564    /// No path available to the destination map.
1565    Status595(models::ErrorResponseSchema),
1566    /// The map is blocked and cannot be accessed.
1567    Status596(models::ErrorResponseSchema),
1568    /// Conditions not met.
1569    Status496(models::ErrorResponseSchema),
1570    /// Request could not be processed due to an invalid payload.
1571    Status422(models::ErrorResponseSchema),
1572}
1573
1574impl<'de> Deserialize<'de> for MoveCharacterError {
1575    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1576    where
1577        D: Deserializer<'de>,
1578    {
1579        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1580        match raw.error.code {
1581            498 => Ok(Self::Status498(raw)),
1582            499 => Ok(Self::Status499(raw)),
1583            490 => Ok(Self::Status490(raw)),
1584            404 => Ok(Self::Status404(raw)),
1585            486 => Ok(Self::Status486(raw)),
1586            595 => Ok(Self::Status595(raw)),
1587            596 => Ok(Self::Status596(raw)),
1588            496 => Ok(Self::Status496(raw)),
1589            422 => Ok(Self::Status422(raw)),
1590            _ => Err(de::Error::custom(format!(
1591                "Unexpected error code: {}",
1592                raw.error.code
1593            ))),
1594        }
1595    }
1596}
1597
1598/// struct for typed errors of method [`npc_buy_item`]
1599#[derive(Debug, Clone, Serialize)]
1600#[serde(untagged)]
1601pub enum NpcBuyItemError {
1602    /// NPC not found on this map.
1603    Status598(models::ErrorResponseSchema),
1604    /// Character not found.
1605    Status498(models::ErrorResponseSchema),
1606    /// The character&#39;s inventory is full.
1607    Status497(models::ErrorResponseSchema),
1608    /// The character is in cooldown.
1609    Status499(models::ErrorResponseSchema),
1610    /// An action is already in progress for this character.
1611    Status486(models::ErrorResponseSchema),
1612    /// The character does not have enough gold.
1613    Status492(models::ErrorResponseSchema),
1614    /// This item is not available for purchase.
1615    Status441(models::ErrorResponseSchema),
1616    /// Missing required item(s).
1617    Status478(models::ErrorResponseSchema),
1618    /// Item not found.
1619    Status404(models::ErrorResponseSchema),
1620    /// Request could not be processed due to an invalid payload.
1621    Status422(models::ErrorResponseSchema),
1622}
1623
1624impl<'de> Deserialize<'de> for NpcBuyItemError {
1625    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1626    where
1627        D: Deserializer<'de>,
1628    {
1629        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1630        match raw.error.code {
1631            598 => Ok(Self::Status598(raw)),
1632            498 => Ok(Self::Status498(raw)),
1633            497 => Ok(Self::Status497(raw)),
1634            499 => Ok(Self::Status499(raw)),
1635            486 => Ok(Self::Status486(raw)),
1636            492 => Ok(Self::Status492(raw)),
1637            441 => Ok(Self::Status441(raw)),
1638            478 => Ok(Self::Status478(raw)),
1639            404 => Ok(Self::Status404(raw)),
1640            422 => Ok(Self::Status422(raw)),
1641            _ => Err(de::Error::custom(format!(
1642                "Unexpected error code: {}",
1643                raw.error.code
1644            ))),
1645        }
1646    }
1647}
1648
1649/// struct for typed errors of method [`npc_sell_item`]
1650#[derive(Debug, Clone, Serialize)]
1651#[serde(untagged)]
1652pub enum NpcSellItemError {
1653    /// NPC not found on this map.
1654    Status598(models::ErrorResponseSchema),
1655    /// Character not found.
1656    Status498(models::ErrorResponseSchema),
1657    /// The character&#39;s inventory is full.
1658    Status497(models::ErrorResponseSchema),
1659    /// The character is in cooldown.
1660    Status499(models::ErrorResponseSchema),
1661    /// An action is already in progress for this character.
1662    Status486(models::ErrorResponseSchema),
1663    /// Missing required item(s).
1664    Status478(models::ErrorResponseSchema),
1665    /// This item cannot be sold.
1666    Status442(models::ErrorResponseSchema),
1667    /// Item not found.
1668    Status404(models::ErrorResponseSchema),
1669    /// Request could not be processed due to an invalid payload.
1670    Status422(models::ErrorResponseSchema),
1671}
1672
1673impl<'de> Deserialize<'de> for NpcSellItemError {
1674    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1675    where
1676        D: Deserializer<'de>,
1677    {
1678        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1679        match raw.error.code {
1680            598 => Ok(Self::Status598(raw)),
1681            498 => Ok(Self::Status498(raw)),
1682            497 => Ok(Self::Status497(raw)),
1683            499 => Ok(Self::Status499(raw)),
1684            486 => Ok(Self::Status486(raw)),
1685            478 => Ok(Self::Status478(raw)),
1686            442 => Ok(Self::Status442(raw)),
1687            404 => Ok(Self::Status404(raw)),
1688            422 => Ok(Self::Status422(raw)),
1689            _ => Err(de::Error::custom(format!(
1690                "Unexpected error code: {}",
1691                raw.error.code
1692            ))),
1693        }
1694    }
1695}
1696
1697/// struct for typed errors of method [`recycle`]
1698#[derive(Debug, Clone, Serialize)]
1699#[serde(untagged)]
1700pub enum RecycleError {
1701    /// Item not found.
1702    Status404(models::ErrorResponseSchema),
1703    /// Workshop not found on this map.
1704    Status598(models::ErrorResponseSchema),
1705    /// Character not found.
1706    Status498(models::ErrorResponseSchema),
1707    /// The character&#39;s inventory is full.
1708    Status497(models::ErrorResponseSchema),
1709    /// The character is in cooldown.
1710    Status499(models::ErrorResponseSchema),
1711    /// An action is already in progress for this character.
1712    Status486(models::ErrorResponseSchema),
1713    /// The character&#39;s skill level is too low.
1714    Status493(models::ErrorResponseSchema),
1715    /// Missing required item(s).
1716    Status478(models::ErrorResponseSchema),
1717    /// This item cannot be recycled.
1718    Status473(models::ErrorResponseSchema),
1719    /// Request could not be processed due to an invalid payload.
1720    Status422(models::ErrorResponseSchema),
1721}
1722
1723impl<'de> Deserialize<'de> for RecycleError {
1724    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1725    where
1726        D: Deserializer<'de>,
1727    {
1728        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1729        match raw.error.code {
1730            404 => Ok(Self::Status404(raw)),
1731            598 => Ok(Self::Status598(raw)),
1732            498 => Ok(Self::Status498(raw)),
1733            497 => Ok(Self::Status497(raw)),
1734            499 => Ok(Self::Status499(raw)),
1735            486 => Ok(Self::Status486(raw)),
1736            493 => Ok(Self::Status493(raw)),
1737            478 => Ok(Self::Status478(raw)),
1738            473 => Ok(Self::Status473(raw)),
1739            422 => Ok(Self::Status422(raw)),
1740            _ => Err(de::Error::custom(format!(
1741                "Unexpected error code: {}",
1742                raw.error.code
1743            ))),
1744        }
1745    }
1746}
1747
1748/// struct for typed errors of method [`rest_character`]
1749#[derive(Debug, Clone, Serialize)]
1750#[serde(untagged)]
1751pub enum RestCharacterError {
1752    /// Character not found.
1753    Status498(models::ErrorResponseSchema),
1754    /// The character is in cooldown.
1755    Status499(models::ErrorResponseSchema),
1756    /// An action is already in progress for this character.
1757    Status486(models::ErrorResponseSchema),
1758    /// Request could not be processed due to an invalid payload.
1759    Status422(models::ErrorResponseSchema),
1760}
1761
1762impl<'de> Deserialize<'de> for RestCharacterError {
1763    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1764    where
1765        D: Deserializer<'de>,
1766    {
1767        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1768        match raw.error.code {
1769            498 => Ok(Self::Status498(raw)),
1770            499 => Ok(Self::Status499(raw)),
1771            486 => Ok(Self::Status486(raw)),
1772            422 => Ok(Self::Status422(raw)),
1773            _ => Err(de::Error::custom(format!(
1774                "Unexpected error code: {}",
1775                raw.error.code
1776            ))),
1777        }
1778    }
1779}
1780
1781/// struct for typed errors of method [`task_exchange`]
1782#[derive(Debug, Clone, Serialize)]
1783#[serde(untagged)]
1784pub enum TaskExchangeError {
1785    /// Character not found.
1786    Status498(models::ErrorResponseSchema),
1787    /// The character is in cooldown.
1788    Status499(models::ErrorResponseSchema),
1789    /// An action is already in progress for this character.
1790    Status486(models::ErrorResponseSchema),
1791    /// Tasks Master not found on this map.
1792    Status598(models::ErrorResponseSchema),
1793    /// Missing required item(s).
1794    Status478(models::ErrorResponseSchema),
1795    /// The character&#39;s inventory is full.
1796    Status497(models::ErrorResponseSchema),
1797    /// Request could not be processed due to an invalid payload.
1798    Status422(models::ErrorResponseSchema),
1799}
1800
1801impl<'de> Deserialize<'de> for TaskExchangeError {
1802    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1803    where
1804        D: Deserializer<'de>,
1805    {
1806        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1807        match raw.error.code {
1808            498 => Ok(Self::Status498(raw)),
1809            499 => Ok(Self::Status499(raw)),
1810            486 => Ok(Self::Status486(raw)),
1811            598 => Ok(Self::Status598(raw)),
1812            478 => Ok(Self::Status478(raw)),
1813            497 => Ok(Self::Status497(raw)),
1814            422 => Ok(Self::Status422(raw)),
1815            _ => Err(de::Error::custom(format!(
1816                "Unexpected error code: {}",
1817                raw.error.code
1818            ))),
1819        }
1820    }
1821}
1822
1823/// struct for typed errors of method [`task_trade`]
1824#[derive(Debug, Clone, Serialize)]
1825#[serde(untagged)]
1826pub enum TaskTradeError {
1827    /// Character not found.
1828    Status498(models::ErrorResponseSchema),
1829    /// The character is in cooldown.
1830    Status499(models::ErrorResponseSchema),
1831    /// An action is already in progress for this character.
1832    Status486(models::ErrorResponseSchema),
1833    /// Tasks Master not found on this map.
1834    Status598(models::ErrorResponseSchema),
1835    /// Task already completed or too many items submitted.
1836    Status475(models::ErrorResponseSchema),
1837    /// The character does not have this task.
1838    Status474(models::ErrorResponseSchema),
1839    /// Missing required item(s).
1840    Status478(models::ErrorResponseSchema),
1841    /// Request could not be processed due to an invalid payload.
1842    Status422(models::ErrorResponseSchema),
1843}
1844
1845impl<'de> Deserialize<'de> for TaskTradeError {
1846    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1847    where
1848        D: Deserializer<'de>,
1849    {
1850        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1851        match raw.error.code {
1852            498 => Ok(Self::Status498(raw)),
1853            499 => Ok(Self::Status499(raw)),
1854            486 => Ok(Self::Status486(raw)),
1855            598 => Ok(Self::Status598(raw)),
1856            475 => Ok(Self::Status475(raw)),
1857            474 => Ok(Self::Status474(raw)),
1858            478 => Ok(Self::Status478(raw)),
1859            422 => Ok(Self::Status422(raw)),
1860            _ => Err(de::Error::custom(format!(
1861                "Unexpected error code: {}",
1862                raw.error.code
1863            ))),
1864        }
1865    }
1866}
1867
1868/// struct for typed errors of method [`unequip_item`]
1869#[derive(Debug, Clone, Serialize)]
1870#[serde(untagged)]
1871pub enum UnequipItemError {
1872    /// Item not found.
1873    Status404(models::ErrorResponseSchema),
1874    /// Character not found.
1875    Status498(models::ErrorResponseSchema),
1876    /// An action is already in progress for this character.
1877    Status486(models::ErrorResponseSchema),
1878    /// The equipment slot is empty.
1879    Status491(models::ErrorResponseSchema),
1880    /// The character&#39;s inventory is full.
1881    Status497(models::ErrorResponseSchema),
1882    /// Missing required item(s).
1883    Status478(models::ErrorResponseSchema),
1884    /// The character does not have enough HP to unequip this item.
1885    Status483(models::ErrorResponseSchema),
1886    /// The character is in cooldown.
1887    Status499(models::ErrorResponseSchema),
1888    /// Request could not be processed due to an invalid payload.
1889    Status422(models::ErrorResponseSchema),
1890}
1891
1892impl<'de> Deserialize<'de> for UnequipItemError {
1893    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1894    where
1895        D: Deserializer<'de>,
1896    {
1897        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1898        match raw.error.code {
1899            404 => Ok(Self::Status404(raw)),
1900            498 => Ok(Self::Status498(raw)),
1901            486 => Ok(Self::Status486(raw)),
1902            491 => Ok(Self::Status491(raw)),
1903            497 => Ok(Self::Status497(raw)),
1904            478 => Ok(Self::Status478(raw)),
1905            483 => Ok(Self::Status483(raw)),
1906            499 => Ok(Self::Status499(raw)),
1907            422 => Ok(Self::Status422(raw)),
1908            _ => Err(de::Error::custom(format!(
1909                "Unexpected error code: {}",
1910                raw.error.code
1911            ))),
1912        }
1913    }
1914}
1915
1916/// struct for typed errors of method [`use_item`]
1917#[derive(Debug, Clone, Serialize)]
1918#[serde(untagged)]
1919pub enum UseItemError {
1920    /// Item not found.
1921    Status404(models::ErrorResponseSchema),
1922    /// Character not found.
1923    Status498(models::ErrorResponseSchema),
1924    /// The character is in cooldown.
1925    Status499(models::ErrorResponseSchema),
1926    /// An action is already in progress for this character.
1927    Status486(models::ErrorResponseSchema),
1928    /// This item is not a consumable.
1929    Status476(models::ErrorResponseSchema),
1930    /// Missing required item(s).
1931    Status478(models::ErrorResponseSchema),
1932    /// Conditions not met.
1933    Status496(models::ErrorResponseSchema),
1934    /// Request could not be processed due to an invalid payload.
1935    Status422(models::ErrorResponseSchema),
1936}
1937
1938impl<'de> Deserialize<'de> for UseItemError {
1939    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1940    where
1941        D: Deserializer<'de>,
1942    {
1943        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1944        match raw.error.code {
1945            404 => Ok(Self::Status404(raw)),
1946            498 => Ok(Self::Status498(raw)),
1947            499 => Ok(Self::Status499(raw)),
1948            486 => Ok(Self::Status486(raw)),
1949            476 => Ok(Self::Status476(raw)),
1950            478 => Ok(Self::Status478(raw)),
1951            496 => Ok(Self::Status496(raw)),
1952            422 => Ok(Self::Status422(raw)),
1953            _ => Err(de::Error::custom(format!(
1954                "Unexpected error code: {}",
1955                raw.error.code
1956            ))),
1957        }
1958    }
1959}
1960
1961/// struct for typed errors of method [`withdraw_gold`]
1962#[derive(Debug, Clone, Serialize)]
1963#[serde(untagged)]
1964pub enum WithdrawGoldError {
1965    /// Character not found.
1966    Status498(models::ErrorResponseSchema),
1967    /// The character is in cooldown.
1968    Status499(models::ErrorResponseSchema),
1969    /// Some of your items or your gold in the bank are already part of an ongoing transaction.
1970    Status461(models::ErrorResponseSchema),
1971    /// An action is already in progress for this character.
1972    Status486(models::ErrorResponseSchema),
1973    /// Bank not found on this map.
1974    Status598(models::ErrorResponseSchema),
1975    /// Insufficient gold in your bank.
1976    Status460(models::ErrorResponseSchema),
1977    /// Request could not be processed due to an invalid payload.
1978    Status422(models::ErrorResponseSchema),
1979}
1980
1981impl<'de> Deserialize<'de> for WithdrawGoldError {
1982    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1983    where
1984        D: Deserializer<'de>,
1985    {
1986        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
1987        match raw.error.code {
1988            498 => Ok(Self::Status498(raw)),
1989            499 => Ok(Self::Status499(raw)),
1990            461 => Ok(Self::Status461(raw)),
1991            486 => Ok(Self::Status486(raw)),
1992            598 => Ok(Self::Status598(raw)),
1993            460 => Ok(Self::Status460(raw)),
1994            422 => Ok(Self::Status422(raw)),
1995            _ => Err(de::Error::custom(format!(
1996                "Unexpected error code: {}",
1997                raw.error.code
1998            ))),
1999        }
2000    }
2001}
2002
2003/// struct for typed errors of method [`withdraw_item`]
2004#[derive(Debug, Clone, Serialize)]
2005#[serde(untagged)]
2006pub enum WithdrawItemError {
2007    /// Item not found.
2008    Status404(models::ErrorResponseSchema),
2009    /// Character not found.
2010    Status498(models::ErrorResponseSchema),
2011    /// The character is in cooldown.
2012    Status499(models::ErrorResponseSchema),
2013    /// Some of your items or your gold in the bank are already part of an ongoing transaction.
2014    Status461(models::ErrorResponseSchema),
2015    /// An action is already in progress for this character.
2016    Status486(models::ErrorResponseSchema),
2017    /// The character&#39;s inventory is full.
2018    Status497(models::ErrorResponseSchema),
2019    /// Bank not found on this map.
2020    Status598(models::ErrorResponseSchema),
2021    /// Missing required item(s).
2022    Status478(models::ErrorResponseSchema),
2023    /// Request could not be processed due to an invalid payload.
2024    Status422(models::ErrorResponseSchema),
2025}
2026
2027impl<'de> Deserialize<'de> for WithdrawItemError {
2028    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2029    where
2030        D: Deserializer<'de>,
2031    {
2032        let raw = models::ErrorResponseSchema::deserialize(deserializer)?;
2033        match raw.error.code {
2034            404 => Ok(Self::Status404(raw)),
2035            498 => Ok(Self::Status498(raw)),
2036            499 => Ok(Self::Status499(raw)),
2037            461 => Ok(Self::Status461(raw)),
2038            486 => Ok(Self::Status486(raw)),
2039            497 => Ok(Self::Status497(raw)),
2040            598 => Ok(Self::Status598(raw)),
2041            478 => Ok(Self::Status478(raw)),
2042            422 => Ok(Self::Status422(raw)),
2043            _ => Err(de::Error::custom(format!(
2044                "Unexpected error code: {}",
2045                raw.error.code
2046            ))),
2047        }
2048    }
2049}
2050
2051/// Accepting a new task.
2052pub async fn accept_new_task(
2053    configuration: &configuration::Configuration,
2054    params: AcceptNewTaskParams,
2055) -> Result<models::TaskResponseSchema, Error<AcceptNewTaskError>> {
2056    let local_var_configuration = configuration;
2057
2058    // unbox the parameters
2059    let name = params.name;
2060
2061    let local_var_client = &local_var_configuration.client;
2062
2063    let local_var_uri_str = format!(
2064        "{}/my/{name}/action/task/new",
2065        local_var_configuration.base_path,
2066        name = crate::apis::urlencode(name)
2067    );
2068    let mut local_var_req_builder =
2069        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2070
2071    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2072        local_var_req_builder =
2073            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2074    }
2075    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2076        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2077    };
2078
2079    let local_var_req = local_var_req_builder.build()?;
2080    let local_var_resp = local_var_client.execute(local_var_req).await?;
2081
2082    let local_var_status = local_var_resp.status();
2083    let local_var_content = local_var_resp.text().await?;
2084
2085    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2086        serde_json::from_str(&local_var_content).map_err(Error::from)
2087    } else {
2088        let local_var_entity: Option<AcceptNewTaskError> =
2089            serde_json::from_str(&local_var_content).ok();
2090        let local_var_error = ResponseContent {
2091            status: local_var_status,
2092            content: local_var_content,
2093            entity: local_var_entity,
2094        };
2095        Err(Error::ResponseError(local_var_error))
2096    }
2097}
2098
2099/// Execute a transition from the current map to another layer. The character must be on a map that has a transition available.
2100pub async fn action_transition(
2101    configuration: &configuration::Configuration,
2102    params: ActionTransitionParams,
2103) -> Result<models::CharacterTransitionResponseSchema, Error<ActionTransitionError>> {
2104    let local_var_configuration = configuration;
2105
2106    // unbox the parameters
2107    let name = params.name;
2108
2109    let local_var_client = &local_var_configuration.client;
2110
2111    let local_var_uri_str = format!(
2112        "{}/my/{name}/action/transition",
2113        local_var_configuration.base_path,
2114        name = crate::apis::urlencode(name)
2115    );
2116    let mut local_var_req_builder =
2117        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2118
2119    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2120        local_var_req_builder =
2121            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2122    }
2123    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2124        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2125    };
2126
2127    let local_var_req = local_var_req_builder.build()?;
2128    let local_var_resp = local_var_client.execute(local_var_req).await?;
2129
2130    let local_var_status = local_var_resp.status();
2131    let local_var_content = local_var_resp.text().await?;
2132
2133    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2134        serde_json::from_str(&local_var_content).map_err(Error::from)
2135    } else {
2136        let local_var_entity: Option<ActionTransitionError> =
2137            serde_json::from_str(&local_var_content).ok();
2138        let local_var_error = ResponseContent {
2139            status: local_var_status,
2140            content: local_var_content,
2141            entity: local_var_entity,
2142        };
2143        Err(Error::ResponseError(local_var_error))
2144    }
2145}
2146
2147/// Buy a 20 slots bank expansion.
2148pub async fn buy_bank_expansion(
2149    configuration: &configuration::Configuration,
2150    params: BuyBankExpansionParams,
2151) -> Result<models::BankExtensionTransactionResponseSchema, Error<BuyBankExpansionError>> {
2152    let local_var_configuration = configuration;
2153
2154    // unbox the parameters
2155    let name = params.name;
2156
2157    let local_var_client = &local_var_configuration.client;
2158
2159    let local_var_uri_str = format!(
2160        "{}/my/{name}/action/bank/buy_expansion",
2161        local_var_configuration.base_path,
2162        name = crate::apis::urlencode(name)
2163    );
2164    let mut local_var_req_builder =
2165        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2166
2167    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2168        local_var_req_builder =
2169            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2170    }
2171    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2172        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2173    };
2174
2175    let local_var_req = local_var_req_builder.build()?;
2176    let local_var_resp = local_var_client.execute(local_var_req).await?;
2177
2178    let local_var_status = local_var_resp.status();
2179    let local_var_content = local_var_resp.text().await?;
2180
2181    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2182        serde_json::from_str(&local_var_content).map_err(Error::from)
2183    } else {
2184        let local_var_entity: Option<BuyBankExpansionError> =
2185            serde_json::from_str(&local_var_content).ok();
2186        let local_var_error = ResponseContent {
2187            status: local_var_status,
2188            content: local_var_content,
2189            entity: local_var_entity,
2190        };
2191        Err(Error::ResponseError(local_var_error))
2192    }
2193}
2194
2195/// Cancel a task for 1 tasks coin.
2196pub async fn cancel_task(
2197    configuration: &configuration::Configuration,
2198    params: CancelTaskParams,
2199) -> Result<models::TaskCancelledResponseSchema, Error<CancelTaskError>> {
2200    let local_var_configuration = configuration;
2201
2202    // unbox the parameters
2203    let name = params.name;
2204
2205    let local_var_client = &local_var_configuration.client;
2206
2207    let local_var_uri_str = format!(
2208        "{}/my/{name}/action/task/cancel",
2209        local_var_configuration.base_path,
2210        name = crate::apis::urlencode(name)
2211    );
2212    let mut local_var_req_builder =
2213        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2214
2215    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2216        local_var_req_builder =
2217            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2218    }
2219    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2220        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2221    };
2222
2223    let local_var_req = local_var_req_builder.build()?;
2224    let local_var_resp = local_var_client.execute(local_var_req).await?;
2225
2226    let local_var_status = local_var_resp.status();
2227    let local_var_content = local_var_resp.text().await?;
2228
2229    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2230        serde_json::from_str(&local_var_content).map_err(Error::from)
2231    } else {
2232        let local_var_entity: Option<CancelTaskError> =
2233            serde_json::from_str(&local_var_content).ok();
2234        let local_var_error = ResponseContent {
2235            status: local_var_status,
2236            content: local_var_content,
2237            entity: local_var_entity,
2238        };
2239        Err(Error::ResponseError(local_var_error))
2240    }
2241}
2242
2243/// Change the skin of your character.
2244pub async fn change_skin(
2245    configuration: &configuration::Configuration,
2246    params: ChangeSkinParams,
2247) -> Result<models::ChangeSkinResponseSchema, Error<ChangeSkinError>> {
2248    let local_var_configuration = configuration;
2249
2250    // unbox the parameters
2251    let name = params.name;
2252    // unbox the parameters
2253    let change_skin_character_schema = params.change_skin_character_schema;
2254
2255    let local_var_client = &local_var_configuration.client;
2256
2257    let local_var_uri_str = format!(
2258        "{}/my/{name}/action/change_skin",
2259        local_var_configuration.base_path,
2260        name = crate::apis::urlencode(name)
2261    );
2262    let mut local_var_req_builder =
2263        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2264
2265    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2266        local_var_req_builder =
2267            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2268    }
2269    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2270        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2271    };
2272    local_var_req_builder = local_var_req_builder.json(&change_skin_character_schema);
2273
2274    let local_var_req = local_var_req_builder.build()?;
2275    let local_var_resp = local_var_client.execute(local_var_req).await?;
2276
2277    let local_var_status = local_var_resp.status();
2278    let local_var_content = local_var_resp.text().await?;
2279
2280    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2281        serde_json::from_str(&local_var_content).map_err(Error::from)
2282    } else {
2283        let local_var_entity: Option<ChangeSkinError> =
2284            serde_json::from_str(&local_var_content).ok();
2285        let local_var_error = ResponseContent {
2286            status: local_var_status,
2287            content: local_var_content,
2288            entity: local_var_entity,
2289        };
2290        Err(Error::ResponseError(local_var_error))
2291    }
2292}
2293
2294/// Claim a pending item with a specific character.
2295pub async fn claim_pending_item(
2296    configuration: &configuration::Configuration,
2297    params: ClaimPendingItemParams,
2298) -> Result<models::ClaimPendingItemResponseSchema, Error<ClaimPendingItemError>> {
2299    let local_var_configuration = configuration;
2300
2301    // unbox the parameters
2302    let name = params.name;
2303    // unbox the parameters
2304    let id = params.id;
2305
2306    let local_var_client = &local_var_configuration.client;
2307
2308    let local_var_uri_str = format!(
2309        "{}/my/{name}/action/claim_item/{id}",
2310        local_var_configuration.base_path,
2311        name = crate::apis::urlencode(name),
2312        id = crate::apis::urlencode(id)
2313    );
2314    let mut local_var_req_builder =
2315        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2316
2317    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2318        local_var_req_builder =
2319            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2320    }
2321    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2322        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2323    };
2324
2325    let local_var_req = local_var_req_builder.build()?;
2326    let local_var_resp = local_var_client.execute(local_var_req).await?;
2327
2328    let local_var_status = local_var_resp.status();
2329    let local_var_content = local_var_resp.text().await?;
2330
2331    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2332        serde_json::from_str(&local_var_content).map_err(Error::from)
2333    } else {
2334        let local_var_entity: Option<ClaimPendingItemError> =
2335            serde_json::from_str(&local_var_content).ok();
2336        let local_var_error = ResponseContent {
2337            status: local_var_status,
2338            content: local_var_content,
2339            entity: local_var_entity,
2340        };
2341        Err(Error::ResponseError(local_var_error))
2342    }
2343}
2344
2345/// Complete a task.
2346pub async fn complete_task(
2347    configuration: &configuration::Configuration,
2348    params: CompleteTaskParams,
2349) -> Result<models::RewardDataResponseSchema, Error<CompleteTaskError>> {
2350    let local_var_configuration = configuration;
2351
2352    // unbox the parameters
2353    let name = params.name;
2354
2355    let local_var_client = &local_var_configuration.client;
2356
2357    let local_var_uri_str = format!(
2358        "{}/my/{name}/action/task/complete",
2359        local_var_configuration.base_path,
2360        name = crate::apis::urlencode(name)
2361    );
2362    let mut local_var_req_builder =
2363        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2364
2365    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2366        local_var_req_builder =
2367            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2368    }
2369    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2370        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2371    };
2372
2373    let local_var_req = local_var_req_builder.build()?;
2374    let local_var_resp = local_var_client.execute(local_var_req).await?;
2375
2376    let local_var_status = local_var_resp.status();
2377    let local_var_content = local_var_resp.text().await?;
2378
2379    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2380        serde_json::from_str(&local_var_content).map_err(Error::from)
2381    } else {
2382        let local_var_entity: Option<CompleteTaskError> =
2383            serde_json::from_str(&local_var_content).ok();
2384        let local_var_error = ResponseContent {
2385            status: local_var_status,
2386            content: local_var_content,
2387            entity: local_var_entity,
2388        };
2389        Err(Error::ResponseError(local_var_error))
2390    }
2391}
2392
2393/// Craft an item. The character must be on a map with a workshop.
2394pub async fn craft(
2395    configuration: &configuration::Configuration,
2396    params: CraftParams,
2397) -> Result<models::SkillResponseSchema, Error<CraftError>> {
2398    let local_var_configuration = configuration;
2399
2400    // unbox the parameters
2401    let name = params.name;
2402    // unbox the parameters
2403    let crafting_schema = params.crafting_schema;
2404
2405    let local_var_client = &local_var_configuration.client;
2406
2407    let local_var_uri_str = format!(
2408        "{}/my/{name}/action/crafting",
2409        local_var_configuration.base_path,
2410        name = crate::apis::urlencode(name)
2411    );
2412    let mut local_var_req_builder =
2413        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2414
2415    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2416        local_var_req_builder =
2417            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2418    }
2419    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2420        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2421    };
2422    local_var_req_builder = local_var_req_builder.json(&crafting_schema);
2423
2424    let local_var_req = local_var_req_builder.build()?;
2425    let local_var_resp = local_var_client.execute(local_var_req).await?;
2426
2427    let local_var_status = local_var_resp.status();
2428    let local_var_content = local_var_resp.text().await?;
2429
2430    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2431        serde_json::from_str(&local_var_content).map_err(Error::from)
2432    } else {
2433        let local_var_entity: Option<CraftError> = serde_json::from_str(&local_var_content).ok();
2434        let local_var_error = ResponseContent {
2435            status: local_var_status,
2436            content: local_var_content,
2437            entity: local_var_entity,
2438        };
2439        Err(Error::ResponseError(local_var_error))
2440    }
2441}
2442
2443/// Delete an item from your character's inventory.
2444pub async fn delete_item(
2445    configuration: &configuration::Configuration,
2446    params: DeleteItemParams,
2447) -> Result<models::DeleteItemResponseSchema, Error<DeleteItemError>> {
2448    let local_var_configuration = configuration;
2449
2450    // unbox the parameters
2451    let name = params.name;
2452    // unbox the parameters
2453    let simple_item_schema = params.simple_item_schema;
2454
2455    let local_var_client = &local_var_configuration.client;
2456
2457    let local_var_uri_str = format!(
2458        "{}/my/{name}/action/delete",
2459        local_var_configuration.base_path,
2460        name = crate::apis::urlencode(name)
2461    );
2462    let mut local_var_req_builder =
2463        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2464
2465    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2466        local_var_req_builder =
2467            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2468    }
2469    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2470        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2471    };
2472    local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
2473
2474    let local_var_req = local_var_req_builder.build()?;
2475    let local_var_resp = local_var_client.execute(local_var_req).await?;
2476
2477    let local_var_status = local_var_resp.status();
2478    let local_var_content = local_var_resp.text().await?;
2479
2480    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2481        serde_json::from_str(&local_var_content).map_err(Error::from)
2482    } else {
2483        let local_var_entity: Option<DeleteItemError> =
2484            serde_json::from_str(&local_var_content).ok();
2485        let local_var_error = ResponseContent {
2486            status: local_var_status,
2487            content: local_var_content,
2488            entity: local_var_entity,
2489        };
2490        Err(Error::ResponseError(local_var_error))
2491    }
2492}
2493
2494/// Deposit gold in a bank on the character's map.
2495pub async fn deposit_gold(
2496    configuration: &configuration::Configuration,
2497    params: DepositGoldParams,
2498) -> Result<models::BankGoldTransactionResponseSchema, Error<DepositGoldError>> {
2499    let local_var_configuration = configuration;
2500
2501    // unbox the parameters
2502    let name = params.name;
2503    // unbox the parameters
2504    let deposit_withdraw_gold_schema = params.deposit_withdraw_gold_schema;
2505
2506    let local_var_client = &local_var_configuration.client;
2507
2508    let local_var_uri_str = format!(
2509        "{}/my/{name}/action/bank/deposit/gold",
2510        local_var_configuration.base_path,
2511        name = crate::apis::urlencode(name)
2512    );
2513    let mut local_var_req_builder =
2514        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2515
2516    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2517        local_var_req_builder =
2518            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2519    }
2520    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2521        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2522    };
2523    local_var_req_builder = local_var_req_builder.json(&deposit_withdraw_gold_schema);
2524
2525    let local_var_req = local_var_req_builder.build()?;
2526    let local_var_resp = local_var_client.execute(local_var_req).await?;
2527
2528    let local_var_status = local_var_resp.status();
2529    let local_var_content = local_var_resp.text().await?;
2530
2531    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2532        serde_json::from_str(&local_var_content).map_err(Error::from)
2533    } else {
2534        let local_var_entity: Option<DepositGoldError> =
2535            serde_json::from_str(&local_var_content).ok();
2536        let local_var_error = ResponseContent {
2537            status: local_var_status,
2538            content: local_var_content,
2539            entity: local_var_entity,
2540        };
2541        Err(Error::ResponseError(local_var_error))
2542    }
2543}
2544
2545/// Deposit multiple items in a bank on the character's map. The cooldown will be 3 seconds multiplied by the number of different items deposited.
2546pub async fn deposit_item(
2547    configuration: &configuration::Configuration,
2548    params: DepositItemParams,
2549) -> Result<models::BankItemTransactionResponseSchema, Error<DepositItemError>> {
2550    let local_var_configuration = configuration;
2551
2552    // unbox the parameters
2553    let name = params.name;
2554    // unbox the parameters
2555    let simple_item_schema = params.simple_item_schema;
2556
2557    let local_var_client = &local_var_configuration.client;
2558
2559    let local_var_uri_str = format!(
2560        "{}/my/{name}/action/bank/deposit/item",
2561        local_var_configuration.base_path,
2562        name = crate::apis::urlencode(name)
2563    );
2564    let mut local_var_req_builder =
2565        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2566
2567    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2568        local_var_req_builder =
2569            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2570    }
2571    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2572        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2573    };
2574    local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
2575
2576    let local_var_req = local_var_req_builder.build()?;
2577    let local_var_resp = local_var_client.execute(local_var_req).await?;
2578
2579    let local_var_status = local_var_resp.status();
2580    let local_var_content = local_var_resp.text().await?;
2581
2582    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2583        serde_json::from_str(&local_var_content).map_err(Error::from)
2584    } else {
2585        let local_var_entity: Option<DepositItemError> =
2586            serde_json::from_str(&local_var_content).ok();
2587        let local_var_error = ResponseContent {
2588            status: local_var_status,
2589            content: local_var_content,
2590            entity: local_var_entity,
2591        };
2592        Err(Error::ResponseError(local_var_error))
2593    }
2594}
2595
2596/// Equip an item on your character.
2597pub async fn equip_item(
2598    configuration: &configuration::Configuration,
2599    params: EquipItemParams,
2600) -> Result<models::EquipmentResponseSchema, Error<EquipItemError>> {
2601    let local_var_configuration = configuration;
2602
2603    // unbox the parameters
2604    let name = params.name;
2605    // unbox the parameters
2606    let equip_schema = params.equip_schema;
2607
2608    let local_var_client = &local_var_configuration.client;
2609
2610    let local_var_uri_str = format!(
2611        "{}/my/{name}/action/equip",
2612        local_var_configuration.base_path,
2613        name = crate::apis::urlencode(name)
2614    );
2615    let mut local_var_req_builder =
2616        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2617
2618    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2619        local_var_req_builder =
2620            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2621    }
2622    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2623        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2624    };
2625    local_var_req_builder = local_var_req_builder.json(&equip_schema);
2626
2627    let local_var_req = local_var_req_builder.build()?;
2628    let local_var_resp = local_var_client.execute(local_var_req).await?;
2629
2630    let local_var_status = local_var_resp.status();
2631    let local_var_content = local_var_resp.text().await?;
2632
2633    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2634        serde_json::from_str(&local_var_content).map_err(Error::from)
2635    } else {
2636        let local_var_entity: Option<EquipItemError> =
2637            serde_json::from_str(&local_var_content).ok();
2638        let local_var_error = ResponseContent {
2639            status: local_var_status,
2640            content: local_var_content,
2641            entity: local_var_entity,
2642        };
2643        Err(Error::ResponseError(local_var_error))
2644    }
2645}
2646
2647/// Start a fight against a monster on the character's map. Add participants for multi-character fights (up to 3 characters, only for boss).
2648pub async fn fight(
2649    configuration: &configuration::Configuration,
2650    params: FightParams,
2651) -> Result<models::CharacterFightResponseSchema, Error<FightError>> {
2652    let local_var_configuration = configuration;
2653
2654    // unbox the parameters
2655    let name = params.name;
2656    // unbox the parameters
2657    let fight_request_schema = params.fight_request_schema;
2658
2659    let local_var_client = &local_var_configuration.client;
2660
2661    let local_var_uri_str = format!(
2662        "{}/my/{name}/action/fight",
2663        local_var_configuration.base_path,
2664        name = crate::apis::urlencode(name)
2665    );
2666    let mut local_var_req_builder =
2667        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2668
2669    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2670        local_var_req_builder =
2671            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2672    }
2673    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2674        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2675    };
2676    local_var_req_builder = local_var_req_builder.json(&fight_request_schema);
2677
2678    let local_var_req = local_var_req_builder.build()?;
2679    let local_var_resp = local_var_client.execute(local_var_req).await?;
2680
2681    let local_var_status = local_var_resp.status();
2682    let local_var_content = local_var_resp.text().await?;
2683
2684    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2685        serde_json::from_str(&local_var_content).map_err(Error::from)
2686    } else {
2687        let local_var_entity: Option<FightError> = serde_json::from_str(&local_var_content).ok();
2688        let local_var_error = ResponseContent {
2689            status: local_var_status,
2690            content: local_var_content,
2691            entity: local_var_entity,
2692        };
2693        Err(Error::ResponseError(local_var_error))
2694    }
2695}
2696
2697/// Harvest a resource on the character's map.
2698pub async fn gather(
2699    configuration: &configuration::Configuration,
2700    params: GatherParams,
2701) -> Result<models::SkillResponseSchema, Error<GatherError>> {
2702    let local_var_configuration = configuration;
2703
2704    // unbox the parameters
2705    let name = params.name;
2706
2707    let local_var_client = &local_var_configuration.client;
2708
2709    let local_var_uri_str = format!(
2710        "{}/my/{name}/action/gathering",
2711        local_var_configuration.base_path,
2712        name = crate::apis::urlencode(name)
2713    );
2714    let mut local_var_req_builder =
2715        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2716
2717    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2718        local_var_req_builder =
2719            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2720    }
2721    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2722        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2723    };
2724
2725    let local_var_req = local_var_req_builder.build()?;
2726    let local_var_resp = local_var_client.execute(local_var_req).await?;
2727
2728    let local_var_status = local_var_resp.status();
2729    let local_var_content = local_var_resp.text().await?;
2730
2731    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2732        serde_json::from_str(&local_var_content).map_err(Error::from)
2733    } else {
2734        let local_var_entity: Option<GatherError> = serde_json::from_str(&local_var_content).ok();
2735        let local_var_error = ResponseContent {
2736            status: local_var_status,
2737            content: local_var_content,
2738            entity: local_var_entity,
2739        };
2740        Err(Error::ResponseError(local_var_error))
2741    }
2742}
2743
2744/// Buy an item at the Grand Exchange on the character's map.
2745pub async fn ge_buy_item(
2746    configuration: &configuration::Configuration,
2747    params: GeBuyItemParams,
2748) -> Result<models::GeTransactionResponseSchema, Error<GeBuyItemError>> {
2749    let local_var_configuration = configuration;
2750
2751    // unbox the parameters
2752    let name = params.name;
2753    // unbox the parameters
2754    let ge_buy_order_schema = params.ge_buy_order_schema;
2755
2756    let local_var_client = &local_var_configuration.client;
2757
2758    let local_var_uri_str = format!(
2759        "{}/my/{name}/action/grandexchange/buy",
2760        local_var_configuration.base_path,
2761        name = crate::apis::urlencode(name)
2762    );
2763    let mut local_var_req_builder =
2764        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2765
2766    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2767        local_var_req_builder =
2768            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2769    }
2770    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2771        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2772    };
2773    local_var_req_builder = local_var_req_builder.json(&ge_buy_order_schema);
2774
2775    let local_var_req = local_var_req_builder.build()?;
2776    let local_var_resp = local_var_client.execute(local_var_req).await?;
2777
2778    let local_var_status = local_var_resp.status();
2779    let local_var_content = local_var_resp.text().await?;
2780
2781    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2782        serde_json::from_str(&local_var_content).map_err(Error::from)
2783    } else {
2784        let local_var_entity: Option<GeBuyItemError> =
2785            serde_json::from_str(&local_var_content).ok();
2786        let local_var_error = ResponseContent {
2787            status: local_var_status,
2788            content: local_var_content,
2789            entity: local_var_entity,
2790        };
2791        Err(Error::ResponseError(local_var_error))
2792    }
2793}
2794
2795/// Cancel an order (sell or buy) at the Grand Exchange on the character's map.  For sell orders: Items are returned to your inventory. For buy orders: Gold is refunded to your character.
2796pub async fn ge_cancel_order(
2797    configuration: &configuration::Configuration,
2798    params: GeCancelOrderParams,
2799) -> Result<models::GeTransactionResponseSchema, Error<GeCancelOrderError>> {
2800    let local_var_configuration = configuration;
2801
2802    // unbox the parameters
2803    let name = params.name;
2804    // unbox the parameters
2805    let ge_cancel_order_schema = params.ge_cancel_order_schema;
2806
2807    let local_var_client = &local_var_configuration.client;
2808
2809    let local_var_uri_str = format!(
2810        "{}/my/{name}/action/grandexchange/cancel",
2811        local_var_configuration.base_path,
2812        name = crate::apis::urlencode(name)
2813    );
2814    let mut local_var_req_builder =
2815        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2816
2817    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2818        local_var_req_builder =
2819            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2820    }
2821    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2822        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2823    };
2824    local_var_req_builder = local_var_req_builder.json(&ge_cancel_order_schema);
2825
2826    let local_var_req = local_var_req_builder.build()?;
2827    let local_var_resp = local_var_client.execute(local_var_req).await?;
2828
2829    let local_var_status = local_var_resp.status();
2830    let local_var_content = local_var_resp.text().await?;
2831
2832    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2833        serde_json::from_str(&local_var_content).map_err(Error::from)
2834    } else {
2835        let local_var_entity: Option<GeCancelOrderError> =
2836            serde_json::from_str(&local_var_content).ok();
2837        let local_var_error = ResponseContent {
2838            status: local_var_status,
2839            content: local_var_content,
2840            entity: local_var_entity,
2841        };
2842        Err(Error::ResponseError(local_var_error))
2843    }
2844}
2845
2846/// Create a buy order at the Grand Exchange on the character's map.  The total gold (price * quantity) is locked when creating the order. Other players can then sell items to fulfill your order. Items will be delivered to your pending items when the order is filled.
2847pub async fn ge_create_buy_order(
2848    configuration: &configuration::Configuration,
2849    params: GeCreateBuyOrderParams,
2850) -> Result<models::GeCreateOrderTransactionResponseSchema, Error<GeCreateBuyOrderError>> {
2851    let local_var_configuration = configuration;
2852
2853    // unbox the parameters
2854    let name = params.name;
2855    // unbox the parameters
2856    let ge_buy_order_creation_schema = params.ge_buy_order_creation_schema;
2857
2858    let local_var_client = &local_var_configuration.client;
2859
2860    let local_var_uri_str = format!(
2861        "{}/my/{name}/action/grandexchange/create-buy-order",
2862        local_var_configuration.base_path,
2863        name = crate::apis::urlencode(name)
2864    );
2865    let mut local_var_req_builder =
2866        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2867
2868    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2869        local_var_req_builder =
2870            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2871    }
2872    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2873        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2874    };
2875    local_var_req_builder = local_var_req_builder.json(&ge_buy_order_creation_schema);
2876
2877    let local_var_req = local_var_req_builder.build()?;
2878    let local_var_resp = local_var_client.execute(local_var_req).await?;
2879
2880    let local_var_status = local_var_resp.status();
2881    let local_var_content = local_var_resp.text().await?;
2882
2883    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2884        serde_json::from_str(&local_var_content).map_err(Error::from)
2885    } else {
2886        let local_var_entity: Option<GeCreateBuyOrderError> =
2887            serde_json::from_str(&local_var_content).ok();
2888        let local_var_error = ResponseContent {
2889            status: local_var_status,
2890            content: local_var_content,
2891            entity: local_var_entity,
2892        };
2893        Err(Error::ResponseError(local_var_error))
2894    }
2895}
2896
2897/// Create a sell order at the Grand Exchange on the character's map.
2898pub async fn ge_create_sell_order(
2899    configuration: &configuration::Configuration,
2900    params: GeCreateSellOrderParams,
2901) -> Result<models::GeCreateOrderTransactionResponseSchema, Error<GeCreateSellOrderError>> {
2902    let local_var_configuration = configuration;
2903
2904    // unbox the parameters
2905    let name = params.name;
2906    // unbox the parameters
2907    let ge_order_creationr_schema = params.ge_order_creationr_schema;
2908
2909    let local_var_client = &local_var_configuration.client;
2910
2911    let local_var_uri_str = format!(
2912        "{}/my/{name}/action/grandexchange/create-sell-order",
2913        local_var_configuration.base_path,
2914        name = crate::apis::urlencode(name)
2915    );
2916    let mut local_var_req_builder =
2917        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2918
2919    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2920        local_var_req_builder =
2921            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2922    }
2923    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2924        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2925    };
2926    local_var_req_builder = local_var_req_builder.json(&ge_order_creationr_schema);
2927
2928    let local_var_req = local_var_req_builder.build()?;
2929    let local_var_resp = local_var_client.execute(local_var_req).await?;
2930
2931    let local_var_status = local_var_resp.status();
2932    let local_var_content = local_var_resp.text().await?;
2933
2934    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2935        serde_json::from_str(&local_var_content).map_err(Error::from)
2936    } else {
2937        let local_var_entity: Option<GeCreateSellOrderError> =
2938            serde_json::from_str(&local_var_content).ok();
2939        let local_var_error = ResponseContent {
2940            status: local_var_status,
2941            content: local_var_content,
2942            entity: local_var_entity,
2943        };
2944        Err(Error::ResponseError(local_var_error))
2945    }
2946}
2947
2948/// Sell items to an existing buy order at the Grand Exchange on the character's map.  You will receive the gold immediately. The buyer will receive the items in their pending items.
2949pub async fn ge_fill_order(
2950    configuration: &configuration::Configuration,
2951    params: GeFillOrderParams,
2952) -> Result<models::GeTransactionResponseSchema, Error<GeFillOrderError>> {
2953    let local_var_configuration = configuration;
2954
2955    // unbox the parameters
2956    let name = params.name;
2957    // unbox the parameters
2958    let ge_fill_buy_order_schema = params.ge_fill_buy_order_schema;
2959
2960    let local_var_client = &local_var_configuration.client;
2961
2962    let local_var_uri_str = format!(
2963        "{}/my/{name}/action/grandexchange/fill",
2964        local_var_configuration.base_path,
2965        name = crate::apis::urlencode(name)
2966    );
2967    let mut local_var_req_builder =
2968        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2969
2970    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2971        local_var_req_builder =
2972            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2973    }
2974    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2975        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2976    };
2977    local_var_req_builder = local_var_req_builder.json(&ge_fill_buy_order_schema);
2978
2979    let local_var_req = local_var_req_builder.build()?;
2980    let local_var_resp = local_var_client.execute(local_var_req).await?;
2981
2982    let local_var_status = local_var_resp.status();
2983    let local_var_content = local_var_resp.text().await?;
2984
2985    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2986        serde_json::from_str(&local_var_content).map_err(Error::from)
2987    } else {
2988        let local_var_entity: Option<GeFillOrderError> =
2989            serde_json::from_str(&local_var_content).ok();
2990        let local_var_error = ResponseContent {
2991            status: local_var_status,
2992            content: local_var_content,
2993            entity: local_var_entity,
2994        };
2995        Err(Error::ResponseError(local_var_error))
2996    }
2997}
2998
2999/// History of the last 5000 actions of all your characters.
3000pub async fn get_all_characters_logs(
3001    configuration: &configuration::Configuration,
3002    params: GetAllCharactersLogsParams,
3003) -> Result<models::DataPageLogSchema, Error<GetAllCharactersLogsError>> {
3004    let local_var_configuration = configuration;
3005
3006    // unbox the parameters
3007    let page = params.page;
3008    // unbox the parameters
3009    let size = params.size;
3010
3011    let local_var_client = &local_var_configuration.client;
3012
3013    let local_var_uri_str = format!("{}/my/logs", local_var_configuration.base_path);
3014    let mut local_var_req_builder =
3015        local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3016
3017    if let Some(ref local_var_str) = page {
3018        local_var_req_builder =
3019            local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
3020    }
3021    if let Some(ref local_var_str) = size {
3022        local_var_req_builder =
3023            local_var_req_builder.query(&[("size", &local_var_str.to_string())]);
3024    }
3025    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3026        local_var_req_builder =
3027            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3028    }
3029    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3030        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3031    };
3032
3033    let local_var_req = local_var_req_builder.build()?;
3034    let local_var_resp = local_var_client.execute(local_var_req).await?;
3035
3036    let local_var_status = local_var_resp.status();
3037    let local_var_content = local_var_resp.text().await?;
3038
3039    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3040        serde_json::from_str(&local_var_content).map_err(Error::from)
3041    } else {
3042        let local_var_entity: Option<GetAllCharactersLogsError> =
3043            serde_json::from_str(&local_var_content).ok();
3044        let local_var_error = ResponseContent {
3045            status: local_var_status,
3046            content: local_var_content,
3047            entity: local_var_entity,
3048        };
3049        Err(Error::ResponseError(local_var_error))
3050    }
3051}
3052
3053/// History of the last actions of your character.
3054pub async fn get_character_logs(
3055    configuration: &configuration::Configuration,
3056    params: GetCharacterLogsParams,
3057) -> Result<models::DataPageLogSchema, Error<GetCharacterLogsError>> {
3058    let local_var_configuration = configuration;
3059
3060    // unbox the parameters
3061    let name = params.name;
3062    // unbox the parameters
3063    let page = params.page;
3064    // unbox the parameters
3065    let size = params.size;
3066
3067    let local_var_client = &local_var_configuration.client;
3068
3069    let local_var_uri_str = format!(
3070        "{}/my/logs/{name}",
3071        local_var_configuration.base_path,
3072        name = crate::apis::urlencode(name)
3073    );
3074    let mut local_var_req_builder =
3075        local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3076
3077    if let Some(ref local_var_str) = page {
3078        local_var_req_builder =
3079            local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
3080    }
3081    if let Some(ref local_var_str) = size {
3082        local_var_req_builder =
3083            local_var_req_builder.query(&[("size", &local_var_str.to_string())]);
3084    }
3085    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3086        local_var_req_builder =
3087            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3088    }
3089    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3090        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3091    };
3092
3093    let local_var_req = local_var_req_builder.build()?;
3094    let local_var_resp = local_var_client.execute(local_var_req).await?;
3095
3096    let local_var_status = local_var_resp.status();
3097    let local_var_content = local_var_resp.text().await?;
3098
3099    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3100        serde_json::from_str(&local_var_content).map_err(Error::from)
3101    } else {
3102        let local_var_entity: Option<GetCharacterLogsError> =
3103            serde_json::from_str(&local_var_content).ok();
3104        let local_var_error = ResponseContent {
3105            status: local_var_status,
3106            content: local_var_content,
3107            entity: local_var_entity,
3108        };
3109        Err(Error::ResponseError(local_var_error))
3110    }
3111}
3112
3113/// List of your characters.
3114pub async fn get_my_characters(
3115    configuration: &configuration::Configuration,
3116) -> Result<models::MyCharactersListSchema, Error<GetMyCharactersError>> {
3117    let local_var_configuration = configuration;
3118
3119    let local_var_client = &local_var_configuration.client;
3120
3121    let local_var_uri_str = format!("{}/my/characters", local_var_configuration.base_path);
3122    let mut local_var_req_builder =
3123        local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3124
3125    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3126        local_var_req_builder =
3127            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3128    }
3129    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3130        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3131    };
3132
3133    let local_var_req = local_var_req_builder.build()?;
3134    let local_var_resp = local_var_client.execute(local_var_req).await?;
3135
3136    let local_var_status = local_var_resp.status();
3137    let local_var_content = local_var_resp.text().await?;
3138
3139    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3140        serde_json::from_str(&local_var_content).map_err(Error::from)
3141    } else {
3142        let local_var_entity: Option<GetMyCharactersError> =
3143            serde_json::from_str(&local_var_content).ok();
3144        let local_var_error = ResponseContent {
3145            status: local_var_status,
3146            content: local_var_content,
3147            entity: local_var_entity,
3148        };
3149        Err(Error::ResponseError(local_var_error))
3150    }
3151}
3152
3153/// Give gold to another character in your account on the same map.
3154pub async fn give_gold(
3155    configuration: &configuration::Configuration,
3156    params: GiveGoldParams,
3157) -> Result<models::GiveGoldResponseSchema, Error<GiveGoldError>> {
3158    let local_var_configuration = configuration;
3159
3160    // unbox the parameters
3161    let name = params.name;
3162    // unbox the parameters
3163    let give_gold_schema = params.give_gold_schema;
3164
3165    let local_var_client = &local_var_configuration.client;
3166
3167    let local_var_uri_str = format!(
3168        "{}/my/{name}/action/give/gold",
3169        local_var_configuration.base_path,
3170        name = crate::apis::urlencode(name)
3171    );
3172    let mut local_var_req_builder =
3173        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3174
3175    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3176        local_var_req_builder =
3177            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3178    }
3179    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3180        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3181    };
3182    local_var_req_builder = local_var_req_builder.json(&give_gold_schema);
3183
3184    let local_var_req = local_var_req_builder.build()?;
3185    let local_var_resp = local_var_client.execute(local_var_req).await?;
3186
3187    let local_var_status = local_var_resp.status();
3188    let local_var_content = local_var_resp.text().await?;
3189
3190    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3191        serde_json::from_str(&local_var_content).map_err(Error::from)
3192    } else {
3193        let local_var_entity: Option<GiveGoldError> = serde_json::from_str(&local_var_content).ok();
3194        let local_var_error = ResponseContent {
3195            status: local_var_status,
3196            content: local_var_content,
3197            entity: local_var_entity,
3198        };
3199        Err(Error::ResponseError(local_var_error))
3200    }
3201}
3202
3203/// Give items to another character in your account on the same map. The cooldown will be 3 seconds multiplied by the number of different items given.
3204pub async fn give_items(
3205    configuration: &configuration::Configuration,
3206    params: GiveItemsParams,
3207) -> Result<models::GiveItemResponseSchema, Error<GiveItemsError>> {
3208    let local_var_configuration = configuration;
3209
3210    // unbox the parameters
3211    let name = params.name;
3212    // unbox the parameters
3213    let give_items_schema = params.give_items_schema;
3214
3215    let local_var_client = &local_var_configuration.client;
3216
3217    let local_var_uri_str = format!(
3218        "{}/my/{name}/action/give/item",
3219        local_var_configuration.base_path,
3220        name = crate::apis::urlencode(name)
3221    );
3222    let mut local_var_req_builder =
3223        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3224
3225    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3226        local_var_req_builder =
3227            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3228    }
3229    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3230        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3231    };
3232    local_var_req_builder = local_var_req_builder.json(&give_items_schema);
3233
3234    let local_var_req = local_var_req_builder.build()?;
3235    let local_var_resp = local_var_client.execute(local_var_req).await?;
3236
3237    let local_var_status = local_var_resp.status();
3238    let local_var_content = local_var_resp.text().await?;
3239
3240    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3241        serde_json::from_str(&local_var_content).map_err(Error::from)
3242    } else {
3243        let local_var_entity: Option<GiveItemsError> =
3244            serde_json::from_str(&local_var_content).ok();
3245        let local_var_error = ResponseContent {
3246            status: local_var_status,
3247            content: local_var_content,
3248            entity: local_var_entity,
3249        };
3250        Err(Error::ResponseError(local_var_error))
3251    }
3252}
3253
3254/// Moves a character on the map using either the map's ID or X and Y position. Provide either 'map_id' or both 'x' and 'y' coordinates in the request body.
3255pub async fn move_character(
3256    configuration: &configuration::Configuration,
3257    params: MoveCharacterParams,
3258) -> Result<models::CharacterMovementResponseSchema, Error<MoveCharacterError>> {
3259    let local_var_configuration = configuration;
3260
3261    // unbox the parameters
3262    let name = params.name;
3263    // unbox the parameters
3264    let destination_schema = params.destination_schema;
3265
3266    let local_var_client = &local_var_configuration.client;
3267
3268    let local_var_uri_str = format!(
3269        "{}/my/{name}/action/move",
3270        local_var_configuration.base_path,
3271        name = crate::apis::urlencode(name)
3272    );
3273    let mut local_var_req_builder =
3274        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3275
3276    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3277        local_var_req_builder =
3278            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3279    }
3280    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3281        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3282    };
3283    local_var_req_builder = local_var_req_builder.json(&destination_schema);
3284
3285    let local_var_req = local_var_req_builder.build()?;
3286    let local_var_resp = local_var_client.execute(local_var_req).await?;
3287
3288    let local_var_status = local_var_resp.status();
3289    let local_var_content = local_var_resp.text().await?;
3290
3291    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3292        serde_json::from_str(&local_var_content).map_err(Error::from)
3293    } else {
3294        let local_var_entity: Option<MoveCharacterError> =
3295            serde_json::from_str(&local_var_content).ok();
3296        let local_var_error = ResponseContent {
3297            status: local_var_status,
3298            content: local_var_content,
3299            entity: local_var_entity,
3300        };
3301        Err(Error::ResponseError(local_var_error))
3302    }
3303}
3304
3305/// Buy an item from an NPC on the character's map.
3306pub async fn npc_buy_item(
3307    configuration: &configuration::Configuration,
3308    params: NpcBuyItemParams,
3309) -> Result<models::NpcMerchantTransactionResponseSchema, Error<NpcBuyItemError>> {
3310    let local_var_configuration = configuration;
3311
3312    // unbox the parameters
3313    let name = params.name;
3314    // unbox the parameters
3315    let npc_merchant_buy_schema = params.npc_merchant_buy_schema;
3316
3317    let local_var_client = &local_var_configuration.client;
3318
3319    let local_var_uri_str = format!(
3320        "{}/my/{name}/action/npc/buy",
3321        local_var_configuration.base_path,
3322        name = crate::apis::urlencode(name)
3323    );
3324    let mut local_var_req_builder =
3325        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3326
3327    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3328        local_var_req_builder =
3329            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3330    }
3331    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3332        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3333    };
3334    local_var_req_builder = local_var_req_builder.json(&npc_merchant_buy_schema);
3335
3336    let local_var_req = local_var_req_builder.build()?;
3337    let local_var_resp = local_var_client.execute(local_var_req).await?;
3338
3339    let local_var_status = local_var_resp.status();
3340    let local_var_content = local_var_resp.text().await?;
3341
3342    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3343        serde_json::from_str(&local_var_content).map_err(Error::from)
3344    } else {
3345        let local_var_entity: Option<NpcBuyItemError> =
3346            serde_json::from_str(&local_var_content).ok();
3347        let local_var_error = ResponseContent {
3348            status: local_var_status,
3349            content: local_var_content,
3350            entity: local_var_entity,
3351        };
3352        Err(Error::ResponseError(local_var_error))
3353    }
3354}
3355
3356/// Sell an item to an NPC on the character's map.
3357pub async fn npc_sell_item(
3358    configuration: &configuration::Configuration,
3359    params: NpcSellItemParams,
3360) -> Result<models::NpcMerchantTransactionResponseSchema, Error<NpcSellItemError>> {
3361    let local_var_configuration = configuration;
3362
3363    // unbox the parameters
3364    let name = params.name;
3365    // unbox the parameters
3366    let npc_merchant_buy_schema = params.npc_merchant_buy_schema;
3367
3368    let local_var_client = &local_var_configuration.client;
3369
3370    let local_var_uri_str = format!(
3371        "{}/my/{name}/action/npc/sell",
3372        local_var_configuration.base_path,
3373        name = crate::apis::urlencode(name)
3374    );
3375    let mut local_var_req_builder =
3376        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3377
3378    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3379        local_var_req_builder =
3380            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3381    }
3382    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3383        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3384    };
3385    local_var_req_builder = local_var_req_builder.json(&npc_merchant_buy_schema);
3386
3387    let local_var_req = local_var_req_builder.build()?;
3388    let local_var_resp = local_var_client.execute(local_var_req).await?;
3389
3390    let local_var_status = local_var_resp.status();
3391    let local_var_content = local_var_resp.text().await?;
3392
3393    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3394        serde_json::from_str(&local_var_content).map_err(Error::from)
3395    } else {
3396        let local_var_entity: Option<NpcSellItemError> =
3397            serde_json::from_str(&local_var_content).ok();
3398        let local_var_error = ResponseContent {
3399            status: local_var_status,
3400            content: local_var_content,
3401            entity: local_var_entity,
3402        };
3403        Err(Error::ResponseError(local_var_error))
3404    }
3405}
3406
3407/// Recycling an item. The character must be on a map with a workshop (only for equipments and weapons).
3408pub async fn recycle(
3409    configuration: &configuration::Configuration,
3410    params: RecycleParams,
3411) -> Result<models::RecyclingResponseSchema, Error<RecycleError>> {
3412    let local_var_configuration = configuration;
3413
3414    // unbox the parameters
3415    let name = params.name;
3416    // unbox the parameters
3417    let recycling_schema = params.recycling_schema;
3418
3419    let local_var_client = &local_var_configuration.client;
3420
3421    let local_var_uri_str = format!(
3422        "{}/my/{name}/action/recycling",
3423        local_var_configuration.base_path,
3424        name = crate::apis::urlencode(name)
3425    );
3426    let mut local_var_req_builder =
3427        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3428
3429    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3430        local_var_req_builder =
3431            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3432    }
3433    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3434        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3435    };
3436    local_var_req_builder = local_var_req_builder.json(&recycling_schema);
3437
3438    let local_var_req = local_var_req_builder.build()?;
3439    let local_var_resp = local_var_client.execute(local_var_req).await?;
3440
3441    let local_var_status = local_var_resp.status();
3442    let local_var_content = local_var_resp.text().await?;
3443
3444    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3445        serde_json::from_str(&local_var_content).map_err(Error::from)
3446    } else {
3447        let local_var_entity: Option<RecycleError> = serde_json::from_str(&local_var_content).ok();
3448        let local_var_error = ResponseContent {
3449            status: local_var_status,
3450            content: local_var_content,
3451            entity: local_var_entity,
3452        };
3453        Err(Error::ResponseError(local_var_error))
3454    }
3455}
3456
3457/// Recovers hit points by resting. (1 second per 5 HP, minimum 3 seconds)
3458pub async fn rest_character(
3459    configuration: &configuration::Configuration,
3460    params: RestCharacterParams,
3461) -> Result<models::CharacterRestResponseSchema, Error<RestCharacterError>> {
3462    let local_var_configuration = configuration;
3463
3464    // unbox the parameters
3465    let name = params.name;
3466
3467    let local_var_client = &local_var_configuration.client;
3468
3469    let local_var_uri_str = format!(
3470        "{}/my/{name}/action/rest",
3471        local_var_configuration.base_path,
3472        name = crate::apis::urlencode(name)
3473    );
3474    let mut local_var_req_builder =
3475        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3476
3477    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3478        local_var_req_builder =
3479            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3480    }
3481    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3482        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3483    };
3484
3485    let local_var_req = local_var_req_builder.build()?;
3486    let local_var_resp = local_var_client.execute(local_var_req).await?;
3487
3488    let local_var_status = local_var_resp.status();
3489    let local_var_content = local_var_resp.text().await?;
3490
3491    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3492        serde_json::from_str(&local_var_content).map_err(Error::from)
3493    } else {
3494        let local_var_entity: Option<RestCharacterError> =
3495            serde_json::from_str(&local_var_content).ok();
3496        let local_var_error = ResponseContent {
3497            status: local_var_status,
3498            content: local_var_content,
3499            entity: local_var_entity,
3500        };
3501        Err(Error::ResponseError(local_var_error))
3502    }
3503}
3504
3505/// Exchange 6 tasks coins for a random reward. Rewards are exclusive items or resources.
3506pub async fn task_exchange(
3507    configuration: &configuration::Configuration,
3508    params: TaskExchangeParams,
3509) -> Result<models::RewardDataResponseSchema, Error<TaskExchangeError>> {
3510    let local_var_configuration = configuration;
3511
3512    // unbox the parameters
3513    let name = params.name;
3514
3515    let local_var_client = &local_var_configuration.client;
3516
3517    let local_var_uri_str = format!(
3518        "{}/my/{name}/action/task/exchange",
3519        local_var_configuration.base_path,
3520        name = crate::apis::urlencode(name)
3521    );
3522    let mut local_var_req_builder =
3523        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3524
3525    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3526        local_var_req_builder =
3527            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3528    }
3529    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3530        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3531    };
3532
3533    let local_var_req = local_var_req_builder.build()?;
3534    let local_var_resp = local_var_client.execute(local_var_req).await?;
3535
3536    let local_var_status = local_var_resp.status();
3537    let local_var_content = local_var_resp.text().await?;
3538
3539    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3540        serde_json::from_str(&local_var_content).map_err(Error::from)
3541    } else {
3542        let local_var_entity: Option<TaskExchangeError> =
3543            serde_json::from_str(&local_var_content).ok();
3544        let local_var_error = ResponseContent {
3545            status: local_var_status,
3546            content: local_var_content,
3547            entity: local_var_entity,
3548        };
3549        Err(Error::ResponseError(local_var_error))
3550    }
3551}
3552
3553/// Trading items with a Tasks Master.
3554pub async fn task_trade(
3555    configuration: &configuration::Configuration,
3556    params: TaskTradeParams,
3557) -> Result<models::TaskTradeResponseSchema, Error<TaskTradeError>> {
3558    let local_var_configuration = configuration;
3559
3560    // unbox the parameters
3561    let name = params.name;
3562    // unbox the parameters
3563    let simple_item_schema = params.simple_item_schema;
3564
3565    let local_var_client = &local_var_configuration.client;
3566
3567    let local_var_uri_str = format!(
3568        "{}/my/{name}/action/task/trade",
3569        local_var_configuration.base_path,
3570        name = crate::apis::urlencode(name)
3571    );
3572    let mut local_var_req_builder =
3573        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3574
3575    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3576        local_var_req_builder =
3577            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3578    }
3579    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3580        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3581    };
3582    local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
3583
3584    let local_var_req = local_var_req_builder.build()?;
3585    let local_var_resp = local_var_client.execute(local_var_req).await?;
3586
3587    let local_var_status = local_var_resp.status();
3588    let local_var_content = local_var_resp.text().await?;
3589
3590    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3591        serde_json::from_str(&local_var_content).map_err(Error::from)
3592    } else {
3593        let local_var_entity: Option<TaskTradeError> =
3594            serde_json::from_str(&local_var_content).ok();
3595        let local_var_error = ResponseContent {
3596            status: local_var_status,
3597            content: local_var_content,
3598            entity: local_var_entity,
3599        };
3600        Err(Error::ResponseError(local_var_error))
3601    }
3602}
3603
3604/// Unequip an item on your character.
3605pub async fn unequip_item(
3606    configuration: &configuration::Configuration,
3607    params: UnequipItemParams,
3608) -> Result<models::EquipmentResponseSchema, Error<UnequipItemError>> {
3609    let local_var_configuration = configuration;
3610
3611    // unbox the parameters
3612    let name = params.name;
3613    // unbox the parameters
3614    let unequip_schema = params.unequip_schema;
3615
3616    let local_var_client = &local_var_configuration.client;
3617
3618    let local_var_uri_str = format!(
3619        "{}/my/{name}/action/unequip",
3620        local_var_configuration.base_path,
3621        name = crate::apis::urlencode(name)
3622    );
3623    let mut local_var_req_builder =
3624        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3625
3626    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3627        local_var_req_builder =
3628            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3629    }
3630    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3631        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3632    };
3633    local_var_req_builder = local_var_req_builder.json(&unequip_schema);
3634
3635    let local_var_req = local_var_req_builder.build()?;
3636    let local_var_resp = local_var_client.execute(local_var_req).await?;
3637
3638    let local_var_status = local_var_resp.status();
3639    let local_var_content = local_var_resp.text().await?;
3640
3641    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3642        serde_json::from_str(&local_var_content).map_err(Error::from)
3643    } else {
3644        let local_var_entity: Option<UnequipItemError> =
3645            serde_json::from_str(&local_var_content).ok();
3646        let local_var_error = ResponseContent {
3647            status: local_var_status,
3648            content: local_var_content,
3649            entity: local_var_entity,
3650        };
3651        Err(Error::ResponseError(local_var_error))
3652    }
3653}
3654
3655/// Use an item as a consumable.
3656pub async fn use_item(
3657    configuration: &configuration::Configuration,
3658    params: UseItemParams,
3659) -> Result<models::UseItemResponseSchema, Error<UseItemError>> {
3660    let local_var_configuration = configuration;
3661
3662    // unbox the parameters
3663    let name = params.name;
3664    // unbox the parameters
3665    let simple_item_schema = params.simple_item_schema;
3666
3667    let local_var_client = &local_var_configuration.client;
3668
3669    let local_var_uri_str = format!(
3670        "{}/my/{name}/action/use",
3671        local_var_configuration.base_path,
3672        name = crate::apis::urlencode(name)
3673    );
3674    let mut local_var_req_builder =
3675        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3676
3677    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3678        local_var_req_builder =
3679            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3680    }
3681    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3682        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3683    };
3684    local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
3685
3686    let local_var_req = local_var_req_builder.build()?;
3687    let local_var_resp = local_var_client.execute(local_var_req).await?;
3688
3689    let local_var_status = local_var_resp.status();
3690    let local_var_content = local_var_resp.text().await?;
3691
3692    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3693        serde_json::from_str(&local_var_content).map_err(Error::from)
3694    } else {
3695        let local_var_entity: Option<UseItemError> = serde_json::from_str(&local_var_content).ok();
3696        let local_var_error = ResponseContent {
3697            status: local_var_status,
3698            content: local_var_content,
3699            entity: local_var_entity,
3700        };
3701        Err(Error::ResponseError(local_var_error))
3702    }
3703}
3704
3705/// Withdraw gold from your bank.
3706pub async fn withdraw_gold(
3707    configuration: &configuration::Configuration,
3708    params: WithdrawGoldParams,
3709) -> Result<models::BankGoldTransactionResponseSchema, Error<WithdrawGoldError>> {
3710    let local_var_configuration = configuration;
3711
3712    // unbox the parameters
3713    let name = params.name;
3714    // unbox the parameters
3715    let deposit_withdraw_gold_schema = params.deposit_withdraw_gold_schema;
3716
3717    let local_var_client = &local_var_configuration.client;
3718
3719    let local_var_uri_str = format!(
3720        "{}/my/{name}/action/bank/withdraw/gold",
3721        local_var_configuration.base_path,
3722        name = crate::apis::urlencode(name)
3723    );
3724    let mut local_var_req_builder =
3725        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3726
3727    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3728        local_var_req_builder =
3729            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3730    }
3731    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3732        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3733    };
3734    local_var_req_builder = local_var_req_builder.json(&deposit_withdraw_gold_schema);
3735
3736    let local_var_req = local_var_req_builder.build()?;
3737    let local_var_resp = local_var_client.execute(local_var_req).await?;
3738
3739    let local_var_status = local_var_resp.status();
3740    let local_var_content = local_var_resp.text().await?;
3741
3742    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3743        serde_json::from_str(&local_var_content).map_err(Error::from)
3744    } else {
3745        let local_var_entity: Option<WithdrawGoldError> =
3746            serde_json::from_str(&local_var_content).ok();
3747        let local_var_error = ResponseContent {
3748            status: local_var_status,
3749            content: local_var_content,
3750            entity: local_var_entity,
3751        };
3752        Err(Error::ResponseError(local_var_error))
3753    }
3754}
3755
3756/// Take items from your bank and put them in the character's inventory. The cooldown will be 3 seconds multiplied by the number of different items withdrawn.
3757pub async fn withdraw_item(
3758    configuration: &configuration::Configuration,
3759    params: WithdrawItemParams,
3760) -> Result<models::BankItemTransactionResponseSchema, Error<WithdrawItemError>> {
3761    let local_var_configuration = configuration;
3762
3763    // unbox the parameters
3764    let name = params.name;
3765    // unbox the parameters
3766    let simple_item_schema = params.simple_item_schema;
3767
3768    let local_var_client = &local_var_configuration.client;
3769
3770    let local_var_uri_str = format!(
3771        "{}/my/{name}/action/bank/withdraw/item",
3772        local_var_configuration.base_path,
3773        name = crate::apis::urlencode(name)
3774    );
3775    let mut local_var_req_builder =
3776        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3777
3778    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3779        local_var_req_builder =
3780            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3781    }
3782    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3783        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3784    };
3785    local_var_req_builder = local_var_req_builder.json(&simple_item_schema);
3786
3787    let local_var_req = local_var_req_builder.build()?;
3788    let local_var_resp = local_var_client.execute(local_var_req).await?;
3789
3790    let local_var_status = local_var_resp.status();
3791    let local_var_content = local_var_resp.text().await?;
3792
3793    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3794        serde_json::from_str(&local_var_content).map_err(Error::from)
3795    } else {
3796        let local_var_entity: Option<WithdrawItemError> =
3797            serde_json::from_str(&local_var_content).ok();
3798        let local_var_error = ResponseContent {
3799            status: local_var_status,
3800            content: local_var_content,
3801            entity: local_var_entity,
3802        };
3803        Err(Error::ResponseError(local_var_error))
3804    }
3805}