Model/ClusterSdnFabricsAllNodesInner.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 Digest
Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications.
.PARAMETER FabricId
Identifier for SDN fabrics
.PARAMETER Interfaces
No description available.
.PARAMETER Ip
IPv4 address for this node
.PARAMETER Ip6
IPv6 address for this node
.PARAMETER LockToken
the token for unlocking the global SDN configuration
.PARAMETER NodeId
Identifier for nodes in an SDN fabric
.PARAMETER Protocol
Type of configuration entry in an SDN Fabric section config
.OUTPUTS

ClusterSdnFabricsAllNodesInner<PSCustomObject>
#>


function Initialize-PVEClusterSdnFabricsAllNodesInner {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Digest},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${FabricId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Interfaces},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Ip},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Ip6},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${LockToken},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${NodeId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("openfabric", "ospf")]
        [String]
        ${Protocol}
    )

    Process {
        'Creating PSCustomObject: ProxmoxPVE => PVEClusterSdnFabricsAllNodesInner' | 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."
        }


         $DisplayNameMapping =@{
            "Digest"="digest"; "FabricId"="fabric_id"; "Interfaces"="interfaces"; "Ip"="ip"; "Ip6"="ip6"; "LockToken"="lock-token"; "NodeId"="node_id"; "Protocol"="protocol"
        }
        
         $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 ClusterSdnFabricsAllNodesInner<PSCustomObject>

.DESCRIPTION

Convert from JSON to ClusterSdnFabricsAllNodesInner<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

ClusterSdnFabricsAllNodesInner<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in PVEClusterSdnFabricsAllNodesInner
        $AllProperties = ("digest", "fabric_id", "interfaces", "ip", "ip6", "lock-token", "node_id", "protocol")
        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 "digest"))) { #optional property not found
            $Digest = $null
        } else {
            $Digest = $JsonParameters.PSobject.Properties["digest"].value
        }

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "digest" = ${Digest}
            "fabric_id" = ${FabricId}
            "interfaces" = ${Interfaces}
            "ip" = ${Ip}
            "ip6" = ${Ip6}
            "lock-token" = ${LockToken}
            "node_id" = ${NodeId}
            "protocol" = ${Protocol}
        }

        return $PSO
    }

}