Model/POSTNodesQemuMigrateRB.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 MigrationType No description available. .PARAMETER Node No description available. .PARAMETER Bwlimit No description available. .PARAMETER Vmid No description available. .PARAMETER Target No description available. .PARAMETER Targetstorage No description available. .PARAMETER Force No description available. .PARAMETER MigrationNetwork No description available. .PARAMETER WithLocalDisks No description available. .PARAMETER Online No description available. .OUTPUTS POSTNodesQemuMigrateRB<PSCustomObject> #> function Initialize-PVEPOSTNodesQemuMigrateRB { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("secure", "insecure")] [String] ${MigrationType}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Node}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Bwlimit}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Vmid}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Target}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Targetstorage}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Force}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${MigrationNetwork}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${WithLocalDisks}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Online} ) Process { 'Creating PSCustomObject: ProxmoxPVE => PVEPOSTNodesQemuMigrateRB' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug 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." } if ($Force -and $Force -gt 1) { throw "invalid value for 'Force', must be smaller than or equal to 1." } if ($Force -and $Force -lt 0) { throw "invalid value for 'Force', must be greater than or equal to 0." } if ($WithLocalDisks -and $WithLocalDisks -gt 1) { throw "invalid value for 'WithLocalDisks', must be smaller than or equal to 1." } if ($WithLocalDisks -and $WithLocalDisks -lt 0) { throw "invalid value for 'WithLocalDisks', must be greater than or equal to 0." } if ($Online -and $Online -gt 1) { throw "invalid value for 'Online', must be smaller than or equal to 1." } if ($Online -and $Online -lt 0) { throw "invalid value for 'Online', must be greater than or equal to 0." } $DisplayNameMapping =@{ "MigrationType"="migration_type"; "Node"="node"; "Bwlimit"="bwlimit"; "Vmid"="vmid"; "Target"="target"; "Targetstorage"="targetstorage"; "Force"="force"; "MigrationNetwork"="migration_network"; "WithLocalDisks"="with-local-disks"; "Online"="online" } $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 POSTNodesQemuMigrateRB<PSCustomObject> .DESCRIPTION Convert from JSON to POSTNodesQemuMigrateRB<PSCustomObject> .PARAMETER Json Json object .OUTPUTS POSTNodesQemuMigrateRB<PSCustomObject> #> function ConvertFrom-PVEJsonToPOSTNodesQemuMigrateRB { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: ProxmoxPVE => PVEPOSTNodesQemuMigrateRB' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in PVEPOSTNodesQemuMigrateRB $AllProperties = ("migration_type", "node", "bwlimit", "vmid", "target", "targetstorage", "force", "migration_network", "with-local-disks", "online") 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 "migration_type"))) { #optional property not found $MigrationType = $null } else { $MigrationType = $JsonParameters.PSobject.Properties["migration_type"].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 "bwlimit"))) { #optional property not found $Bwlimit = $null } else { $Bwlimit = $JsonParameters.PSobject.Properties["bwlimit"].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 "target"))) { #optional property not found $Target = $null } else { $Target = $JsonParameters.PSobject.Properties["target"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "targetstorage"))) { #optional property not found $Targetstorage = $null } else { $Targetstorage = $JsonParameters.PSobject.Properties["targetstorage"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "force"))) { #optional property not found $Force = $null } else { $Force = $JsonParameters.PSobject.Properties["force"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "migration_network"))) { #optional property not found $MigrationNetwork = $null } else { $MigrationNetwork = $JsonParameters.PSobject.Properties["migration_network"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "with-local-disks"))) { #optional property not found $WithLocalDisks = $null } else { $WithLocalDisks = $JsonParameters.PSobject.Properties["with-local-disks"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "online"))) { #optional property not found $Online = $null } else { $Online = $JsonParameters.PSobject.Properties["online"].value } $PSO = [PSCustomObject]@{ "migration_type" = ${MigrationType} "node" = ${Node} "bwlimit" = ${Bwlimit} "vmid" = ${Vmid} "target" = ${Target} "targetstorage" = ${Targetstorage} "force" = ${Force} "migration_network" = ${MigrationNetwork} "with-local-disks" = ${WithLocalDisks} "online" = ${Online} } return $PSO } } |