# This file was generated by the Julia OpenAPI Code Generator
# Do not modify this file directly. Modify the OpenAPI specification instead.


@doc raw"""Order
An order for a pets from the pet store

    Order(;
        id=nothing,
        petId=nothing,
        quantity=nothing,
        shipDate=nothing,
        status=nothing,
        complete=false,
    )

    - id::Int64
    - petId::Int64
    - quantity::Int64
    - shipDate::ZonedDateTime
    - status::String : Order Status
    - complete::Bool
"""
Base.@kwdef mutable struct Order <: OpenAPI.APIModel
    id::Union{Nothing, Int64} = nothing
    petId::Union{Nothing, Int64} = nothing
    quantity::Union{Nothing, Int64} = nothing
    shipDate::Union{Nothing, ZonedDateTime} = nothing
    status::Union{Nothing, String} = nothing
    complete::Union{Nothing, Bool} = false

    function Order(id, petId, quantity, shipDate, status, complete, )
        OpenAPI.validate_property(Order, Symbol("id"), id)
        OpenAPI.validate_property(Order, Symbol("petId"), petId)
        OpenAPI.validate_property(Order, Symbol("quantity"), quantity)
        OpenAPI.validate_property(Order, Symbol("shipDate"), shipDate)
        OpenAPI.validate_property(Order, Symbol("status"), status)
        OpenAPI.validate_property(Order, Symbol("complete"), complete)
        return new(id, petId, quantity, shipDate, status, complete, )
    end
end # type Order

const _property_types_Order = Dict{Symbol,String}(Symbol("id")=>"Int64", Symbol("petId")=>"Int64", Symbol("quantity")=>"Int64", Symbol("shipDate")=>"ZonedDateTime", Symbol("status")=>"String", Symbol("complete")=>"Bool", )
OpenAPI.property_type(::Type{ Order }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_Order[name]))}

function check_required(o::Order)
    true
end

function OpenAPI.validate_property(::Type{ Order }, name::Symbol, val)
    if name === Symbol("id")
        OpenAPI.validate_param(name, "Order", :format, val, "int64")
    end
    if name === Symbol("petId")
        OpenAPI.validate_param(name, "Order", :format, val, "int64")
    end
    if name === Symbol("quantity")
        OpenAPI.validate_param(name, "Order", :format, val, "int32")
    end
    if name === Symbol("shipDate")
        OpenAPI.validate_param(name, "Order", :format, val, "date-time")
    end
    if name === Symbol("status")
        OpenAPI.validate_param(name, "Order", :enum, val, ["placed", "approved", "delivered"])
    end
end
