Skip to content

Commit

Permalink
Update models with regenerated for ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph McKinsey committed Oct 28, 2024
1 parent 3745368 commit 2fa588c
Show file tree
Hide file tree
Showing 9 changed files with 207 additions and 207 deletions.
32 changes: 16 additions & 16 deletions SiennaOpenAPIModels.jl/src/models/model_CostCurve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
44 changes: 22 additions & 22 deletions SiennaOpenAPIModels.jl/src/models/model_FuelCurve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
24 changes: 12 additions & 12 deletions SiennaOpenAPIModels.jl/src/models/model_LinearFunctionData.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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

Expand Down
14 changes: 7 additions & 7 deletions SiennaOpenAPIModels.jl/src/models/model_MinMax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]))}

Expand Down
38 changes: 19 additions & 19 deletions SiennaOpenAPIModels.jl/src/models/model_QuadraticFunctionData.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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

Expand Down
16 changes: 8 additions & 8 deletions SiennaOpenAPIModels.jl/src/models/model_StartUpStages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading

0 comments on commit 2fa588c

Please sign in to comment.