This repository has been archived by the owner on Nov 16, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
structs.go
1150 lines (1031 loc) · 65.8 KB
/
structs.go
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
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package golem
// Berries Section
// https://pokeapi.co/docs/v2.html/#berries-section
// Berry ...
// Berries are small fruits that can provide HP and status condition restoration, stat enhancement, and even damage negation when eaten by Pokémon. Check out Bulbapedia for greater detail.
// The berry schema is found at https://pokeapi.co/docs/v2.html/#berries
type Berry struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
GrowthTime int `json:"growth_time" mapstructure:"growth_time"`
MaxHarvest int `json:"max_harvest" mapstructure:"max_harvest"`
NaturalGiftPower int `json:"natural_gift_power" mapstructure:"natural_gift_power"`
Size int `json:"size" mapstructure:"size"`
Smoothness int `json:"smoothness" mapstructure:"smoothness"`
SoilDryness int `json:"soil_dryness" mapstructure:"soil_dryness"`
Firmness namedAPIResource `json:"firmness" mapstructure:"firmness"`
GetFirmness func() BerryFirmness `json:"-" mapstructure:"-"`
Flavors []berryFlavor `json:"flavors" mapstructure:"flavors"`
GetItem func() Item `json:"-" mapstructure:"-"`
GetNaturalGiftType func() Type `json:"-" mapstructure:"-"`
Item namedAPIResource `json:"item" mapstructure:"item"`
NaturalGiftType namedAPIResource `json:"natural_gift_type" mapstructure:"natural_gift_type"`
}
type berryFlavor struct {
Potency int `json:"potency" mapstructure:"potency"`
Flavor namedAPIResource `json:"flavor" mapstructure:"flavor"`
GetFlavor func() BerryFlavor `json:"-" mapstructure:"-"`
}
// BerryFirmness ...
// Berries can be soft or hard. Check out Bulbapedia for greater detail.
// The BerryFirmness schema is found at https://pokeapi.co/docs/v2.html/#berry-firmnesses
type BerryFirmness struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Berries []namedAPIResource `json:"berries" mapstructure:"berries"`
GetBerries []func() Berry `json:"-" mapstructure:"-"`
Names []name `json:"names" mapstructure:"names"`
}
// BerryFlavor ...
// Flavors determine whether a Pokémon will benefit or suffer from eating a berry based on their nature. Check out Bulbapedia for greater detail.
// The BerryFlavor schema can be found at https://pokeapi.co/docs/v2.html/#berry-flavors
type BerryFlavor struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Berries []flavorBerry `json:"berries" mapstructure:"berries"`
ContestType namedAPIResource `json:"contest_type" mapstructure:"contest_type"`
GetContestType func() ContestType `json:"-" mapstructure:"-"`
Names []name `json:"names" mapstructure:"names"`
}
type flavorBerry struct {
Potency int `json:"potency" mapstructure:"potency"`
Berry namedAPIResource `json:"berry" mapstructure:"berry"`
GetBerry func() Berry `json:"-" mapstructure:"-"`
}
// Contests Section
// https://pokeapi.co/docs/v2.html/#contests-section
// ContestType ...
// Contest types are categories judges used to weigh a Pokémon's condition in Pokémon contests. Check out Bulbapedia for greater detail.
// The ContestType schema can be found at https://pokeapi.co/docs/v2.html/#contest-types
type ContestType struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
GetBerryFlavor func() BerryFlavor `json:"-" mapstructure:"-"`
BerryFlavor namedAPIResource `json:"berry_flavor" mapstructure:"berry_flavor"`
Names []contestName `json:"names" mapstructure:"names"`
}
type contestName struct {
Name string `json:"name" mapstructure:"name"`
Color string `json:"color" mapstructure:"color"`
GetLanguage func() Language `json:"-" mapstructure:"-"`
Language namedAPIResource `json:"language" mapstructure:"language"`
}
// ContestEffect ...
// Contest effects refer to the effects of moves when used in contests.
// The ContestEffect schema can be found at https://pokeapi.co/docs/v2.html/#contest-effects
type ContestEffect struct {
ID int `json:"id" mapstructure:"id"`
Appeal int `json:"appeal" mapstructure:"appeal"`
Jam int `json:"jam" mapstructure:"jam"`
EffectEntries []effect `json:"effect_entries" mapstructure:"effect_entries"`
FlavorTextEntries []flavorText `json:"flavor_text_entries" mapstructure:"flavor_text_entries"`
}
// SuperContestEffect ...
// Super contest effects refer to the effects of moves when used in super contests.
// The SuperContestEffect can be found at https://pokeapi.co/docs/v2.html/#super-contest-effects
type SuperContestEffect struct {
ID int `json:"id" mapstructure:"id"`
Appeal int `json:"appeal" mapstructure:"appeal"`
FlavorTextEntries []flavorText `json:"flavor_text_entries" mapstructure:"flavor_text_entries"`
GetMoves []func() Move `json:"-" mapstructure:"-"`
Moves []namedAPIResource `json:"moves" mapstructure:"moves"`
}
// Encounters Section
// https://pokeapi.co/docs/v2.html/#encounters-section
// EncounterMethod ...
// Methods by which the player might can encounter Pokémon in the wild, e.g., walking in tall grass. Check out Bulbapedia for greater detail.
// The EncounterMethod schema can be found at https://pokeapi.co/docs/v2.html/#encounter-methods
type EncounterMethod struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Order int `json:"order" mapstructure:"order"`
Names []name `json:"names" mapstructure:"names"`
}
// EncounterCondition ...
// Conditions which affect what pokemon might appear in the wild, e.g., day or night.
// The EncounterCondition schema can be found at https://pokeapi.co/docs/v2.html/#encounter-conditions
type EncounterCondition struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
GetValues []func() EncounterConditionValue `json:"-" mapstructure:"-"`
Values []namedAPIResource `json:"values" mapstructure:"values"`
Names []name `json:"names" mapstructure:"names"`
}
// EncounterConditionValue ...
// Encounter condition values are the various states that an encounter condition can have, i.e., time of day can be either day or night.
// The EncounterConditionValue schema can be found at https://pokeapi.co/docs/v2.html/#encounter-condition-values
type EncounterConditionValue struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
GetCondition func() EncounterCondition `json:"-" mapstructure:"-"`
Condition namedAPIResource `json:"condition" mapstructure:"condition"`
Names []name `json:"names" mapstructure:"names"`
}
// Evolutions Section
// https://pokeapi.co/docs/v2.html/#evolution-section
// EvolutionChain ...
// Evolution chains are essentially family trees. They start with the lowest stage within a family and detail evolution conditions for each as well as Pokémon they can evolve into up through the hierarchy.
// The EvolutionChain schema can be found at https://pokeapi.co/docs/v2.html/#evolution-chains
type EvolutionChain struct {
ID int `json:"id" mapstructure:"id"`
GetBabyTriggerItem func() Item `json:"-" mapstructure:"-"`
BabyTriggerItem namedAPIResource `json:"baby_trigger_item" mapstructure:"baby_trigger_item"`
Chain chainLink `json:"chain" mapstructure:"chain"`
}
type chainLink struct {
IsBaby bool `json:"is_baby" mapstructure:"is_baby"`
GetSpecies func() PokemonSpecies `json:"-" mapstructure:"-"`
Species namedAPIResource `json:"species" mapstructure:"species"`
EvolutionDetails []evolutionDetail `json:"evolution_details" mapstructure:"evolution_details"`
EvolvesTo []chainLink `json:"evolves_to" mapstructure:"evolves_to"`
}
type evolutionDetail struct {
GetItem func() Item `json:"-" mapstructure:"-"`
Item namedAPIResource `json:"item" mapstructure:"item"`
GetTrigger func() EvolutionTrigger `json:"-" mapstructure:"-"`
Trigger namedAPIResource `json:"trigger" mapstructure:"trigger"`
Gender int `json:"gender" mapstructure:"gender"`
GetHeldItem func() Item `json:"-" mapstructure:"-"`
HeldItem namedAPIResource `json:"held_item" mapstructure:"held_item"`
GetKnownMove func() Move `json:"-" mapstructure:"-"`
KnownMove namedAPIResource `json:"known_move" mapstructure:"known_move"`
GetKnownMoveType func() Type `json:"-" mapstructure:"-"`
KnownMoveType namedAPIResource `json:"known_move_type" mapstructure:"known_move_type"`
GetLocation func() Location `json:"-" mapstructure:"-"`
Location namedAPIResource `json:"location" mapstructure:"location"`
MinLevel int `json:"min_level" mapstructure:"min_level"`
MinHappiness int `json:"min_happiness" mapstructure:"min_happiness"`
MinBeauty int `json:"min_beauty" mapstructure:"min_beauty"`
MinAffection int `json:"min_affection" mapstructure:"min_affection"`
NeedsOverworldRain bool `json:"needs_overworld_rain" mapstructure:"needs_overworld_rain"`
GetPartySpecies func() PokemonSpecies `json:"-" mapstructure:"-"`
PartySpecies namedAPIResource `json:"party_species" mapstructure:"party_species"`
GetPartyType func() Type `json:"-" mapstructure:"-"`
PartyType namedAPIResource `json:"party_type" mapstructure:"party_type"`
RelativePhysicalStats int `json:"relative_physical_stats" mapstructure:"relative_physical_stats"`
TimeOfDay string `json:"time_of_day" mapstructure:"time_of_day"`
GetTradeSpecies func() PokemonSpecies `json:"-" mapstructure:"-"`
TradeSpecies namedAPIResource `json:"trade_species" mapstructure:"trade_species"`
TurnUpsideDown bool `json:"turn_upside_down" mapstructure:"turn_upside_down"`
}
// EvolutionTrigger ...
// Evolution triggers are the events and conditions that cause a Pokémon to evolve. Check out Bulbapedia for greater detail.
// The EvolutionTrigger schema can be found at https://pokeapi.co/docs/v2.html/#evolution-triggers
type EvolutionTrigger struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Names []name `json:"names" mapstructure:"names"`
GetPokemonSpecies []func() PokemonSpecies `json:"-" mapstructure:"-"`
PokemonSpecies []namedAPIResource `json:"pokemon_species" mapstructure:"pokemon_species"`
}
// Games Section
// https://pokeapi.co/docs/v2.html/#games-section
// Generation ...
// A generation is a grouping of the Pokémon games that separates them based on the Pokémon they include. In each generation, a new set of Pokémon, Moves, Abilities and Types that did not exist in the previous generation are released.
// The Generation schema can be found at https://pokeapi.co/docs/v2.html/#generations
type Generation struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
GetAbilities []func() Ability `json:"-" mapstructure:"-"`
Abilities []namedAPIResource `json:"abilities" mapstructure:"abilities"`
Names []name `json:"names" mapstructure:"names"`
GetMainRegion func() Region `json:"-" mapstructure:"-"`
MainRegion namedAPIResource `json:"main_region" mapstructure:"main_region"`
GetMoves []func() Move `json:"-" mapstructure:"-"`
Moves []namedAPIResource `json:"moves" mapstructure:"moves"`
GetPokemonSpecies []func() PokemonSpecies `json:"-" mapstructure:"-"`
PokemonSpecies []namedAPIResource `json:"pokemon_species" mapstructure:"pokemon_species"`
GetTypes []func() Type `json:"-" mapstructure:"-"`
Types []namedAPIResource `json:"types" mapstructure:"types"`
GetVersionGroups []func() VersionGroup `json:"-" mapstructure:"-"`
VersionGroups []namedAPIResource `json:"version_groups" mapstructure:"version_groups"`
}
// Pokedex ...
// A Pokédex is a handheld electronic encyclopedia device; one which is capable of recording and retaining information of the various Pokémon in a given region with the exception of the national dex and some smaller dexes related to portions of a region. See Bulbapedia for greater detail.
// The Pokedex schema can be found at https://pokeapi.co/docs/v2.html/#pokedexes
type Pokedex struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
IsMainSeries bool `json:"is_main_series" mapstructure:"is_main_series"`
Descriptions []description `json:"descriptions" mapstructure:"descriptions"`
Names []name `json:"names" mapstructure:"names"`
PokemonEntries []pokemonEntry `json:"pokemon_entries" mapstructure:"pokemon_entries"`
GetRegion func() Region `json:"-" mapstructure:"-"`
Region namedAPIResource `json:"region" mapstructure:"region"`
GetVersionGroups []func() VersionGroup `json:"-" mapstructure:"-"`
VersionGroups []namedAPIResource `json:"version_groups" mapstructure:"version_groups"`
}
type pokemonEntry struct {
EntryNumber int `json:"entry_number" mapstructure:"entry_number"`
GetPokemonSpecies func() PokemonSpecies `json:"-" mapstructure:"-"`
PokemonSpecies namedAPIResource `json:"pokemon_species" mapstructure:"pokemon_species"`
}
// Version ...
// Versions of the games, e.g., Red, Blue or Yellow.
// The Version schema can be found at https://pokeapi.co/docs/v2.html/#version
type Version struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Names []name `json:"names" mapstructure:"names"`
GetVersionGroup func() VersionGroup `json:"-" mapstructure:"-"`
VersionGroup namedAPIResource `json:"version_group" mapstructure:"version_group"`
}
// VersionGroup ...
// Version groups categorize highly similar versions of the games.
// The VersionGroup schema can be found at https://pokeapi.co/docs/v2.html/#version-groups
type VersionGroup struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Order int `json:"order" mapstructure:"order"`
Generation namedAPIResource `json:"generation" mapstructure:"generation"`
GetMoveLearnMethods []func() MoveLearnMethod `json:"-" mapstructure:"-"`
MoveLearnMethods []namedAPIResource `json:"move_learn_methods" mapstructure:"move_learn_methods"`
GetPokedexes []func() Pokedex `json:"-" mapstructure:"-"`
GetVersions []func() Version `json:"-" mapstructure:"-"`
GetGeneration func() Generation `json:"-" mapstructure:"-"`
Pokedexes []namedAPIResource `json:"pokedexes" mapstructure:"pokedexes"`
Regions []namedAPIResource `json:"regions" mapstructure:"regions"`
Versions []namedAPIResource `json:"versions" mapstructure:"versions"`
}
// Items Section
// https://pokeapi.co/docs/v2.html/#items-section
// Item ...
// An item is an object in the games which the player can pick up, keep in their bag, and use in some manner. They have various uses, including healing, powering up, helping catch Pokémon, or to access a new area.
// The Item schema can be found at https://pokeapi.co/docs/v2.html/#item
type Item struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Cost int `json:"cost" mapstructure:"cost"`
FlingPower int `json:"fling_power" mapstructure:"fling_power"`
GetFlingEffect func() ItemFlingEffect `json:"-" mapstructure:"-"`
FlingEffect namedAPIResource `json:"fling_effect" mapstructure:"fling_effect"`
GetAttributes []func() ItemAttribute `json:"-" mapstructure:"-"`
Attributes []namedAPIResource `json:"attributes" mapstructure:"attributes"`
GetCategory func() ItemCategory `json:"-" mapstructure:"-"`
Category namedAPIResource `json:"category" mapstructure:"category"`
EffectEntries []verboseEffect `json:"effect_entries" mapstructure:"effect_entries"`
FlavorTextEntries []versionGroupFlavorText `json:"flavor_text_entries" mapstructure:"flavor_text_entries"`
GameIndices []generationGameIndex `json:"game_indices" mapstructure:"game_indices"`
Sprites itemSprite `json:"sprites" mapstructure:"sprites"`
HeldByPokemon []itemHolderPokemon `json:"held_by_pokemon" mapstructure:"held_by_pokemon"`
GetBabyTriggerFor func() EvolutionChain `json:"-" mapstructure:"-"`
BabyTriggerFor apiResource `json:"baby_trigger_for" mapstructure:"baby_trigger_for"`
Machines []machineVersionDetail `json:"machines" mapstructure:"machines"`
}
type itemSprite struct {
Default string `json:"default" mapstructure:"default"`
GetSprite func() string `json:"-" mapstructure:"-"`
}
type itemHolderPokemon struct {
Pokemon string `json:"pokemon" mapstructure:"pokemon"`
VersionDetails itemHolderPokemonDetail `json:"version_details" mapstructure:"version_details"`
}
type itemHolderPokemonDetail struct {
Rarity string `json:"rarity" mapstructure:"rarity"`
GetVersion func() Version `json:"-" mapstructure:"-"`
Version namedAPIResource `json:"version" mapstructure:"version"`
}
// ItemAttribute ...
// Item attributes define particular aspects of items, e.g. "usable in battle" or "consumable".
// The ItemAttribute schema can be found at https://pokeapi.co/docs/v2.html/#item-attributes
type ItemAttribute struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
GetItems []func() Item `json:"-" mapstructure:"-"`
Items []namedAPIResource `json:"items" mapstructure:"items"`
Names []name `json:"names" mapstructure:"names"`
Descriptions []description `json:"descriptions" mapstructure:"descriptions"`
}
// ItemCategory ...
// Item categories determine where items will be placed in the players bag.
// The ItemCategory schema can be found at https://pokeapi.co/docs/v2.html/#item-categories
type ItemCategory struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
GetItems []func() Item `json:"-" mapstructure:"-"`
Items []namedAPIResource `json:"items" mapstructure:"items"`
Names []name `json:"names" mapstructure:"names"`
GetPocket func() ItemPocket `json:"-" mapstructure:"-"`
Pocket namedAPIResource `json:"pocket" mapstructure:"pocket"`
}
// ItemFlingEffect ...
// The various effects of the move "Fling" when used with different items.
// The ItemFlingEffect schema can be found at https://pokeapi.co/docs/v2.html/#item-fling-effects
type ItemFlingEffect struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
EffectEntries []effect `json:"effect_entries" mapstructure:"effect_entries"`
GetItems []func() Item `json:"-" mapstructure:"-"`
Items []namedAPIResource `json:"items" mapstructure:"items"`
}
// ItemPocket ...
// Pockets within the players bag used for storing items by category.
// The ItemPocket schema can be found at https://pokeapi.co/docs/v2.html/#item-pockets
type ItemPocket struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
GetCategories []func() ItemCategory `json:"-" mapstructure:"-"`
Categories []namedAPIResource `json:"categories" mapstructure:"categories"`
Names []name `json:"names" mapstructure:"names"`
}
// Locations Section
// https://pokeapi.co/docs/v2.html/#locations-section
// Location ...
// Locations that can be visited within the games. Locations make up sizable portions of regions, like cities or routes.
// The Location schema can be found at https://pokeapi.co/docs/v2.html/#locations
type Location struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
GetRegion func() Region `json:"-" mapstructure:"-"`
Region namedAPIResource `json:"region" mapstructure:"region"`
Names []name `json:"names" mapstructure:"names"`
GameIndices []generationGameIndex `json:"game_indices" mapstructure:"game_indices"`
GetAreas []func() LocationArea `json:"-" mapstructure:"-"`
Areas []namedAPIResource `json:"areas" mapstructure:"areas"`
}
// LocationArea ...
// Location areas are sections of areas, such as floors in a building or cave. Each area has its own set of possible Pokémon encounters.
// The LocationArea schema can be found at https://pokeapi.co/docs/v2.html/#location-areas
type LocationArea struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
GameIndex int `json:"game_index" mapstructure:"game_index"`
EncounterMethodRates []encounterMethodRate `json:"encounter_method_rates" mapstructure:"encounter_method_rates"`
GetLocation func() Location `json:"-" mapstructure:"-"`
Location namedAPIResource `json:"location" mapstructure:"location"`
Names []name `json:"names" mapstructure:"names"`
PokemonEncounters []pokemonEncounter `json:"pokemon_encounters" mapstructure:"pokemon_encounters"`
}
type encounterMethodRate struct {
GetEncounterMethod func() EncounterMethod `json:"-" mapstructure:"-"`
EncounterMethod namedAPIResource `json:"encounter_method" mapstructure:"encounter_method"`
VersionDetails []encounterVersionDetail `json:"version_details" mapstructure:"version_details"`
}
type encounterVersionDetail struct {
Rate int `json:"rate" mapstructure:"rate"`
GetVersion func() Version `json:"-" mapstructure:"-"`
Version namedAPIResource `json:"version" mapstructure:"version"`
}
type pokemonEncounter struct {
GetPokemon func() Pokemon `json:"-" mapstructure:"-"`
Pokemon namedAPIResource `json:"pokemon" mapstructure:"pokemon"`
VersionDetails []versionEncounterDetail `json:"version_details" mapstructure:"version_details"`
}
// PalParkArea ...
// Areas used for grouping Pokémon encounters in Pal Park. They're like habitats that are specific to Pal Park.
// The PalParkArea schema can be found at https://pokeapi.co/docs/v2.html/#pal-park-areas
type PalParkArea struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Names []name `json:"names" mapstructure:"names"`
PokemonEncounters []palParkEncounterSpecies `json:"pokemon_encounters" mapstructure:"pokemon_encounters"`
}
type palParkEncounterSpecies struct {
BaseScore int `json:"base_score" mapstructure:"base_score"`
Rate int `json:"rate" mapstructure:"rate"`
GetPokemonSpecies func() PokemonSpecies `json:"-" mapstructure:"-"`
PokemonSpecies namedAPIResource `json:"pokemon_species" mapstructure:"pokemon_species"`
}
// Region ...
// A region is an organized area of the Pokémon world. Most often, the main difference between regions is the species of Pokémon that can be encountered within them.
// The Region schema can be found at https://pokeapi.co/docs/v2.html/#regions
type Region struct {
ID int `json:"id" mapstructure:"id"`
GetLocations []func() Location
Locations []namedAPIResource `json:"locations" mapstructure:"locations"`
Name string `json:"name" mapstructure:"name"`
Names []name `json:"names" mapstructure:"names"`
GetMainGeneration func() Generation `json:"-" mapstructure:"-"`
MainGeneration namedAPIResource `json:"main_generation" mapstructure:"main_generation"`
GetPokedexes []func() Pokedex `json:"-" mapstructure:"-"`
Pokedexes []namedAPIResource `json:"pokedexes" mapstructure:"pokedexes"`
GetVersionGroups []func() VersionGroup `json:"-" mapstructure:"-"`
VersionGroups []namedAPIResource `json:"version_groups" mapstructure:"version_groups"`
}
// Machines Section
// https://pokeapi.co/docs/v2.html/#machines-section
// Machine ...
// Machines are the representation of items that teach moves to Pokémon. They vary from version to version, so it is not certain that one specific TM or HM corresponds to a single Machine.
// The Machine schema can be found at https://pokeapi.co/docs/v2.html/#machines
type Machine struct {
ID int `json:"id" mapstructure:"id"`
GetItem func() Item `json:"-" mapstructure:"-"`
Item namedAPIResource `json:"item" mapstructure:"item"`
GetMove func() Move `json:"-" mapstructure:"-"`
Move namedAPIResource `json:"move" mapstructure:"move"`
GetVersionGroup func() VersionGroup `json:"-" mapstructure:"-"`
VersionGroup namedAPIResource `json:"version_group" mapstructure:"version_group"`
}
// Moves Section
// https://pokeapi.co/docs/v2.html/#moves-section
// Move ...
// Moves are the skills of Pokémon in battle. In battle, a Pokémon uses one move each turn. Some moves (including those learned by Hidden Machine) can be used outside of battle as well, usually for the purpose of removing obstacles or exploring new areas.
// The Move schema can be found at https://pokeapi.co/docs/v2.html/#moves
type Move struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Accuracy int `json:"accuracy" mapstructure:"accuracy"`
EffectChance int `json:"effect_chance" mapstructure:"effect_chance"`
PP int `json:"pp" mapstructure:"pp"`
Priorty int `json:"priorty" mapstructure:"priorty"`
Power int `json:"power" mapstructure:"power"`
ContestCombos contestComboSet `json:"contest_combos" mapstructure:"contest_combos"`
GetContestType func() ContestType `json:"-" mapstructure:"-"`
ContestType namedAPIResource `json:"contest_type" mapstructure:"contest_type"`
GetContestEffect func() ContestEffect `json:"-" mapstructure:"-"`
ContestEffect apiResource `json:"contest_effect" mapstructure:"contest_effect"`
GetDamageClass func() MoveDamageClass `json:"-" mapstructure:"-"`
DamageClass namedAPIResource `json:"damage_class" mapstructure:"damage_class"`
EffectEntries []verboseEffect `json:"effect_entries" mapstructure:"effect_entries"`
EffectChanges []abilityEffectChange `json:"effect_changes" mapstructure:"effect_changes"`
FlavorTextEntries []moveFlavorText `json:"flavor_text_entries" mapstructure:"flavor_text_entries"`
GetGeneration func() Generation `json:"-" mapstructure:"-"`
Generation namedAPIResource `json:"generation" mapstructure:"generation"`
Machines []machineVersionDetail `json:"machines" mapstructure:"machines"`
Meta moveMetaData `json:"meta" mapstructure:"meta"`
Names []name `json:"names" mapstructure:"names"`
PastValues []pastMoveStatValue `json:"past_values" mapstructure:"past_values"`
StatChanges []moveStatChange `json:"stat_changes" mapstructure:"stat_changes"`
GetSuperContestEffect func() SuperContestEffect `json:"-" mapstructure:"-"`
SuperContestEffect apiResource `json:"super_contest_effect" mapstructure:"super_contest_effect"`
GetTarget func() MoveTarget `json:"-" mapstructure:"-"`
Target namedAPIResource `json:"target" mapstructure:"target"`
GetType func() Type `json:"-" mapstructure:"-"`
Type namedAPIResource `json:"type" mapstructure:"type"`
}
type contestComboSet struct {
Normal contestComboDetail `json:"normal" mapstructure:"normal"`
Super contestComboDetail `json:"super" mapstructure:"super"`
}
type contestComboDetail struct {
GetUseBefore []func() Move `json:"-" mapstructure:"-"`
UseBefore []namedAPIResource `json:"use_before" mapstructure:"use_before"`
GetUseAfter []func() Move `json:"-" mapstructure:"-"`
UseAfter []namedAPIResource `json:"use_after" mapstructure:"use_after"`
}
type moveFlavorText struct {
FlavorText string `json:"flavor_text" mapstructure:"flavor_text"`
GetLanguage func() Language `json:"-" mapstructure:"-"`
Language namedAPIResource `json:"language" mapstructure:"language"`
GetVersionGroup func() VersionGroup `json:"-" mapstructure:"-"`
VersionGroup namedAPIResource `json:"version_group" mapstructure:"version_group"`
}
type moveStatChange struct {
Change int `json:"change" mapstructure:"change"`
GetStat func() Stat `json:"-" mapstructure:"-"`
Stat namedAPIResource `json:"stat" mapstructure:"stat"`
}
type pastMoveStatValue struct {
Accuracy int `json:"accuracy" mapstructure:"accuracy"`
EffectChance int `json:"effect_chance" mapstructure:"effect_chance"`
Power int `json:"power" mapstructure:"power"`
PP int `json:"pp" mapstructure:"pp"`
EffectEntries []verboseEffect `json:"effect_entries" mapstructure:"effect_entries"`
GetType func() Type `json:"-" mapstructure:"-"`
Type namedAPIResource `json:"type" mapstructure:"type"`
GetVersionGroup func() VersionGroup `json:"-" mapstructure:"-"`
VersionGroup namedAPIResource `json:"version_group" mapstructure:"version_group"`
}
type moveMetaData struct {
GetAilment func() MoveAilment `json:"-" mapstructure:"-"`
Ailment namedAPIResource `json:"ailment" mapstructure:"ailment"`
GetCategory func() MoveCategory `json:"-" mapstructure:"-"`
Category namedAPIResource `json:"category" mapstructure:"category"`
MinHits int `json:"min_hits" mapstructure:"min_hits"`
MaxHits int `json:"max_hits" mapstructure:"max_hits"`
MinTurns int `json:"min_turns" mapstructure:"min_turns"`
MaxTurns int `json:"max_turns" mapstructure:"max_turns"`
Drain int `json:"drain" mapstructure:"drain"`
Healing int `json:"healing" mapstructure:"healing"`
CritRate int `json:"crit_rate" mapstructure:"crit_rate"`
AilmentChance int `json:"ailment_chance" mapstructure:"ailment_chance"`
FlinchChance int `json:"flinch_chance" mapstructure:"flinch_chance"`
StatChance int `json:"stat_chance" mapstructure:"stat_chance"`
}
// MoveAilment ...
// Move Ailments are status conditions caused by moves used during battle. See Bulbapedia for greater detail.
// The MoveAilment schema can be found at https://pokeapi.co/docs/v2.html/#move-ailments
type MoveAilment struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
GetMoves []func() Move `json:"-" mapstructure:"-"`
Moves []namedAPIResource `json:"moves" mapstructure:"moves"`
Names []name `json:"names" mapstructure:"names"`
}
// MoveBattleStyle ...
// Styles of moves when used in the Battle Palace. See Bulbapedia for greater detail.
// The MoveBattleStyle schema can be found at https://pokeapi.co/docs/v2.html/#move-battle-styles
type MoveBattleStyle struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Names []name `json:"names" mapstructure:"names"`
}
// MoveCategory ...
// Very general categories that loosely group move effects.
// The MoveCategory schema can be found at https://pokeapi.co/docs/v2.html/#move-categories
type MoveCategory struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
GetMoves []func() Move `json:"-" mapstructure:"-"`
Moves []namedAPIResource `json:"moves" mapstructure:"moves"`
Descriptions []description `json:"descriptions" mapstructure:"descriptions"`
}
// MoveDamageClass ...
// The MoveDamageClass schema can be found at https://pokeapi.co/docs/v2.html/#move-damage-classes
type MoveDamageClass struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Descriptions []description `json:"descriptions" mapstructure:"descriptions"`
GetMoves []func() Move `json:"-" mapstructure:"-"`
Moves []namedAPIResource `json:"moves" mapstructure:"moves"`
Names []name `json:"names" mapstructure:"names"`
}
// MoveLearnMethod ...
// Methods by which Pokémon can learn moves.
// The MoveLearnMethod schema can be found at https://pokeapi.co/docs/v2.html/#move-learn-methods
type MoveLearnMethod struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Descriptions []description `json:"descriptions" mapstructure:"descriptions"`
Names []name `json:"names" mapstructure:"names"`
GetVersionGroups []func() VersionGroup `json:"-" mapstructure:"-"`
VersionGroups []namedAPIResource `json:"version_groups" mapstructure:"version_groups"`
}
// MoveTarget ...
// Targets moves can be directed at during battle. Targets can be Pokémon, environments or even other moves.
// The MoveTarget schema can be found at https://pokeapi.co/docs/v2.html/#move-targets
type MoveTarget struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Descriptions []description `json:"descriptions" mapstructure:"descriptions"`
GetMoves []func() Move `json:"-" mapstructure:"-"`
Moves []namedAPIResource `json:"moves" mapstructure:"moves"`
Names []name `json:"names" mapstructure:"names"`
}
// Pokemon Section
// https://pokeapi.co/docs/v2.html/#pokemon-section
// Ability ...
// Abilities provide passive effects for Pokémon in battle or in the overworld. Pokémon have multiple possible abilities but can have only one ability at a time. Check out Bulbapedia for greater detail.
// The MoveTarget schema can be found at https://pokeapi.co/docs/v2.html/#abilities
type Ability struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
IsMainSeries bool `json:"is_main_series" mapstructure:"is_main_series"`
GetGeneration func() Generation `json:"-" mapstructure:"-"`
Generation namedAPIResource `json:"generation" mapstructure:"generation"`
Names []name `json:"names" mapstructure:"names"`
EffectEntries []verboseEffect `json:"effect_entries" mapstructure:"effect_entries"`
EffectChanges []abilityEffectChange `json:"effect_changes" mapstructure:"effect_changes"`
FlavorTextEntries []abilityFlavorText `json:"flavor_text_entries" mapstructure:"flavor_text_entries"`
Pokemon []abilityPokemon `json:"pokemon" mapstructure:"pokemon"`
}
type abilityEffectChange struct {
EffectEntries []effect `json:"effect_entries" mapstructure:"effect_entries"`
GetVersionGroup func() VersionGroup `json:"-" mapstructure:"-"`
VersionGroup namedAPIResource `json:"version_group" mapstructure:"version_group"`
}
type abilityFlavorText struct {
FlavorText string `json:"flavor_text" mapstructure:"flavor_text"`
GetLanguage func() Language `json:"-" mapstructure:"-"`
Language namedAPIResource `json:"language" mapstructure:"language"`
GetVersionGroup func() VersionGroup `json:"-" mapstructure:"-"`
VersionGroup namedAPIResource `json:"version_group" mapstructure:"version_group"`
}
type abilityPokemon struct {
IsHidden bool `json:"is_hidden" mapstructure:"is_hidden"`
Slot int `json:"slot" mapstructure:"slot"`
GetPokemon func() Pokemon `json:"-" mapstructure:"-"`
Pokemon namedAPIResource `json:"pokemon" mapstructure:"pokemon"`
}
// Characteristic ...
// Characteristics indicate which stat contains a Pokémon's highest IV. A Pokémon's Characteristic is determined by the remainder of its highest IV divided by 5 (gene_modulo). Check out Bulbapedia for greater detail.
// The Characteristic schema can be found at https://pokeapi.co/docs/v2.html/#characteristics
type Characteristic struct {
ID int `json:"id" mapstructure:"id"`
GeneModulo int `json:"gene_modulo" mapstructure:"gene_modulo"`
PossibleValues []int `json:"possible_values" mapstructure:"possible_values"`
Descriptions []description `json:"descriptions" mapstructure:"descriptions"`
}
// EggGroup ...
// Egg Groups are categories which determine which Pokémon are able to interbreed. Pokémon may belong to either one or two Egg Groups. Check out Bulbapedia for greater detail.
// The EggGroup schema can be found at https://pokeapi.co/docs/v2.html/#egg-groups
type EggGroup struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Names []name `json:"names" mapstructure:"names"`
GetPokemonSpecies []func() PokemonSpecies `json:"-" mapstructure:"-"`
PokemonSpecies []namedAPIResource `json:"pokemon_species" mapstructure:"pokemon_species"`
}
// Gender ...
// Genders were introduced in Generation II for the purposes of breeding Pokémon but can also result in visual differences or even different evolutionary lines. Check out Bulbapedia for greater detail.
// The Gender schema can be found at https://pokeapi.co/docs/v2.html/#genders
type Gender struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
PokemonSpeciesDetails []pokemonSpeciesGender `json:"pokemon_species_details" mapstructure:"pokemon_species_details"`
GetRequiredForEvolution []func() PokemonSpecies `json:"-" mapstructure:"-"`
RequiredForEvolution []namedAPIResource `json:"required_for_evolution" mapstructure:"required_for_evolution"`
}
type pokemonSpeciesGender struct {
Rate int `json:"rate" mapstructure:"rate"`
GetPokemonSpecies func() PokemonSpecies `json:"-" mapstructure:"-"`
PokemonSpecies namedAPIResource `json:"pokemon_species" mapstructure:"pokemon_species"`
}
// GrowthRate ...
// Growth rates are the speed with which Pokémon gain levels through experience. Check out Bulbapedia for greater detail.
// The GrowthRate schema can be found at https://pokeapi.co/docs/v2.html/#growth-rates
type GrowthRate struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Formula string `json:"formula" mapstructure:"formula"`
Descriptions []description `json:"descriptions" mapstructure:"descriptions"`
Levels []growthRateExperienceLevel `json:"levels" mapstructure:"levels"`
GetPokemonSpecies []func() PokemonSpecies `json:"-" mapstructure:"-"`
PokemonSpecies []namedAPIResource `json:"pokemon_species" mapstructure:"pokemon_species"`
}
type growthRateExperienceLevel struct {
Level int `json:"level" mapstructure:"level"`
Experience int `json:"experience" mapstructure:"experience"`
}
// Nature ...
// Natures influence how a Pokémon's stats grow. See Bulbapedia for greater detail.
// The Nature schema can be found at https://pokeapi.co/docs/v2.html/#natures
type Nature struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
GetDecreasedStat func() Stat `json:"-" mapstructure:"-"`
DecreasedStat namedAPIResource `json:"decreased_stat" mapstructure:"decreased_stat"`
GetIncreasedStat func() Stat `json:"-" mapstructure:"-"`
IncreasedStat namedAPIResource `json:"increased_stat" mapstructure:"increased_stat"`
GetHatesFlavor func() BerryFlavor `json:"-" mapstructure:"-"`
HatesFlavor namedAPIResource `json:"hates_flavor" mapstructure:"hates_flavor"`
GetLikesFlavor func() BerryFlavor `json:"-" mapstructure:"-"`
LikesFlavor namedAPIResource `json:"likes_flavor" mapstructure:"likes_flavor"`
PokeathlonStatChanges []natureStatChange `json:"pokeathlon_stat_changes" mapstructure:"pokeathlon_stat_changes"`
MoveBattleStylePreferences []moveBattleStylePreference `json:"move_battle_style_preferences" mapstructure:"move_battle_style_preferences"`
Names []name `json:"names" mapstructure:"names"`
}
type natureStatChange struct {
MaxChange int `json:"max_change" mapstructure:"max_change"`
GetPokeathlonStat func() PokeathlonStat `json:"-" mapstructure:"-"`
PokeathlonStat namedAPIResource `json:"pokeathlon_stat" mapstructure:"pokeathlon_stat"`
}
type moveBattleStylePreference struct {
LowHPPrefernce int `json:"low_hp_prefernce" mapstructure:"low_hp_prefernce"`
HighHPPreference int `json:"high_hp_preference" mapstructure:"high_hp_preference"`
GetMoveBattleStyle func() MoveBattleStyle `json:"-" mapstructure:"-"`
MoveBattleStyle namedAPIResource `json:"move_battle_style" mapstructure:"move_battle_style"`
}
// PokeathlonStat ...
// Pokeathlon Stats are different attributes of a Pokémon's performance in Pokéathlons. In Pokéathlons, competitions happen on different courses; one for each of the different Pokéathlon stats. See Bulbapedia for greater detail.
// The PokeathlonStat schema can be found at https://pokeapi.co/docs/v2.html/#pokeathlon-stats
type PokeathlonStat struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Names []name `json:"names" mapstructure:"names"`
AffectingNatures []naturePokeathlonStatAffectSets `json:"affecting_natures" mapstructure:"affecting_natures"`
}
type naturePokeathlonStatAffectSets struct {
Increase []naturePokeathlonStatAffect `json:"increase" mapstructure:"increase"`
Decrease []naturePokeathlonStatAffect `json:"decrease" mapstructure:"decrease"`
}
type naturePokeathlonStatAffect struct {
MaxChange int `json:"max_change" mapstructure:"max_change"`
GetNature func() Nature `json:"-" mapstructure:"-"`
Nature namedAPIResource `json:"nature" mapstructure:"nature"`
}
// Pokemon ...
// Pokémon are the creatures that inhabit the world of the Pokémon games. They can be caught using Pokéballs and trained by battling with other Pokémon. See Bulbapedia for greater detail.
// The Pokemon schema can be found at https://pokeapi.co/docs/v2.html/#pokemon
type Pokemon struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
BaseExperience int `json:"base_experience" mapstructure:"base_experience"`
Height int `json:"height" mapstructure:"height"`
IsDefault bool `json:"is_default" mapstructure:"is_default"`
Order int `json:"order" mapstructure:"order"`
Weight int `json:"weight" mapstructure:"weight"`
Abilities []pokemonAbility `json:"abilities" mapstructure:"abilities"`
GetForms []func() PokemonForm `json:"-" mapstructure:"-"`
Forms []namedAPIResource `json:"forms" mapstructure:"forms"`
GameIndices []versionGameIndex `json:"game_indices" mapstructure:"game_indices"`
HeldItems []pokemonHeldItem `json:"held_items" mapstructure:"held_items"`
GetLocationAreaEncounters func() LocationArea `json:"-" mapstructure:"-"`
LocationAreaEncounters string `json:"location_area_encounters" mapstructure:"location_area_encounters"`
Moves []pokemonMove `json:"moves" mapstructure:"moves"`
Sprites pokemonSprites `json:"sprites" mapstructure:"sprites"`
GetSpecies func() PokemonSpecies `json:"-" mapstructure:"-"`
Species namedAPIResource `json:"species" mapstructure:"species"`
Stats []pokemonStat `json:"stats" mapstructure:"stats"`
Types []pokemonType `json:"types" mapstructure:"types"`
}
type pokemonAbility struct {
IsHidden bool `json:"is_hidden" mapstructure:"is_hidden"`
Slot int `json:"slot" mapstructure:"slot"`
GetAbility func() Ability `json:"-" mapstructure:"-"`
Ability namedAPIResource `json:"ability" mapstructure:"ability"`
}
type pokemonType struct {
Slot int `json:"slot" mapstructure:"slot"`
GetType func() Type `json:"-" mapstructure:"-"`
Type namedAPIResource `json:"type" mapstructure:"type"`
}
type pokemonHeldItem struct {
GetItem func() Item `json:"-" mapstructure:"-"`
Item namedAPIResource `json:"item" mapstructure:"item"`
VersionDetails []pokemonHeldItemVersion `json:"version_details" mapstructure:"version_details"`
}
type pokemonHeldItemVersion struct {
GetVersion func() Version `json:"-" mapstructure:"-"`
Version namedAPIResource `json:"version" mapstructure:"version"`
Rarity int `json:"rarity" mapstructure:"rarity"`
}
type pokemonMove struct {
GetMove func() Move `json:"-" mapstructure:"-"`
Move namedAPIResource `json:"move" mapstructure:"move"`
VersionGroupDetails []pokemonMoveVersion `json:"version_group_details" mapstructure:"version_group_details"`
}
type pokemonMoveVersion struct {
GetMoveLearnMethod func() MoveLearnMethod `json:"-" mapstructure:"-"`
MoveLearnMethod namedAPIResource `json:"move_learn_method" mapstructure:"move_learn_method"`
GetVersionGroup func() VersionGroup `json:"-" mapstructure:"-"`
VersionGroup namedAPIResource `json:"version_group" mapstructure:"version_group"`
LevelLearnedAt int `json:"level_learned_at" mapstructure:"level_learned_at"`
}
type pokemonStat struct {
GetStat func() Stat `json:"-" mapstructure:"-"`
Stat namedAPIResource `json:"stat" mapstructure:"stat"`
Effort int `json:"effort" mapstructure:"effort"`
BaseStat int `json:"base_stat" mapstructure:"base_stat"`
}
type pokemonSprites struct {
FrontDefault string `json:"front_default" mapstructure:"front_default"`
FrontShiny string `json:"front_shiny" mapstructure:"front_shiny"`
FrontFemale string `json:"front_female" mapstructure:"front_female"`
FrontShinyFemale string `json:"front_shiny_female" mapstructure:"front_shiny_female"`
BackDefault string `json:"back_default" mapstructure:"back_default"`
BackShiny string `json:"back_shiny" mapstructure:"back_shiny"`
BackFemale string `json:"back_female" mapstructure:"back_female"`
BackShinyFemale string `json:"back_shiny_female" mapstructure:"back_shiny_female"`
GetSprites []func() string `json:"-" mapstructure:"-"`
}
// PokemonColor ...
// Colors used for sorting Pokémon in a Pokédex. The color listed in the Pokédex is usually the color most apparent or covering each Pokémon's body. No orange category exists; Pokémon that are primarily orange are listed as red or brown.
// The PokemonColor schema can be found at https://pokeapi.co/docs/v2.html/#pokemon-colors
type PokemonColor struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Names []name `json:"names" mapstructure:"names"`
GetPokemonSpecies []func() PokemonSpecies `json:"-" mapstructure:"-"`
PokemonSpecies []namedAPIResource `json:"pokemon_species" mapstructure:"pokemon_species"`
}
// PokemonForm ...
// Some Pokémon have the ability to take on different forms. At times, these differences are purely cosmetic and have no bearing on the difference in the Pokémon's stats from another; however, several Pokémon differ in stats (other than HP), type, and Ability depending on their form.
// The PokemonForm schema can be found at https://pokeapi.co/docs/v2.html/#pokemon-forms
type PokemonForm struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Order int `json:"order" mapstructure:"order"`
FormOrder int `json:"form_order" mapstructure:"form_order"`
IsDefault bool `json:"is_default" mapstructure:"is_default"`
IsBattleOnly bool `json:"is_battle_only" mapstructure:"is_battle_only"`
IsMega bool `json:"is_mega" mapstructure:"is_mega"`
FormName string `json:"form_name" mapstructure:"form_name"`
GetPokemon func() Pokemon `json:"-" mapstructure:"-"`
Pokemon namedAPIResource `json:"pokemon" mapstructure:"pokemon"`
Sprites pokemonFormSprites `json:"sprites" mapstructure:"sprites"`
GetVersionGroup func() VersionGroup `json:"-" mapstructure:"-"`
VersionGroup namedAPIResource `json:"version_group" mapstructure:"version_group"`
Names []name `json:"names" mapstructure:"names"`
FormNames []name `json:"form_names" mapstructure:"form_names"`
}
type pokemonFormSprites struct {
FrontDefault string `json:"front_default" mapstructure:"front_default"`
FrontShiny string `json:"front_shiny" mapstructure:"front_shiny"`
BackDefault string `json:"back_default" mapstructure:"back_default"`
BackShiny string `json:"back_shiny" mapstructure:"back_shiny"`
GetSprites []func() string `json:"-" mapstructure:"-"`
}
// PokemonHabitat ...
// Habitats are generally different terrain Pokémon can be found in but can also be areas designated for rare or legendary Pokémon.
// The PokemonHabitat schema can be found at https://pokeapi.co/docs/v2.html/#pokemon-habitats
type PokemonHabitat struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Names []name `json:"names" mapstructure:"names"`
GetPokemonSpecies []func() PokemonSpecies `json:"-" mapstructure:"-"`
PokemonSpecies []namedAPIResource `json:"pokemon_species" mapstructure:"pokemon_species"`
}
// PokemonShape ...
// Shapes used for sorting Pokémon in a Pokédex.
// The PokemonShape schema can be found at https://pokeapi.co/docs/v2.html/#pokemon-shapes
type PokemonShape struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
AwesomeNames []awesomeName `json:"awesome_names" mapstructure:"awesome_names"`
Names []name `json:"names" mapstructure:"names"`
GetPokemonSpecies []func() PokemonSpecies `json:"-" mapstructure:"-"`
PokemonSpecies []namedAPIResource `json:"pokemon_species" mapstructure:"pokemon_species"`
}
type awesomeName struct {
AwesomeName string `json:"awesome_name" mapstructure:"awesome_name"`
GetLanguage func() Language `json:"-" mapstructure:"-"`
Language namedAPIResource `json:"language" mapstructure:"language"`
}
// PokemonSpecies ...
// A Pokémon Species forms the basis for at least one Pokémon. Attributes of a Pokémon species are shared across all varieties of Pokémon within the species. A good example is Wormadam; Wormadam is the species which can be found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant.
// The PokemonSpecies schema can be found at https://pokeapi.co/docs/v2.html/#pokemon-species
type PokemonSpecies struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
Order int `json:"order" mapstructure:"order"`
GenderRate int `json:"gender_rate" mapstructure:"gender_rate"`
CaptureRate int `json:"capture_rate" mapstructure:"capture_rate"`
BaseHappiness int `json:"base_happiness" mapstructure:"base_happiness"`
IsBaby bool `json:"is_baby" mapstructure:"is_baby"`
HatchCounter int `json:"hatch_counter" mapstructure:"hatch_counter"`
HasGenderDifferences bool `json:"has_gender_differences" mapstructure:"has_gender_differences"`
FormsSwitchable bool `json:"forms_switchable" mapstructure:"forms_switchable"`
GetGrowthRate func() GrowthRate `json:"-" mapstructure:"-"`
GrowthRate namedAPIResource `json:"growth_rate" mapstructure:"growth_rate"`
PokedexNumbers []pokemonSpeciesDexEntry `json:"pokedex_numbers" mapstructure:"pokedex_numbers"`
GetEggGroups []func() EggGroup `json:"-" mapstructure:"-"`
EggGroups []namedAPIResource `json:"egg_groups" mapstructure:"egg_groups"`
GetColor func() PokemonColor `json:"-" mapstructure:"-"`
Color namedAPIResource `json:"color" mapstructure:"color"`
GetShape func() PokemonShape `json:"-" mapstructure:"-"`
Shape namedAPIResource `json:"shape" mapstructure:"shape"`
GetEvolvesFromSpecies func() PokemonSpecies `json:"-" mapstructure:"-"`
EvolvesFromSpecies namedAPIResource `json:"evolves_from_species" mapstructure:"evolves_from_species"`
GetEvolutionChain func() EvolutionChain `json:"-" mapstructure:"-"`
EvolutionChain apiResource `json:"evolution_chain" mapstructure:"evolution_chain"`
GetHabitat func() PokemonHabitat `json:"-" mapstructure:"-"`
Habitat namedAPIResource `json:"habitat" mapstructure:"habitat"`
GetGeneration func() Generation `json:"-" mapstructure:"-"`
Generation namedAPIResource `json:"generation" mapstructure:"generation"`
Names []name `json:"names" mapstructure:"names"`
PalParkEncounters []palParkEncounterArea `json:"pal_park_encounters" mapstructure:"pal_park_encounters"`
FlavorTextEntries []flavorText `json:"flavor_text_entries" mapstructure:"flavor_text_entries"`
FormDescriptions []description `json:"form_descriptions" mapstructure:"form_descriptions"`
Genera []genus `json:"genera" mapstructure:"genera"`
Varieties []pokemonSpeciesVariety `json:"varieties" mapstructure:"varieties"`
}
type genus struct {
Genus string `json:"genus" mapstructure:"genus"`
GetLanguage func() Language `json:"-" mapstructure:"-"`
Language namedAPIResource `json:"language" mapstructure:"language"`
}
type pokemonSpeciesDexEntry struct {
EntryNumber int `json:"entry_number" mapstructure:"entry_number"`
GetPokedex func() Pokedex `json:"-" mapstructure:"-"`
Pokedex namedAPIResource `json:"pokedex" mapstructure:"pokedex"`
}
type palParkEncounterArea struct {
BaseScore int `json:"base_score" mapstructure:"base_score"`
Rate int `json:"rate" mapstructure:"rate"`
GetArea func() PalParkArea `json:"-" mapstructure:"-"`
Area namedAPIResource `json:"area" mapstructure:"area"`
}
type pokemonSpeciesVariety struct {
IsDefault bool `json:"is_default" mapstructure:"is_default"`
GetPokemon func() Pokemon `json:"-" mapstructure:"-"`
Pokemon namedAPIResource `json:"pokemon" mapstructure:"pokemon"`
}
// Stat ...
// Stats determine certain aspects of battles. Each Pokémon has a value for each stat which grows as they gain levels and can be altered momentarily by effects in battles.
// The Stat schema can be found at https://pokeapi.co/docs/v2.html/#stats
type Stat struct {
ID int `json:"id" mapstructure:"id"`
Name string `json:"name" mapstructure:"name"`
GameIndex int `json:"game_index" mapstructure:"game_index"`
IsBattleOnly bool `json:"is_battle_only" mapstructure:"is_battle_only"`
AffectingMoves moveStatAffectSets `json:"affecting_moves" mapstructure:"affecting_moves"`