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