pokepurple/addons/twitcher/generated/twitch_game.gd

57 lines
1.6 KiB
GDScript3
Raw Permalink Normal View History

@tool
extends TwitchData
# CLASS GOT AUTOGENERATED DON'T CHANGE MANUALLY. CHANGES CAN BE OVERWRITTEN EASILY.
##
## #/components/schemas/Game
class_name TwitchGame
## An ID that identifies the category or game.
@export var id: String:
set(val):
id = val
track_data(&"id", val)
## The categorys or games name.
@export var name: String:
set(val):
name = val
track_data(&"name", val)
## A URL to the categorys or games box art. You must replace the `{width}x{height}` placeholder with the size of image you want.
@export var box_art_url: String:
set(val):
box_art_url = val
track_data(&"box_art_url", val)
## The ID that [IGDB](https://www.igdb.com/) uses to identify this game. If the IGDB ID is not available to Twitch, this field is set to an empty string.
@export var igdb_id: String:
set(val):
igdb_id = val
track_data(&"igdb_id", val)
var response: BufferedHTTPClient.ResponseData
## Constructor with all required fields.
static func create(_id: String, _name: String, _box_art_url: String, _igdb_id: String) -> TwitchGame:
var twitch_game: TwitchGame = TwitchGame.new()
twitch_game.id = _id
twitch_game.name = _name
twitch_game.box_art_url = _box_art_url
twitch_game.igdb_id = _igdb_id
return twitch_game
static func from_json(d: Dictionary) -> TwitchGame:
var result: TwitchGame = TwitchGame.new()
if d.get("id", null) != null:
result.id = d["id"]
if d.get("name", null) != null:
result.name = d["name"]
if d.get("box_art_url", null) != null:
result.box_art_url = d["box_art_url"]
if d.get("igdb_id", null) != null:
result.igdb_id = d["igdb_id"]
return result