Model/SharedMailboxBasicGridModel.ps1

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

<#
SharedMailboxBasicGridModel<PSCustomObject>
#>


function New-SharedMailboxBasicGridModel {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Email},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${CreatedTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${LastModifiedTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${LastRenewalTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ElectionProfileName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ElectionProfileId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ClaimStatus} = "Unclaimed",
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ClaimStatusDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${OngoingTaskCount} = 0,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${TenantId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Status} = "Active",
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Members},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${DirectorySyncState} = "Cloud",
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PrimaryContact},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PrimaryContactEmail},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PrimaryContactDisplayName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PrimaryContactObjectId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SecondaryContact},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SecondaryContactEmail},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SecondaryContactDisplayName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SecondaryContactObjectId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PrimaryContactJobTitle},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PrimaryContactDepartment},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PrimaryContactCompanyName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SecondaryContactJobTitle},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SecondaryContactDepartment},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SecondaryContactCompanyName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${LastRenewalBy},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${LastRenewalByEmail},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${LastRenewalByDisplayName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PhaseAssigneeDisplayNames},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PhaseAssigneeObjectIds},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PhaseAssignees},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PhaseProfileName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PhaseProfileId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${PhaseStartTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${RenewalDueDate},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${NextRenewalDate},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Phase} = "Confirmed",
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PhaseDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Metadata}
    )

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

        
        $PSO = [PSCustomObject]@{
            "Id" = ${Id}
            "Name" = ${Name}
            "Email" = ${Email}
            "CreatedTime" = ${CreatedTime}
            "LastModifiedTime" = ${LastModifiedTime}
            "LastRenewalTime" = ${LastRenewalTime}
            "ElectionProfileName" = ${ElectionProfileName}
            "ElectionProfileId" = ${ElectionProfileId}
            "ClaimStatus" = ${ClaimStatus}
            "ClaimStatusDescription" = ${ClaimStatusDescription}
            "OngoingTaskCount" = ${OngoingTaskCount}
            "TenantId" = ${TenantId}
            "Status" = ${Status}
            "Members" = ${Members}
            "DirectorySyncState" = ${DirectorySyncState}
            "PrimaryContact" = ${PrimaryContact}
            "PrimaryContactEmail" = ${PrimaryContactEmail}
            "PrimaryContactDisplayName" = ${PrimaryContactDisplayName}
            "PrimaryContactObjectId" = ${PrimaryContactObjectId}
            "SecondaryContact" = ${SecondaryContact}
            "SecondaryContactEmail" = ${SecondaryContactEmail}
            "SecondaryContactDisplayName" = ${SecondaryContactDisplayName}
            "SecondaryContactObjectId" = ${SecondaryContactObjectId}
            "PrimaryContactJobTitle" = ${PrimaryContactJobTitle}
            "PrimaryContactDepartment" = ${PrimaryContactDepartment}
            "PrimaryContactCompanyName" = ${PrimaryContactCompanyName}
            "SecondaryContactJobTitle" = ${SecondaryContactJobTitle}
            "SecondaryContactDepartment" = ${SecondaryContactDepartment}
            "SecondaryContactCompanyName" = ${SecondaryContactCompanyName}
            "LastRenewalBy" = ${LastRenewalBy}
            "LastRenewalByEmail" = ${LastRenewalByEmail}
            "LastRenewalByDisplayName" = ${LastRenewalByDisplayName}
            "PhaseAssigneeDisplayNames" = ${PhaseAssigneeDisplayNames}
            "PhaseAssigneeObjectIds" = ${PhaseAssigneeObjectIds}
            "PhaseAssignees" = ${PhaseAssignees}
            "PhaseProfileName" = ${PhaseProfileName}
            "PhaseProfileId" = ${PhaseProfileId}
            "PhaseStartTime" = ${PhaseStartTime}
            "RenewalDueDate" = ${RenewalDueDate}
            "NextRenewalDate" = ${NextRenewalDate}
            "Phase" = ${Phase}
            "PhaseDescription" = ${PhaseDescription}
            "Metadata" = ${Metadata}
        }

        return $PSO
    }
}

<#
SharedMailboxBasicGridModel<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in SharedMailboxBasicGridModel
        $AllProperties = $("Id", "Name", "Email", "CreatedTime", "LastModifiedTime", "LastRenewalTime", "ElectionProfileName", "ElectionProfileId", "ClaimStatus", "ClaimStatusDescription", "OngoingTaskCount", "TenantId", "Status", "Members", "DirectorySyncState", "PrimaryContact", "PrimaryContactEmail", "PrimaryContactDisplayName", "PrimaryContactObjectId", "SecondaryContact", "SecondaryContactEmail", "SecondaryContactDisplayName", "SecondaryContactObjectId", "PrimaryContactJobTitle", "PrimaryContactDepartment", "PrimaryContactCompanyName", "SecondaryContactJobTitle", "SecondaryContactDepartment", "SecondaryContactCompanyName", "LastRenewalBy", "LastRenewalByEmail", "LastRenewalByDisplayName", "PhaseAssigneeDisplayNames", "PhaseAssigneeObjectIds", "PhaseAssignees", "PhaseProfileName", "PhaseProfileId", "PhaseStartTime", "RenewalDueDate", "NextRenewalDate", "Phase", "PhaseDescription", "Metadata")
        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 "Id"))) { #optional property not found
            $Id = $null
        } else {
            $Id = $JsonParameters.PSobject.Properties["Id"].value
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "Id" = ${Id}
            "Name" = ${Name}
            "Email" = ${Email}
            "CreatedTime" = ${CreatedTime}
            "LastModifiedTime" = ${LastModifiedTime}
            "LastRenewalTime" = ${LastRenewalTime}
            "ElectionProfileName" = ${ElectionProfileName}
            "ElectionProfileId" = ${ElectionProfileId}
            "ClaimStatus" = ${ClaimStatus}
            "ClaimStatusDescription" = ${ClaimStatusDescription}
            "OngoingTaskCount" = ${OngoingTaskCount}
            "TenantId" = ${TenantId}
            "Status" = ${Status}
            "Members" = ${Members}
            "DirectorySyncState" = ${DirectorySyncState}
            "PrimaryContact" = ${PrimaryContact}
            "PrimaryContactEmail" = ${PrimaryContactEmail}
            "PrimaryContactDisplayName" = ${PrimaryContactDisplayName}
            "PrimaryContactObjectId" = ${PrimaryContactObjectId}
            "SecondaryContact" = ${SecondaryContact}
            "SecondaryContactEmail" = ${SecondaryContactEmail}
            "SecondaryContactDisplayName" = ${SecondaryContactDisplayName}
            "SecondaryContactObjectId" = ${SecondaryContactObjectId}
            "PrimaryContactJobTitle" = ${PrimaryContactJobTitle}
            "PrimaryContactDepartment" = ${PrimaryContactDepartment}
            "PrimaryContactCompanyName" = ${PrimaryContactCompanyName}
            "SecondaryContactJobTitle" = ${SecondaryContactJobTitle}
            "SecondaryContactDepartment" = ${SecondaryContactDepartment}
            "SecondaryContactCompanyName" = ${SecondaryContactCompanyName}
            "LastRenewalBy" = ${LastRenewalBy}
            "LastRenewalByEmail" = ${LastRenewalByEmail}
            "LastRenewalByDisplayName" = ${LastRenewalByDisplayName}
            "PhaseAssigneeDisplayNames" = ${PhaseAssigneeDisplayNames}
            "PhaseAssigneeObjectIds" = ${PhaseAssigneeObjectIds}
            "PhaseAssignees" = ${PhaseAssignees}
            "PhaseProfileName" = ${PhaseProfileName}
            "PhaseProfileId" = ${PhaseProfileId}
            "PhaseStartTime" = ${PhaseStartTime}
            "RenewalDueDate" = ${RenewalDueDate}
            "NextRenewalDate" = ${NextRenewalDate}
            "Phase" = ${Phase}
            "PhaseDescription" = ${PhaseDescription}
            "Metadata" = ${Metadata}
        }

        return $PSO
    }

}