@tool
extends TwitchData

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

class_name TwitchUpdateExtensionBitsProduct
	


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

	## The product's SKU. The SKU must be unique within an extension. The product's SKU cannot be changed. The SKU may contain only alphanumeric characters, dashes (-), underscores (\_), and periods (.) and is limited to a maximum of 255 characters. No spaces.
	@export var sku: String:
		set(val): 
			sku = val
			track_data(&"sku", val)
	
	## An object that contains the product's cost information.
	@export var cost: BodyCost:
		set(val): 
			cost = val
			track_data(&"cost", val)
	
	## The product's name as displayed in the extension. The maximum length is 255 characters.
	@export var display_name: String:
		set(val): 
			display_name = val
			track_data(&"display_name", val)
	
	## A Boolean value that indicates whether the product is in development. Set to **true** if the product is in development and not available for public use. The default is **false**.
	@export var in_development: bool:
		set(val): 
			in_development = val
			track_data(&"in_development", val)
	
	## The date and time, in RFC3339 format, when the product expires. If not set, the product does not expire. To disable the product, set the expiration date to a date in the past.
	@export var expiration: String:
		set(val): 
			expiration = val
			track_data(&"expiration", val)
	
	## A Boolean value that determines whether Bits product purchase events are broadcast to all instances of the extension on a channel. The events are broadcast via the `onTransactionComplete` helper callback. The default is **false**.
	@export var is_broadcast: bool:
		set(val): 
			is_broadcast = val
			track_data(&"is_broadcast", val)
	var response: BufferedHTTPClient.ResponseData
	
	
	## Constructor with all required fields.
	static func create(_sku: String, _cost: BodyCost, _display_name: String) -> Body:
		var body: Body = Body.new()
		body.sku = _sku
		body.cost = _cost
		body.display_name = _display_name
		return body
	
	
	static func from_json(d: Dictionary) -> Body:
		var result: Body = Body.new()
		if d.get("sku", null) != null:
			result.sku = d["sku"]
		if d.get("cost", null) != null:
			result.cost = BodyCost.from_json(d["cost"])
		if d.get("display_name", null) != null:
			result.display_name = d["display_name"]
		if d.get("in_development", null) != null:
			result.in_development = d["in_development"]
		if d.get("expiration", null) != null:
			result.expiration = d["expiration"]
		if d.get("is_broadcast", null) != null:
			result.is_broadcast = d["is_broadcast"]
		return result
	


## An object that contains the product's cost information.
## #/components/schemas/UpdateExtensionBitsProductBody/Cost
class BodyCost extends TwitchData:

	## The product's price.
	@export var amount: int:
		set(val): 
			amount = val
			track_data(&"amount", val)
	
	## The type of currency. Possible values are:  
	##   
	## * bits — The minimum price is 1 and the maximum is 10000.
	@export var type: String:
		set(val): 
			type = val
			track_data(&"type", val)
	
	
	
	## Constructor with all required fields.
	static func create(_amount: int, _type: String) -> BodyCost:
		var body_cost: BodyCost = BodyCost.new()
		body_cost.amount = _amount
		body_cost.type = _type
		return body_cost
	
	
	static func from_json(d: Dictionary) -> BodyCost:
		var result: BodyCost = BodyCost.new()
		if d.get("amount", null) != null:
			result.amount = d["amount"]
		if d.get("type", null) != null:
			result.type = d["type"]
		return result
	


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

	## A list of Bits products that the extension created. The list is in ascending SKU order. The list is empty if the extension hasn't created any products or they're all expired or disabled.
	@export var data: Array[TwitchExtensionBitsProduct]:
		set(val): 
			data = val
			track_data(&"data", val)
	var response: BufferedHTTPClient.ResponseData
	
	
	## Constructor with all required fields.
	static func create(_data: Array[TwitchExtensionBitsProduct]) -> 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(TwitchExtensionBitsProduct.from_json(value))
		return result
	