StreamOverlay/addons/twitcher/generated/twitch_get_hype_train_status.gd

421 lines
14 KiB
GDScript3
Raw Normal View History

2026-02-23 18:38:03 -06:00
@tool
extends TwitchData
# CLASS GOT AUTOGENERATED DON'T CHANGE MANUALLY. CHANGES CAN BE OVERWRITTEN EASILY.
class_name TwitchGetHypeTrainStatus
##
## #/components/schemas/GetHypeTrainStatusResponse
class Response extends TwitchData:
## A list that contains information related to the channels Hype Train.
@export var data: Array[ResponseData]:
set(val):
data = val
track_data(&"data", val)
## An object with information about the channels Hype Train records. Null if a Hype Train has not occurred.
@export var all_time_high: ResponseAllTimeHigh:
set(val):
all_time_high = val
track_data(&"all_time_high", val)
## An object with information about the channels shared Hype Train records. Null if a Hype Train has not occurred.
@export var shared_all_time_high: ResponseSharedAllTimeHigh:
set(val):
shared_all_time_high = val
track_data(&"shared_all_time_high", val)
var response: BufferedHTTPClient.ResponseData
## Constructor with all required fields.
static func create(_data: Array[ResponseData], _all_time_high: ResponseAllTimeHigh, _shared_all_time_high: ResponseSharedAllTimeHigh) -> Response:
var response: Response = Response.new()
response.data = _data
response.all_time_high = _all_time_high
response.shared_all_time_high = _shared_all_time_high
return response
static func from_json(d: Dictionary) -> Response:
var result: Response = Response.new()
if d.get("data", null) != null:
for value in d["data"]:
result.data.append(ResponseData.from_json(value))
if d.get("all_time_high", null) != null:
result.all_time_high = ResponseAllTimeHigh.from_json(d["all_time_high"])
if d.get("shared_all_time_high", null) != null:
result.shared_all_time_high = ResponseSharedAllTimeHigh.from_json(d["shared_all_time_high"])
return result
## A list that contains information related to the channels Hype Train.
## #/components/schemas/GetHypeTrainStatusResponse/Data
class ResponseData extends TwitchData:
## An object describing the current Hype Train. Null if a Hype Train is not active.
@export var current: ResponseCurrent:
set(val):
current = val
track_data(&"current", val)
var response: BufferedHTTPClient.ResponseData
## Constructor with all required fields.
static func create(_current: ResponseCurrent) -> ResponseData:
var response_data: ResponseData = ResponseData.new()
response_data.current = _current
return response_data
static func from_json(d: Dictionary) -> ResponseData:
var result: ResponseData = ResponseData.new()
if d.get("current", null) != null:
result.current = ResponseCurrent.from_json(d["current"])
return result
## An object describing the current Hype Train. Null if a Hype Train is not active.
## #/components/schemas/GetHypeTrainStatusResponse/Data/Current
class ResponseCurrent extends TwitchData:
## The Hype Train ID.
@export var id: String:
set(val):
id = val
track_data(&"id", val)
## The broadcaster ID.
@export var broadcaster_user_id: String:
set(val):
broadcaster_user_id = val
track_data(&"broadcaster_user_id", val)
## The broadcaster login.
@export var broadcaster_user_login: String:
set(val):
broadcaster_user_login = val
track_data(&"broadcaster_user_login", val)
## The broadcaster display name.
@export var broadcaster_user_name: String:
set(val):
broadcaster_user_name = val
track_data(&"broadcaster_user_name", val)
## The current level of the Hype Train.
@export var level: int:
set(val):
level = val
track_data(&"level", val)
## Total points contributed to the Hype Train.
@export var total: int:
set(val):
total = val
track_data(&"total", val)
## The number of points contributed to the Hype Train at the current level.
@export var progress: int:
set(val):
progress = val
track_data(&"progress", val)
## The number of points required to reach the next level.
@export var goal: int:
set(val):
goal = val
track_data(&"goal", val)
## The contributors with the most points contributed.
@export var top_contributions: Array[ResponseTopContributions]:
set(val):
top_contributions = val
track_data(&"top_contributions", val)
var response: BufferedHTTPClient.ResponseData
## Constructor with all required fields.
static func create(_id: String, _broadcaster_user_id: String, _broadcaster_user_login: String, _broadcaster_user_name: String, _level: int, _total: int, _progress: int, _goal: int, _top_contributions: Array[ResponseTopContributions]) -> ResponseCurrent:
var response_current: ResponseCurrent = ResponseCurrent.new()
response_current.id = _id
response_current.broadcaster_user_id = _broadcaster_user_id
response_current.broadcaster_user_login = _broadcaster_user_login
response_current.broadcaster_user_name = _broadcaster_user_name
response_current.level = _level
response_current.total = _total
response_current.progress = _progress
response_current.goal = _goal
response_current.top_contributions = _top_contributions
return response_current
static func from_json(d: Dictionary) -> ResponseCurrent:
var result: ResponseCurrent = ResponseCurrent.new()
if d.get("id", null) != null:
result.id = d["id"]
if d.get("broadcaster_user_id", null) != null:
result.broadcaster_user_id = d["broadcaster_user_id"]
if d.get("broadcaster_user_login", null) != null:
result.broadcaster_user_login = d["broadcaster_user_login"]
if d.get("broadcaster_user_name", null) != null:
result.broadcaster_user_name = d["broadcaster_user_name"]
if d.get("level", null) != null:
result.level = d["level"]
if d.get("total", null) != null:
result.total = d["total"]
if d.get("progress", null) != null:
result.progress = d["progress"]
if d.get("goal", null) != null:
result.goal = d["goal"]
if d.get("top_contributions", null) != null:
for value in d["top_contributions"]:
result.top_contributions.append(ResponseTopContributions.from_json(value))
return result
## The contributors with the most points contributed.
## #/components/schemas/GetHypeTrainStatusResponse/Data/Current/TopContributions
class ResponseTopContributions extends TwitchData:
## The ID of the user that made the contribution.
@export var user_id: String:
set(val):
user_id = val
track_data(&"user_id", val)
## The users login name.
@export var user_login: String:
set(val):
user_login = val
track_data(&"user_login", val)
## The users display name.
@export var user_name: String:
set(val):
user_name = val
track_data(&"user_name", val)
## The type of the Hype Train. Possible values are:
##
## * **treasure**
## * **golden\_kappa**
## * **regular**
##
## [Learn More](https://help.twitch.tv/s/article/hype-train-guide#special)
@export var type: String:
set(val):
type = val
track_data(&"type", val)
## The total number of points contributed for the type.
@export var total: int:
set(val):
total = val
track_data(&"total", val)
## A list containing the broadcasters participating in the shared Hype Train. Null if the Hype Train is not shared.
@export var shared_train_participants: Array[ResponseSharedTrainParticipants]:
set(val):
shared_train_participants = val
track_data(&"shared_train_participants", val)
## The time when the Hype Train started.
@export var started_at: String:
set(val):
started_at = val
track_data(&"started_at", val)
## The time when the Hype Train expires. The expiration is extended when the Hype Train reaches a new level.
@export var expires_at: String:
set(val):
expires_at = val
track_data(&"expires_at", val)
## Indicates if the Hype Train is shared. When true, shared\_train\_participants will contain the list of broadcasters the train is shared with.
@export var is_shared_train: bool:
set(val):
is_shared_train = val
track_data(&"is_shared_train", val)
var response: BufferedHTTPClient.ResponseData
## Constructor with all required fields.
static func create(_user_id: String, _user_login: String, _user_name: String, _type: String, _total: int, _shared_train_participants: Array[ResponseSharedTrainParticipants], _started_at: String, _expires_at: String, _is_shared_train: bool) -> ResponseTopContributions:
var response_top_contributions: ResponseTopContributions = ResponseTopContributions.new()
response_top_contributions.user_id = _user_id
response_top_contributions.user_login = _user_login
response_top_contributions.user_name = _user_name
response_top_contributions.type = _type
response_top_contributions.total = _total
response_top_contributions.shared_train_participants = _shared_train_participants
response_top_contributions.started_at = _started_at
response_top_contributions.expires_at = _expires_at
response_top_contributions.is_shared_train = _is_shared_train
return response_top_contributions
static func from_json(d: Dictionary) -> ResponseTopContributions:
var result: ResponseTopContributions = ResponseTopContributions.new()
if d.get("user_id", null) != null:
result.user_id = d["user_id"]
if d.get("user_login", null) != null:
result.user_login = d["user_login"]
if d.get("user_name", null) != null:
result.user_name = d["user_name"]
if d.get("type", null) != null:
result.type = d["type"]
if d.get("total", null) != null:
result.total = d["total"]
if d.get("shared_train_participants", null) != null:
for value in d["shared_train_participants"]:
result.shared_train_participants.append(ResponseSharedTrainParticipants.from_json(value))
if d.get("started_at", null) != null:
result.started_at = d["started_at"]
if d.get("expires_at", null) != null:
result.expires_at = d["expires_at"]
if d.get("is_shared_train", null) != null:
result.is_shared_train = d["is_shared_train"]
return result
## A list containing the broadcasters participating in the shared Hype Train. Null if the Hype Train is not shared.
## #/components/schemas/GetHypeTrainStatusResponse/Data/Current/TopContributions/SharedTrainParticipants
class ResponseSharedTrainParticipants extends TwitchData:
## The broadcaster ID.
@export var broadcaster_user_id: String:
set(val):
broadcaster_user_id = val
track_data(&"broadcaster_user_id", val)
## The broadcaster login.
@export var broadcaster_user_login: String:
set(val):
broadcaster_user_login = val
track_data(&"broadcaster_user_login", val)
## The broadcaster display name.
@export var broadcaster_user_name: String:
set(val):
broadcaster_user_name = val
track_data(&"broadcaster_user_name", val)
var response: BufferedHTTPClient.ResponseData
## Constructor with all required fields.
static func create(_broadcaster_user_id: String, _broadcaster_user_login: String, _broadcaster_user_name: String) -> ResponseSharedTrainParticipants:
var response_shared_train_participants: ResponseSharedTrainParticipants = ResponseSharedTrainParticipants.new()
response_shared_train_participants.broadcaster_user_id = _broadcaster_user_id
response_shared_train_participants.broadcaster_user_login = _broadcaster_user_login
response_shared_train_participants.broadcaster_user_name = _broadcaster_user_name
return response_shared_train_participants
static func from_json(d: Dictionary) -> ResponseSharedTrainParticipants:
var result: ResponseSharedTrainParticipants = ResponseSharedTrainParticipants.new()
if d.get("broadcaster_user_id", null) != null:
result.broadcaster_user_id = d["broadcaster_user_id"]
if d.get("broadcaster_user_login", null) != null:
result.broadcaster_user_login = d["broadcaster_user_login"]
if d.get("broadcaster_user_name", null) != null:
result.broadcaster_user_name = d["broadcaster_user_name"]
return result
## An object with information about the channels Hype Train records. Null if a Hype Train has not occurred.
## #/components/schemas/GetHypeTrainStatusResponse/AllTimeHigh
class ResponseAllTimeHigh extends TwitchData:
## The level of the record Hype Train.
@export var level: int:
set(val):
level = val
track_data(&"level", val)
## Total points contributed to the record Hype Train.
@export var total: int:
set(val):
total = val
track_data(&"total", val)
## The time when the record was achieved.
@export var achieved_at: String:
set(val):
achieved_at = val
track_data(&"achieved_at", val)
var response: BufferedHTTPClient.ResponseData
## Constructor with all required fields.
static func create(_level: int, _total: int, _achieved_at: String) -> ResponseAllTimeHigh:
var response_all_time_high: ResponseAllTimeHigh = ResponseAllTimeHigh.new()
response_all_time_high.level = _level
response_all_time_high.total = _total
response_all_time_high.achieved_at = _achieved_at
return response_all_time_high
static func from_json(d: Dictionary) -> ResponseAllTimeHigh:
var result: ResponseAllTimeHigh = ResponseAllTimeHigh.new()
if d.get("level", null) != null:
result.level = d["level"]
if d.get("total", null) != null:
result.total = d["total"]
if d.get("achieved_at", null) != null:
result.achieved_at = d["achieved_at"]
return result
## An object with information about the channels shared Hype Train records. Null if a Hype Train has not occurred.
## #/components/schemas/GetHypeTrainStatusResponse/SharedAllTimeHigh
class ResponseSharedAllTimeHigh extends TwitchData:
## The level of the record Hype Train.
@export var level: int:
set(val):
level = val
track_data(&"level", val)
## Total points contributed to the record Hype Train.
@export var total: int:
set(val):
total = val
track_data(&"total", val)
## The time when the record was achieved.
@export var achieved_at: String:
set(val):
achieved_at = val
track_data(&"achieved_at", val)
var response: BufferedHTTPClient.ResponseData
## Constructor with all required fields.
static func create(_level: int, _total: int, _achieved_at: String) -> ResponseSharedAllTimeHigh:
var response_shared_all_time_high: ResponseSharedAllTimeHigh = ResponseSharedAllTimeHigh.new()
response_shared_all_time_high.level = _level
response_shared_all_time_high.total = _total
response_shared_all_time_high.achieved_at = _achieved_at
return response_shared_all_time_high
static func from_json(d: Dictionary) -> ResponseSharedAllTimeHigh:
var result: ResponseSharedAllTimeHigh = ResponseSharedAllTimeHigh.new()
if d.get("level", null) != null:
result.level = d["level"]
if d.get("total", null) != null:
result.total = d["total"]
if d.get("achieved_at", null) != null:
result.achieved_at = d["achieved_at"]
return result