Model/VFSQuota.ps1

#
# SMServer V6
# Syncplify Server! REST API
# Version: 1.0.0
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER Soft
bytes. If broken the current upload can continue, but after that it's game over. 0 means unlimited. If missing 0 is assumed
.PARAMETER Hard
bytes. If broken the current upload is forcefully interrupted. 0 means unlimited. If missing 0 is assumed
.OUTPUTS

VFSQuota<PSCustomObject>
#>


function Initialize-SS6VFSQuota {
    [CmdletBinding()]
    Param (
        [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Soft},
        [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Hard}
    )

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


        $PSO = [PSCustomObject]@{
            "soft" = ${Soft}
            "hard" = ${Hard}
        }


        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to VFSQuota<PSCustomObject>

.DESCRIPTION

Convert from JSON to VFSQuota<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

VFSQuota<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in SS6VFSQuota
        $AllProperties = ("soft", "hard")
        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 "soft"))) { #optional property not found
            $Soft = $null
        } else {
            $Soft = $JsonParameters.PSobject.Properties["soft"].value
        }

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

        $PSO = [PSCustomObject]@{
            "soft" = ${Soft}
            "hard" = ${Hard}
        }

        return $PSO
    }

}