Model/ClusterHaResourcesRelocate.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 No description available. .PARAMETER BlockingResources No description available. .PARAMETER RequestedNode No description available. .PARAMETER ComigratedResources No description available. .PARAMETER Sid No description available. .OUTPUTS ClusterHaResourcesRelocate<PSCustomObject> #> function Initialize-PVEClusterHaResourcesRelocate { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${BlockingResources}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${RequestedNode}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String[]] ${ComigratedResources}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Sid} ) Process { 'Creating PSCustomObject: ProxmoxPVE => PVEClusterHaResourcesRelocate' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $DisplayNameMapping =@{ "BlockingResources"="blocking-resources"; "RequestedNode"="requested-node"; "ComigratedResources"="comigrated-resources"; "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 ClusterHaResourcesRelocate<PSCustomObject> .DESCRIPTION Convert from JSON to ClusterHaResourcesRelocate<PSCustomObject> .PARAMETER Json Json object .OUTPUTS ClusterHaResourcesRelocate<PSCustomObject> #> function ConvertFrom-PVEJsonToClusterHaResourcesRelocate { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: ProxmoxPVE => PVEClusterHaResourcesRelocate' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in PVEClusterHaResourcesRelocate $AllProperties = ("blocking-resources", "requested-node", "comigrated-resources", "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 "blocking-resources"))) { #optional property not found $BlockingResources = $null } else { $BlockingResources = $JsonParameters.PSobject.Properties["blocking-resources"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "requested-node"))) { #optional property not found $RequestedNode = $null } else { $RequestedNode = $JsonParameters.PSobject.Properties["requested-node"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "comigrated-resources"))) { #optional property not found $ComigratedResources = $null } else { $ComigratedResources = $JsonParameters.PSobject.Properties["comigrated-resources"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "sid"))) { #optional property not found $Sid = $null } else { $Sid = $JsonParameters.PSobject.Properties["sid"].value } $PSO = [PSCustomObject]@{ "blocking-resources" = ${BlockingResources} "requested-node" = ${RequestedNode} "comigrated-resources" = ${ComigratedResources} "sid" = ${Sid} } return $PSO } } |