-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathmodel_Cat.jl
More file actions
47 lines (35 loc) · 1.28 KB
/
model_Cat.jl
File metadata and controls
47 lines (35 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# This file was generated by the Julia OpenAPI Code Generator
# Do not modify this file directly. Modify the OpenAPI specification instead.
@doc raw"""Cat
Cat(;
pet_type=nothing,
hunts=nothing,
age=nothing,
)
- pet_type::String
- hunts::Bool
- age::Int64
"""
Base.@kwdef mutable struct Cat <: OpenAPI.APIModel
pet_type::Union{Nothing, String} = nothing
hunts::Union{Nothing, Bool} = nothing
age::Union{Nothing, Int64} = nothing
function Cat(pet_type, hunts, age, )
o = new(pet_type, hunts, age, )
OpenAPI.validate_properties(o)
return o
end
end # type Cat
const _property_types_Cat = Dict{Symbol,String}(Symbol("pet_type")=>"String", Symbol("hunts")=>"Bool", Symbol("age")=>"Int64", )
OpenAPI.property_type(::Type{ Cat }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_Cat[name]))}
function OpenAPI.check_required(o::Cat)
o.pet_type === nothing && (return false)
true
end
function OpenAPI.validate_properties(o::Cat)
OpenAPI.validate_property(Cat, Symbol("pet_type"), o.pet_type)
OpenAPI.validate_property(Cat, Symbol("hunts"), o.hunts)
OpenAPI.validate_property(Cat, Symbol("age"), o.age)
end
function OpenAPI.validate_property(::Type{ Cat }, name::Symbol, val)
end