@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 that’s running the campaign.
@export var broadcaster_id: String:
	set(val): 
		broadcaster_id = val
		track_data(&"broadcaster_id", val)

## The broadcaster’s login name.
@export var broadcaster_login: String:
	set(val): 
		broadcaster_login = val
		track_data(&"broadcaster_login", val)

## The broadcaster’s display name.
@export var broadcaster_name: String:
	set(val): 
		broadcaster_name = val
		track_data(&"broadcaster_name", val)

## The charity’s 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 charity’s logo. The image’s 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 charity’s 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 campaign’s 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 currency’s 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 campaign’s 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 currency’s 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
	