Skip to content

Commit 63a792c

Browse files
authored
add kdoc for utility.kt (#145)
1 parent b6a874f commit 63a792c

File tree

1 file changed

+92
-0
lines changed
  • src/commonMain/kotlin/co/pokeapi/pokekotlin/model

1 file changed

+92
-0
lines changed

src/commonMain/kotlin/co/pokeapi/pokekotlin/model/utility.kt

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@ package co.pokeapi.pokekotlin.model
33
import co.pokeapi.pokekotlin.internal.JsOnlyExport
44
import kotlinx.serialization.Serializable
55

6+
/**
7+
* Languages are resources for translating API resource information into different languages. They
8+
* have an identifier and several codes for different language standards. See:
9+
* https://pokeapi.co/docs/v2#languages
10+
*
11+
* @param id The identifier for this resource.
12+
* @param name The name for this resource.
13+
* @param official Whether or not the language is official.
14+
* @param iso639 The two-letter code of the language as per ISO 639.
15+
* @param iso3166 The two-letter code of the country as per ISO 3166.
16+
* @param names The localized names for this language resource.
17+
*/
618
@Serializable
719
@JsOnlyExport
820
public data class Language(
@@ -14,14 +26,38 @@ public data class Language(
1426
val names: List<Name>,
1527
)
1628

29+
/**
30+
* The localized description for an API resource in a specific language. See:
31+
* https://pokeapi.co/docs/v2#description
32+
*
33+
* @param description The localized description for an API resource in a specific language.
34+
* @param language The language this description is in.
35+
*/
1736
@Serializable
1837
@JsOnlyExport
1938
public data class Description(val description: String, val language: NamedApiResource)
2039

40+
/**
41+
* The localized effect text for an API resource in a specific language. See:
42+
* https://pokeapi.co/docs/v2#effect
43+
*
44+
* @param effect The localized effect text.
45+
* @param language The language this effect is in.
46+
*/
2147
@Serializable
2248
@JsOnlyExport
2349
public data class Effect(val effect: String, val language: NamedApiResource)
2450

51+
/**
52+
* Encounter details for a Pokémon in a specific location area. See:
53+
* https://pokeapi.co/docs/v2#encounter
54+
*
55+
* @param minLevel The lowest level the Pokémon could be encountered at.
56+
* @param maxLevel The highest level the Pokémon could be encountered at.
57+
* @param conditionValues A list of condition values affecting this encounter.
58+
* @param chance The chance of the encounter.
59+
* @param method The method by which the encounter happens.
60+
*/
2561
@Serializable
2662
@JsOnlyExport
2763
public data class Encounter(
@@ -32,25 +68,59 @@ public data class Encounter(
3268
val method: NamedApiResource,
3369
)
3470

71+
/**
72+
* The localized flavor text for an API resource in a specific language. See:
73+
* https://pokeapi.co/docs/v2#flavortext
74+
*
75+
* @param flavorText The localized flavor text.
76+
* @param language The language this flavor text is in.
77+
*/
3578
@Serializable
3679
@JsOnlyExport
3780
public data class FlavorText(val flavorText: String, val language: NamedApiResource)
3881

82+
/**
83+
* Generation game index for a resource. See: https://pokeapi.co/docs/v2#generationgameindex
84+
*
85+
* @param gameIndex The internal id of an API resource within game data.
86+
* @param generation The generation relevant to this game index.
87+
*/
3988
@Serializable
4089
@JsOnlyExport
4190
public data class GenerationGameIndex(val gameIndex: Int, val generation: NamedApiResource)
4291

92+
/**
93+
* Machine and version group details. See: https://pokeapi.co/docs/v2#machineversiondetail
94+
*
95+
* @param machine The machine that teaches a move from an item.
96+
* @param versionGroup The version group relevant to this machine.
97+
*/
4398
@Serializable
4499
@JsOnlyExport
45100
public data class MachineVersionDetail(
46101
val machine: ApiResource,
47102
val versionGroup: NamedApiResource,
48103
)
49104

105+
/**
106+
* The localized name for an API resource in a specific language. See:
107+
* https://pokeapi.co/docs/v2#name
108+
*
109+
* @param name The localized name for an API resource in a specific language.
110+
* @param language The language this name is in.
111+
*/
50112
@Serializable
51113
@JsOnlyExport
52114
public data class Name(val name: String, val language: NamedApiResource)
53115

116+
/**
117+
* The verbose effect text for an API resource in a specific language. See:
118+
* https://pokeapi.co/docs/v2#verboseeffect
119+
*
120+
* @param effect The localized effect text.
121+
* @param shortEffect The localized effect text in brief.
122+
* @param language The language this effect is in.
123+
*/
54124
@Serializable
55125
@JsOnlyExport
56126
public data class VerboseEffect(
@@ -59,6 +129,14 @@ public data class VerboseEffect(
59129
val language: NamedApiResource,
60130
)
61131

132+
/**
133+
* Version encounter details for a Pokémon in a specific version. See:
134+
* https://pokeapi.co/docs/v2#versionencounterdetail
135+
*
136+
* @param version The version relevant to this encounter detail.
137+
* @param maxChance The total chance of all encounter details.
138+
* @param encounterDetails A list of encounters and their specifics.
139+
*/
62140
@Serializable
63141
@JsOnlyExport
64142
public data class VersionEncounterDetail(
@@ -67,10 +145,24 @@ public data class VersionEncounterDetail(
67145
val encounterDetails: List<Encounter>,
68146
)
69147

148+
/**
149+
* Game index for a resource in a specific version. See: https://pokeapi.co/docs/v2#versiongameindex
150+
*
151+
* @param gameIndex The internal id of an API resource within game data.
152+
* @param version The version relevant to this game index.
153+
*/
70154
@Serializable
71155
@JsOnlyExport
72156
public data class VersionGameIndex(val gameIndex: Int, val version: NamedApiResource)
73157

158+
/**
159+
* The localized flavor text for a version group. See:
160+
* https://pokeapi.co/docs/v2#versiongroupflavortext
161+
*
162+
* @param text The localized flavor text for a version group.
163+
* @param language The language this flavor text is in.
164+
* @param versionGroup The version group which uses this flavor text.
165+
*/
74166
@Serializable
75167
@JsOnlyExport
76168
public data class VersionGroupFlavorText(

0 commit comments

Comments
 (0)