Model/NodesStoragePrunebackupsInner.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 Vmid
No description available.
.PARAMETER Volid
No description available.
.PARAMETER Ctime
No description available.
.PARAMETER Mark
No description available.
.PARAMETER Type
No description available.
.OUTPUTS

NodesStoragePrunebackupsInner<PSCustomObject>
#>


function Initialize-PVENodesStoragePrunebackupsInner {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Vmid},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Volid},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Ctime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("keep", "remove", "protected", "renamed")]
        [String]
        ${Mark},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Type}
    )

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


         $DisplayNameMapping =@{
            "Vmid"="vmid"; "Volid"="volid"; "Ctime"="ctime"; "Mark"="mark"; "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 NodesStoragePrunebackupsInner<PSCustomObject>

.DESCRIPTION

Convert from JSON to NodesStoragePrunebackupsInner<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

NodesStoragePrunebackupsInner<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in PVENodesStoragePrunebackupsInner
        $AllProperties = ("vmid", "volid", "ctime", "mark", "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 "vmid"))) { #optional property not found
            $Vmid = $null
        } else {
            $Vmid = $JsonParameters.PSobject.Properties["vmid"].value
        }

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

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

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

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

        $PSO = [PSCustomObject]@{
            "vmid" = ${Vmid}
            "volid" = ${Volid}
            "ctime" = ${Ctime}
            "mark" = ${Mark}
            "type" = ${Type}
        }

        return $PSO
    }

}