Model/POSTNodesTermproxyRB.ps1

#
# Proxmox PowerShell VE
# Generated module to access all Proxmox VE Api Endpoints. This module has been generated from the proxmox api description v. 8.4.0
# Version: 8.4.0
# Contact: mail@timo-wolf.de
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER Cmd
No description available.
.PARAMETER CmdOpts
No description available.
.OUTPUTS

POSTNodesTermproxyRB<PSCustomObject>
#>


function Initialize-PVEPOSTNodesTermproxyRB {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("ceph_install", "upgrade", "login")]
        [String]
        ${Cmd},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${CmdOpts}
    )

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


         $DisplayNameMapping =@{
            "Cmd"="cmd"; "CmdOpts"="cmd-opts"
        }
        
         $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 POSTNodesTermproxyRB<PSCustomObject>

.DESCRIPTION

Convert from JSON to POSTNodesTermproxyRB<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

POSTNodesTermproxyRB<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in PVEPOSTNodesTermproxyRB
        $AllProperties = ("cmd", "cmd-opts")
        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 "cmd"))) { #optional property not found
            $Cmd = $null
        } else {
            $Cmd = $JsonParameters.PSobject.Properties["cmd"].value
        }

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

        $PSO = [PSCustomObject]@{
            "cmd" = ${Cmd}
            "cmd-opts" = ${CmdOpts}
        }

        return $PSO
    }

}