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


mutable struct ManagementPolicyRule <: SwaggerModel
    enabled::Any # spec type: Union{ Nothing, Bool } # spec name: enabled
    name::Any # spec type: Union{ Nothing, String } # spec name: name
    type::Any # spec type: Union{ Nothing, String } # spec name: type
    definition::Any # spec type: Union{ Nothing, ManagementPolicyDefinition } # spec name: definition

    function ManagementPolicyRule(;enabled=nothing, name=nothing, type=nothing, definition=nothing)
        o = new()
        validate_property(ManagementPolicyRule, Symbol("enabled"), enabled)
        setfield!(o, Symbol("enabled"), enabled)
        validate_property(ManagementPolicyRule, Symbol("name"), name)
        setfield!(o, Symbol("name"), name)
        validate_property(ManagementPolicyRule, Symbol("type"), type)
        setfield!(o, Symbol("type"), type)
        validate_property(ManagementPolicyRule, Symbol("definition"), definition)
        setfield!(o, Symbol("definition"), definition)
        o
    end
end # type ManagementPolicyRule

const _property_map_ManagementPolicyRule = Dict{Symbol,Symbol}(Symbol("enabled")=>Symbol("enabled"), Symbol("name")=>Symbol("name"), Symbol("type")=>Symbol("type"), Symbol("definition")=>Symbol("definition"))
const _property_types_ManagementPolicyRule = Dict{Symbol,String}(Symbol("enabled")=>"Bool", Symbol("name")=>"String", Symbol("type")=>"String", Symbol("definition")=>"ManagementPolicyDefinition")
Base.propertynames(::Type{ ManagementPolicyRule }) = collect(keys(_property_map_ManagementPolicyRule))
Swagger.property_type(::Type{ ManagementPolicyRule }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_ManagementPolicyRule[name]))}
Swagger.field_name(::Type{ ManagementPolicyRule }, property_name::Symbol) =  _property_map_ManagementPolicyRule[property_name]

const _allowed_ManagementPolicyRule_type = ["Lifecycle"]

function check_required(o::ManagementPolicyRule)
    (getproperty(o, Symbol("name")) === nothing) && (return false)
    (getproperty(o, Symbol("definition")) === nothing) && (return false)
    true
end

function validate_property(::Type{ ManagementPolicyRule }, name::Symbol, val)
    if name === Symbol("type")
        Swagger.validate_param(name, "ManagementPolicyRule", :enum, val, _allowed_ManagementPolicyRule_type)
    end
end
