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

205 lines
No EOL
7.2 KiB
GDScript
Raw Permalink 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/CharityCampaign
class_name TwitchCharityCampaign
## An ID that identifies the charity campaign.
@export var id: String:
set(val):
id = val
track_data(&"id", val)
## An ID that identifies the broadcaster thats running the campaign.
@export var broadcaster_id: String:
set(val):
broadcaster_id = val
track_data(&"broadcaster_id", val)
## The broadcasters login name.
@export var broadcaster_login: String:
set(val):
broadcaster_login = val
track_data(&"broadcaster_login", val)
## The broadcasters display name.
@export var broadcaster_name: String:
set(val):
broadcaster_name = val
track_data(&"broadcaster_name", val)
## The charitys name.
@export var charity_name: String:
set(val):
charity_name = val
track_data(&"charity_name", val)
## A description of the charity.
@export var charity_description: String:
set(val):
charity_description = val
track_data(&"charity_description", val)
## A URL to an image of the charitys logo. The images type is PNG and its size is 100px X 100px.
@export var charity_logo: String:
set(val):
charity_logo = val
track_data(&"charity_logo", val)
## A URL to the charitys website.
@export var charity_website: String:
set(val):
charity_website = val
track_data(&"charity_website", val)
## The current amount of donations that the campaign has received.
@export var current_amount: CurrentAmount:
set(val):
current_amount = val
track_data(&"current_amount", val)
## The campaigns fundraising goal. This field is **null** if the broadcaster has not defined a fundraising goal.
@export var target_amount: TargetAmount:
set(val):
target_amount = val
track_data(&"target_amount", val)
var response: BufferedHTTPClient.ResponseData
## Constructor with all required fields.
static func create(_id: String, _broadcaster_id: String, _broadcaster_login: String, _broadcaster_name: String, _charity_name: String, _charity_description: String, _charity_logo: String, _charity_website: String, _current_amount: CurrentAmount, _target_amount: TargetAmount) -> TwitchCharityCampaign:
var twitch_charity_campaign: TwitchCharityCampaign = TwitchCharityCampaign.new()
twitch_charity_campaign.id = _id
twitch_charity_campaign.broadcaster_id = _broadcaster_id
twitch_charity_campaign.broadcaster_login = _broadcaster_login
twitch_charity_campaign.broadcaster_name = _broadcaster_name
twitch_charity_campaign.charity_name = _charity_name
twitch_charity_campaign.charity_description = _charity_description
twitch_charity_campaign.charity_logo = _charity_logo
twitch_charity_campaign.charity_website = _charity_website
twitch_charity_campaign.current_amount = _current_amount
twitch_charity_campaign.target_amount = _target_amount
return twitch_charity_campaign
static func from_json(d: Dictionary) -> TwitchCharityCampaign:
var result: TwitchCharityCampaign = TwitchCharityCampaign.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_login", null) != null:
result.broadcaster_login = d["broadcaster_login"]
if d.get("broadcaster_name", null) != null:
result.broadcaster_name = d["broadcaster_name"]
if d.get("charity_name", null) != null:
result.charity_name = d["charity_name"]
if d.get("charity_description", null) != null:
result.charity_description = d["charity_description"]
if d.get("charity_logo", null) != null:
result.charity_logo = d["charity_logo"]
if d.get("charity_website", null) != null:
result.charity_website = d["charity_website"]
if d.get("current_amount", null) != null:
result.current_amount = CurrentAmount.from_json(d["current_amount"])
if d.get("target_amount", null) != null:
result.target_amount = TargetAmount.from_json(d["target_amount"])
return result
## The current amount of donations that the campaign has received.
## #/components/schemas/CharityCampaign/CurrentAmount
class CurrentAmount extends TwitchData:
## The monetary amount. The amount is specified in the currencys minor unit. For example, the minor units for USD is cents, so if the amount is $5.50 USD, `value` is set to 550.
@export var value: int:
set(val):
value = val
track_data(&"value", val)
## The number of decimal places used by the currency. For example, USD uses two decimal places. Use this number to translate `value` from minor units to major units by using the formula:
##
## `value / 10^decimal_places`
@export var decimal_places: int:
set(val):
decimal_places = val
track_data(&"decimal_places", val)
## The ISO-4217 three-letter currency code that identifies the type of currency in `value`.
@export var currency: String:
set(val):
currency = val
track_data(&"currency", val)
## Constructor with all required fields.
static func create(_value: int, _decimal_places: int, _currency: String) -> CurrentAmount:
var current_amount: CurrentAmount = CurrentAmount.new()
current_amount.value = _value
current_amount.decimal_places = _decimal_places
current_amount.currency = _currency
return current_amount
static func from_json(d: Dictionary) -> CurrentAmount:
var result: CurrentAmount = CurrentAmount.new()
if d.get("value", null) != null:
result.value = d["value"]
if d.get("decimal_places", null) != null:
result.decimal_places = d["decimal_places"]
if d.get("currency", null) != null:
result.currency = d["currency"]
return result
## The campaigns fundraising goal. This field is **null** if the broadcaster has not defined a fundraising goal.
## #/components/schemas/CharityCampaign/TargetAmount
class TargetAmount extends TwitchData:
## The monetary amount. The amount is specified in the currencys minor unit. For example, the minor units for USD is cents, so if the amount is $5.50 USD, `value` is set to 550.
@export var value: int:
set(val):
value = val
track_data(&"value", val)
## The number of decimal places used by the currency. For example, USD uses two decimal places. Use this number to translate `value` from minor units to major units by using the formula:
##
## `value / 10^decimal_places`
@export var decimal_places: int:
set(val):
decimal_places = val
track_data(&"decimal_places", val)
## The ISO-4217 three-letter currency code that identifies the type of currency in `value`.
@export var currency: String:
set(val):
currency = val
track_data(&"currency", val)
## Constructor with all required fields.
static func create(_value: int, _decimal_places: int, _currency: String) -> TargetAmount:
var target_amount: TargetAmount = TargetAmount.new()
target_amount.value = _value
target_amount.decimal_places = _decimal_places
target_amount.currency = _currency
return target_amount
static func from_json(d: Dictionary) -> TargetAmount:
var result: TargetAmount = TargetAmount.new()
if d.get("value", null) != null:
result.value = d["value"]
if d.get("decimal_places", null) != null:
result.decimal_places = d["decimal_places"]
if d.get("currency", null) != null:
result.currency = d["currency"]
return result