Model/ChangePrivateChannelQuotaModel.ps1

#
# Cloud Governance Api
# Contact: support@avepoint.com
#

<#
ChangePrivateChannelQuotaModel<PSCustomObject>
#>


function New-ChangePrivateChannelQuotaModel {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IsEnabled} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ChangePrivateChannelQuotaType} = "AllowAllValue",
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${WithinSpecifyValue} = 0
    )

    Process {
        'Creating PSCustomObject: Cloud.Governance.Client => ChangePrivateChannelQuotaModel' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        
        $PSO = [PSCustomObject]@{
            "IsEnabled" = ${IsEnabled}
            "ChangePrivateChannelQuotaType" = ${ChangePrivateChannelQuotaType}
            "WithinSpecifyValue" = ${WithinSpecifyValue}
        }

        return $PSO
    }
}

<#
ChangePrivateChannelQuotaModel<PSCustomObject>
#>

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

    Process {
        'Converting JSON to PSCustomObject: Cloud.Governance.Client => ChangePrivateChannelQuotaModel' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

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

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

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

        $PSO = [PSCustomObject]@{
            "IsEnabled" = ${IsEnabled}
            "ChangePrivateChannelQuotaType" = ${ChangePrivateChannelQuotaType}
            "WithinSpecifyValue" = ${WithinSpecifyValue}
        }

        return $PSO
    }

}