-
Notifications
You must be signed in to change notification settings - Fork 3
/
models.go
415 lines (380 loc) · 14.1 KB
/
models.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
package rawg
type Roles struct {
Results []*Role `json:"results"`
Count int `json:"count"`
}
// Role is a position (job) of the video game creator
type Role struct {
ID int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
}
// Creator represents main information about creator
type Creator struct {
ID int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Image string `json:"results"`
ImageBackground string `json:"image_background"`
GamesCount int `json:"games_count"`
}
// CreatorDetailed represents detailed information about creator
type CreatorDetailed struct {
Creator
Description string `json:"description"`
ReviewsCount int `json:"reviews_count"`
Rating string `json:"rating"`
RatingTop int `json:"rating_top"`
Updated DateTime `json:"updated"`
}
// Developer represents main information about video game developer
type Developer struct {
ID int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
GamesCount int `json:"games_count"`
ImageBackground string `json:"image_background"`
}
// DeveloperDetailed represents detailed information about video game developer
type DeveloperDetailed struct {
Developer
Description string `json:"description"`
}
// Genre represents game genre
type Genre struct {
ID int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
GamesCount int `json:"games_count"`
ImageBackground string `json:"image_background"`
}
// GenreDetailed represents detailed information of video game genre
type GenreDetailed struct {
Genre
Description string `json:"description"`
}
// Platform represents game platform
type Platform struct {
ID int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
GamesCount int `json:"games_count"`
ImageBackground string `json:"image_background"`
Image string `json:"image"`
YearStart int `json:"year_start"`
YearEnd int `json:"year_end"`
}
// PlatformDetailed represents detailed information of video game platform
type PlatformDetailed struct {
Platform
Description string `json:"description"`
}
// ParentPlatform is a parent video game platform. For instance, for PS2 and PS4 the “parent platform” is PlayStation.
type ParentPlatform struct {
Platform struct {
ID int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
} `json:"platform"`
}
// Publisher represents main information about video game publisher
type Publisher struct {
ID int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
GamesCount int `json:"games_count"`
ImageBackground string `json:"image_background"`
}
// PublisherDetailed represents detailed information about video game developer
type PublisherDetailed struct {
Publisher
Description string `json:"description"`
}
// Store is a video game storefront
type Store struct {
ID int `json:"id"`
Name string `json:"name"`
Domain string `json:"domain"`
Slug string `json:"slug"`
GamesCount int `json:"games_count"`
ImageBackground string `json:"image_background"`
}
// StoreDetailed represents video game storefront (detailed information)
type StoreDetailed struct {
Store
Description string `json:"description"`
}
// Tag of the video game
type Tag struct {
ID int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
GamesCount int `json:"games_count"`
ImageBackground string `json:"image_background"`
Language string `json:"language"`
}
// TagDetailed represents detailed information about tag of the video game
type TagDetailed struct {
Tag
Description string `json:"description"`
}
// EsrbRating is an Entertainment Software Rating Board
type EsrbRating struct {
ID int `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
}
// GameStore represents "Video game - storefront" relation
type GameStore struct {
ID int `json:"id"`
GameID int `json:"game_id"`
StoreID int `json:"store_id"`
Url string `json:"url"`
}
// Screenshot of the game
type Screenshot struct {
ID int `json:"id"`
Image string `json:"image"`
Width int `json:"width"`
Height int `json:"height"`
IsDeleted bool `json:"is_deleted"`
}
// Rating of the game
type Rating struct {
ID int `json:"id"`
Title string `json:"title"`
Count int `json:"count"`
Percent float32 `json:"percent"`
}
// AddedByStatus represents number of games added by status
type AddedByStatus struct {
Yet int `json:"yet"`
Owned int `json:"owned"`
Beaten int `json:"beaten"`
Toplay int `json:"toplay"`
Dropped int `json:"dropped"`
Playing int `json:"playing"`
}
// Requirement represents game requirements
type Requirement struct {
Minimum string `json:"minimum"`
Recommended string `json:"recommended"`
}
// Position (job)
type Position struct {
ID int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
}
// Clip (Trailer) of the game
type Clip struct {
Clip string `json:"clip"`
Clips map[string]string `json:"clips"`
Video string `json:"video"`
Preview string `json:"preview"`
}
// MetacriticPlatform represents metascore - metacritic rating of the game
type MetacriticPlatform struct {
Metascore int `json:"metascore"`
Url string `json:"url"`
Platform *struct {
Platform int `json:"platform"`
Name string `json:"name"`
Slug string `json:"slug"`
} `json:"platform"`
}
// Game represents main information of the game
type Game struct {
ID int `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
Released DateTime `json:"released"`
Tba bool `json:"tba"`
ImageBackground string `json:"background_image"`
Rating float32 `json:"rating"`
RatingTop int `json:"rating_top"`
Ratings []*Rating `json:"ratings"`
RatingsCount int `json:"ratings_count"`
ReviewsTextCount int `json:"reviews_text_count"`
Added int `json:"added"`
AddedByStatus *AddedByStatus `json:"added_by_status"`
Metacritic int `json:"metacritic"`
Playtime int `json:"playtime"`
SuggestionsCount int `json:"suggestions_count"`
Updated DateTime `json:"updated"`
ReviewsCount int `json:"reviews_count"`
SaturatedColor string `json:"saturated_color"`
DominantColor string `json:"dominant_color"`
AlternativeNames []string `json:"alternative_names"`
Platforms []*struct {
Platform *Platform `json:"platform"`
ReleasedAt DateTime `json:"released_at"`
Requirements *Requirement `json:"requirements"`
} `json:"platforms"`
ParentPlatforms []*struct {
Platform struct {
ID int `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
}
} `json:"parent_platforms"`
Genres []*Genre `json:"genres"`
Stores []*struct {
ID int `json:"id"`
Store *Store `json:"store"`
UrlEn string `json:"url_en"`
UrlRu string `json:"url_ru"`
} `json:"stores"`
Clip *Clip `json:"clip"`
Tags []*Tag `json:"tags"`
ShortScreenshots []*struct {
ID int `json:"id"`
Name string `json:"name"`
} `json:"short_screenshots"`
}
// GameDetailed represents detailed information of the game
type GameDetailed struct {
ID int `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
NameOriginal string `json:"name_original"`
Description string `json:"description"`
Metacritic int `json:"metacritic"`
MetacriticPlatforms []*MetacriticPlatform `json:"metacritic_platforms"`
Released DateTime `json:"released"`
Tba bool `json:"tba"`
Updated DateTime `json:"updated"`
ImageBackground string `json:"background_image"`
ImageBackgroundAdditional string `json:"background_image_additional"`
Website string `json:"website"`
Rating float32 `json:"rating"`
RatingTop int `json:"rating_top"`
Ratings []*Rating `json:"ratings"`
Reactions map[string]int `json:"reactions"`
Added int `json:"added"`
AddedByStatus *AddedByStatus `json:"added_by_status"`
Playtime int `json:"playtime"`
ScreenshotsCount int `json:"screenshots_count"`
MoviesCount int `json:"movies_count"`
CreatorsCount int `json:"creators_count"`
AchievementsCount int `json:"achievements_count"`
ParentAchievementsCount int `json:"parent_achievements_count"`
RedditUrl string `json:"reddit_url"`
RedditName string `json:"reddit_name"`
RedditDescription string `json:"reddit_description"`
RedditLogo string `json:"reddit_logo"`
RedditCount int `json:"reddit_count"`
TwitchCount int `json:"twitch_count"`
YoutubeCount int `json:"youtube_count"`
ReviewsTextCount int `json:"reviews_text_count"`
RatingsCount int `json:"ratings_count"`
SuggestionsCount int `json:"suggestions_count"`
AlternativeNames []string `json:"alternative_names"`
MetacriticUrl string `json:"metacritic_url"`
ParentsCount int `json:"parents_count"`
AdditionsCount int `json:"additions_count"`
GameSeriesCountCount int `json:"game_series_count"`
ReviewsCount int `json:"reviews_count"`
SaturatedColor string `json:"saturated_color"`
DominantColor string `json:"dominant_color"`
ParentPlatforms []*struct {
Platform struct {
ID int `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
}
} `json:"parent_platforms"`
Platforms []*struct {
Platform *Platform `json:"platform"`
ReleasedAt DateTime `json:"released_at"`
Requirements *Requirement `json:"requirements"`
} `json:"platforms"`
Stores []*struct {
ID int `json:"id"`
Url string `json:"url"`
Store *Store `json:"store"`
} `json:"stores"`
Developers []*Developer `json:"developers"`
Genres []*Genre `json:"genres"`
Tags []*Tag `json:"tags"`
Publishers []*Publisher `json:"publishers"`
EsrbRating *EsrbRating `json:"esrb_rating"`
Clip *Clip `json:"clip"`
DescriptionRaw string `json:"description_raw"`
}
// Achievement (a meta-goal defined outside a game's parameters)
type Achievement struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Image string `json:"image"`
Percent float32 `json:"percent,string"`
}
// Movie of the game
type Movie struct {
ID int `json:"id"`
Name string `json:"name"`
Preview string `json:"preview"`
Data map[string]string `json:"data"`
}
// Reddit comment
type Reddit struct {
ID int `json:"id"`
Name string `json:"name"`
Text string `json:"text"`
Image string `json:"image"`
Url string `json:"url"`
Username string `json:"username"`
UsernameUrl string `json:"username_url"`
Created DateTime `json:"created"`
}
// Twitch stream
type Twitch struct {
ID int `json:"id"`
ExternalID int `json:"external_id"`
Name string `json:"name"`
Description string `json:"description"`
Created DateTime `json:"created"`
Published DateTime `json:"published"`
Thumbnail string `json:"thumbnail"`
ViewCount int `json:"view_count"`
Language string `json:"language"`
}
// YoutubeThumbnail represents thumbnail of the youtube video
type YoutubeThumbnail struct {
Url string `json:"url"`
Width int `json:"width"`
Height int `json:"height"`
}
// Youtube video associated with the game
type Youtube struct {
ID int `json:"id"`
ExternalID string `json:"external_id"`
ChannelID string `json:"channel_id"`
Name string `json:"name"`
Description string `json:"description"`
Created DateTime `json:"created"`
ViewCount int `json:"view_count"`
CommentsCount int `json:"comments_count"`
LikeCount int `json:"like_count"`
DislikeCount int `json:"dislike_count"`
FavoriteCount int `json:"favorite_count"`
Thumbnails *struct {
High *YoutubeThumbnail
Medium *YoutubeThumbnail
Default *YoutubeThumbnail
SdDefault *YoutubeThumbnail
MaxResDefault *YoutubeThumbnail
}
}
// GameDeveloper represents detailed information of game developer (with games list)
type GameDeveloper struct {
ID int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Image string `json:"image"`
ImageBackground string `json:"image_background"`
GamesCount int `json:"games_count"`
Games []*Game `json:"games"`
Positions []*Position `json:"positions"`
}