Model/ClusterSdnZonesInner.ps1

#
# Proxmox PowerShell VE
# Generated module to access all Proxmox VE Api Endpoints. This module has been generated from the proxmox api description v. 9.0.8
# Version: 9.0.8
# Contact: mail@timo-wolf.de
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER Mtu
No description available.
.PARAMETER Nodes
No description available.
.PARAMETER Tag
No description available.
.PARAMETER VrfVxlan
No description available.
.PARAMETER Controller
No description available.
.PARAMETER VxlanPort
No description available.
.PARAMETER RtImport
No description available.
.PARAMETER Exitnodes
No description available.
.PARAMETER Type
No description available.
.PARAMETER Reversedns
No description available.
.PARAMETER DisableArpNdSuppression
No description available.
.PARAMETER Dhcp
No description available.
.PARAMETER Mac
No description available.
.PARAMETER AdvertiseSubnets
No description available.
.PARAMETER BridgeDisableMacLearning
No description available.
.PARAMETER Dnszone
No description available.
.PARAMETER Zone
No description available.
.PARAMETER Ipam
No description available.
.PARAMETER Bridge
No description available.
.PARAMETER State
No description available.
.PARAMETER Pending
No description available.
.PARAMETER Dns
No description available.
.PARAMETER ExitnodesLocalRouting
No description available.
.PARAMETER Peers
No description available.
.PARAMETER ExitnodesPrimary
No description available.
.PARAMETER VlanProtocol
No description available.
.PARAMETER Digest
No description available.
.OUTPUTS

ClusterSdnZonesInner<PSCustomObject>
#>


function Initialize-PVEClusterSdnZonesInner {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Mtu},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Nodes},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Tag},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${VrfVxlan},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Controller},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${VxlanPort},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${RtImport},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Exitnodes},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("evpn", "faucet", "qinq", "simple", "vlan", "vxlan")]
        [String]
        ${Type},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Reversedns},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${DisableArpNdSuppression},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("dnsmasq")]
        [String]
        ${Dhcp},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Mac},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${AdvertiseSubnets},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${BridgeDisableMacLearning},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Dnszone},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Zone},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Ipam},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Bridge},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("new", "changed", "deleted")]
        [String]
        ${State},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Pending},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Dns},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${ExitnodesLocalRouting},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Peers},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ExitnodesPrimary},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("802.1q", "802.1ad")]
        [String]
        ${VlanProtocol},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Digest}
    )

    Process {
        'Creating PSCustomObject: ProxmoxPVE => PVEClusterSdnZonesInner' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        if ($VrfVxlan -and $VrfVxlan -gt 16777215) {
          throw "invalid value for 'VrfVxlan', must be smaller than or equal to 16777215."
        }

        if ($VrfVxlan -and $VrfVxlan -lt 1) {
          throw "invalid value for 'VrfVxlan', must be greater than or equal to 1."
        }

        if ($VxlanPort -and $VxlanPort -gt 65536) {
          throw "invalid value for 'VxlanPort', must be smaller than or equal to 65536."
        }

        if ($VxlanPort -and $VxlanPort -lt 1) {
          throw "invalid value for 'VxlanPort', must be greater than or equal to 1."
        }


         $DisplayNameMapping =@{
            "Mtu"="mtu"; "Nodes"="nodes"; "Tag"="tag"; "VrfVxlan"="vrf-vxlan"; "Controller"="controller"; "VxlanPort"="vxlan-port"; "RtImport"="rt-import"; "Exitnodes"="exitnodes"; "Type"="type"; "Reversedns"="reversedns"; "DisableArpNdSuppression"="disable-arp-nd-suppression"; "Dhcp"="dhcp"; "Mac"="mac"; "AdvertiseSubnets"="advertise-subnets"; "BridgeDisableMacLearning"="bridge-disable-mac-learning"; "Dnszone"="dnszone"; "Zone"="zone"; "Ipam"="ipam"; "Bridge"="bridge"; "State"="state"; "Pending"="pending"; "Dns"="dns"; "ExitnodesLocalRouting"="exitnodes-local-routing"; "Peers"="peers"; "ExitnodesPrimary"="exitnodes-primary"; "VlanProtocol"="vlan-protocol"; "Digest"="digest"
        }
        
         $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 ClusterSdnZonesInner<PSCustomObject>

.DESCRIPTION

Convert from JSON to ClusterSdnZonesInner<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

ClusterSdnZonesInner<PSCustomObject>
#>

function ConvertFrom-PVEJsonToClusterSdnZonesInner {
    Param(
        [AllowEmptyString()]
        [string]$Json
    )

    Process {
        'Converting JSON to PSCustomObject: ProxmoxPVE => PVEClusterSdnZonesInner' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in PVEClusterSdnZonesInner
        $AllProperties = ("mtu", "nodes", "tag", "vrf-vxlan", "controller", "vxlan-port", "rt-import", "exitnodes", "type", "reversedns", "disable-arp-nd-suppression", "dhcp", "mac", "advertise-subnets", "bridge-disable-mac-learning", "dnszone", "zone", "ipam", "bridge", "state", "pending", "dns", "exitnodes-local-routing", "peers", "exitnodes-primary", "vlan-protocol", "digest")
        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 "mtu"))) { #optional property not found
            $Mtu = $null
        } else {
            $Mtu = $JsonParameters.PSobject.Properties["mtu"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "nodes"))) { #optional property not found
            $Nodes = $null
        } else {
            $Nodes = $JsonParameters.PSobject.Properties["nodes"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "tag"))) { #optional property not found
            $Tag = $null
        } else {
            $Tag = $JsonParameters.PSobject.Properties["tag"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "vrf-vxlan"))) { #optional property not found
            $VrfVxlan = $null
        } else {
            $VrfVxlan = $JsonParameters.PSobject.Properties["vrf-vxlan"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "controller"))) { #optional property not found
            $Controller = $null
        } else {
            $Controller = $JsonParameters.PSobject.Properties["controller"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "vxlan-port"))) { #optional property not found
            $VxlanPort = $null
        } else {
            $VxlanPort = $JsonParameters.PSobject.Properties["vxlan-port"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "rt-import"))) { #optional property not found
            $RtImport = $null
        } else {
            $RtImport = $JsonParameters.PSobject.Properties["rt-import"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "exitnodes"))) { #optional property not found
            $Exitnodes = $null
        } else {
            $Exitnodes = $JsonParameters.PSobject.Properties["exitnodes"].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 "reversedns"))) { #optional property not found
            $Reversedns = $null
        } else {
            $Reversedns = $JsonParameters.PSobject.Properties["reversedns"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "disable-arp-nd-suppression"))) { #optional property not found
            $DisableArpNdSuppression = $null
        } else {
            $DisableArpNdSuppression = $JsonParameters.PSobject.Properties["disable-arp-nd-suppression"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "dhcp"))) { #optional property not found
            $Dhcp = $null
        } else {
            $Dhcp = $JsonParameters.PSobject.Properties["dhcp"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "mac"))) { #optional property not found
            $Mac = $null
        } else {
            $Mac = $JsonParameters.PSobject.Properties["mac"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "advertise-subnets"))) { #optional property not found
            $AdvertiseSubnets = $null
        } else {
            $AdvertiseSubnets = $JsonParameters.PSobject.Properties["advertise-subnets"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "bridge-disable-mac-learning"))) { #optional property not found
            $BridgeDisableMacLearning = $null
        } else {
            $BridgeDisableMacLearning = $JsonParameters.PSobject.Properties["bridge-disable-mac-learning"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "dnszone"))) { #optional property not found
            $Dnszone = $null
        } else {
            $Dnszone = $JsonParameters.PSobject.Properties["dnszone"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "zone"))) { #optional property not found
            $Zone = $null
        } else {
            $Zone = $JsonParameters.PSobject.Properties["zone"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "ipam"))) { #optional property not found
            $Ipam = $null
        } else {
            $Ipam = $JsonParameters.PSobject.Properties["ipam"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "bridge"))) { #optional property not found
            $Bridge = $null
        } else {
            $Bridge = $JsonParameters.PSobject.Properties["bridge"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "state"))) { #optional property not found
            $State = $null
        } else {
            $State = $JsonParameters.PSobject.Properties["state"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "pending"))) { #optional property not found
            $Pending = $null
        } else {
            $Pending = $JsonParameters.PSobject.Properties["pending"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "dns"))) { #optional property not found
            $Dns = $null
        } else {
            $Dns = $JsonParameters.PSobject.Properties["dns"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "exitnodes-local-routing"))) { #optional property not found
            $ExitnodesLocalRouting = $null
        } else {
            $ExitnodesLocalRouting = $JsonParameters.PSobject.Properties["exitnodes-local-routing"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "peers"))) { #optional property not found
            $Peers = $null
        } else {
            $Peers = $JsonParameters.PSobject.Properties["peers"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "exitnodes-primary"))) { #optional property not found
            $ExitnodesPrimary = $null
        } else {
            $ExitnodesPrimary = $JsonParameters.PSobject.Properties["exitnodes-primary"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "vlan-protocol"))) { #optional property not found
            $VlanProtocol = $null
        } else {
            $VlanProtocol = $JsonParameters.PSobject.Properties["vlan-protocol"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "digest"))) { #optional property not found
            $Digest = $null
        } else {
            $Digest = $JsonParameters.PSobject.Properties["digest"].value
        }

        $PSO = [PSCustomObject]@{
            "mtu" = ${Mtu}
            "nodes" = ${Nodes}
            "tag" = ${Tag}
            "vrf-vxlan" = ${VrfVxlan}
            "controller" = ${Controller}
            "vxlan-port" = ${VxlanPort}
            "rt-import" = ${RtImport}
            "exitnodes" = ${Exitnodes}
            "type" = ${Type}
            "reversedns" = ${Reversedns}
            "disable-arp-nd-suppression" = ${DisableArpNdSuppression}
            "dhcp" = ${Dhcp}
            "mac" = ${Mac}
            "advertise-subnets" = ${AdvertiseSubnets}
            "bridge-disable-mac-learning" = ${BridgeDisableMacLearning}
            "dnszone" = ${Dnszone}
            "zone" = ${Zone}
            "ipam" = ${Ipam}
            "bridge" = ${Bridge}
            "state" = ${State}
            "pending" = ${Pending}
            "dns" = ${Dns}
            "exitnodes-local-routing" = ${ExitnodesLocalRouting}
            "peers" = ${Peers}
            "exitnodes-primary" = ${ExitnodesPrimary}
            "vlan-protocol" = ${VlanProtocol}
            "digest" = ${Digest}
        }

        return $PSO
    }

}