Model/PUTNodesCephPoolRB.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 MinSize No description available. .PARAMETER Node No description available. .PARAMETER CrushRule No description available. .PARAMETER Name No description available. .PARAMETER Size No description available. .PARAMETER PgNum No description available. .PARAMETER PgAutoscaleMode No description available. .PARAMETER PgNumMin No description available. .PARAMETER TargetSizeRatio No description available. .PARAMETER Application No description available. .PARAMETER TargetSize No description available. .OUTPUTS PUTNodesCephPoolRB<PSCustomObject> #> function Initialize-PVEPUTNodesCephPoolRB { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${MinSize}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Node}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${CrushRule}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Name}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Size}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${PgNum}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("on", "off", "warn")] [String] ${PgAutoscaleMode}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${PgNumMin}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Decimal]] ${TargetSizeRatio}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("rbd", "cephfs", "rgw")] [String] ${Application}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidatePattern("^(\d+(\.\d+)?)([KMGT])?$")] [String] ${TargetSize} ) Process { 'Creating PSCustomObject: ProxmoxPVE => PVEPUTNodesCephPoolRB' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug if ($MinSize -and $MinSize -gt 7) { throw "invalid value for 'MinSize', must be smaller than or equal to 7." } if ($MinSize -and $MinSize -lt 1) { throw "invalid value for 'MinSize', must be greater than or equal to 1." } if ($Size -and $Size -gt 7) { throw "invalid value for 'Size', must be smaller than or equal to 7." } if ($Size -and $Size -lt 1) { throw "invalid value for 'Size', must be greater than or equal to 1." } if ($PgNum -and $PgNum -gt 32768) { throw "invalid value for 'PgNum', must be smaller than or equal to 32768." } if ($PgNum -and $PgNum -lt 1) { throw "invalid value for 'PgNum', must be greater than or equal to 1." } if ($PgNumMin -and $PgNumMin -gt 32768) { throw "invalid value for 'PgNumMin', must be smaller than or equal to 32768." } $DisplayNameMapping =@{ "MinSize"="min_size"; "Node"="node"; "CrushRule"="crush_rule"; "Name"="name"; "Size"="size"; "PgNum"="pg_num"; "PgAutoscaleMode"="pg_autoscale_mode"; "PgNumMin"="pg_num_min"; "TargetSizeRatio"="target_size_ratio"; "Application"="application"; "TargetSize"="target_size" } $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 PUTNodesCephPoolRB<PSCustomObject> .DESCRIPTION Convert from JSON to PUTNodesCephPoolRB<PSCustomObject> .PARAMETER Json Json object .OUTPUTS PUTNodesCephPoolRB<PSCustomObject> #> function ConvertFrom-PVEJsonToPUTNodesCephPoolRB { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: ProxmoxPVE => PVEPUTNodesCephPoolRB' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in PVEPUTNodesCephPoolRB $AllProperties = ("min_size", "node", "crush_rule", "name", "size", "pg_num", "pg_autoscale_mode", "pg_num_min", "target_size_ratio", "application", "target_size") 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 "min_size"))) { #optional property not found $MinSize = $null } else { $MinSize = $JsonParameters.PSobject.Properties["min_size"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "node"))) { #optional property not found $Node = $null } else { $Node = $JsonParameters.PSobject.Properties["node"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "crush_rule"))) { #optional property not found $CrushRule = $null } else { $CrushRule = $JsonParameters.PSobject.Properties["crush_rule"].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 "size"))) { #optional property not found $Size = $null } else { $Size = $JsonParameters.PSobject.Properties["size"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "pg_num"))) { #optional property not found $PgNum = $null } else { $PgNum = $JsonParameters.PSobject.Properties["pg_num"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "pg_autoscale_mode"))) { #optional property not found $PgAutoscaleMode = $null } else { $PgAutoscaleMode = $JsonParameters.PSobject.Properties["pg_autoscale_mode"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "pg_num_min"))) { #optional property not found $PgNumMin = $null } else { $PgNumMin = $JsonParameters.PSobject.Properties["pg_num_min"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "target_size_ratio"))) { #optional property not found $TargetSizeRatio = $null } else { $TargetSizeRatio = $JsonParameters.PSobject.Properties["target_size_ratio"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "application"))) { #optional property not found $Application = $null } else { $Application = $JsonParameters.PSobject.Properties["application"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "target_size"))) { #optional property not found $TargetSize = $null } else { $TargetSize = $JsonParameters.PSobject.Properties["target_size"].value } $PSO = [PSCustomObject]@{ "min_size" = ${MinSize} "node" = ${Node} "crush_rule" = ${CrushRule} "name" = ${Name} "size" = ${Size} "pg_num" = ${PgNum} "pg_autoscale_mode" = ${PgAutoscaleMode} "pg_num_min" = ${PgNumMin} "target_size_ratio" = ${TargetSizeRatio} "application" = ${Application} "target_size" = ${TargetSize} } return $PSO } } |