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

159 lines
No EOL
6.3 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.
class_name TwitchCreateCustomRewards
##
## #/components/schemas/CreateCustomRewardsBody
class Body extends TwitchData:
## The custom rewards title. The title may contain a maximum of 45 characters and it must be unique amongst all of the broadcasters custom rewards.
@export var title: String:
set(val):
title = val
track_data(&"title", val)
## The cost of the reward, in Channel Points. The minimum is 1 point.
@export var cost: int:
set(val):
cost = val
track_data(&"cost", val)
## The prompt shown to the viewer when they redeem the reward. Specify a prompt if `is_user_input_required` is **true**. The prompt is limited to a maximum of 200 characters.
@export var prompt: String:
set(val):
prompt = val
track_data(&"prompt", val)
## A Boolean value that determines whether the reward is enabled. Viewers see only enabled rewards. The default is **true**.
@export var is_enabled: bool:
set(val):
is_enabled = val
track_data(&"is_enabled", val)
## The background color to use for the reward. Specify the color using Hex format (for example, #9147FF).
@export var background_color: String:
set(val):
background_color = val
track_data(&"background_color", val)
## A Boolean value that determines whether the user needs to enter information when redeeming the reward. See the `prompt` field. The default is **false**.
@export var is_user_input_required: bool:
set(val):
is_user_input_required = val
track_data(&"is_user_input_required", val)
## A Boolean value that determines whether to limit the maximum number of redemptions allowed per live stream (see the `max_per_stream` field). The default is **false**.
@export var is_max_per_stream_enabled: bool:
set(val):
is_max_per_stream_enabled = val
track_data(&"is_max_per_stream_enabled", val)
## The maximum number of redemptions allowed per live stream. Applied only if `is_max_per_stream_enabled` is **true**. The minimum value is 1.
@export var max_per_stream: int:
set(val):
max_per_stream = val
track_data(&"max_per_stream", val)
## A Boolean value that determines whether to limit the maximum number of redemptions allowed per user per stream (see the `max_per_user_per_stream` field). The default is **false**.
@export var is_max_per_user_per_stream_enabled: bool:
set(val):
is_max_per_user_per_stream_enabled = val
track_data(&"is_max_per_user_per_stream_enabled", val)
## The maximum number of redemptions allowed per user per stream. Applied only if `is_max_per_user_per_stream_enabled` is **true**. The minimum value is 1.
@export var max_per_user_per_stream: int:
set(val):
max_per_user_per_stream = val
track_data(&"max_per_user_per_stream", val)
## A Boolean value that determines whether to apply a cooldown period between redemptions (see the `global_cooldown_seconds` field for the duration of the cooldown period). The default is **false**.
@export var is_global_cooldown_enabled: bool:
set(val):
is_global_cooldown_enabled = val
track_data(&"is_global_cooldown_enabled", val)
## The cooldown period, in seconds. Applied only if the `is_global_cooldown_enabled` field is **true**. The minimum value is 1; however, the minimum value is 60 for it to be shown in the Twitch UX.
@export var global_cooldown_seconds: int:
set(val):
global_cooldown_seconds = val
track_data(&"global_cooldown_seconds", val)
## A Boolean value that determines whether redemptions should be set to FULFILLED status immediately when a reward is redeemed. If **false**, status is set to UNFULFILLED and follows the normal request queue process. The default is **false**.
@export var should_redemptions_skip_request_queue: bool:
set(val):
should_redemptions_skip_request_queue = val
track_data(&"should_redemptions_skip_request_queue", val)
var response: BufferedHTTPClient.ResponseData
## Constructor with all required fields.
static func create(_title: String, _cost: int) -> Body:
var body: Body = Body.new()
body.title = _title
body.cost = _cost
return body
static func from_json(d: Dictionary) -> Body:
var result: Body = Body.new()
if d.get("title", null) != null:
result.title = d["title"]
if d.get("cost", null) != null:
result.cost = d["cost"]
if d.get("prompt", null) != null:
result.prompt = d["prompt"]
if d.get("is_enabled", null) != null:
result.is_enabled = d["is_enabled"]
if d.get("background_color", null) != null:
result.background_color = d["background_color"]
if d.get("is_user_input_required", null) != null:
result.is_user_input_required = d["is_user_input_required"]
if d.get("is_max_per_stream_enabled", null) != null:
result.is_max_per_stream_enabled = d["is_max_per_stream_enabled"]
if d.get("max_per_stream", null) != null:
result.max_per_stream = d["max_per_stream"]
if d.get("is_max_per_user_per_stream_enabled", null) != null:
result.is_max_per_user_per_stream_enabled = d["is_max_per_user_per_stream_enabled"]
if d.get("max_per_user_per_stream", null) != null:
result.max_per_user_per_stream = d["max_per_user_per_stream"]
if d.get("is_global_cooldown_enabled", null) != null:
result.is_global_cooldown_enabled = d["is_global_cooldown_enabled"]
if d.get("global_cooldown_seconds", null) != null:
result.global_cooldown_seconds = d["global_cooldown_seconds"]
if d.get("should_redemptions_skip_request_queue", null) != null:
result.should_redemptions_skip_request_queue = d["should_redemptions_skip_request_queue"]
return result
##
## #/components/schemas/CreateCustomRewardsResponse
class Response extends TwitchData:
## A list that contains the single custom reward you created.
@export var data: Array[TwitchCustomReward]:
set(val):
data = val
track_data(&"data", val)
var response: BufferedHTTPClient.ResponseData
## Constructor with all required fields.
static func create(_data: Array[TwitchCustomReward]) -> Response:
var response: Response = Response.new()
response.data = _data
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(TwitchCustomReward.from_json(value))
return result