diff --git a/SiennaOpenAPIModels.jl/src/models/model_CostCurve.jl b/SiennaOpenAPIModels.jl/src/models/model_CostCurve.jl index 3e9ed14..0da8b60 100644 --- a/SiennaOpenAPIModels.jl/src/models/model_CostCurve.jl +++ b/SiennaOpenAPIModels.jl/src/models/model_CostCurve.jl @@ -5,56 +5,53 @@ @doc raw"""CostCurve CostCurve(; - variable_cost_type=nothing, - value_curve=nothing, power_units=nothing, + value_curve=nothing, + variable_cost_type=nothing, vom_cost=nothing, ) - - variable_cost_type::String - - value_curve::CostCurveValueCurve - power_units::String + - value_curve::CostCurveValueCurve + - variable_cost_type::String - vom_cost::InputOutputCurve """ Base.@kwdef mutable struct CostCurve <: OpenAPI.APIModel - variable_cost_type::Union{Nothing,String} = nothing - value_curve = nothing # spec type: Union{ Nothing, CostCurveValueCurve } power_units::Union{Nothing,String} = nothing + value_curve = nothing # spec type: Union{ Nothing, CostCurveValueCurve } + variable_cost_type::Union{Nothing,String} = nothing vom_cost = nothing # spec type: Union{ Nothing, InputOutputCurve } - function CostCurve(variable_cost_type, value_curve, power_units, vom_cost) + function CostCurve(power_units, value_curve, variable_cost_type, vom_cost) + OpenAPI.validate_property(CostCurve, Symbol("power_units"), power_units) + OpenAPI.validate_property(CostCurve, Symbol("value_curve"), value_curve) OpenAPI.validate_property( CostCurve, Symbol("variable_cost_type"), variable_cost_type, ) - OpenAPI.validate_property(CostCurve, Symbol("value_curve"), value_curve) - OpenAPI.validate_property(CostCurve, Symbol("power_units"), power_units) OpenAPI.validate_property(CostCurve, Symbol("vom_cost"), vom_cost) - return new(variable_cost_type, value_curve, power_units, vom_cost) + return new(power_units, value_curve, variable_cost_type, vom_cost) end end # type CostCurve const _property_types_CostCurve = Dict{Symbol,String}( - Symbol("variable_cost_type") => "String", - Symbol("value_curve") => "CostCurveValueCurve", Symbol("power_units") => "String", + Symbol("value_curve") => "CostCurveValueCurve", + Symbol("variable_cost_type") => "String", Symbol("vom_cost") => "InputOutputCurve", ) OpenAPI.property_type(::Type{CostCurve}, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_CostCurve[name]))} function check_required(o::CostCurve) - o.value_curve === nothing && (return false) o.power_units === nothing && (return false) + o.value_curve === nothing && (return false) o.vom_cost === nothing && (return false) true end function OpenAPI.validate_property(::Type{CostCurve}, name::Symbol, val) - if name === Symbol("variable_cost_type") - OpenAPI.validate_param(name, "CostCurve", :enum, val, ["COST"]) - end if name === Symbol("power_units") OpenAPI.validate_param( name, @@ -64,4 +61,7 @@ function OpenAPI.validate_property(::Type{CostCurve}, name::Symbol, val) ["SYSTEM_BASE", "DEVICE_BASE", "NATURAL_UNITS"], ) end + if name === Symbol("variable_cost_type") + OpenAPI.validate_param(name, "CostCurve", :enum, val, ["COST"]) + end end diff --git a/SiennaOpenAPIModels.jl/src/models/model_FuelCurve.jl b/SiennaOpenAPIModels.jl/src/models/model_FuelCurve.jl index 997d7dc..caf39af 100644 --- a/SiennaOpenAPIModels.jl/src/models/model_FuelCurve.jl +++ b/SiennaOpenAPIModels.jl/src/models/model_FuelCurve.jl @@ -5,62 +5,59 @@ @doc raw"""FuelCurve FuelCurve(; - variable_cost_type=nothing, - value_curve=nothing, - power_units=nothing, fuel_cost=nothing, + power_units=nothing, + value_curve=nothing, + variable_cost_type=nothing, vom_cost=nothing, ) - - variable_cost_type::String - - value_curve::CostCurveValueCurve - - power_units::String - fuel_cost::FuelCurveFuelCost + - power_units::String + - value_curve::CostCurveValueCurve + - variable_cost_type::String - vom_cost::InputOutputCurve """ Base.@kwdef mutable struct FuelCurve <: OpenAPI.APIModel - variable_cost_type::Union{Nothing,String} = nothing - value_curve = nothing # spec type: Union{ Nothing, CostCurveValueCurve } - power_units::Union{Nothing,String} = nothing fuel_cost = nothing # spec type: Union{ Nothing, FuelCurveFuelCost } + power_units::Union{Nothing,String} = nothing + value_curve = nothing # spec type: Union{ Nothing, CostCurveValueCurve } + variable_cost_type::Union{Nothing,String} = nothing vom_cost = nothing # spec type: Union{ Nothing, InputOutputCurve } - function FuelCurve(variable_cost_type, value_curve, power_units, fuel_cost, vom_cost) + function FuelCurve(fuel_cost, power_units, value_curve, variable_cost_type, vom_cost) + OpenAPI.validate_property(FuelCurve, Symbol("fuel_cost"), fuel_cost) + OpenAPI.validate_property(FuelCurve, Symbol("power_units"), power_units) + OpenAPI.validate_property(FuelCurve, Symbol("value_curve"), value_curve) OpenAPI.validate_property( FuelCurve, Symbol("variable_cost_type"), variable_cost_type, ) - OpenAPI.validate_property(FuelCurve, Symbol("value_curve"), value_curve) - OpenAPI.validate_property(FuelCurve, Symbol("power_units"), power_units) - OpenAPI.validate_property(FuelCurve, Symbol("fuel_cost"), fuel_cost) OpenAPI.validate_property(FuelCurve, Symbol("vom_cost"), vom_cost) - return new(variable_cost_type, value_curve, power_units, fuel_cost, vom_cost) + return new(fuel_cost, power_units, value_curve, variable_cost_type, vom_cost) end end # type FuelCurve const _property_types_FuelCurve = Dict{Symbol,String}( - Symbol("variable_cost_type") => "String", - Symbol("value_curve") => "CostCurveValueCurve", - Symbol("power_units") => "String", Symbol("fuel_cost") => "FuelCurveFuelCost", + Symbol("power_units") => "String", + Symbol("value_curve") => "CostCurveValueCurve", + Symbol("variable_cost_type") => "String", Symbol("vom_cost") => "InputOutputCurve", ) OpenAPI.property_type(::Type{FuelCurve}, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_FuelCurve[name]))} function check_required(o::FuelCurve) - o.value_curve === nothing && (return false) - o.power_units === nothing && (return false) o.fuel_cost === nothing && (return false) + o.power_units === nothing && (return false) + o.value_curve === nothing && (return false) o.vom_cost === nothing && (return false) true end function OpenAPI.validate_property(::Type{FuelCurve}, name::Symbol, val) - if name === Symbol("variable_cost_type") - OpenAPI.validate_param(name, "FuelCurve", :enum, val, ["FUEL"]) - end if name === Symbol("power_units") OpenAPI.validate_param( name, @@ -70,4 +67,7 @@ function OpenAPI.validate_property(::Type{FuelCurve}, name::Symbol, val) ["SYSTEM_BASE", "DEVICE_BASE", "NATURAL_UNITS"], ) end + if name === Symbol("variable_cost_type") + OpenAPI.validate_param(name, "FuelCurve", :enum, val, ["FUEL"]) + end end diff --git a/SiennaOpenAPIModels.jl/src/models/model_LinearFunctionData.jl b/SiennaOpenAPIModels.jl/src/models/model_LinearFunctionData.jl index 63c60a7..e1c307a 100644 --- a/SiennaOpenAPIModels.jl/src/models/model_LinearFunctionData.jl +++ b/SiennaOpenAPIModels.jl/src/models/model_LinearFunctionData.jl @@ -5,21 +5,26 @@ @doc raw"""LinearFunctionData LinearFunctionData(; + constant_term=nothing, function_type=nothing, proportional_term=nothing, - constant_term=nothing, ) + - constant_term::Float64 - function_type::String - proportional_term::Float64 - - constant_term::Float64 """ Base.@kwdef mutable struct LinearFunctionData <: OpenAPI.APIModel + constant_term::Union{Nothing,Float64} = nothing function_type::Union{Nothing,String} = nothing proportional_term::Union{Nothing,Float64} = nothing - constant_term::Union{Nothing,Float64} = nothing - function LinearFunctionData(function_type, proportional_term, constant_term) + function LinearFunctionData(constant_term, function_type, proportional_term) + OpenAPI.validate_property( + LinearFunctionData, + Symbol("constant_term"), + constant_term, + ) OpenAPI.validate_property( LinearFunctionData, Symbol("function_type"), @@ -30,26 +35,21 @@ Base.@kwdef mutable struct LinearFunctionData <: OpenAPI.APIModel Symbol("proportional_term"), proportional_term, ) - OpenAPI.validate_property( - LinearFunctionData, - Symbol("constant_term"), - constant_term, - ) - return new(function_type, proportional_term, constant_term) + return new(constant_term, function_type, proportional_term) end end # type LinearFunctionData const _property_types_LinearFunctionData = Dict{Symbol,String}( + Symbol("constant_term") => "Float64", Symbol("function_type") => "String", Symbol("proportional_term") => "Float64", - Symbol("constant_term") => "Float64", ) OpenAPI.property_type(::Type{LinearFunctionData}, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_LinearFunctionData[name]))} function check_required(o::LinearFunctionData) - o.proportional_term === nothing && (return false) o.constant_term === nothing && (return false) + o.proportional_term === nothing && (return false) true end diff --git a/SiennaOpenAPIModels.jl/src/models/model_MinMax.jl b/SiennaOpenAPIModels.jl/src/models/model_MinMax.jl index 9609b6a..4e91e55 100644 --- a/SiennaOpenAPIModels.jl/src/models/model_MinMax.jl +++ b/SiennaOpenAPIModels.jl/src/models/model_MinMax.jl @@ -5,26 +5,26 @@ @doc raw"""MinMax MinMax(; - min=nothing, max=nothing, + min=nothing, ) - - min::Float64 - max::Float64 + - min::Float64 """ Base.@kwdef mutable struct MinMax <: OpenAPI.APIModel - min::Union{Nothing,Float64} = nothing max::Union{Nothing,Float64} = nothing + min::Union{Nothing,Float64} = nothing - function MinMax(min, max) - OpenAPI.validate_property(MinMax, Symbol("min"), min) + function MinMax(max, min) OpenAPI.validate_property(MinMax, Symbol("max"), max) - return new(min, max) + OpenAPI.validate_property(MinMax, Symbol("min"), min) + return new(max, min) end end # type MinMax const _property_types_MinMax = - Dict{Symbol,String}(Symbol("min") => "Float64", Symbol("max") => "Float64") + Dict{Symbol,String}(Symbol("max") => "Float64", Symbol("min") => "Float64") OpenAPI.property_type(::Type{MinMax}, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_MinMax[name]))} diff --git a/SiennaOpenAPIModels.jl/src/models/model_QuadraticFunctionData.jl b/SiennaOpenAPIModels.jl/src/models/model_QuadraticFunctionData.jl index ab5058e..cec7d41 100644 --- a/SiennaOpenAPIModels.jl/src/models/model_QuadraticFunctionData.jl +++ b/SiennaOpenAPIModels.jl/src/models/model_QuadraticFunctionData.jl @@ -5,38 +5,38 @@ @doc raw"""QuadraticFunctionData QuadraticFunctionData(; + constant_term=nothing, function_type=nothing, - quadratic_term=nothing, proportional_term=nothing, - constant_term=nothing, + quadratic_term=nothing, ) + - constant_term::Float64 - function_type::String - - quadratic_term::Float64 - proportional_term::Float64 - - constant_term::Float64 + - quadratic_term::Float64 """ Base.@kwdef mutable struct QuadraticFunctionData <: OpenAPI.APIModel + constant_term::Union{Nothing,Float64} = nothing function_type::Union{Nothing,String} = nothing - quadratic_term::Union{Nothing,Float64} = nothing proportional_term::Union{Nothing,Float64} = nothing - constant_term::Union{Nothing,Float64} = nothing + quadratic_term::Union{Nothing,Float64} = nothing function QuadraticFunctionData( + constant_term, function_type, - quadratic_term, proportional_term, - constant_term, + quadratic_term, ) OpenAPI.validate_property( QuadraticFunctionData, - Symbol("function_type"), - function_type, + Symbol("constant_term"), + constant_term, ) OpenAPI.validate_property( QuadraticFunctionData, - Symbol("quadratic_term"), - quadratic_term, + Symbol("function_type"), + function_type, ) OpenAPI.validate_property( QuadraticFunctionData, @@ -45,26 +45,26 @@ Base.@kwdef mutable struct QuadraticFunctionData <: OpenAPI.APIModel ) OpenAPI.validate_property( QuadraticFunctionData, - Symbol("constant_term"), - constant_term, + Symbol("quadratic_term"), + quadratic_term, ) - return new(function_type, quadratic_term, proportional_term, constant_term) + return new(constant_term, function_type, proportional_term, quadratic_term) end end # type QuadraticFunctionData const _property_types_QuadraticFunctionData = Dict{Symbol,String}( + Symbol("constant_term") => "Float64", Symbol("function_type") => "String", - Symbol("quadratic_term") => "Float64", Symbol("proportional_term") => "Float64", - Symbol("constant_term") => "Float64", + Symbol("quadratic_term") => "Float64", ) OpenAPI.property_type(::Type{QuadraticFunctionData}, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_QuadraticFunctionData[name]))} function check_required(o::QuadraticFunctionData) - o.quadratic_term === nothing && (return false) - o.proportional_term === nothing && (return false) o.constant_term === nothing && (return false) + o.proportional_term === nothing && (return false) + o.quadratic_term === nothing && (return false) true end diff --git a/SiennaOpenAPIModels.jl/src/models/model_StartUpStages.jl b/SiennaOpenAPIModels.jl/src/models/model_StartUpStages.jl index 48f8a63..053ad46 100644 --- a/SiennaOpenAPIModels.jl/src/models/model_StartUpStages.jl +++ b/SiennaOpenAPIModels.jl/src/models/model_StartUpStages.jl @@ -5,40 +5,40 @@ @doc raw"""StartUpStages StartUpStages(; + cold=nothing, hot=nothing, warm=nothing, - cold=nothing, ) + - cold::Float64 - hot::Float64 - warm::Float64 - - cold::Float64 """ Base.@kwdef mutable struct StartUpStages <: OpenAPI.APIModel + cold::Union{Nothing,Float64} = nothing hot::Union{Nothing,Float64} = nothing warm::Union{Nothing,Float64} = nothing - cold::Union{Nothing,Float64} = nothing - function StartUpStages(hot, warm, cold) + function StartUpStages(cold, hot, warm) + OpenAPI.validate_property(StartUpStages, Symbol("cold"), cold) OpenAPI.validate_property(StartUpStages, Symbol("hot"), hot) OpenAPI.validate_property(StartUpStages, Symbol("warm"), warm) - OpenAPI.validate_property(StartUpStages, Symbol("cold"), cold) - return new(hot, warm, cold) + return new(cold, hot, warm) end end # type StartUpStages const _property_types_StartUpStages = Dict{Symbol,String}( + Symbol("cold") => "Float64", Symbol("hot") => "Float64", Symbol("warm") => "Float64", - Symbol("cold") => "Float64", ) OpenAPI.property_type(::Type{StartUpStages}, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_StartUpStages[name]))} function check_required(o::StartUpStages) + o.cold === nothing && (return false) o.hot === nothing && (return false) o.warm === nothing && (return false) - o.cold === nothing && (return false) true end diff --git a/SiennaOpenAPIModels.jl/src/models/model_ThermalStandard.jl b/SiennaOpenAPIModels.jl/src/models/model_ThermalStandard.jl index 3a83a4d..b60206d 100644 --- a/SiennaOpenAPIModels.jl/src/models/model_ThermalStandard.jl +++ b/SiennaOpenAPIModels.jl/src/models/model_ThermalStandard.jl @@ -5,159 +5,183 @@ @doc raw"""ThermalStandard ThermalStandard(; + active_power=0.0, + active_power_limits=nothing, + available=true, + base_power=0.0, + bus_id=nothing, + fuel_type="OTHER", id=nothing, + must_run=false, name=nothing, + operation_cost=nothing, prime_mover="OT", - fuel_type="OTHER", + ramp_limits=nothing, rating=0.0, - base_power=0.0, - available=true, - status=true, - active_power=0.0, reactive_power=0.0, - active_power_limits=nothing, reactive_power_limits=nothing, - ramp_limits=nothing, - operation_cost=nothing, + status=true, time_limits=nothing, - must_run=false, - bus_id=nothing, ) + - active_power::Float64 + - active_power_limits::MinMax + - available::Bool + - base_power::Float64 + - bus_id::Int64 + - fuel_type::String : Thermal fuels that reflect options in the EIA annual energy review. - id::Int64 + - must_run::Bool - name::String + - operation_cost::ThermalStandardOperationCost - prime_mover::String - - fuel_type::String : Thermal fuels that reflect options in the EIA annual energy review. + - ramp_limits::UpDown - rating::Float64 - - base_power::Float64 - - available::Bool - - status::Bool - - active_power::Float64 - reactive_power::Float64 - - active_power_limits::MinMax - reactive_power_limits::MinMax - - ramp_limits::UpDown - - operation_cost::ThermalStandardOperationCost + - status::Bool - time_limits::UpDown - - must_run::Bool - - bus_id::Int64 """ Base.@kwdef mutable struct ThermalStandard <: OpenAPI.APIModel + active_power::Union{Nothing,Float64} = 0.0 + active_power_limits = nothing # spec type: Union{ Nothing, MinMax } + available::Union{Nothing,Bool} = true + base_power::Union{Nothing,Float64} = 0.0 + bus_id::Union{Nothing,Int64} = nothing + fuel_type::Union{Nothing,String} = "OTHER" id::Union{Nothing,Int64} = nothing + must_run::Union{Nothing,Bool} = false name::Union{Nothing,String} = nothing + operation_cost = nothing # spec type: Union{ Nothing, ThermalStandardOperationCost } prime_mover::Union{Nothing,String} = "OT" - fuel_type::Union{Nothing,String} = "OTHER" + ramp_limits = nothing # spec type: Union{ Nothing, UpDown } rating::Union{Nothing,Float64} = 0.0 - base_power::Union{Nothing,Float64} = 0.0 - available::Union{Nothing,Bool} = true - status::Union{Nothing,Bool} = true - active_power::Union{Nothing,Float64} = 0.0 reactive_power::Union{Nothing,Float64} = 0.0 - active_power_limits = nothing # spec type: Union{ Nothing, MinMax } reactive_power_limits = nothing # spec type: Union{ Nothing, MinMax } - ramp_limits = nothing # spec type: Union{ Nothing, UpDown } - operation_cost = nothing # spec type: Union{ Nothing, ThermalStandardOperationCost } + status::Union{Nothing,Bool} = true time_limits = nothing # spec type: Union{ Nothing, UpDown } - must_run::Union{Nothing,Bool} = false - bus_id::Union{Nothing,Int64} = nothing function ThermalStandard( + active_power, + active_power_limits, + available, + base_power, + bus_id, + fuel_type, id, + must_run, name, + operation_cost, prime_mover, - fuel_type, + ramp_limits, rating, - base_power, - available, - status, - active_power, reactive_power, - active_power_limits, reactive_power_limits, - ramp_limits, - operation_cost, + status, time_limits, - must_run, - bus_id, ) - OpenAPI.validate_property(ThermalStandard, Symbol("id"), id) - OpenAPI.validate_property(ThermalStandard, Symbol("name"), name) - OpenAPI.validate_property(ThermalStandard, Symbol("prime_mover"), prime_mover) - OpenAPI.validate_property(ThermalStandard, Symbol("fuel_type"), fuel_type) - OpenAPI.validate_property(ThermalStandard, Symbol("rating"), rating) - OpenAPI.validate_property(ThermalStandard, Symbol("base_power"), base_power) - OpenAPI.validate_property(ThermalStandard, Symbol("available"), available) - OpenAPI.validate_property(ThermalStandard, Symbol("status"), status) OpenAPI.validate_property(ThermalStandard, Symbol("active_power"), active_power) - OpenAPI.validate_property(ThermalStandard, Symbol("reactive_power"), reactive_power) OpenAPI.validate_property( ThermalStandard, Symbol("active_power_limits"), active_power_limits, ) + OpenAPI.validate_property(ThermalStandard, Symbol("available"), available) + OpenAPI.validate_property(ThermalStandard, Symbol("base_power"), base_power) + OpenAPI.validate_property(ThermalStandard, Symbol("bus_id"), bus_id) + OpenAPI.validate_property(ThermalStandard, Symbol("fuel_type"), fuel_type) + OpenAPI.validate_property(ThermalStandard, Symbol("id"), id) + OpenAPI.validate_property(ThermalStandard, Symbol("must_run"), must_run) + OpenAPI.validate_property(ThermalStandard, Symbol("name"), name) + OpenAPI.validate_property(ThermalStandard, Symbol("operation_cost"), operation_cost) + OpenAPI.validate_property(ThermalStandard, Symbol("prime_mover"), prime_mover) + OpenAPI.validate_property(ThermalStandard, Symbol("ramp_limits"), ramp_limits) + OpenAPI.validate_property(ThermalStandard, Symbol("rating"), rating) + OpenAPI.validate_property(ThermalStandard, Symbol("reactive_power"), reactive_power) OpenAPI.validate_property( ThermalStandard, Symbol("reactive_power_limits"), reactive_power_limits, ) - OpenAPI.validate_property(ThermalStandard, Symbol("ramp_limits"), ramp_limits) - OpenAPI.validate_property(ThermalStandard, Symbol("operation_cost"), operation_cost) + OpenAPI.validate_property(ThermalStandard, Symbol("status"), status) OpenAPI.validate_property(ThermalStandard, Symbol("time_limits"), time_limits) - OpenAPI.validate_property(ThermalStandard, Symbol("must_run"), must_run) - OpenAPI.validate_property(ThermalStandard, Symbol("bus_id"), bus_id) return new( + active_power, + active_power_limits, + available, + base_power, + bus_id, + fuel_type, id, + must_run, name, + operation_cost, prime_mover, - fuel_type, + ramp_limits, rating, - base_power, - available, - status, - active_power, reactive_power, - active_power_limits, reactive_power_limits, - ramp_limits, - operation_cost, + status, time_limits, - must_run, - bus_id, ) end end # type ThermalStandard const _property_types_ThermalStandard = Dict{Symbol,String}( + Symbol("active_power") => "Float64", + Symbol("active_power_limits") => "MinMax", + Symbol("available") => "Bool", + Symbol("base_power") => "Float64", + Symbol("bus_id") => "Int64", + Symbol("fuel_type") => "String", Symbol("id") => "Int64", + Symbol("must_run") => "Bool", Symbol("name") => "String", + Symbol("operation_cost") => "ThermalStandardOperationCost", Symbol("prime_mover") => "String", - Symbol("fuel_type") => "String", + Symbol("ramp_limits") => "UpDown", Symbol("rating") => "Float64", - Symbol("base_power") => "Float64", - Symbol("available") => "Bool", - Symbol("status") => "Bool", - Symbol("active_power") => "Float64", Symbol("reactive_power") => "Float64", - Symbol("active_power_limits") => "MinMax", Symbol("reactive_power_limits") => "MinMax", - Symbol("ramp_limits") => "UpDown", - Symbol("operation_cost") => "ThermalStandardOperationCost", + Symbol("status") => "Bool", Symbol("time_limits") => "UpDown", - Symbol("must_run") => "Bool", - Symbol("bus_id") => "Int64", ) OpenAPI.property_type(::Type{ThermalStandard}, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_ThermalStandard[name]))} function check_required(o::ThermalStandard) + o.bus_id === nothing && (return false) o.id === nothing && (return false) o.name === nothing && (return false) o.operation_cost === nothing && (return false) - o.bus_id === nothing && (return false) true end function OpenAPI.validate_property(::Type{ThermalStandard}, name::Symbol, val) + if name === Symbol("fuel_type") + OpenAPI.validate_param( + name, + "ThermalStandard", + :enum, + val, + [ + "COAL", + "WASTE_COAL", + "DISTILLATE_FUEL_OIL", + "WASTE_OIL", + "PETROLEUM_COKE", + "RESIDUAL_FUEL_OIL", + "NATURAL_GAS", + "OTHER_GAS", + "NUCLEAR", + "AG_BIPRODUCT", + "MUNICIPAL_WASTE", + "WOOD_WASTE", + "GEOTHERMAL", + "OTHER", + ], + ) + end if name === Symbol("prime_mover") OpenAPI.validate_param( name, @@ -191,28 +215,4 @@ function OpenAPI.validate_property(::Type{ThermalStandard}, name::Symbol, val) ], ) end - if name === Symbol("fuel_type") - OpenAPI.validate_param( - name, - "ThermalStandard", - :enum, - val, - [ - "COAL", - "WASTE_COAL", - "DISTILLATE_FUEL_OIL", - "WASTE_OIL", - "PETROLEUM_COKE", - "RESIDUAL_FUEL_OIL", - "NATURAL_GAS", - "OTHER_GAS", - "NUCLEAR", - "AG_BIPRODUCT", - "MUNICIPAL_WASTE", - "WOOD_WASTE", - "GEOTHERMAL", - "OTHER", - ], - ) - end end diff --git a/SiennaOpenAPIModels.jl/src/models/model_ThermalStandardOperationCost.jl b/SiennaOpenAPIModels.jl/src/models/model_ThermalStandardOperationCost.jl index 14064f0..1dc9679 100644 --- a/SiennaOpenAPIModels.jl/src/models/model_ThermalStandardOperationCost.jl +++ b/SiennaOpenAPIModels.jl/src/models/model_ThermalStandardOperationCost.jl @@ -6,30 +6,30 @@ Cost representation for thermal generation units ThermalStandardOperationCost(; - variable=nothing, fixed=nothing, - start_up=nothing, shut_down=nothing, + start_up=nothing, + variable=nothing, ) - - variable::ThermalStandardOperationCostVariable - fixed::Float64 : Fixed cost of keeping the unit online. For some cost represenations this field can be duplicative - - start_up::ThermalStandardOperationCostStartUp - shut_down::Float64 : Cost to turn the unit off + - start_up::ThermalStandardOperationCostStartUp + - variable::ThermalStandardOperationCostVariable """ Base.@kwdef mutable struct ThermalStandardOperationCost <: OpenAPI.APIModel - variable = nothing # spec type: Union{ Nothing, ThermalStandardOperationCostVariable } fixed::Union{Nothing,Float64} = nothing - start_up = nothing # spec type: Union{ Nothing, ThermalStandardOperationCostStartUp } shut_down::Union{Nothing,Float64} = nothing + start_up = nothing # spec type: Union{ Nothing, ThermalStandardOperationCostStartUp } + variable = nothing # spec type: Union{ Nothing, ThermalStandardOperationCostVariable } - function ThermalStandardOperationCost(variable, fixed, start_up, shut_down) + function ThermalStandardOperationCost(fixed, shut_down, start_up, variable) + OpenAPI.validate_property(ThermalStandardOperationCost, Symbol("fixed"), fixed) OpenAPI.validate_property( ThermalStandardOperationCost, - Symbol("variable"), - variable, + Symbol("shut_down"), + shut_down, ) - OpenAPI.validate_property(ThermalStandardOperationCost, Symbol("fixed"), fixed) OpenAPI.validate_property( ThermalStandardOperationCost, Symbol("start_up"), @@ -37,27 +37,27 @@ Base.@kwdef mutable struct ThermalStandardOperationCost <: OpenAPI.APIModel ) OpenAPI.validate_property( ThermalStandardOperationCost, - Symbol("shut_down"), - shut_down, + Symbol("variable"), + variable, ) - return new(variable, fixed, start_up, shut_down) + return new(fixed, shut_down, start_up, variable) end end # type ThermalStandardOperationCost const _property_types_ThermalStandardOperationCost = Dict{Symbol,String}( - Symbol("variable") => "ThermalStandardOperationCostVariable", Symbol("fixed") => "Float64", - Symbol("start_up") => "ThermalStandardOperationCostStartUp", Symbol("shut_down") => "Float64", + Symbol("start_up") => "ThermalStandardOperationCostStartUp", + Symbol("variable") => "ThermalStandardOperationCostVariable", ) OpenAPI.property_type(::Type{ThermalStandardOperationCost}, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_ThermalStandardOperationCost[name]))} function check_required(o::ThermalStandardOperationCost) - o.variable === nothing && (return false) o.fixed === nothing && (return false) - o.start_up === nothing && (return false) o.shut_down === nothing && (return false) + o.start_up === nothing && (return false) + o.variable === nothing && (return false) true end diff --git a/SiennaOpenAPIModels.jl/src/models/model_UpDown.jl b/SiennaOpenAPIModels.jl/src/models/model_UpDown.jl index 9c3b8bf..9ef8a27 100644 --- a/SiennaOpenAPIModels.jl/src/models/model_UpDown.jl +++ b/SiennaOpenAPIModels.jl/src/models/model_UpDown.jl @@ -5,32 +5,32 @@ @doc raw"""UpDown UpDown(; - up=nothing, down=nothing, + up=nothing, ) - - up::Float64 - down::Float64 + - up::Float64 """ Base.@kwdef mutable struct UpDown <: OpenAPI.APIModel - up::Union{Nothing,Float64} = nothing down::Union{Nothing,Float64} = nothing + up::Union{Nothing,Float64} = nothing - function UpDown(up, down) - OpenAPI.validate_property(UpDown, Symbol("up"), up) + function UpDown(down, up) OpenAPI.validate_property(UpDown, Symbol("down"), down) - return new(up, down) + OpenAPI.validate_property(UpDown, Symbol("up"), up) + return new(down, up) end end # type UpDown const _property_types_UpDown = - Dict{Symbol,String}(Symbol("up") => "Float64", Symbol("down") => "Float64") + Dict{Symbol,String}(Symbol("down") => "Float64", Symbol("up") => "Float64") OpenAPI.property_type(::Type{UpDown}, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_UpDown[name]))} function check_required(o::UpDown) - o.up === nothing && (return false) o.down === nothing && (return false) + o.up === nothing && (return false) true end