Model/POSTClusterAcmePluginsRB.ps1

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

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER ValidationDelay
No description available.
.PARAMETER VarData
No description available.
.PARAMETER Nodes
No description available.
.PARAMETER Api
No description available.
.PARAMETER Type
No description available.
.PARAMETER Id
No description available.
.PARAMETER Disable
No description available.
.OUTPUTS

POSTClusterAcmePluginsRB<PSCustomObject>
#>


function Initialize-PVEPOSTClusterAcmePluginsRB {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${ValidationDelay},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${VarData},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Nodes},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("1984hosting", "acmedns", "acmeproxy", "active24", "ad", "ali", "alviy", "anx", "artfiles", "arvan", "aurora", "autodns", "aws", "azion", "azure", "bookmyname", "bunny", "cf", "clouddns", "cloudns", "cn", "conoha", "constellix", "cpanel", "curanet", "cyon", "da", "ddnss", "desec", "df", "dgon", "dnsexit", "dnshome", "dnsimple", "dnsservices", "doapi", "domeneshop", "dp", "dpi", "dreamhost", "duckdns", "durabledns", "dyn", "dynu", "dynv6", "easydns", "edgedns", "euserv", "exoscale", "fornex", "freedns", "gandi_livedns", "gcloud", "gcore", "gd", "geoscaling", "googledomains", "he", "hetzner", "hexonet", "hostingde", "huaweicloud", "infoblox", "infomaniak", "internetbs", "inwx", "ionos", "ionos_cloud", "ipv64", "ispconfig", "jd", "joker", "kappernet", "kas", "kinghost", "knot", "la", "leaseweb", "lexicon", "limacity", "linode", "linode_v4", "loopia", "lua", "maradns", "me", "miab", "misaka", "myapi", "mydevil", "mydnsjp", "mythic_beasts", "namecheap", "namecom", "namesilo", "nanelo", "nederhost", "neodigit", "netcup", "netlify", "nic", "njalla", "nm", "nsd", "nsone", "nsupdate", "nw", "oci", "omglol", "one", "online", "openprovider", "openstack", "opnsense", "ovh", "pdns", "pleskxml", "pointhq", "porkbun", "rackcorp", "rackspace", "rage4", "rcode0", "regru", "scaleway", "schlundtech", "selectel", "selfhost", "servercow", "simply", "technitium", "tele3", "tencent", "timeweb", "transip", "udr", "ultra", "unoeuro", "variomedia", "veesp", "vercel", "vscale", "vultr", "websupport", "west_cn", "world4you", "yandex360", "yc", "zilore", "zone", "zoneedit", "zonomi")]
        [String]
        ${Api},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("dns", "standalone")]
        [String]
        ${Type},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Disable}
    )

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

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


         $DisplayNameMapping =@{
            "ValidationDelay"="validation-delay"; "VarData"="data"; "Nodes"="nodes"; "Api"="api"; "Type"="type"; "Id"="id"; "Disable"="disable"
        }
        
         $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 POSTClusterAcmePluginsRB<PSCustomObject>

.DESCRIPTION

Convert from JSON to POSTClusterAcmePluginsRB<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

POSTClusterAcmePluginsRB<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in PVEPOSTClusterAcmePluginsRB
        $AllProperties = ("validation-delay", "data", "nodes", "api", "type", "id", "disable")
        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 "validation-delay"))) { #optional property not found
            $ValidationDelay = $null
        } else {
            $ValidationDelay = $JsonParameters.PSobject.Properties["validation-delay"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "data"))) { #optional property not found
            $VarData = $null
        } else {
            $VarData = $JsonParameters.PSobject.Properties["data"].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 "api"))) { #optional property not found
            $Api = $null
        } else {
            $Api = $JsonParameters.PSobject.Properties["api"].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 "id"))) { #optional property not found
            $Id = $null
        } else {
            $Id = $JsonParameters.PSobject.Properties["id"].value
        }

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

        $PSO = [PSCustomObject]@{
            "validation-delay" = ${ValidationDelay}
            "data" = ${VarData}
            "nodes" = ${Nodes}
            "api" = ${Api}
            "type" = ${Type}
            "id" = ${Id}
            "disable" = ${Disable}
        }

        return $PSO
    }

}