@tool
extends TwitchData

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

class_name TwitchGetAdSchedule
	


## 
## #/components/schemas/GetAdScheduleResponse
class Response extends TwitchData:

	## A list that contains information related to the channel’s ad schedule.
	@export var data: Array[ResponseData]:
		set(val): 
			data = val
			track_data(&"data", val)
	var response: BufferedHTTPClient.ResponseData
	
	
	## Constructor with all required fields.
	static func create(_data: Array[ResponseData]) -> 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(ResponseData.from_json(value))
		return result
	


## A list that contains information related to the channel’s ad schedule.
## #/components/schemas/GetAdScheduleResponse/Data
class ResponseData extends TwitchData:

	## The number of snoozes available for the broadcaster.
	@export var snooze_count: int:
		set(val): 
			snooze_count = val
			track_data(&"snooze_count", val)
	
	## The UTC timestamp when the broadcaster will gain an additional snooze, in RFC3339 format.
	@export var snooze_refresh_at: String:
		set(val): 
			snooze_refresh_at = val
			track_data(&"snooze_refresh_at", val)
	
	## The UTC timestamp of the broadcaster’s next scheduled ad, in RFC3339 format. Empty if the channel has no ad scheduled or is not live.
	@export var next_ad_at: String:
		set(val): 
			next_ad_at = val
			track_data(&"next_ad_at", val)
	
	## The length in seconds of the scheduled upcoming ad break.
	@export var duration: int:
		set(val): 
			duration = val
			track_data(&"duration", val)
	
	## The UTC timestamp of the broadcaster’s last ad-break, in RFC3339 format. Empty if the channel has not run an ad or is not live.
	@export var last_ad_at: String:
		set(val): 
			last_ad_at = val
			track_data(&"last_ad_at", val)
	
	## The amount of pre-roll free time remaining for the channel in seconds. Returns 0 if they are currently not pre-roll free.
	@export var preroll_free_time: int:
		set(val): 
			preroll_free_time = val
			track_data(&"preroll_free_time", val)
	
	
	
	## Constructor with all required fields.
	static func create(_snooze_count: int, _snooze_refresh_at: String, _next_ad_at: String, _duration: int, _last_ad_at: String, _preroll_free_time: int) -> ResponseData:
		var response_data: ResponseData = ResponseData.new()
		response_data.snooze_count = _snooze_count
		response_data.snooze_refresh_at = _snooze_refresh_at
		response_data.next_ad_at = _next_ad_at
		response_data.duration = _duration
		response_data.last_ad_at = _last_ad_at
		response_data.preroll_free_time = _preroll_free_time
		return response_data
	
	
	static func from_json(d: Dictionary) -> ResponseData:
		var result: ResponseData = ResponseData.new()
		if d.get("snooze_count", null) != null:
			result.snooze_count = d["snooze_count"]
		if d.get("snooze_refresh_at", null) != null:
			result.snooze_refresh_at = d["snooze_refresh_at"]
		if d.get("next_ad_at", null) != null:
			result.next_ad_at = d["next_ad_at"]
		if d.get("duration", null) != null:
			result.duration = d["duration"]
		if d.get("last_ad_at", null) != null:
			result.last_ad_at = d["last_ad_at"]
		if d.get("preroll_free_time", null) != null:
			result.preroll_free_time = d["preroll_free_time"]
		return result
	