Model/PUTClusterSdnVnetsFirewallOptionsRB.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 Delete No description available. .PARAMETER LogLevelForward No description available. .PARAMETER PolicyForward No description available. .PARAMETER Vnet No description available. .PARAMETER Digest No description available. .PARAMETER Enable No description available. .OUTPUTS PUTClusterSdnVnetsFirewallOptionsRB<PSCustomObject> #> function Initialize-PVEPUTClusterSdnVnetsFirewallOptionsRB { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Delete}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("emerg", "alert", "crit", "err", "warning", "notice", "info", "debug", "nolog")] [String] ${LogLevelForward}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("ACCEPT", "DROP")] [String] ${PolicyForward}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Vnet}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Digest}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${Enable} ) Process { 'Creating PSCustomObject: ProxmoxPVE => PVEPUTClusterSdnVnetsFirewallOptionsRB' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug if (!$Digest -and $Digest.length -gt 64) { throw "invalid value for 'Digest', the character length must be smaller than or equal to 64." } if ($Enable -and $Enable -gt 1) { throw "invalid value for 'Enable', must be smaller than or equal to 1." } if ($Enable -and $Enable -lt 0) { throw "invalid value for 'Enable', must be greater than or equal to 0." } $DisplayNameMapping =@{ "Delete"="delete"; "LogLevelForward"="log_level_forward"; "PolicyForward"="policy_forward"; "Vnet"="vnet"; "Digest"="digest"; "Enable"="enable" } $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 PUTClusterSdnVnetsFirewallOptionsRB<PSCustomObject> .DESCRIPTION Convert from JSON to PUTClusterSdnVnetsFirewallOptionsRB<PSCustomObject> .PARAMETER Json Json object .OUTPUTS PUTClusterSdnVnetsFirewallOptionsRB<PSCustomObject> #> function ConvertFrom-PVEJsonToPUTClusterSdnVnetsFirewallOptionsRB { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: ProxmoxPVE => PVEPUTClusterSdnVnetsFirewallOptionsRB' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in PVEPUTClusterSdnVnetsFirewallOptionsRB $AllProperties = ("delete", "log_level_forward", "policy_forward", "vnet", "digest", "enable") 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 "delete"))) { #optional property not found $Delete = $null } else { $Delete = $JsonParameters.PSobject.Properties["delete"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "log_level_forward"))) { #optional property not found $LogLevelForward = $null } else { $LogLevelForward = $JsonParameters.PSobject.Properties["log_level_forward"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "policy_forward"))) { #optional property not found $PolicyForward = $null } else { $PolicyForward = $JsonParameters.PSobject.Properties["policy_forward"].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 "digest"))) { #optional property not found $Digest = $null } else { $Digest = $JsonParameters.PSobject.Properties["digest"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "enable"))) { #optional property not found $Enable = $null } else { $Enable = $JsonParameters.PSobject.Properties["enable"].value } $PSO = [PSCustomObject]@{ "delete" = ${Delete} "log_level_forward" = ${LogLevelForward} "policy_forward" = ${PolicyForward} "vnet" = ${Vnet} "digest" = ${Digest} "enable" = ${Enable} } return $PSO } } |