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


mutable struct VirtualNetworkRule <: SwaggerModel
    id::Any # spec type: Union{ Nothing, String } # spec name: id
    action::Any # spec type: Union{ Nothing, String } # spec name: action
    state::Any # spec type: Union{ Nothing, String } # spec name: state

    function VirtualNetworkRule(;id=nothing, action="Allow", state=nothing)
        o = new()
        validate_property(VirtualNetworkRule, Symbol("id"), id)
        setfield!(o, Symbol("id"), id)
        validate_property(VirtualNetworkRule, Symbol("action"), action)
        setfield!(o, Symbol("action"), action)
        validate_property(VirtualNetworkRule, Symbol("state"), state)
        setfield!(o, Symbol("state"), state)
        o
    end
end # type VirtualNetworkRule

const _property_map_VirtualNetworkRule = Dict{Symbol,Symbol}(Symbol("id")=>Symbol("id"), Symbol("action")=>Symbol("action"), Symbol("state")=>Symbol("state"))
const _property_types_VirtualNetworkRule = Dict{Symbol,String}(Symbol("id")=>"String", Symbol("action")=>"String", Symbol("state")=>"String")
Base.propertynames(::Type{ VirtualNetworkRule }) = collect(keys(_property_map_VirtualNetworkRule))
Swagger.property_type(::Type{ VirtualNetworkRule }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_VirtualNetworkRule[name]))}
Swagger.field_name(::Type{ VirtualNetworkRule }, property_name::Symbol) =  _property_map_VirtualNetworkRule[property_name]

const _allowed_VirtualNetworkRule_action = ["Allow"]

const _allowed_VirtualNetworkRule_state = ["provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted"]

function check_required(o::VirtualNetworkRule)
    (getproperty(o, Symbol("id")) === nothing) && (return false)
    true
end

function validate_property(::Type{ VirtualNetworkRule }, name::Symbol, val)
    if name === Symbol("action")
        Swagger.validate_param(name, "VirtualNetworkRule", :enum, val, _allowed_VirtualNetworkRule_action)
    end
    if name === Symbol("state")
        Swagger.validate_param(name, "VirtualNetworkRule", :enum, val, _allowed_VirtualNetworkRule_state)
    end
end
