Model/POSTClusterHaGroupsRB.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 Comment No description available. .PARAMETER Type No description available. .PARAMETER Group No description available. .PARAMETER Restricted No description available. .PARAMETER Nofailback No description available. .PARAMETER Nodes No description available. .OUTPUTS POSTClusterHaGroupsRB<PSCustomObject> #> function Initialize-PVEPOSTClusterHaGroupsRB { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Comment}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("group")] [String] ${Type}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Group}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Restricted}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Nofailback}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Nodes} ) Process { 'Creating PSCustomObject: ProxmoxPVE => PVEPOSTClusterHaGroupsRB' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug if (!$Comment -and $Comment.length -gt 4096) { throw "invalid value for 'Comment', the character length must be smaller than or equal to 4096." } if ($Restricted -and $Restricted -gt 1) { throw "invalid value for 'Restricted', must be smaller than or equal to 1." } if ($Restricted -and $Restricted -lt 0) { throw "invalid value for 'Restricted', must be greater than or equal to 0." } if ($Nofailback -and $Nofailback -gt 1) { throw "invalid value for 'Nofailback', must be smaller than or equal to 1." } if ($Nofailback -and $Nofailback -lt 0) { throw "invalid value for 'Nofailback', must be greater than or equal to 0." } $DisplayNameMapping =@{ "Comment"="comment"; "Type"="type"; "Group"="group"; "Restricted"="restricted"; "Nofailback"="nofailback"; "Nodes"="nodes" } $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 POSTClusterHaGroupsRB<PSCustomObject> .DESCRIPTION Convert from JSON to POSTClusterHaGroupsRB<PSCustomObject> .PARAMETER Json Json object .OUTPUTS POSTClusterHaGroupsRB<PSCustomObject> #> function ConvertFrom-PVEJsonToPOSTClusterHaGroupsRB { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: ProxmoxPVE => PVEPOSTClusterHaGroupsRB' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in PVEPOSTClusterHaGroupsRB $AllProperties = ("comment", "type", "group", "restricted", "nofailback", "nodes") 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 "comment"))) { #optional property not found $Comment = $null } else { $Comment = $JsonParameters.PSobject.Properties["comment"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "type"))) { #optional property not found $Type = $null } else { $Type = $JsonParameters.PSobject.Properties["type"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "group"))) { #optional property not found $Group = $null } else { $Group = $JsonParameters.PSobject.Properties["group"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "restricted"))) { #optional property not found $Restricted = $null } else { $Restricted = $JsonParameters.PSobject.Properties["restricted"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "nofailback"))) { #optional property not found $Nofailback = $null } else { $Nofailback = $JsonParameters.PSobject.Properties["nofailback"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "nodes"))) { #optional property not found $Nodes = $null } else { $Nodes = $JsonParameters.PSobject.Properties["nodes"].value } $PSO = [PSCustomObject]@{ "comment" = ${Comment} "type" = ${Type} "group" = ${Group} "restricted" = ${Restricted} "nofailback" = ${Nofailback} "nodes" = ${Nodes} } return $PSO } } |