Model/ClusterSdnZonesInner.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 State
No description available.
.PARAMETER Reversedns
No description available.
.PARAMETER Pending
No description available.
.PARAMETER Dhcp
No description available.
.PARAMETER Mtu
No description available.
.PARAMETER Nodes
No description available.
.PARAMETER Dnszone
No description available.
.PARAMETER Type
No description available.
.PARAMETER Zone
No description available.
.PARAMETER Dns
No description available.
.PARAMETER Ipam
No description available.
.OUTPUTS

ClusterSdnZonesInner<PSCustomObject>
#>


function Initialize-PVEClusterSdnZonesInner {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${State},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Reversedns},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Pending},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Dhcp},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Mtu},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Nodes},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Dnszone},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Type},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Zone},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Dns},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Ipam}
    )

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

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

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


         $DisplayNameMapping =@{
            "State"="state"; "Reversedns"="reversedns"; "Pending"="pending"; "Dhcp"="dhcp"; "Mtu"="mtu"; "Nodes"="nodes"; "Dnszone"="dnszone"; "Type"="type"; "Zone"="zone"; "Dns"="dns"; "Ipam"="ipam"
        }
        
         $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 = ("state", "reversedns", "pending", "dhcp", "mtu", "nodes", "dnszone", "type", "zone", "dns", "ipam")
        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 "state"))) { #optional property not found
            $State = $null
        } else {
            $State = $JsonParameters.PSobject.Properties["state"].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 "pending"))) { #optional property not found
            $Pending = $null
        } else {
            $Pending = $JsonParameters.PSobject.Properties["pending"].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 "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 "dnszone"))) { #optional property not found
            $Dnszone = $null
        } else {
            $Dnszone = $JsonParameters.PSobject.Properties["dnszone"].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 "zone"))) { #optional property not found
            $Zone = $null
        } else {
            $Zone = $JsonParameters.PSobject.Properties["zone"].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 "ipam"))) { #optional property not found
            $Ipam = $null
        } else {
            $Ipam = $JsonParameters.PSobject.Properties["ipam"].value
        }

        $PSO = [PSCustomObject]@{
            "state" = ${State}
            "reversedns" = ${Reversedns}
            "pending" = ${Pending}
            "dhcp" = ${Dhcp}
            "mtu" = ${Mtu}
            "nodes" = ${Nodes}
            "dnszone" = ${Dnszone}
            "type" = ${Type}
            "zone" = ${Zone}
            "dns" = ${Dns}
            "ipam" = ${Ipam}
        }

        return $PSO
    }

}