Model/NodesLxcMigrate.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 NotAllowedNodes No description available. .PARAMETER DependentHaResources No description available. .PARAMETER AllowedNodes No description available. .PARAMETER Running No description available. .OUTPUTS NodesLxcMigrate<PSCustomObject> #> function Initialize-PVENodesLxcMigrate { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${NotAllowedNodes}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String[]] ${DependentHaResources}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String[]] ${AllowedNodes}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${Running} ) Process { 'Creating PSCustomObject: ProxmoxPVE => PVENodesLxcMigrate' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $DisplayNameMapping =@{ "NotAllowedNodes"="not-allowed-nodes"; "DependentHaResources"="dependent-ha-resources"; "AllowedNodes"="allowed-nodes"; "Running"="running" } $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 NodesLxcMigrate<PSCustomObject> .DESCRIPTION Convert from JSON to NodesLxcMigrate<PSCustomObject> .PARAMETER Json Json object .OUTPUTS NodesLxcMigrate<PSCustomObject> #> function ConvertFrom-PVEJsonToNodesLxcMigrate { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: ProxmoxPVE => PVENodesLxcMigrate' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in PVENodesLxcMigrate $AllProperties = ("not-allowed-nodes", "dependent-ha-resources", "allowed-nodes", "running") 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 "not-allowed-nodes"))) { #optional property not found $NotAllowedNodes = $null } else { $NotAllowedNodes = $JsonParameters.PSobject.Properties["not-allowed-nodes"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "dependent-ha-resources"))) { #optional property not found $DependentHaResources = $null } else { $DependentHaResources = $JsonParameters.PSobject.Properties["dependent-ha-resources"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "allowed-nodes"))) { #optional property not found $AllowedNodes = $null } else { $AllowedNodes = $JsonParameters.PSobject.Properties["allowed-nodes"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "running"))) { #optional property not found $Running = $null } else { $Running = $JsonParameters.PSobject.Properties["running"].value } $PSO = [PSCustomObject]@{ "not-allowed-nodes" = ${NotAllowedNodes} "dependent-ha-resources" = ${DependentHaResources} "allowed-nodes" = ${AllowedNodes} "running" = ${Running} } return $PSO } } |