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