Model/ClusterAcmeAccount.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 Location
No description available.
.PARAMETER Directory
No description available.
.PARAMETER Tos
No description available.
.PARAMETER Account
No description available.
.OUTPUTS

ClusterAcmeAccount<PSCustomObject>
#>


function Initialize-PVEClusterAcmeAccount {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Location},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidatePattern("^https?://.*")]
        [String]
        ${Directory},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Tos},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Account}
    )

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


         $DisplayNameMapping =@{
            "Location"="location"; "Directory"="directory"; "Tos"="tos"; "Account"="account"
        }
        
         $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 ClusterAcmeAccount<PSCustomObject>

.DESCRIPTION

Convert from JSON to ClusterAcmeAccount<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

ClusterAcmeAccount<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in PVEClusterAcmeAccount
        $AllProperties = ("location", "directory", "tos", "account")
        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 "location"))) { #optional property not found
            $Location = $null
        } else {
            $Location = $JsonParameters.PSobject.Properties["location"].value
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "location" = ${Location}
            "directory" = ${Directory}
            "tos" = ${Tos}
            "account" = ${Account}
        }

        return $PSO
    }

}