@tool
extends TwitchData

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

## 
## #/components/schemas/UserSubscription
class_name TwitchUserSubscription
	
## An ID that identifies the broadcaster.
@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 ID of the user that gifted the subscription. The object includes this field only if `is_gift` is **true**.
@export var gifter_id: String:
	set(val): 
		gifter_id = val
		track_data(&"gifter_id", val)

## The gifter’s login name. The object includes this field only if `is_gift` is **true**.
@export var gifter_login: String:
	set(val): 
		gifter_login = val
		track_data(&"gifter_login", val)

## The gifter’s display name. The object includes this field only if `is_gift` is **true**.
@export var gifter_name: String:
	set(val): 
		gifter_name = val
		track_data(&"gifter_name", val)

## A Boolean value that determines whether the subscription is a gift subscription. Is **true** if the subscription was gifted.
@export var is_gift: bool:
	set(val): 
		is_gift = val
		track_data(&"is_gift", val)

## The type of subscription. Possible values are:  
##   
## * 1000 — Tier 1
## * 2000 — Tier 2
## * 3000 — Tier 3
@export var tier: String:
	set(val): 
		tier = val
		track_data(&"tier", val)
var response: BufferedHTTPClient.ResponseData


## Constructor with all required fields.
static func create(_broadcaster_id: String, _broadcaster_login: String, _broadcaster_name: String, _is_gift: bool, _tier: String) -> TwitchUserSubscription:
	var twitch_user_subscription: TwitchUserSubscription = TwitchUserSubscription.new()
	twitch_user_subscription.broadcaster_id = _broadcaster_id
	twitch_user_subscription.broadcaster_login = _broadcaster_login
	twitch_user_subscription.broadcaster_name = _broadcaster_name
	twitch_user_subscription.is_gift = _is_gift
	twitch_user_subscription.tier = _tier
	return twitch_user_subscription


static func from_json(d: Dictionary) -> TwitchUserSubscription:
	var result: TwitchUserSubscription = TwitchUserSubscription.new()
	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("gifter_id", null) != null:
		result.gifter_id = d["gifter_id"]
	if d.get("gifter_login", null) != null:
		result.gifter_login = d["gifter_login"]
	if d.get("gifter_name", null) != null:
		result.gifter_name = d["gifter_name"]
	if d.get("is_gift", null) != null:
		result.is_gift = d["is_gift"]
	if d.get("tier", null) != null:
		result.tier = d["tier"]
	return result
