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



mutable struct RollingUpgradePolicy <: SwaggerModel
    maxBatchInstancePercent::Any # spec type: Union{ Nothing, Int32 } # spec name: maxBatchInstancePercent
    maxUnhealthyInstancePercent::Any # spec type: Union{ Nothing, Int32 } # spec name: maxUnhealthyInstancePercent
    maxUnhealthyUpgradedInstancePercent::Any # spec type: Union{ Nothing, Int32 } # spec name: maxUnhealthyUpgradedInstancePercent
    pauseTimeBetweenBatches::Any # spec type: Union{ Nothing, String } # spec name: pauseTimeBetweenBatches

    function RollingUpgradePolicy(;maxBatchInstancePercent=nothing, maxUnhealthyInstancePercent=nothing, maxUnhealthyUpgradedInstancePercent=nothing, pauseTimeBetweenBatches=nothing)
        o = new()
        validate_property(RollingUpgradePolicy, Symbol("maxBatchInstancePercent"), maxBatchInstancePercent)
        setfield!(o, Symbol("maxBatchInstancePercent"), maxBatchInstancePercent)
        validate_property(RollingUpgradePolicy, Symbol("maxUnhealthyInstancePercent"), maxUnhealthyInstancePercent)
        setfield!(o, Symbol("maxUnhealthyInstancePercent"), maxUnhealthyInstancePercent)
        validate_property(RollingUpgradePolicy, Symbol("maxUnhealthyUpgradedInstancePercent"), maxUnhealthyUpgradedInstancePercent)
        setfield!(o, Symbol("maxUnhealthyUpgradedInstancePercent"), maxUnhealthyUpgradedInstancePercent)
        validate_property(RollingUpgradePolicy, Symbol("pauseTimeBetweenBatches"), pauseTimeBetweenBatches)
        setfield!(o, Symbol("pauseTimeBetweenBatches"), pauseTimeBetweenBatches)
        o
    end
end # type RollingUpgradePolicy

const _property_map_RollingUpgradePolicy = Dict{Symbol,Symbol}(Symbol("maxBatchInstancePercent")=>Symbol("maxBatchInstancePercent"), Symbol("maxUnhealthyInstancePercent")=>Symbol("maxUnhealthyInstancePercent"), Symbol("maxUnhealthyUpgradedInstancePercent")=>Symbol("maxUnhealthyUpgradedInstancePercent"), Symbol("pauseTimeBetweenBatches")=>Symbol("pauseTimeBetweenBatches"))
const _property_types_RollingUpgradePolicy = Dict{Symbol,String}(Symbol("maxBatchInstancePercent")=>"Int32", Symbol("maxUnhealthyInstancePercent")=>"Int32", Symbol("maxUnhealthyUpgradedInstancePercent")=>"Int32", Symbol("pauseTimeBetweenBatches")=>"String")
Base.propertynames(::Type{ RollingUpgradePolicy }) = collect(keys(_property_map_RollingUpgradePolicy))
Swagger.property_type(::Type{ RollingUpgradePolicy }, name::Symbol) = Union{Nothing,eval(Meta.parse(_property_types_RollingUpgradePolicy[name]))}
Swagger.field_name(::Type{ RollingUpgradePolicy }, property_name::Symbol) =  _property_map_RollingUpgradePolicy[property_name]

function check_required(o::RollingUpgradePolicy)
    true
end

function validate_property(::Type{ RollingUpgradePolicy }, name::Symbol, val)
    if name === Symbol("maxBatchInstancePercent")
        Swagger.validate_param(name, "RollingUpgradePolicy", :maximum, val, 100, false)
        Swagger.validate_param(name, "RollingUpgradePolicy", :minimum, val, 5, false)
    end
    if name === Symbol("maxUnhealthyInstancePercent")
        Swagger.validate_param(name, "RollingUpgradePolicy", :maximum, val, 100, false)
        Swagger.validate_param(name, "RollingUpgradePolicy", :minimum, val, 5, false)
    end
    if name === Symbol("maxUnhealthyUpgradedInstancePercent")
        Swagger.validate_param(name, "RollingUpgradePolicy", :maximum, val, 100, false)
        Swagger.validate_param(name, "RollingUpgradePolicy", :minimum, val, 0, false)
    end
end
