Model/ClusterHaResourcesRelocateBlockingResourcesInner.ps1

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

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

A blocking HA resource

.PARAMETER Cause
The reason why the HA resource is blocking the relocation.
.PARAMETER Sid
The blocking HA resource id
.OUTPUTS

ClusterHaResourcesRelocateBlockingResourcesInner<PSCustomObject>
#>


function Initialize-PVEClusterHaResourcesRelocateBlockingResourcesInner {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("resource-affinity")]
        [String]
        ${Cause},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Sid}
    )

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


         $DisplayNameMapping =@{
            "Cause"="cause"; "Sid"="sid"
        }
        
         $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 ClusterHaResourcesRelocateBlockingResourcesInner<PSCustomObject>

.DESCRIPTION

Convert from JSON to ClusterHaResourcesRelocateBlockingResourcesInner<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

ClusterHaResourcesRelocateBlockingResourcesInner<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

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

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

        $PSO = [PSCustomObject]@{
            "cause" = ${Cause}
            "sid" = ${Sid}
        }

        return $PSO
    }

}