-module(gamebrain_game_response).
-export([encode/1]).
-export_type([gamebrain_game_response/0]).
-type gamebrain_game_response() ::
#{ 'id' => integer(),
'name' => binary(),
'image' => gamebrain_u_ri:gamebrain_u_ri(),
'gameplay' => gamebrain_u_ri:gamebrain_u_ri(),
'link' => gamebrain_u_ri:gamebrain_u_ri(),
'x_url' => gamebrain_u_ri:gamebrain_u_ri(),
'rating' => gamebrain_game_response_rating:gamebrain_game_response_rating(),
'description' => binary(),
'short_description' => binary(),
'release_date' => calendar:date(),
'developer' => binary(),
'playtime' => gamebrain_game_response_playtime:gamebrain_game_response_playtime(),
'platforms' => list(),
'tags' => list(),
'genres' => list(),
'genre' => binary(),
'themes' => list(),
'adult_only' => boolean(),
'play_modes' => list(),
'screenshots' => list(),
'videos' => list(),
'offers' => list(),
'official_stores' => list(),
'micro_trailer' => gamebrain_u_ri:gamebrain_u_ri()
}.
encode(#{ 'id' := Id,
'name' := Name,
'image' := Image,
'gameplay' := Gameplay,
'link' := Link,
'x_url' := XUrl,
'rating' := Rating,
'description' := Description,
'short_description' := ShortDescription,
'release_date' := ReleaseDate,
'developer' := Developer,
'playtime' := Playtime,
'platforms' := Platforms,
'tags' := Tags,
'genres' := Genres,
'genre' := Genre,
'themes' := Themes,
'adult_only' := AdultOnly,
'play_modes' := PlayModes,
'screenshots' := Screenshots,
'videos' := Videos,
'offers' := Offers,
'official_stores' := OfficialStores,
'micro_trailer' := MicroTrailer
}) ->
#{ 'id' => Id,
'name' => Name,
'image' => Image,
'gameplay' => Gameplay,
'link' => Link,
'x_url' => XUrl,
'rating' => Rating,
'description' => Description,
'short_description' => ShortDescription,
'release_date' => ReleaseDate,
'developer' => Developer,
'playtime' => Playtime,
'platforms' => Platforms,
'tags' => Tags,
'genres' => Genres,
'genre' => Genre,
'themes' => Themes,
'adult_only' => AdultOnly,
'play_modes' => PlayModes,
'screenshots' => Screenshots,
'videos' => Videos,
'offers' => Offers,
'official_stores' => OfficialStores,
'micro_trailer' => MicroTrailer
}.