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

mutable struct TokenBucket <: SwaggerModel
    size::Union{ Nothing, Int64 } # size
    one_time_burst::Union{ Nothing, Int64 } # one_time_burst
    refill_time::Union{ Nothing, Int64 } # refill_time

    function TokenBucket(;size=nothing, one_time_burst=nothing, refill_time=nothing)
        o = new()
        set_field!(o, :size, size)
        set_field!(o, :one_time_burst, one_time_burst)
        set_field!(o, :refill_time, refill_time)
        o
    end
end # type TokenBucket

const _name_map_TokenBucket = Dict{String,Symbol}(["size"=>:size, "one_time_burst"=>:one_time_burst, "refill_time"=>:refill_time])
const _field_map_TokenBucket = Dict{Symbol,String}([:size=>"size", :one_time_burst=>"one_time_burst", :refill_time=>"refill_time"])
Swagger.name_map(::Type{ TokenBucket }) = _name_map_TokenBucket
Swagger.field_map(::Type{ TokenBucket }) = _field_map_TokenBucket

function check_required(o::TokenBucket)
    (o.size === nothing) && (return false)
    (o.refill_time === nothing) && (return false)
    true
end

function validate_field(o::TokenBucket, name::Symbol, val)
    if name === :size
        Swagger.validate_param(name, "TokenBucket", :minimum, val, 0, false)
    end
    if name === :one_time_burst
        Swagger.validate_param(name, "TokenBucket", :minimum, val, 0, false)
    end
    if name === :refill_time
        Swagger.validate_param(name, "TokenBucket", :minimum, val, 0, false)
    end
end
