forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodel_User.jl
More file actions
78 lines (61 loc) · 2.56 KB
/
model_User.jl
File metadata and controls
78 lines (61 loc) · 2.56 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# This file was generated by the Julia OpenAPI Code Generator
# Do not modify this file directly. Modify the OpenAPI specification instead.
@doc raw"""User
A User who is purchasing from the pet store
User(;
id=nothing,
username=nothing,
firstName=nothing,
lastName=nothing,
email=nothing,
password=nothing,
phone=nothing,
userStatus=nothing,
)
- id::Int64
- username::String
- firstName::String
- lastName::String
- email::String
- password::String
- phone::String
- userStatus::Int64 : User Status
"""
Base.@kwdef mutable struct User <: OpenAPI.APIModel
id::Union{Nothing, Int64} = nothing
username::Union{Nothing, String} = nothing
firstName::Union{Nothing, String} = nothing
lastName::Union{Nothing, String} = nothing
email::Union{Nothing, String} = nothing
password::Union{Nothing, String} = nothing
phone::Union{Nothing, String} = nothing
userStatus::Union{Nothing, Int64} = nothing
function User(id, username, firstName, lastName, email, password, phone, userStatus, )
o = new(id, username, firstName, lastName, email, password, phone, userStatus, )
OpenAPI.validate_properties(o)
return o
end
end # type User
const _property_types_User = Dict{Symbol,String}(Symbol("id")=>"Int64", Symbol("username")=>"String", Symbol("firstName")=>"String", Symbol("lastName")=>"String", Symbol("email")=>"String", Symbol("password")=>"String", Symbol("phone")=>"String", Symbol("userStatus")=>"Int64", )
OpenAPI.property_type(::Type{ User }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_User[name]))}
function OpenAPI.check_required(o::User)
true
end
function OpenAPI.validate_properties(o::User)
OpenAPI.validate_property(User, Symbol("id"), o.id)
OpenAPI.validate_property(User, Symbol("username"), o.username)
OpenAPI.validate_property(User, Symbol("firstName"), o.firstName)
OpenAPI.validate_property(User, Symbol("lastName"), o.lastName)
OpenAPI.validate_property(User, Symbol("email"), o.email)
OpenAPI.validate_property(User, Symbol("password"), o.password)
OpenAPI.validate_property(User, Symbol("phone"), o.phone)
OpenAPI.validate_property(User, Symbol("userStatus"), o.userStatus)
end
function OpenAPI.validate_property(::Type{ User }, name::Symbol, val)
if name === Symbol("id")
OpenAPI.validate_param(name, "User", :format, val, "int64")
end
if name === Symbol("userStatus")
OpenAPI.validate_param(name, "User", :format, val, "int32")
end
end