@tool
extends TwitchData

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

class_name TwitchUpdateChannelStreamScheduleSegment
	


## 
## #/components/schemas/UpdateChannelStreamScheduleSegmentBody
class Body extends TwitchData:

	## The date and time that the broadcast segment starts. Specify the date and time in RFC3339 format (for example, 2022-08-02T06:00:00Z).  
	##   
	## **NOTE**: Only partners and affiliates may update a broadcast’s start time and only for non-recurring segments.
	@export var start_time: String:
		set(val): 
			start_time = val
			track_data(&"start_time", val)
	
	## The length of time, in minutes, that the broadcast is scheduled to run. The duration must be in the range 30 through 1380 (23 hours).
	@export var duration: String:
		set(val): 
			duration = val
			track_data(&"duration", val)
	
	## The ID of the category that best represents the broadcast’s content. To get the category ID, use the [Search Categories](https://dev.twitch.tv/docs/api/reference#search-categories) endpoint.
	@export var category_id: String:
		set(val): 
			category_id = val
			track_data(&"category_id", val)
	
	## The broadcast’s title. The title may contain a maximum of 140 characters.
	@export var title: String:
		set(val): 
			title = val
			track_data(&"title", val)
	
	## A Boolean value that indicates whether the broadcast is canceled. Set to **true** to cancel the segment.  
	##   
	## **NOTE**: For recurring segments, the API cancels the first segment after the current UTC date and time and not the specified segment (unless the specified segment is the next segment after the current UTC date and time).
	@export var is_canceled: bool:
		set(val): 
			is_canceled = val
			track_data(&"is_canceled", val)
	
	## The time zone where the broadcast takes place. Specify the time zone using [IANA time zone database](https://www.iana.org/time-zones) format (for example, America/New\_York).
	@export var timezone: String:
		set(val): 
			timezone = val
			track_data(&"timezone", val)
	var response: BufferedHTTPClient.ResponseData
	
	
	## Constructor with all required fields.
	static func create() -> Body:
		var body: Body = Body.new()
		return body
	
	
	static func from_json(d: Dictionary) -> Body:
		var result: Body = Body.new()
		if d.get("start_time", null) != null:
			result.start_time = d["start_time"]
		if d.get("duration", null) != null:
			result.duration = d["duration"]
		if d.get("category_id", null) != null:
			result.category_id = d["category_id"]
		if d.get("title", null) != null:
			result.title = d["title"]
		if d.get("is_canceled", null) != null:
			result.is_canceled = d["is_canceled"]
		if d.get("timezone", null) != null:
			result.timezone = d["timezone"]
		return result
	


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

	## The broadcaster’s streaming scheduled.
	@export var data: ResponseData:
		set(val): 
			data = val
			track_data(&"data", val)
	var response: BufferedHTTPClient.ResponseData
	
	
	## Constructor with all required fields.
	static func create(_data: 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:
			result.data = ResponseData.from_json(d["data"])
		return result
	


## The broadcaster’s streaming scheduled.
## #/components/schemas/UpdateChannelStreamScheduleSegmentResponse/Data
class ResponseData extends TwitchData:

	## A list that contains the single broadcast segment that you updated.
	@export var segments: Array[TwitchChannelStreamScheduleSegment]:
		set(val): 
			segments = val
			track_data(&"segments", val)
	
	## The ID of the broadcaster that owns the broadcast schedule.
	@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 dates when the broadcaster is on vacation and not streaming. Is set to **null** if vacation mode is not enabled.
	@export var vacation: ResponseVacation:
		set(val): 
			vacation = val
			track_data(&"vacation", val)
	
	
	
	## Constructor with all required fields.
	static func create(_segments: Array[TwitchChannelStreamScheduleSegment], _broadcaster_id: String, _broadcaster_name: String, _broadcaster_login: String, _vacation: ResponseVacation) -> ResponseData:
		var response_data: ResponseData = ResponseData.new()
		response_data.segments = _segments
		response_data.broadcaster_id = _broadcaster_id
		response_data.broadcaster_name = _broadcaster_name
		response_data.broadcaster_login = _broadcaster_login
		response_data.vacation = _vacation
		return response_data
	
	
	static func from_json(d: Dictionary) -> ResponseData:
		var result: ResponseData = ResponseData.new()
		if d.get("segments", null) != null:
			for value in d["segments"]:
				result.segments.append(TwitchChannelStreamScheduleSegment.from_json(value))
		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("vacation", null) != null:
			result.vacation = ResponseVacation.from_json(d["vacation"])
		return result
	


## The dates when the broadcaster is on vacation and not streaming. Is set to **null** if vacation mode is not enabled.
## #/components/schemas/UpdateChannelStreamScheduleSegmentResponse/Data/Vacation
class ResponseVacation extends TwitchData:

	## The UTC date and time (in RFC3339 format) of when the broadcaster’s vacation starts.
	@export var start_time: String:
		set(val): 
			start_time = val
			track_data(&"start_time", val)
	
	## The UTC date and time (in RFC3339 format) of when the broadcaster’s vacation ends.
	@export var end_time: String:
		set(val): 
			end_time = val
			track_data(&"end_time", val)
	
	
	
	## Constructor with all required fields.
	static func create(_start_time: String, _end_time: String) -> ResponseVacation:
		var response_vacation: ResponseVacation = ResponseVacation.new()
		response_vacation.start_time = _start_time
		response_vacation.end_time = _end_time
		return response_vacation
	
	
	static func from_json(d: Dictionary) -> ResponseVacation:
		var result: ResponseVacation = ResponseVacation.new()
		if d.get("start_time", null) != null:
			result.start_time = d["start_time"]
		if d.get("end_time", null) != null:
			result.end_time = d["end_time"]
		return result
	