@tool
extends TwitchData

# CLASS GOT AUTOGENERATED DON'T CHANGE MANUALLY. CHANGES CAN BE OVERWRITTEN EASILY.

## 
## #/components/schemas/CreatorGoal
class_name TwitchCreatorGoal
	
## An ID that identifies this goal.
@export var id: String:
	set(val): 
		id = val
		track_data(&"id", val)

## An ID that identifies the broadcaster that created the goal.
@export var broadcaster_id: String:
	set(val): 
		broadcaster_id = val
		track_data(&"broadcaster_id", val)

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

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

## The type of goal. Possible values are:   
##   
## * follower — The goal is to increase followers.
## * subscription — The goal is to increase subscriptions. This type shows the net increase or decrease in tier points associated with the subscriptions.
## * subscription\_count — The goal is to increase subscriptions. This type shows the net increase or decrease in the number of subscriptions.
## * new\_subscription — The goal is to increase subscriptions. This type shows only the net increase in tier points associated with the subscriptions (it does not account for users that unsubscribed since the goal started).
## * new\_subscription\_count — The goal is to increase subscriptions. This type shows only the net increase in the number of subscriptions (it does not account for users that unsubscribed since the goal started).
@export var type: String:
	set(val): 
		type = val
		track_data(&"type", val)

## A description of the goal. Is an empty string if not specified.
@export var description: String:
	set(val): 
		description = val
		track_data(&"description", val)

## The goal’s current value.  
##   
## The goal’s `type` determines how this value is increased or decreased.   
##   
## * If `type` is follower, this field is set to the broadcaster's current number of followers. This number increases with new followers and decreases when users unfollow the broadcaster.
## * If `type` is subscription, this field is increased and decreased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased or decreased by 2, not 1.
## * If `type` is subscription\_count, this field is increased by 1 for each new subscription and decreased by 1 for each user that unsubscribes.
## * If `type` is new\_subscription, this field is increased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased by 2, not 1.
## * If `type` is new\_subscription\_count, this field is increased by 1 for each new subscription.
@export var current_amount: int:
	set(val): 
		current_amount = val
		track_data(&"current_amount", val)

## The goal’s target value. For example, if the broadcaster has 200 followers before creating the goal, and their goal is to double that number, this field is set to 400.
@export var target_amount: int:
	set(val): 
		target_amount = val
		track_data(&"target_amount", val)

## The UTC date and time (in RFC3339 format) that the broadcaster created the goal.
@export var created_at: String:
	set(val): 
		created_at = val
		track_data(&"created_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, _type: String, _description: String, _current_amount: int, _target_amount: int, _created_at: String) -> TwitchCreatorGoal:
	var twitch_creator_goal: TwitchCreatorGoal = TwitchCreatorGoal.new()
	twitch_creator_goal.id = _id
	twitch_creator_goal.broadcaster_id = _broadcaster_id
	twitch_creator_goal.broadcaster_name = _broadcaster_name
	twitch_creator_goal.broadcaster_login = _broadcaster_login
	twitch_creator_goal.type = _type
	twitch_creator_goal.description = _description
	twitch_creator_goal.current_amount = _current_amount
	twitch_creator_goal.target_amount = _target_amount
	twitch_creator_goal.created_at = _created_at
	return twitch_creator_goal


static func from_json(d: Dictionary) -> TwitchCreatorGoal:
	var result: TwitchCreatorGoal = TwitchCreatorGoal.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("type", null) != null:
		result.type = d["type"]
	if d.get("description", null) != null:
		result.description = d["description"]
	if d.get("current_amount", null) != null:
		result.current_amount = d["current_amount"]
	if d.get("target_amount", null) != null:
		result.target_amount = d["target_amount"]
	if d.get("created_at", null) != null:
		result.created_at = d["created_at"]
	return result
