Model/NodesLxcInner.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 Netout No description available. .PARAMETER Tags No description available. .PARAMETER Uptime No description available. .PARAMETER Maxmem No description available. .PARAMETER Maxswap No description available. .PARAMETER Netin No description available. .PARAMETER Diskwrite No description available. .PARAMETER Lock No description available. .PARAMETER Template No description available. .PARAMETER Disk No description available. .PARAMETER Vmid No description available. .PARAMETER Name No description available. .PARAMETER Maxdisk No description available. .PARAMETER Diskread No description available. .PARAMETER Status No description available. .PARAMETER Cpus No description available. .OUTPUTS NodesLxcInner<PSCustomObject> #> function Initialize-PVENodesLxcInner { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Netout}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Tags}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Uptime}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Maxmem}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Maxswap}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Netin}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Diskwrite}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Lock}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Template}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Disk}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Vmid}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Name}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Maxdisk}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Diskread}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("stopped", "running")] [String] ${Status}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Decimal]] ${Cpus} ) Process { 'Creating PSCustomObject: ProxmoxPVE => PVENodesLxcInner' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug if ($Template -and $Template -gt 1) { throw "invalid value for 'Template', must be smaller than or equal to 1." } if ($Template -and $Template -lt 0) { throw "invalid value for 'Template', must be greater than or equal to 0." } if ($Vmid -and $Vmid -gt 999999999) { throw "invalid value for 'Vmid', must be smaller than or equal to 999999999." } if ($Vmid -and $Vmid -lt 100) { throw "invalid value for 'Vmid', must be greater than or equal to 100." } $DisplayNameMapping =@{ "Netout"="netout"; "Tags"="tags"; "Uptime"="uptime"; "Maxmem"="maxmem"; "Maxswap"="maxswap"; "Netin"="netin"; "Diskwrite"="diskwrite"; "Lock"="lock"; "Template"="template"; "Disk"="disk"; "Vmid"="vmid"; "Name"="name"; "Maxdisk"="maxdisk"; "Diskread"="diskread"; "Status"="status"; "Cpus"="cpus" } $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 NodesLxcInner<PSCustomObject> .DESCRIPTION Convert from JSON to NodesLxcInner<PSCustomObject> .PARAMETER Json Json object .OUTPUTS NodesLxcInner<PSCustomObject> #> function ConvertFrom-PVEJsonToNodesLxcInner { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: ProxmoxPVE => PVENodesLxcInner' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in PVENodesLxcInner $AllProperties = ("netout", "tags", "uptime", "maxmem", "maxswap", "netin", "diskwrite", "lock", "template", "disk", "vmid", "name", "maxdisk", "diskread", "status", "cpus") 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 "netout"))) { #optional property not found $Netout = $null } else { $Netout = $JsonParameters.PSobject.Properties["netout"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "tags"))) { #optional property not found $Tags = $null } else { $Tags = $JsonParameters.PSobject.Properties["tags"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "uptime"))) { #optional property not found $Uptime = $null } else { $Uptime = $JsonParameters.PSobject.Properties["uptime"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "maxmem"))) { #optional property not found $Maxmem = $null } else { $Maxmem = $JsonParameters.PSobject.Properties["maxmem"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "maxswap"))) { #optional property not found $Maxswap = $null } else { $Maxswap = $JsonParameters.PSobject.Properties["maxswap"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "netin"))) { #optional property not found $Netin = $null } else { $Netin = $JsonParameters.PSobject.Properties["netin"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "diskwrite"))) { #optional property not found $Diskwrite = $null } else { $Diskwrite = $JsonParameters.PSobject.Properties["diskwrite"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "lock"))) { #optional property not found $Lock = $null } else { $Lock = $JsonParameters.PSobject.Properties["lock"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "template"))) { #optional property not found $Template = $null } else { $Template = $JsonParameters.PSobject.Properties["template"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "disk"))) { #optional property not found $Disk = $null } else { $Disk = $JsonParameters.PSobject.Properties["disk"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "vmid"))) { #optional property not found $Vmid = $null } else { $Vmid = $JsonParameters.PSobject.Properties["vmid"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "name"))) { #optional property not found $Name = $null } else { $Name = $JsonParameters.PSobject.Properties["name"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "maxdisk"))) { #optional property not found $Maxdisk = $null } else { $Maxdisk = $JsonParameters.PSobject.Properties["maxdisk"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "diskread"))) { #optional property not found $Diskread = $null } else { $Diskread = $JsonParameters.PSobject.Properties["diskread"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "status"))) { #optional property not found $Status = $null } else { $Status = $JsonParameters.PSobject.Properties["status"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "cpus"))) { #optional property not found $Cpus = $null } else { $Cpus = $JsonParameters.PSobject.Properties["cpus"].value } $PSO = [PSCustomObject]@{ "netout" = ${Netout} "tags" = ${Tags} "uptime" = ${Uptime} "maxmem" = ${Maxmem} "maxswap" = ${Maxswap} "netin" = ${Netin} "diskwrite" = ${Diskwrite} "lock" = ${Lock} "template" = ${Template} "disk" = ${Disk} "vmid" = ${Vmid} "name" = ${Name} "maxdisk" = ${Maxdisk} "diskread" = ${Diskread} "status" = ${Status} "cpus" = ${Cpus} } return $PSO } } |