Model/DELETENodesCephPoolRB.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 Force
No description available.
.PARAMETER RemoveStorages
No description available.
.PARAMETER Name
No description available.
.PARAMETER Node
No description available.
.PARAMETER RemoveEcprofile
No description available.
.OUTPUTS

DELETENodesCephPoolRB<PSCustomObject>
#>


function Initialize-PVEDELETENodesCephPoolRB {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Force},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${RemoveStorages},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Node},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${RemoveEcprofile}
    )

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

        if ($Force -and $Force -gt 1) {
          throw "invalid value for 'Force', must be smaller than or equal to 1."
        }

        if ($Force -and $Force -lt 0) {
          throw "invalid value for 'Force', must be greater than or equal to 0."
        }

        if ($RemoveStorages -and $RemoveStorages -gt 1) {
          throw "invalid value for 'RemoveStorages', must be smaller than or equal to 1."
        }

        if ($RemoveStorages -and $RemoveStorages -lt 0) {
          throw "invalid value for 'RemoveStorages', must be greater than or equal to 0."
        }

        if ($RemoveEcprofile -and $RemoveEcprofile -gt 1) {
          throw "invalid value for 'RemoveEcprofile', must be smaller than or equal to 1."
        }

        if ($RemoveEcprofile -and $RemoveEcprofile -lt 0) {
          throw "invalid value for 'RemoveEcprofile', must be greater than or equal to 0."
        }


         $DisplayNameMapping =@{
            "Force"="force"; "RemoveStorages"="remove_storages"; "Name"="name"; "Node"="node"; "RemoveEcprofile"="remove_ecprofile"
        }
        
         $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 DELETENodesCephPoolRB<PSCustomObject>

.DESCRIPTION

Convert from JSON to DELETENodesCephPoolRB<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

DELETENodesCephPoolRB<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in PVEDELETENodesCephPoolRB
        $AllProperties = ("force", "remove_storages", "name", "node", "remove_ecprofile")
        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 "force"))) { #optional property not found
            $Force = $null
        } else {
            $Force = $JsonParameters.PSobject.Properties["force"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "remove_storages"))) { #optional property not found
            $RemoveStorages = $null
        } else {
            $RemoveStorages = $JsonParameters.PSobject.Properties["remove_storages"].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 "node"))) { #optional property not found
            $Node = $null
        } else {
            $Node = $JsonParameters.PSobject.Properties["node"].value
        }

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

        $PSO = [PSCustomObject]@{
            "force" = ${Force}
            "remove_storages" = ${RemoveStorages}
            "name" = ${Name}
            "node" = ${Node}
            "remove_ecprofile" = ${RemoveEcprofile}
        }

        return $PSO
    }

}