pokepurple/addons/twitcher/generated/twitch_prediction.gd
Mario Steele c11a4ebbc2 Initial Commit
Initial commit of Code Base.
2025-06-12 14:31:14 -05:00

134 lines
4.7 KiB
GDScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@tool
extends TwitchData
# CLASS GOT AUTOGENERATED DON'T CHANGE MANUALLY. CHANGES CAN BE OVERWRITTEN EASILY.
##
## #/components/schemas/Prediction
class_name TwitchPrediction
## An ID that identifies this prediction.
@export var id: String:
set(val):
id = val
track_data(&"id", val)
## An ID that identifies the broadcaster that created the prediction.
@export var broadcaster_id: String:
set(val):
broadcaster_id = val
track_data(&"broadcaster_id", val)
## The broadcasters display name.
@export var broadcaster_name: String:
set(val):
broadcaster_name = val
track_data(&"broadcaster_name", val)
## The broadcasters login name.
@export var broadcaster_login: String:
set(val):
broadcaster_login = val
track_data(&"broadcaster_login", val)
## The question that the prediction asks. For example, _Will I finish this entire pizza?_
@export var title: String:
set(val):
title = val
track_data(&"title", val)
## The ID of the winning outcome. Is **null** unless `status` is RESOLVED.
@export var winning_outcome_id: String:
set(val):
winning_outcome_id = val
track_data(&"winning_outcome_id", val)
## The list of possible outcomes for the prediction.
@export var outcomes: Array[TwitchPredictionOutcome]:
set(val):
outcomes = val
track_data(&"outcomes", val)
## The length of time (in seconds) that the prediction will run for.
@export var prediction_window: int:
set(val):
prediction_window = val
track_data(&"prediction_window", val)
## The predictions status. Valid values are:
##
## * ACTIVE — The Prediction is running and viewers can make predictions.
## * CANCELED — The broadcaster canceled the Prediction and refunded the Channel Points to the participants.
## * LOCKED — The broadcaster locked the Prediction, which means viewers can no longer make predictions.
## * RESOLVED — The winning outcome was determined and the Channel Points were distributed to the viewers who predicted the correct outcome.
@export var status: String:
set(val):
status = val
track_data(&"status", val)
## The UTC date and time of when the Prediction began.
@export var created_at: String:
set(val):
created_at = val
track_data(&"created_at", val)
## The UTC date and time of when the Prediction ended. If `status` is ACTIVE, this is set to **null**.
@export var ended_at: String:
set(val):
ended_at = val
track_data(&"ended_at", val)
## The UTC date and time of when the Prediction was locked. If `status` is not LOCKED, this is set to **null**.
@export var locked_at: String:
set(val):
locked_at = val
track_data(&"locked_at", val)
var response: BufferedHTTPClient.ResponseData
## Constructor with all required fields.
static func create(_id: String, _broadcaster_id: String, _broadcaster_name: String, _broadcaster_login: String, _title: String, _winning_outcome_id: String, _outcomes: Array[TwitchPredictionOutcome], _prediction_window: int, _status: String, _created_at: String, _ended_at: String, _locked_at: String) -> TwitchPrediction:
var twitch_prediction: TwitchPrediction = TwitchPrediction.new()
twitch_prediction.id = _id
twitch_prediction.broadcaster_id = _broadcaster_id
twitch_prediction.broadcaster_name = _broadcaster_name
twitch_prediction.broadcaster_login = _broadcaster_login
twitch_prediction.title = _title
twitch_prediction.winning_outcome_id = _winning_outcome_id
twitch_prediction.outcomes = _outcomes
twitch_prediction.prediction_window = _prediction_window
twitch_prediction.status = _status
twitch_prediction.created_at = _created_at
twitch_prediction.ended_at = _ended_at
twitch_prediction.locked_at = _locked_at
return twitch_prediction
static func from_json(d: Dictionary) -> TwitchPrediction:
var result: TwitchPrediction = TwitchPrediction.new()
if d.get("id", null) != null:
result.id = d["id"]
if d.get("broadcaster_id", null) != null:
result.broadcaster_id = d["broadcaster_id"]
if d.get("broadcaster_name", null) != null:
result.broadcaster_name = d["broadcaster_name"]
if d.get("broadcaster_login", null) != null:
result.broadcaster_login = d["broadcaster_login"]
if d.get("title", null) != null:
result.title = d["title"]
if d.get("winning_outcome_id", null) != null:
result.winning_outcome_id = d["winning_outcome_id"]
if d.get("outcomes", null) != null:
for value in d["outcomes"]:
result.outcomes.append(TwitchPredictionOutcome.from_json(value))
if d.get("prediction_window", null) != null:
result.prediction_window = d["prediction_window"]
if d.get("status", null) != null:
result.status = d["status"]
if d.get("created_at", null) != null:
result.created_at = d["created_at"]
if d.get("ended_at", null) != null:
result.ended_at = d["ended_at"]
if d.get("locked_at", null) != null:
result.locked_at = d["locked_at"]
return result