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



mutable struct OSDisk <: SwaggerModel
    osType::Any # spec type: Union{ Nothing, String } # spec name: osType
    encryptionSettings::Any # spec type: Union{ Nothing, DiskEncryptionSettings } # spec name: encryptionSettings
    name::Any # spec type: Union{ Nothing, String } # spec name: name
    vhd::Any # spec type: Union{ Nothing, VirtualHardDisk } # spec name: vhd
    image::Any # spec type: Union{ Nothing, VirtualHardDisk } # spec name: image
    caching::Any # spec type: Union{ Nothing, Caching } # spec name: caching
    createOption::Any # spec type: Union{ Nothing, CreateOption } # spec name: createOption
    diskSizeGB::Any # spec type: Union{ Nothing, Int32 } # spec name: diskSizeGB
    managedDisk::Any # spec type: Union{ Nothing, ManagedDiskParameters } # spec name: managedDisk

    function OSDisk(;osType=nothing, encryptionSettings=nothing, name=nothing, vhd=nothing, image=nothing, caching=nothing, createOption=nothing, diskSizeGB=nothing, managedDisk=nothing)
        o = new()
        validate_property(OSDisk, Symbol("osType"), osType)
        setfield!(o, Symbol("osType"), osType)
        validate_property(OSDisk, Symbol("encryptionSettings"), encryptionSettings)
        setfield!(o, Symbol("encryptionSettings"), encryptionSettings)
        validate_property(OSDisk, Symbol("name"), name)
        setfield!(o, Symbol("name"), name)
        validate_property(OSDisk, Symbol("vhd"), vhd)
        setfield!(o, Symbol("vhd"), vhd)
        validate_property(OSDisk, Symbol("image"), image)
        setfield!(o, Symbol("image"), image)
        validate_property(OSDisk, Symbol("caching"), caching)
        setfield!(o, Symbol("caching"), caching)
        validate_property(OSDisk, Symbol("createOption"), createOption)
        setfield!(o, Symbol("createOption"), createOption)
        validate_property(OSDisk, Symbol("diskSizeGB"), diskSizeGB)
        setfield!(o, Symbol("diskSizeGB"), diskSizeGB)
        validate_property(OSDisk, Symbol("managedDisk"), managedDisk)
        setfield!(o, Symbol("managedDisk"), managedDisk)
        o
    end
end # type OSDisk

const _property_map_OSDisk = Dict{Symbol,Symbol}(Symbol("osType")=>Symbol("osType"), Symbol("encryptionSettings")=>Symbol("encryptionSettings"), Symbol("name")=>Symbol("name"), Symbol("vhd")=>Symbol("vhd"), Symbol("image")=>Symbol("image"), Symbol("caching")=>Symbol("caching"), Symbol("createOption")=>Symbol("createOption"), Symbol("diskSizeGB")=>Symbol("diskSizeGB"), Symbol("managedDisk")=>Symbol("managedDisk"))
const _property_types_OSDisk = Dict{Symbol,String}(Symbol("osType")=>"String", Symbol("encryptionSettings")=>"DiskEncryptionSettings", Symbol("name")=>"String", Symbol("vhd")=>"VirtualHardDisk", Symbol("image")=>"VirtualHardDisk", Symbol("caching")=>"Caching", Symbol("createOption")=>"CreateOption", Symbol("diskSizeGB")=>"Int32", Symbol("managedDisk")=>"ManagedDiskParameters")
Base.propertynames(::Type{ OSDisk }) = collect(keys(_property_map_OSDisk))
Swagger.property_type(::Type{ OSDisk }, name::Symbol) = Union{Nothing,eval(Meta.parse(_property_types_OSDisk[name]))}
Swagger.field_name(::Type{ OSDisk }, property_name::Symbol) =  _property_map_OSDisk[property_name]

const _allowed_OSDisk_osType = ["Windows", "Linux"]

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

function validate_property(::Type{ OSDisk }, name::Symbol, val)
    if name === Symbol("osType")
        Swagger.validate_param(name, "OSDisk", :enum, val, _allowed_OSDisk_osType)
    end
end
