Model/NodesDisksDirectoryInner.ps1

#
# Proxmox VE
# Generated module to access all Proxmox VE Api Endpoints
# Version: 0.3
# Contact: amna.wolf@gmail.com
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER Device
No description available.
.PARAMETER Unitfile
No description available.
.PARAMETER Options
No description available.
.PARAMETER Path
No description available.
.PARAMETER Type
No description available.
.OUTPUTS

NodesDisksDirectoryInner<PSCustomObject>
#>


function Initialize-PVENodesDisksDirectoryInner {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Device},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Unitfile},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Options},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Path},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Type}
    )

    Process {
        'Creating PSCustomObject: ProxmoxPVE => PVENodesDisksDirectoryInner' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug


         $DisplayNameMapping =@{
            "Device"="device"; "Unitfile"="unitfile"; "Options"="options"; "Path"="path"; "Type"="type"
        }
        
         $OBJ = @{}
        foreach($parameter in   $PSBoundParameters.Keys){
            #If Specifield map the Display name back
            $OBJ.($DisplayNameMapping.($parameter)) = "$PSBoundParameters.$parameter"
        }

        $PSO = [PSCustomObject]$OBJ


        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to NodesDisksDirectoryInner<PSCustomObject>

.DESCRIPTION

Convert from JSON to NodesDisksDirectoryInner<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

NodesDisksDirectoryInner<PSCustomObject>
#>

function ConvertFrom-PVEJsonToNodesDisksDirectoryInner {
    Param(
        [AllowEmptyString()]
        [string]$Json
    )

    Process {
        'Converting JSON to PSCustomObject: ProxmoxPVE => PVENodesDisksDirectoryInner' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in PVENodesDisksDirectoryInner
        $AllProperties = ("device", "unitfile", "options", "path", "type")
        foreach ($name in $JsonParameters.PsObject.Properties.Name) {
            if (!($AllProperties.Contains($name))) {
                throw "Error! JSON key '$name' not found in the properties: $($AllProperties)"
            }
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "device"))) { #optional property not found
            $Device = $null
        } else {
            $Device = $JsonParameters.PSobject.Properties["device"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "unitfile"))) { #optional property not found
            $Unitfile = $null
        } else {
            $Unitfile = $JsonParameters.PSobject.Properties["unitfile"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "options"))) { #optional property not found
            $Options = $null
        } else {
            $Options = $JsonParameters.PSobject.Properties["options"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "path"))) { #optional property not found
            $Path = $null
        } else {
            $Path = $JsonParameters.PSobject.Properties["path"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "type"))) { #optional property not found
            $Type = $null
        } else {
            $Type = $JsonParameters.PSobject.Properties["type"].value
        }

        $PSO = [PSCustomObject]@{
            "device" = ${Device}
            "unitfile" = ${Unitfile}
            "options" = ${Options}
            "path" = ${Path}
            "type" = ${Type}
        }

        return $PSO
    }

}