Model/ClusterSdnControllersInnerPending.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 Asn
The local ASN of the controller. BGP & EVPN only.
.PARAMETER BgpMultipathAsRelax
Consider different AS paths of equal length for multipath computation. BGP only.
.PARAMETER Ebgp
Enable eBGP (remote-as external). BGP only.
.PARAMETER EbgpMultihop
Set maximum amount of hops for eBGP peers. Needs ebgp set to 1. BGP only.
.PARAMETER IsisDomain
Name of the IS-IS domain. IS-IS only.
.PARAMETER IsisIfaces
Comma-separated list of interfaces where IS-IS should be active. IS-IS only.
.PARAMETER IsisNet
Network Entity title for this node in the IS-IS network. IS-IS only.
.PARAMETER Loopback
Name of the loopback/dummy interface that provides the Router-IP. BGP only.
.PARAMETER Node
Node(s) where this controller is active.
.PARAMETER Peers
Comma-separated list of the peers IP addresses.
.OUTPUTS

ClusterSdnControllersInnerPending<PSCustomObject>
#>


function Initialize-PVEClusterSdnControllersInnerPending {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Asn},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${BgpMultipathAsRelax},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Ebgp},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${EbgpMultihop},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${IsisDomain},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${IsisIfaces},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${IsisNet},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Loopback},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Node},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Peers}
    )

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

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

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


         $DisplayNameMapping =@{
            "Asn"="asn"; "BgpMultipathAsRelax"="bgp-multipath-as-relax"; "Ebgp"="ebgp"; "EbgpMultihop"="ebgp-multihop"; "IsisDomain"="isis-domain"; "IsisIfaces"="isis-ifaces"; "IsisNet"="isis-net"; "Loopback"="loopback"; "Node"="node"; "Peers"="peers"
        }
        
         $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 ClusterSdnControllersInnerPending<PSCustomObject>

.DESCRIPTION

Convert from JSON to ClusterSdnControllersInnerPending<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

ClusterSdnControllersInnerPending<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in PVEClusterSdnControllersInnerPending
        $AllProperties = ("asn", "bgp-multipath-as-relax", "ebgp", "ebgp-multihop", "isis-domain", "isis-ifaces", "isis-net", "loopback", "node", "peers")
        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 "asn"))) { #optional property not found
            $Asn = $null
        } else {
            $Asn = $JsonParameters.PSobject.Properties["asn"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "bgp-multipath-as-relax"))) { #optional property not found
            $BgpMultipathAsRelax = $null
        } else {
            $BgpMultipathAsRelax = $JsonParameters.PSobject.Properties["bgp-multipath-as-relax"].value
        }

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "asn" = ${Asn}
            "bgp-multipath-as-relax" = ${BgpMultipathAsRelax}
            "ebgp" = ${Ebgp}
            "ebgp-multihop" = ${EbgpMultihop}
            "isis-domain" = ${IsisDomain}
            "isis-ifaces" = ${IsisIfaces}
            "isis-net" = ${IsisNet}
            "loopback" = ${Loopback}
            "node" = ${Node}
            "peers" = ${Peers}
        }

        return $PSO
    }

}