273 lines
8.9 KiB
GDScript3
273 lines
8.9 KiB
GDScript3
|
|
@tool
|
|||
|
|
extends TwitchData
|
|||
|
|
|
|||
|
|
# CLASS GOT AUTOGENERATED DON'T CHANGE MANUALLY. CHANGES CAN BE OVERWRITTEN EASILY.
|
|||
|
|
|
|||
|
|
##
|
|||
|
|
## #/components/schemas/HypeTrainEvent
|
|||
|
|
class_name TwitchHypeTrainEvent
|
|||
|
|
|
|||
|
|
## An ID that identifies this event.
|
|||
|
|
@export var id: String:
|
|||
|
|
set(val):
|
|||
|
|
id = val
|
|||
|
|
track_data(&"id", val)
|
|||
|
|
|
|||
|
|
## The type of event. The string is in the form, hypetrain.{event\_name}. The request returns only progress event types (i.e., hypetrain.progression).
|
|||
|
|
@export var event_type: String:
|
|||
|
|
set(val):
|
|||
|
|
event_type = val
|
|||
|
|
track_data(&"event_type", val)
|
|||
|
|
|
|||
|
|
## The UTC date and time (in RFC3339 format) that the event occurred.
|
|||
|
|
@export var event_timestamp: String:
|
|||
|
|
set(val):
|
|||
|
|
event_timestamp = val
|
|||
|
|
track_data(&"event_timestamp", val)
|
|||
|
|
|
|||
|
|
## The version number of the definition of the event’s data. For example, the value is 1 if the data in `event_data` uses the first definition of the event’s data.
|
|||
|
|
@export var version: String:
|
|||
|
|
set(val):
|
|||
|
|
version = val
|
|||
|
|
track_data(&"version", val)
|
|||
|
|
|
|||
|
|
## The event’s data.
|
|||
|
|
@export var event_data: EventData:
|
|||
|
|
set(val):
|
|||
|
|
event_data = val
|
|||
|
|
track_data(&"event_data", val)
|
|||
|
|
var response: BufferedHTTPClient.ResponseData
|
|||
|
|
|
|||
|
|
|
|||
|
|
## Constructor with all required fields.
|
|||
|
|
static func create(_id: String, _event_type: String, _event_timestamp: String, _version: String, _event_data: EventData) -> TwitchHypeTrainEvent:
|
|||
|
|
var twitch_hype_train_event: TwitchHypeTrainEvent = TwitchHypeTrainEvent.new()
|
|||
|
|
twitch_hype_train_event.id = _id
|
|||
|
|
twitch_hype_train_event.event_type = _event_type
|
|||
|
|
twitch_hype_train_event.event_timestamp = _event_timestamp
|
|||
|
|
twitch_hype_train_event.version = _version
|
|||
|
|
twitch_hype_train_event.event_data = _event_data
|
|||
|
|
return twitch_hype_train_event
|
|||
|
|
|
|||
|
|
|
|||
|
|
static func from_json(d: Dictionary) -> TwitchHypeTrainEvent:
|
|||
|
|
var result: TwitchHypeTrainEvent = TwitchHypeTrainEvent.new()
|
|||
|
|
if d.get("id", null) != null:
|
|||
|
|
result.id = d["id"]
|
|||
|
|
if d.get("event_type", null) != null:
|
|||
|
|
result.event_type = d["event_type"]
|
|||
|
|
if d.get("event_timestamp", null) != null:
|
|||
|
|
result.event_timestamp = d["event_timestamp"]
|
|||
|
|
if d.get("version", null) != null:
|
|||
|
|
result.version = d["version"]
|
|||
|
|
if d.get("event_data", null) != null:
|
|||
|
|
result.event_data = EventData.from_json(d["event_data"])
|
|||
|
|
return result
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
## The event’s data.
|
|||
|
|
## #/components/schemas/HypeTrainEvent/EventData
|
|||
|
|
class EventData extends TwitchData:
|
|||
|
|
|
|||
|
|
## The ID of the broadcaster that’s running the Hype Train.
|
|||
|
|
@export var broadcaster_id: String:
|
|||
|
|
set(val):
|
|||
|
|
broadcaster_id = val
|
|||
|
|
track_data(&"broadcaster_id", val)
|
|||
|
|
|
|||
|
|
## The UTC date and time (in RFC3339 format) that another Hype Train can start.
|
|||
|
|
@export var cooldown_end_time: String:
|
|||
|
|
set(val):
|
|||
|
|
cooldown_end_time = val
|
|||
|
|
track_data(&"cooldown_end_time", val)
|
|||
|
|
|
|||
|
|
## The UTC date and time (in RFC3339 format) that the Hype Train ends.
|
|||
|
|
@export var expires_at: String:
|
|||
|
|
set(val):
|
|||
|
|
expires_at = val
|
|||
|
|
track_data(&"expires_at", val)
|
|||
|
|
|
|||
|
|
## The value needed to reach the next level.
|
|||
|
|
@export var goal: int:
|
|||
|
|
set(val):
|
|||
|
|
goal = val
|
|||
|
|
track_data(&"goal", val)
|
|||
|
|
|
|||
|
|
## An ID that identifies this Hype Train.
|
|||
|
|
@export var id: String:
|
|||
|
|
set(val):
|
|||
|
|
id = val
|
|||
|
|
track_data(&"id", val)
|
|||
|
|
|
|||
|
|
## The most recent contribution towards the Hype Train’s goal.
|
|||
|
|
@export var last_contribution: LastContribution:
|
|||
|
|
set(val):
|
|||
|
|
last_contribution = val
|
|||
|
|
track_data(&"last_contribution", val)
|
|||
|
|
|
|||
|
|
## The highest level that the Hype Train reached (the levels are 1 through 5).
|
|||
|
|
@export var level: int:
|
|||
|
|
set(val):
|
|||
|
|
level = val
|
|||
|
|
track_data(&"level", val)
|
|||
|
|
|
|||
|
|
## The UTC date and time (in RFC3339 format) that this Hype Train started.
|
|||
|
|
@export var started_at: String:
|
|||
|
|
set(val):
|
|||
|
|
started_at = val
|
|||
|
|
track_data(&"started_at", val)
|
|||
|
|
|
|||
|
|
## The top contributors for each contribution type. For example, the top contributor using BITS (by aggregate) and the top contributor using SUBS (by count).
|
|||
|
|
@export var top_contributions: Array[TopContributions]:
|
|||
|
|
set(val):
|
|||
|
|
top_contributions = val
|
|||
|
|
track_data(&"top_contributions", val)
|
|||
|
|
|
|||
|
|
## The current total amount raised.
|
|||
|
|
@export var total: int:
|
|||
|
|
set(val):
|
|||
|
|
total = val
|
|||
|
|
track_data(&"total", val)
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
## Constructor with all required fields.
|
|||
|
|
static func create(_broadcaster_id: String, _cooldown_end_time: String, _expires_at: String, _goal: int, _id: String, _last_contribution: LastContribution, _level: int, _started_at: String, _top_contributions: Array[TopContributions], _total: int) -> EventData:
|
|||
|
|
var event_data: EventData = EventData.new()
|
|||
|
|
event_data.broadcaster_id = _broadcaster_id
|
|||
|
|
event_data.cooldown_end_time = _cooldown_end_time
|
|||
|
|
event_data.expires_at = _expires_at
|
|||
|
|
event_data.goal = _goal
|
|||
|
|
event_data.id = _id
|
|||
|
|
event_data.last_contribution = _last_contribution
|
|||
|
|
event_data.level = _level
|
|||
|
|
event_data.started_at = _started_at
|
|||
|
|
event_data.top_contributions = _top_contributions
|
|||
|
|
event_data.total = _total
|
|||
|
|
return event_data
|
|||
|
|
|
|||
|
|
|
|||
|
|
static func from_json(d: Dictionary) -> EventData:
|
|||
|
|
var result: EventData = EventData.new()
|
|||
|
|
if d.get("broadcaster_id", null) != null:
|
|||
|
|
result.broadcaster_id = d["broadcaster_id"]
|
|||
|
|
if d.get("cooldown_end_time", null) != null:
|
|||
|
|
result.cooldown_end_time = d["cooldown_end_time"]
|
|||
|
|
if d.get("expires_at", null) != null:
|
|||
|
|
result.expires_at = d["expires_at"]
|
|||
|
|
if d.get("goal", null) != null:
|
|||
|
|
result.goal = d["goal"]
|
|||
|
|
if d.get("id", null) != null:
|
|||
|
|
result.id = d["id"]
|
|||
|
|
if d.get("last_contribution", null) != null:
|
|||
|
|
result.last_contribution = LastContribution.from_json(d["last_contribution"])
|
|||
|
|
if d.get("level", null) != null:
|
|||
|
|
result.level = d["level"]
|
|||
|
|
if d.get("started_at", null) != null:
|
|||
|
|
result.started_at = d["started_at"]
|
|||
|
|
if d.get("top_contributions", null) != null:
|
|||
|
|
for value in d["top_contributions"]:
|
|||
|
|
result.top_contributions.append(TopContributions.from_json(value))
|
|||
|
|
if d.get("total", null) != null:
|
|||
|
|
result.total = d["total"]
|
|||
|
|
return result
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
## The most recent contribution towards the Hype Train’s goal.
|
|||
|
|
## #/components/schemas/HypeTrainEvent/EventData/LastContribution
|
|||
|
|
class LastContribution extends TwitchData:
|
|||
|
|
|
|||
|
|
## The total amount contributed. If `type` is BITS, `total` represents the amount of Bits used. If `type` is SUBS, `total` is 500, 1000, or 2500 to represent tier 1, 2, or 3 subscriptions, respectively.
|
|||
|
|
@export var total: int:
|
|||
|
|
set(val):
|
|||
|
|
total = val
|
|||
|
|
track_data(&"total", val)
|
|||
|
|
|
|||
|
|
## The contribution method used. Possible values are:
|
|||
|
|
##
|
|||
|
|
## * BITS — Cheering with Bits.
|
|||
|
|
## * SUBS — Subscription activity like subscribing or gifting subscriptions.
|
|||
|
|
## * OTHER — Covers other contribution methods not listed.
|
|||
|
|
@export var type: String:
|
|||
|
|
set(val):
|
|||
|
|
type = val
|
|||
|
|
track_data(&"type", val)
|
|||
|
|
|
|||
|
|
## The ID of the user that made the contribution.
|
|||
|
|
@export var user: String:
|
|||
|
|
set(val):
|
|||
|
|
user = val
|
|||
|
|
track_data(&"user", val)
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
## Constructor with all required fields.
|
|||
|
|
static func create(_total: int, _type: String, _user: String) -> LastContribution:
|
|||
|
|
var last_contribution: LastContribution = LastContribution.new()
|
|||
|
|
last_contribution.total = _total
|
|||
|
|
last_contribution.type = _type
|
|||
|
|
last_contribution.user = _user
|
|||
|
|
return last_contribution
|
|||
|
|
|
|||
|
|
|
|||
|
|
static func from_json(d: Dictionary) -> LastContribution:
|
|||
|
|
var result: LastContribution = LastContribution.new()
|
|||
|
|
if d.get("total", null) != null:
|
|||
|
|
result.total = d["total"]
|
|||
|
|
if d.get("type", null) != null:
|
|||
|
|
result.type = d["type"]
|
|||
|
|
if d.get("user", null) != null:
|
|||
|
|
result.user = d["user"]
|
|||
|
|
return result
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
## The top contributors for each contribution type. For example, the top contributor using BITS (by aggregate) and the top contributor using SUBS (by count).
|
|||
|
|
## #/components/schemas/HypeTrainEvent/EventData/TopContributions
|
|||
|
|
class TopContributions extends TwitchData:
|
|||
|
|
|
|||
|
|
## The total amount contributed. If `type` is BITS, `total` represents the amount of Bits used. If `type` is SUBS, `total` is 500, 1000, or 2500 to represent tier 1, 2, or 3 subscriptions, respectively.
|
|||
|
|
@export var total: int:
|
|||
|
|
set(val):
|
|||
|
|
total = val
|
|||
|
|
track_data(&"total", val)
|
|||
|
|
|
|||
|
|
## The contribution method used. Possible values are:
|
|||
|
|
##
|
|||
|
|
## * BITS — Cheering with Bits.
|
|||
|
|
## * SUBS — Subscription activity like subscribing or gifting subscriptions.
|
|||
|
|
## * OTHER — Covers other contribution methods not listed.
|
|||
|
|
@export var type: String:
|
|||
|
|
set(val):
|
|||
|
|
type = val
|
|||
|
|
track_data(&"type", val)
|
|||
|
|
|
|||
|
|
## The ID of the user that made the contribution.
|
|||
|
|
@export var user: String:
|
|||
|
|
set(val):
|
|||
|
|
user = val
|
|||
|
|
track_data(&"user", val)
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
## Constructor with all required fields.
|
|||
|
|
static func create(_total: int, _type: String, _user: String) -> TopContributions:
|
|||
|
|
var top_contributions: TopContributions = TopContributions.new()
|
|||
|
|
top_contributions.total = _total
|
|||
|
|
top_contributions.type = _type
|
|||
|
|
top_contributions.user = _user
|
|||
|
|
return top_contributions
|
|||
|
|
|
|||
|
|
|
|||
|
|
static func from_json(d: Dictionary) -> TopContributions:
|
|||
|
|
var result: TopContributions = TopContributions.new()
|
|||
|
|
if d.get("total", null) != null:
|
|||
|
|
result.total = d["total"]
|
|||
|
|
if d.get("type", null) != null:
|
|||
|
|
result.type = d["type"]
|
|||
|
|
if d.get("user", null) != null:
|
|||
|
|
result.user = d["user"]
|
|||
|
|
return result
|
|||
|
|
|