Model/POSTClusterSdnVnetsSubnetsRB.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 Type No description available. .PARAMETER Gateway No description available. .PARAMETER Dnszoneprefix No description available. .PARAMETER DhcpRange No description available. .PARAMETER Snat No description available. .PARAMETER Vnet No description available. .PARAMETER Subnet No description available. .PARAMETER DhcpDnsServer No description available. .OUTPUTS POSTClusterSdnVnetsSubnetsRB<PSCustomObject> #> function Initialize-PVEPOSTClusterSdnVnetsSubnetsRB { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("subnet")] [String] ${Type}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Gateway}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Dnszoneprefix}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String[]] ${DhcpRange}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Snat}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Vnet}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Subnet}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${DhcpDnsServer} ) Process { 'Creating PSCustomObject: ProxmoxPVE => PVEPOSTClusterSdnVnetsSubnetsRB' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug if ($Snat -and $Snat -gt 1) { throw "invalid value for 'Snat', must be smaller than or equal to 1." } if ($Snat -and $Snat -lt 0) { throw "invalid value for 'Snat', must be greater than or equal to 0." } $DisplayNameMapping =@{ "Type"="type"; "Gateway"="gateway"; "Dnszoneprefix"="dnszoneprefix"; "DhcpRange"="dhcp-range"; "Snat"="snat"; "Vnet"="vnet"; "Subnet"="subnet"; "DhcpDnsServer"="dhcp-dns-server" } $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 POSTClusterSdnVnetsSubnetsRB<PSCustomObject> .DESCRIPTION Convert from JSON to POSTClusterSdnVnetsSubnetsRB<PSCustomObject> .PARAMETER Json Json object .OUTPUTS POSTClusterSdnVnetsSubnetsRB<PSCustomObject> #> function ConvertFrom-PVEJsonToPOSTClusterSdnVnetsSubnetsRB { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: ProxmoxPVE => PVEPOSTClusterSdnVnetsSubnetsRB' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in PVEPOSTClusterSdnVnetsSubnetsRB $AllProperties = ("type", "gateway", "dnszoneprefix", "dhcp-range", "snat", "vnet", "subnet", "dhcp-dns-server") 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 "type"))) { #optional property not found $Type = $null } else { $Type = $JsonParameters.PSobject.Properties["type"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "gateway"))) { #optional property not found $Gateway = $null } else { $Gateway = $JsonParameters.PSobject.Properties["gateway"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "dnszoneprefix"))) { #optional property not found $Dnszoneprefix = $null } else { $Dnszoneprefix = $JsonParameters.PSobject.Properties["dnszoneprefix"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "dhcp-range"))) { #optional property not found $DhcpRange = $null } else { $DhcpRange = $JsonParameters.PSobject.Properties["dhcp-range"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "snat"))) { #optional property not found $Snat = $null } else { $Snat = $JsonParameters.PSobject.Properties["snat"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "vnet"))) { #optional property not found $Vnet = $null } else { $Vnet = $JsonParameters.PSobject.Properties["vnet"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "subnet"))) { #optional property not found $Subnet = $null } else { $Subnet = $JsonParameters.PSobject.Properties["subnet"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "dhcp-dns-server"))) { #optional property not found $DhcpDnsServer = $null } else { $DhcpDnsServer = $JsonParameters.PSobject.Properties["dhcp-dns-server"].value } $PSO = [PSCustomObject]@{ "type" = ${Type} "gateway" = ${Gateway} "dnszoneprefix" = ${Dnszoneprefix} "dhcp-range" = ${DhcpRange} "snat" = ${Snat} "vnet" = ${Vnet} "subnet" = ${Subnet} "dhcp-dns-server" = ${DhcpDnsServer} } return $PSO } } |