Model/NodesDisksLvmChildrenInnerChildrenInner.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 Free
The free bytes in the physical volume
.PARAMETER Leaf
No description available.
.PARAMETER Name
The name of the physical volume
.PARAMETER Size
The size of the physical volume in bytes
.OUTPUTS

NodesDisksLvmChildrenInnerChildrenInner<PSCustomObject>
#>


function Initialize-PVENodesDisksLvmChildrenInnerChildrenInner {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Free},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Leaf},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Size}
    )

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


         $DisplayNameMapping =@{
            "Free"="free"; "Leaf"="leaf"; "Name"="name"; "Size"="size"
        }
        
         $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 NodesDisksLvmChildrenInnerChildrenInner<PSCustomObject>

.DESCRIPTION

Convert from JSON to NodesDisksLvmChildrenInnerChildrenInner<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

NodesDisksLvmChildrenInnerChildrenInner<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in PVENodesDisksLvmChildrenInnerChildrenInner
        $AllProperties = ("free", "leaf", "name", "size")
        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 "free"))) { #optional property not found
            $Free = $null
        } else {
            $Free = $JsonParameters.PSobject.Properties["free"].value
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "free" = ${Free}
            "leaf" = ${Leaf}
            "name" = ${Name}
            "size" = ${Size}
        }

        return $PSO
    }

}