Model/NodesStatus.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 BootInfo No description available. .PARAMETER CurrentKernel No description available. .OUTPUTS NodesStatus<PSCustomObject> #> function Initialize-PVENodesStatus { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${BootInfo}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${CurrentKernel} ) Process { 'Creating PSCustomObject: ProxmoxPVE => PVENodesStatus' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $DisplayNameMapping =@{ "BootInfo"="boot-info"; "CurrentKernel"="current-kernel" } $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 NodesStatus<PSCustomObject> .DESCRIPTION Convert from JSON to NodesStatus<PSCustomObject> .PARAMETER Json Json object .OUTPUTS NodesStatus<PSCustomObject> #> function ConvertFrom-PVEJsonToNodesStatus { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: ProxmoxPVE => PVENodesStatus' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in PVENodesStatus $AllProperties = ("boot-info", "current-kernel") 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 "boot-info"))) { #optional property not found $BootInfo = $null } else { $BootInfo = $JsonParameters.PSobject.Properties["boot-info"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "current-kernel"))) { #optional property not found $CurrentKernel = $null } else { $CurrentKernel = $JsonParameters.PSobject.Properties["current-kernel"].value } $PSO = [PSCustomObject]@{ "boot-info" = ${BootInfo} "current-kernel" = ${CurrentKernel} } return $PSO } } |