Model/MailboxLanguageDataTime.ps1

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

<#
MailboxLanguageDataTime<PSCustomObject>
#>


function New-MailboxLanguageDataTime {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Language},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${LanguageId} = 0,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${DateFormat},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${TimeFormat},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${EnableLocalizeDefaultFolderName} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ActivityId}
    )

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

        
        $PSO = [PSCustomObject]@{
            "Language" = ${Language}
            "LanguageId" = ${LanguageId}
            "DateFormat" = ${DateFormat}
            "TimeFormat" = ${TimeFormat}
            "EnableLocalizeDefaultFolderName" = ${EnableLocalizeDefaultFolderName}
            "ActivityId" = ${ActivityId}
        }

        return $PSO
    }
}

<#
MailboxLanguageDataTime<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in MailboxLanguageDataTime
        $AllProperties = $("Language", "LanguageId", "DateFormat", "TimeFormat", "EnableLocalizeDefaultFolderName", "ActivityId")
        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 "Language"))) { #optional property not found
            $Language = $null
        } else {
            $Language = $JsonParameters.PSobject.Properties["Language"].value
        }

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "Language" = ${Language}
            "LanguageId" = ${LanguageId}
            "DateFormat" = ${DateFormat}
            "TimeFormat" = ${TimeFormat}
            "EnableLocalizeDefaultFolderName" = ${EnableLocalizeDefaultFolderName}
            "ActivityId" = ${ActivityId}
        }

        return $PSO
    }

}