Model/NodesStorageInnerFormats.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.1.1 # Version: 9.1.1 # Contact: mail@timo-wolf.de # Generated by OpenAPI Generator: https://openapi-generator.tech # <# .SYNOPSIS No summary available. .DESCRIPTION No description available. .PARAMETER Default The default format of the storage. .PARAMETER Supported The list of supported formats .OUTPUTS NodesStorageInnerFormats<PSCustomObject> #> function Initialize-PVENodesStorageInnerFormats { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("qcow2", "raw", "subvol", "vmdk")] [String] ${Default}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("qcow2", "raw", "subvol", "vmdk")] [String[]] ${Supported} ) Process { 'Creating PSCustomObject: ProxmoxPVE => PVENodesStorageInnerFormats' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $DisplayNameMapping =@{ "Default"="default"; "Supported"="supported" } $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 NodesStorageInnerFormats<PSCustomObject> .DESCRIPTION Convert from JSON to NodesStorageInnerFormats<PSCustomObject> .PARAMETER Json Json object .OUTPUTS NodesStorageInnerFormats<PSCustomObject> #> function ConvertFrom-PVEJsonToNodesStorageInnerFormats { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: ProxmoxPVE => PVENodesStorageInnerFormats' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in PVENodesStorageInnerFormats $AllProperties = ("default", "supported") 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 "default"))) { #optional property not found $Default = $null } else { $Default = $JsonParameters.PSobject.Properties["default"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "supported"))) { #optional property not found $Supported = $null } else { $Supported = $JsonParameters.PSobject.Properties["supported"].value } $PSO = [PSCustomObject]@{ "default" = ${Default} "supported" = ${Supported} } return $PSO } } |