gw2api 0.2.0

A sort-of well-documented and WIP wrapper over the Guild Wars 2 API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
use crate::client::Client;
use crate::error::ApiError;


const ENDPOINT_URL: &str = "/v1/files";

/// Struct containing all possible files.
#[derive(Debug, Deserialize, PartialEq)]
pub struct Files {
    map_complete: File,
    map_dungeon: File,
    map_heart_empty: File,
    map_heart_full: File,
    map_node_harvesting: File,
    map_node_logging: File,
    map_node_mining: File,
    map_poi: File,
    map_special_event: File,
    map_story: File,
    map_waypoint: File,
    map_waypoint_contested: File,
    map_waypoint_hover: File,
    map_vista: File,
    map_heropoint: File,
    wvw_battles_hollow_blue: File,
    wvw_battles_hollow_green: File,
    wvw_battles_hollow_red: File,
    wvw_battles_hollow_white: File,
    wvw_bauers_estate_blue: File,
    wvw_bauers_estate_green: File,
    wvw_bauers_estate_red: File,
    wvw_bauers_estate_white: File,
    wvw_carvers_ascent_blue: File,
    wvw_carvers_ascent_green: File,
    wvw_carvers_ascent_red: File,
    wvw_carvers_ascent_white: File,
    wvw_orchard_overlook_blue: File,
    wvw_orchard_overlook_green: File,
    wvw_orchard_overlook_red: File,
    wvw_orchard_overlook_white: File,
    wvw_temple_of_lost_prayers_blue: File,
    wvw_temple_of_lost_prayers_green: File,
    wvw_temple_of_lost_prayers_red: File,
    wvw_temple_of_lost_prayers_white: File,
    wvw_camp: File,
    wvw_tower: File,
    wvw_keep: File,
    wvw_castle: File,
    ui_upgrade_slot_open: File,
    ui_infusion_slot_agony: File,
    ui_infusion_slot_defensive: File,
    ui_infusion_slot_offensive: File,
    ui_infusion_slot_utility: File,
    ui_coin_gold: File,
    ui_coin_silver: File,
    ui_coin_copper: File,
    ui_gem: File,
    ui_supply: File,
    ui_minor_trait_mask: File,
    ui_major_trait_mask: File,
    icon_guardian: File,
    icon_warrior: File,
    icon_revenant: File,
    icon_necromancer: File,
    icon_mesmer: File,
    icon_elementalist: File,
    icon_thief: File,
    icon_ranger: File,
    icon_engineer: File,
    icon_guardian_big: File,
    icon_warrior_big: File,
    icon_revenant_big: File,
    icon_necromancer_big: File,
    icon_mesmer_big: File,
    icon_elementalist_big: File,
    icon_thief_big: File,
    icon_ranger_big: File,
    icon_engineer_big: File,
    map_crafting_scribe: File,
    map_bank: File,
    map_guild_bank: File,
    map_trading_post: File,
    map_crafting_armorsmith: File,
    map_crafting_artificer: File,
    map_crafting_cook: File,
    map_crafting_huntsman: File,
    map_crafting_jeweler: File,
    map_crafting_leatherworker: File,
    map_crafting_tailor: File,
    map_crafting_weaponsmith: File,
    map_guild_registrar: File,
    map_profession_trainer: File,
    map_repair: File,
    map_vendor: File,
    map_vendor_armor: File,
    map_vendor_weapons: File,
    map_vendor_mystic_forge: File,
    map_vendor_laurel: File,
    map_fractal: File,
    map_raid_entrance: File,
    map_adventure: File,
    map_adventure_complete: File,
    map_adventure_locked: File,
    map_outpost: File,
    map_outpost_locked: File,
    map_outpost_contested: File,
    map_outpost_active: File,
    map_vendor_festival: File,
    map_guild_armorer: File,
    map_guild_weaponsmith: File,
    map_vendor_ecto: File,
    map_vendor_guild: File,
    map_vendor_cultural_armor: File,
    map_vendor_cultural_weapons: File,
    map_vendor_crystalline_ore: File,
    map_vendor_airship_parts: File,
    map_vendor_aurillium: File,
    map_vendor_leyline_crystals: File,
    map_vendor_dungeon: File,
    map_elevator_down: File,
    map_elevator_up: File,
    map_ramp_down: File,
    map_ramp_up: File,
    map_stairs_down: File,
    map_stairs_up: File,
}

/// Contains information about an event.
#[derive(Debug, Deserialize, PartialEq)]
pub struct File {
    /// File id of the asset.
    #[serde(rename = "file_id")]
    id: u32,
    /// File signature of the asset.
    signature: String,
}

impl Files {
    /// Retrieve information about commonly requested in-game assets (icons) that are in the game.
    pub fn get_all_files(client: &Client) -> Result<Files, ApiError> {
        client.request(ENDPOINT_URL)
    }

    /// Return File object for map_complete
    pub fn map_complete(&self) -> &File {
        &self.map_complete
    }

    /// Return File object for map_dungeon
    pub fn map_dungeon(&self) -> &File {
        &self.map_dungeon
    }

    /// Return File object for map_heart_empty
    pub fn map_heart_empty(&self) -> &File {
        &self.map_heart_empty
    }

    /// Return File object for map_heart_full
    pub fn map_heart_full(&self) -> &File {
        &self.map_heart_full
    }

    /// Return File object for map_node_harvesting
    pub fn map_node_harvesting(&self) -> &File {
        &self.map_node_harvesting
    }

    /// Return File object for map_node_logging
    pub fn map_node_logging(&self) -> &File {
        &self.map_node_logging
    }

    /// Return File object for map_node_mining
    pub fn map_node_mining(&self) -> &File {
        &self.map_node_mining
    }

    /// Return File object for map_poi
    pub fn map_poi(&self) -> &File {
        &self.map_poi
    }

    /// Return File object for map_special_event
    pub fn map_special_event(&self) -> &File {
        &self.map_special_event
    }

    /// Return File object for map_story
    pub fn map_story(&self) -> &File {
        &self.map_story
    }

    /// Return File object for map_waypoint
    pub fn map_waypoint(&self) -> &File {
        &self.map_waypoint
    }

    /// Return File object for map_waypoint_contested
    pub fn map_waypoint_contested(&self) -> &File {
        &self.map_waypoint_contested
    }

    /// Return File object for map_waypoint_hover
    pub fn map_waypoint_hover(&self) -> &File {
        &self.map_waypoint_hover
    }

    /// Return File object for map_vista
    pub fn map_vista(&self) -> &File {
        &self.map_vista
    }

    /// Return File object for map_heropoint
    pub fn map_heropoint(&self) -> &File {
        &self.map_heropoint
    }

    /// Return File object for wvw_battles_hollow_blue
    pub fn wvw_battles_hollow_blue(&self) -> &File {
        &self.wvw_battles_hollow_blue
    }

    /// Return File object for wvw_battles_hollow_green
    pub fn wvw_battles_hollow_green(&self) -> &File {
        &self.wvw_battles_hollow_green
    }

    /// Return File object for wvw_battles_hollow_red
    pub fn wvw_battles_hollow_red(&self) -> &File {
        &self.wvw_battles_hollow_red
    }

    /// Return File object for wvw_battles_hollow_white
    pub fn wvw_battles_hollow_white(&self) -> &File {
        &self.wvw_battles_hollow_white
    }

    /// Return File object for wvw_bauers_estate_blue
    pub fn wvw_bauers_estate_blue(&self) -> &File {
        &self.wvw_bauers_estate_blue
    }

    /// Return File object for wvw_bauers_estate_green
    pub fn wvw_bauers_estate_green(&self) -> &File {
        &self.wvw_bauers_estate_green
    }

    /// Return File object for wvw_bauers_estate_red
    pub fn wvw_bauers_estate_red(&self) -> &File {
        &self.wvw_bauers_estate_red
    }

    /// Return File object for wvw_bauers_estate_white
    pub fn wvw_bauers_estate_white(&self) -> &File {
        &self.wvw_bauers_estate_white
    }

    /// Return File object for wvw_carvers_ascent_blue
    pub fn wvw_carvers_ascent_blue(&self) -> &File {
        &self.wvw_carvers_ascent_blue
    }

    /// Return File object for wvw_carvers_ascent_green
    pub fn wvw_carvers_ascent_green(&self) -> &File {
        &self.wvw_carvers_ascent_green
    }

    /// Return File object for wvw_carvers_ascent_red
    pub fn wvw_carvers_ascent_red(&self) -> &File {
        &self.wvw_carvers_ascent_red
    }

    /// Return File object for wvw_carvers_ascent_white
    pub fn wvw_carvers_ascent_white(&self) -> &File {
        &self.wvw_carvers_ascent_white
    }

    /// Return File object for wvw_orchard_overlook_blue
    pub fn wvw_orchard_overlook_blue(&self) -> &File {
        &self.wvw_orchard_overlook_blue
    }

    /// Return File object for wvw_orchard_overlook_green
    pub fn wvw_orchard_overlook_green(&self) -> &File {
        &self.wvw_orchard_overlook_green
    }

    /// Return File object for wvw_orchard_overlook_red
    pub fn wvw_orchard_overlook_red(&self) -> &File {
        &self.wvw_orchard_overlook_red
    }

    /// Return File object for wvw_orchard_overlook_white
    pub fn wvw_orchard_overlook_white(&self) -> &File {
        &self.wvw_orchard_overlook_white
    }

    /// Return File object for wvw_temple_of_lost_prayers_blue
    pub fn wvw_temple_of_lost_prayers_blue(&self) -> &File {
        &self.wvw_temple_of_lost_prayers_blue
    }

    /// Return File object for wvw_temple_of_lost_prayers_green
    pub fn wvw_temple_of_lost_prayers_green(&self) -> &File {
        &self.wvw_temple_of_lost_prayers_green
    }

    /// Return File object for wvw_temple_of_lost_prayers_red
    pub fn wvw_temple_of_lost_prayers_red(&self) -> &File {
        &self.wvw_temple_of_lost_prayers_red
    }

    /// Return File object for wvw_temple_of_lost_prayers_white
    pub fn wvw_temple_of_lost_prayers_white(&self) -> &File {
        &self.wvw_temple_of_lost_prayers_white
    }

    /// Return File object for wvw_camp
    pub fn wvw_camp(&self) -> &File {
        &self.wvw_camp
    }

    /// Return File object for wvw_tower
    pub fn wvw_tower(&self) -> &File {
        &self.wvw_tower
    }

    /// Return File object for wvw_keep
    pub fn wvw_keep(&self) -> &File {
        &self.wvw_keep
    }

    /// Return File object for wvw_castle
    pub fn wvw_castle(&self) -> &File {
        &self.wvw_castle
    }

    /// Return File object for ui_upgrade_slot_open
    pub fn ui_upgrade_slot_open(&self) -> &File {
        &self.ui_upgrade_slot_open
    }

    /// Return File object for ui_infusion_slot_agony
    pub fn ui_infusion_slot_agony(&self) -> &File {
        &self.ui_infusion_slot_agony
    }

    /// Return File object for ui_infusion_slot_defensive
    pub fn ui_infusion_slot_defensive(&self) -> &File {
        &self.ui_infusion_slot_defensive
    }

    /// Return File object for ui_infusion_slot_offensive
    pub fn ui_infusion_slot_offensive(&self) -> &File {
        &self.ui_infusion_slot_offensive
    }

    /// Return File object for ui_infusion_slot_utility
    pub fn ui_infusion_slot_utility(&self) -> &File {
        &self.ui_infusion_slot_utility
    }

    /// Return File object for ui_coin_gold
    pub fn ui_coin_gold(&self) -> &File {
        &self.ui_coin_gold
    }

    /// Return File object for ui_coin_silver
    pub fn ui_coin_silver(&self) -> &File {
        &self.ui_coin_silver
    }

    /// Return File object for ui_coin_copper
    pub fn ui_coin_copper(&self) -> &File {
        &self.ui_coin_copper
    }

    /// Return File object for ui_gem
    pub fn ui_gem(&self) -> &File {
        &self.ui_gem
    }

    /// Return File object for ui_supply
    pub fn ui_supply(&self) -> &File {
        &self.ui_supply
    }

    /// Return File object for ui_minor_trait_mask
    pub fn ui_minor_trait_mask(&self) -> &File {
        &self.ui_minor_trait_mask
    }

    /// Return File object for ui_major_trait_mask
    pub fn ui_major_trait_mask(&self) -> &File {
        &self.ui_major_trait_mask
    }

    /// Return File object for icon_guardian
    pub fn icon_guardian(&self) -> &File {
        &self.icon_guardian
    }

    /// Return File object for icon_warrior
    pub fn icon_warrior(&self) -> &File {
        &self.icon_warrior
    }

    /// Return File object for icon_revenant
    pub fn icon_revenant(&self) -> &File {
        &self.icon_revenant
    }

    /// Return File object for icon_necromancer
    pub fn icon_necromancer(&self) -> &File {
        &self.icon_necromancer
    }

    /// Return File object for icon_mesmer
    pub fn icon_mesmer(&self) -> &File {
        &self.icon_mesmer
    }

    /// Return File object for icon_elementalist
    pub fn icon_elementalist(&self) -> &File {
        &self.icon_elementalist
    }

    /// Return File object for icon_thief
    pub fn icon_thief(&self) -> &File {
        &self.icon_thief
    }

    /// Return File object for icon_ranger
    pub fn icon_ranger(&self) -> &File {
        &self.icon_ranger
    }

    /// Return File object for icon_engineer
    pub fn icon_engineer(&self) -> &File {
        &self.icon_engineer
    }

    /// Return File object for icon_guardian_big
    pub fn icon_guardian_big(&self) -> &File {
        &self.icon_guardian_big
    }

    /// Return File object for icon_warrior_big
    pub fn icon_warrior_big(&self) -> &File {
        &self.icon_warrior_big
    }

    /// Return File object for icon_revenant_big
    pub fn icon_revenant_big(&self) -> &File {
        &self.icon_revenant_big
    }

    /// Return File object for icon_necromancer_big
    pub fn icon_necromancer_big(&self) -> &File {
        &self.icon_necromancer_big
    }

    /// Return File object for icon_mesmer_big
    pub fn icon_mesmer_big(&self) -> &File {
        &self.icon_mesmer_big
    }

    /// Return File object for icon_elementalist_big
    pub fn icon_elementalist_big(&self) -> &File {
        &self.icon_elementalist_big
    }

    /// Return File object for icon_thief_big
    pub fn icon_thief_big(&self) -> &File {
        &self.icon_thief_big
    }

    /// Return File object for icon_ranger_big
    pub fn icon_ranger_big(&self) -> &File {
        &self.icon_ranger_big
    }

    /// Return File object for icon_engineer_big
    pub fn icon_engineer_big(&self) -> &File {
        &self.icon_engineer_big
    }

    /// Return File object for map_crafting_scribe
    pub fn map_crafting_scribe(&self) -> &File {
        &self.map_crafting_scribe
    }

    /// Return File object for map_bank
    pub fn map_bank(&self) -> &File {
        &self.map_bank
    }

    /// Return File object for map_guild_bank
    pub fn map_guild_bank(&self) -> &File {
        &self.map_guild_bank
    }

    /// Return File object for map_trading_post
    pub fn map_trading_post(&self) -> &File {
        &self.map_trading_post
    }

    /// Return File object for map_crafting_armorsmith
    pub fn map_crafting_armorsmith(&self) -> &File {
        &self.map_crafting_armorsmith
    }

    /// Return File object for map_crafting_artificer
    pub fn map_crafting_artificer(&self) -> &File {
        &self.map_crafting_artificer
    }

    /// Return File object for map_crafting_cook
    pub fn map_crafting_cook(&self) -> &File {
        &self.map_crafting_cook
    }

    /// Return File object for map_crafting_huntsman
    pub fn map_crafting_huntsman(&self) -> &File {
        &self.map_crafting_huntsman
    }

    /// Return File object for map_crafting_jeweler
    pub fn map_crafting_jeweler(&self) -> &File {
        &self.map_crafting_jeweler
    }

    /// Return File object for map_crafting_leatherworker
    pub fn map_crafting_leatherworker(&self) -> &File {
        &self.map_crafting_leatherworker
    }

    /// Return File object for map_crafting_tailor
    pub fn map_crafting_tailor(&self) -> &File {
        &self.map_crafting_tailor
    }

    /// Return File object for map_crafting_weaponsmith
    pub fn map_crafting_weaponsmith(&self) -> &File {
        &self.map_crafting_weaponsmith
    }

    /// Return File object for map_guild_registrar
    pub fn map_guild_registrar(&self) -> &File {
        &self.map_guild_registrar
    }

    /// Return File object for map_profession_trainer
    pub fn map_profession_trainer(&self) -> &File {
        &self.map_profession_trainer
    }

    /// Return File object for map_repair
    pub fn map_repair(&self) -> &File {
        &self.map_repair
    }

    /// Return File object for map_vendor
    pub fn map_vendor(&self) -> &File {
        &self.map_vendor
    }

    /// Return File object for map_vendor_armor
    pub fn map_vendor_armor(&self) -> &File {
        &self.map_vendor_armor
    }

    /// Return File object for map_vendor_weapons
    pub fn map_vendor_weapons(&self) -> &File {
        &self.map_vendor_weapons
    }

    /// Return File object for map_vendor_mystic_forge
    pub fn map_vendor_mystic_forge(&self) -> &File {
        &self.map_vendor_mystic_forge
    }

    /// Return File object for map_vendor_laurel
    pub fn map_vendor_laurel(&self) -> &File {
        &self.map_vendor_laurel
    }

    /// Return File object for map_fractal
    pub fn map_fractal(&self) -> &File {
        &self.map_fractal
    }

    /// Return File object for map_raid_entrance
    pub fn map_raid_entrance(&self) -> &File {
        &self.map_raid_entrance
    }

    /// Return File object for map_adventure
    pub fn map_adventure(&self) -> &File {
        &self.map_adventure
    }

    /// Return File object for map_adventure_complete
    pub fn map_adventure_complete(&self) -> &File {
        &self.map_adventure_complete
    }

    /// Return File object for map_adventure_locked
    pub fn map_adventure_locked(&self) -> &File {
        &self.map_adventure_locked
    }

    /// Return File object for map_outpost
    pub fn map_outpost(&self) -> &File {
        &self.map_outpost
    }

    /// Return File object for map_outpost_locked
    pub fn map_outpost_locked(&self) -> &File {
        &self.map_outpost_locked
    }

    /// Return File object for map_outpost_contested
    pub fn map_outpost_contested(&self) -> &File {
        &self.map_outpost_contested
    }

    /// Return File object for map_outpost_active
    pub fn map_outpost_active(&self) -> &File {
        &self.map_outpost_active
    }

    /// Return File object for map_vendor_festival
    pub fn map_vendor_festival(&self) -> &File {
        &self.map_vendor_festival
    }

    /// Return File object for map_guild_armorer
    pub fn map_guild_armorer(&self) -> &File {
        &self.map_guild_armorer
    }

    /// Return File object for map_guild_weaponsmith
    pub fn map_guild_weaponsmith(&self) -> &File {
        &self.map_guild_weaponsmith
    }

    /// Return File object for map_vendor_ecto
    pub fn map_vendor_ecto(&self) -> &File {
        &self.map_vendor_ecto
    }

    /// Return File object for map_vendor_guild
    pub fn map_vendor_guild(&self) -> &File {
        &self.map_vendor_guild
    }

    /// Return File object for map_vendor_cultural_armor
    pub fn map_vendor_cultural_armor(&self) -> &File {
        &self.map_vendor_cultural_armor
    }

    /// Return File object for map_vendor_cultural_weapons
    pub fn map_vendor_cultural_weapons(&self) -> &File {
        &self.map_vendor_cultural_weapons
    }

    /// Return File object for map_vendor_crystalline_ore
    pub fn map_vendor_crystalline_ore(&self) -> &File {
        &self.map_vendor_crystalline_ore
    }

    /// Return File object for map_vendor_airship_parts
    pub fn map_vendor_airship_parts(&self) -> &File {
        &self.map_vendor_airship_parts
    }

    /// Return File object for map_vendor_aurillium
    pub fn map_vendor_aurillium(&self) -> &File {
        &self.map_vendor_aurillium
    }

    /// Return File object for map_vendor_leyline_crystals
    pub fn map_vendor_leyline_crystals(&self) -> &File {
        &self.map_vendor_leyline_crystals
    }

    /// Return File object for map_vendor_dungeon
    pub fn map_vendor_dungeon(&self) -> &File {
        &self.map_vendor_dungeon
    }

    /// Return File object for map_elevator_down
    pub fn map_elevator_down(&self) -> &File {
        &self.map_elevator_down
    }

    /// Return File object for map_elevator_up
    pub fn map_elevator_up(&self) -> &File {
        &self.map_elevator_up
    }

    /// Return File object for map_ramp_down
    pub fn map_ramp_down(&self) -> &File {
        &self.map_ramp_down
    }

    /// Return File object for map_ramp_up
    pub fn map_ramp_up(&self) -> &File {
        &self.map_ramp_up
    }

    /// Return File object for map_stairs_down
    pub fn map_stairs_down(&self) -> &File {
        &self.map_stairs_down
    }

    /// Return File object for map_stairs_up
    pub fn map_stairs_up(&self) -> &File {
        &self.map_stairs_up
    }
}

impl File {
    /// Returns the file id of the asset.
    pub fn id(&self) -> u32 {
        self.id
    }

    /// Returns the signature of the asset..
    pub fn signature(&self) -> &str {
        &self.signature
    }
}

#[cfg(test)]
mod tests {
    use crate::v1::files::*;
    use crate::client::Client;

    // map_stairs_up
    const JSON_FILE: &str = r#"
    {
      "file_id": 102442,
      "signature": "0F80D8D900E1F356B41F752594BEFCE52693DEB3"
    }"#;

    #[test]
    fn create_event() {
        match serde_json::from_str::<File>(JSON_FILE) {
            Ok(_) => assert!(true),
            Err(e) => panic!(e.to_string()),
        }
    }

    #[test]
    fn get_all_files() {
        let client = Client::new();
        let file = serde_json::from_str::<File>(JSON_FILE).unwrap();
        assert_eq!(Files::get_all_files(&client).unwrap().map_stairs_up(), &file)
    }
}