artifacts/apis/
my_characters_api.rs

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