Model/YammerDetailModel.ps1

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

<#
YammerDetailModel<PSCustomObject>
#>


function New-YammerDetailModel {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${YammerLink},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Sensitivity},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${EnableDynamicMembership} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${DynamicGroupRules},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Email},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Status} = "Active",
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${StatusDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SiteStatus} = "None",
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${LegalHold} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SiteStatusDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Owners},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Privacy} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PrivacyDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SiteSharing} = "None",
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${TeamsSiteSharingDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${GroupSharing} = "None",
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${GroupSharingDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SiteLink},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${FileLink},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${NoteBookLink},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PlannerLink},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${HasPendingApprovalTask} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Description},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Phase} = "Confirmed",
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PhaseDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PolicyName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PolicyDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PolicyId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${PrimaryContact},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SecondaryContact},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${HubSite},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${HubType} = "No",
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ClaimStatus} = "Unclaimed",
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ClaimStatusDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Type} = "Site",
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${TypeDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Classification},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${LockedBy} = "Unknown",
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${LockedByDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${GeoLocation},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${GeoLocationDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${StorageLimit},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${StorageUsed},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${RenewalProfileName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${RenewalProfileId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${QuotaProfileName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${QuotaProfileId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ExternalSharingProfileName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ExternalSharingProfileId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${CreatedTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${LeaseExpirationTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${InactivityThresholdTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${PhaseAssignees},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${RenewalStartTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${RenewDueDate},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${LastRenewalDate},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${LastAccessedTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${NextRenewalDate},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${LastRenewalBy},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Metadatas},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${HasOngoingTasks} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${InsightsStatus} = "NotRegistered",
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ElectionProfileId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ElectionProfileName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${LastSyncTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${CreatedSource} = "None",
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ErrorMessage}
    )

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

        
        $PSO = [PSCustomObject]@{
            "YammerLink" = ${YammerLink}
            "Sensitivity" = ${Sensitivity}
            "EnableDynamicMembership" = ${EnableDynamicMembership}
            "DynamicGroupRules" = ${DynamicGroupRules}
            "Email" = ${Email}
            "Status" = ${Status}
            "StatusDescription" = ${StatusDescription}
            "SiteStatus" = ${SiteStatus}
            "LegalHold" = ${LegalHold}
            "SiteStatusDescription" = ${SiteStatusDescription}
            "Owners" = ${Owners}
            "Privacy" = ${Privacy}
            "PrivacyDescription" = ${PrivacyDescription}
            "SiteSharing" = ${SiteSharing}
            "TeamsSiteSharingDescription" = ${TeamsSiteSharingDescription}
            "GroupSharing" = ${GroupSharing}
            "GroupSharingDescription" = ${GroupSharingDescription}
            "SiteLink" = ${SiteLink}
            "FileLink" = ${FileLink}
            "NoteBookLink" = ${NoteBookLink}
            "PlannerLink" = ${PlannerLink}
            "HasPendingApprovalTask" = ${HasPendingApprovalTask}
            "Id" = ${Id}
            "Name" = ${Name}
            "Description" = ${Description}
            "Phase" = ${Phase}
            "PhaseDescription" = ${PhaseDescription}
            "PolicyName" = ${PolicyName}
            "PolicyDescription" = ${PolicyDescription}
            "PolicyId" = ${PolicyId}
            "PrimaryContact" = ${PrimaryContact}
            "SecondaryContact" = ${SecondaryContact}
            "HubSite" = ${HubSite}
            "HubType" = ${HubType}
            "ClaimStatus" = ${ClaimStatus}
            "ClaimStatusDescription" = ${ClaimStatusDescription}
            "Type" = ${Type}
            "TypeDescription" = ${TypeDescription}
            "Classification" = ${Classification}
            "LockedBy" = ${LockedBy}
            "LockedByDescription" = ${LockedByDescription}
            "GeoLocation" = ${GeoLocation}
            "GeoLocationDescription" = ${GeoLocationDescription}
            "StorageLimit" = ${StorageLimit}
            "StorageUsed" = ${StorageUsed}
            "RenewalProfileName" = ${RenewalProfileName}
            "RenewalProfileId" = ${RenewalProfileId}
            "QuotaProfileName" = ${QuotaProfileName}
            "QuotaProfileId" = ${QuotaProfileId}
            "ExternalSharingProfileName" = ${ExternalSharingProfileName}
            "ExternalSharingProfileId" = ${ExternalSharingProfileId}
            "CreatedTime" = ${CreatedTime}
            "LeaseExpirationTime" = ${LeaseExpirationTime}
            "InactivityThresholdTime" = ${InactivityThresholdTime}
            "PhaseAssignees" = ${PhaseAssignees}
            "RenewalStartTime" = ${RenewalStartTime}
            "RenewDueDate" = ${RenewDueDate}
            "LastRenewalDate" = ${LastRenewalDate}
            "LastAccessedTime" = ${LastAccessedTime}
            "NextRenewalDate" = ${NextRenewalDate}
            "LastRenewalBy" = ${LastRenewalBy}
            "Metadatas" = ${Metadatas}
            "HasOngoingTasks" = ${HasOngoingTasks}
            "InsightsStatus" = ${InsightsStatus}
            "ElectionProfileId" = ${ElectionProfileId}
            "ElectionProfileName" = ${ElectionProfileName}
            "LastSyncTime" = ${LastSyncTime}
            "CreatedSource" = ${CreatedSource}
            "ErrorMessage" = ${ErrorMessage}
        }

        return $PSO
    }
}

<#
YammerDetailModel<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in YammerDetailModel
        $AllProperties = $("YammerLink", "Sensitivity", "EnableDynamicMembership", "DynamicGroupRules", "Email", "Status", "StatusDescription", "SiteStatus", "LegalHold", "SiteStatusDescription", "Owners", "Privacy", "PrivacyDescription", "SiteSharing", "TeamsSiteSharingDescription", "GroupSharing", "GroupSharingDescription", "SiteLink", "FileLink", "NoteBookLink", "PlannerLink", "HasPendingApprovalTask", "Id", "Name", "Description", "Phase", "PhaseDescription", "PolicyName", "PolicyDescription", "PolicyId", "PrimaryContact", "SecondaryContact", "HubSite", "HubType", "ClaimStatus", "ClaimStatusDescription", "Type", "TypeDescription", "Classification", "LockedBy", "LockedByDescription", "GeoLocation", "GeoLocationDescription", "StorageLimit", "StorageUsed", "RenewalProfileName", "RenewalProfileId", "QuotaProfileName", "QuotaProfileId", "ExternalSharingProfileName", "ExternalSharingProfileId", "CreatedTime", "LeaseExpirationTime", "InactivityThresholdTime", "PhaseAssignees", "RenewalStartTime", "RenewDueDate", "LastRenewalDate", "LastAccessedTime", "NextRenewalDate", "LastRenewalBy", "Metadatas", "HasOngoingTasks", "InsightsStatus", "ElectionProfileId", "ElectionProfileName", "LastSyncTime", "CreatedSource", "ErrorMessage")
        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 "YammerLink"))) { #optional property not found
            $YammerLink = $null
        } else {
            $YammerLink = $JsonParameters.PSobject.Properties["YammerLink"].value
        }

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "DynamicGroupRules"))) { #optional property not found
            $DynamicGroupRules = $null
        } else {
            $DynamicGroupRules = $JsonParameters.PSobject.Properties["DynamicGroupRules"].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 "Status"))) { #optional property not found
            $Status = $null
        } else {
            $Status = $JsonParameters.PSobject.Properties["Status"].value
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        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 "Description"))) { #optional property not found
            $Description = $null
        } else {
            $Description = $JsonParameters.PSobject.Properties["Description"].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 "PolicyName"))) { #optional property not found
            $PolicyName = $null
        } else {
            $PolicyName = $JsonParameters.PSobject.Properties["PolicyName"].value
        }

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "PolicyId"))) { #optional property not found
            $PolicyId = $null
        } else {
            $PolicyId = $JsonParameters.PSobject.Properties["PolicyId"].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 "SecondaryContact"))) { #optional property not found
            $SecondaryContact = $null
        } else {
            $SecondaryContact = $JsonParameters.PSobject.Properties["SecondaryContact"].value
        }

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "HubType"))) { #optional property not found
            $HubType = $null
        } else {
            $HubType = $JsonParameters.PSobject.Properties["HubType"].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 "Type"))) { #optional property not found
            $Type = $null
        } else {
            $Type = $JsonParameters.PSobject.Properties["Type"].value
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "ExternalSharingProfileId"))) { #optional property not found
            $ExternalSharingProfileId = $null
        } else {
            $ExternalSharingProfileId = $JsonParameters.PSobject.Properties["ExternalSharingProfileId"].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 "LeaseExpirationTime"))) { #optional property not found
            $LeaseExpirationTime = $null
        } else {
            $LeaseExpirationTime = $JsonParameters.PSobject.Properties["LeaseExpirationTime"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "InactivityThresholdTime"))) { #optional property not found
            $InactivityThresholdTime = $null
        } else {
            $InactivityThresholdTime = $JsonParameters.PSobject.Properties["InactivityThresholdTime"].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 "RenewalStartTime"))) { #optional property not found
            $RenewalStartTime = $null
        } else {
            $RenewalStartTime = $JsonParameters.PSobject.Properties["RenewalStartTime"].value
        }

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "LastAccessedTime"))) { #optional property not found
            $LastAccessedTime = $null
        } else {
            $LastAccessedTime = $JsonParameters.PSobject.Properties["LastAccessedTime"].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 "LastRenewalBy"))) { #optional property not found
            $LastRenewalBy = $null
        } else {
            $LastRenewalBy = $JsonParameters.PSobject.Properties["LastRenewalBy"].value
        }

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "InsightsStatus"))) { #optional property not found
            $InsightsStatus = $null
        } else {
            $InsightsStatus = $JsonParameters.PSobject.Properties["InsightsStatus"].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 "ElectionProfileName"))) { #optional property not found
            $ElectionProfileName = $null
        } else {
            $ElectionProfileName = $JsonParameters.PSobject.Properties["ElectionProfileName"].value
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "YammerLink" = ${YammerLink}
            "Sensitivity" = ${Sensitivity}
            "EnableDynamicMembership" = ${EnableDynamicMembership}
            "DynamicGroupRules" = ${DynamicGroupRules}
            "Email" = ${Email}
            "Status" = ${Status}
            "StatusDescription" = ${StatusDescription}
            "SiteStatus" = ${SiteStatus}
            "LegalHold" = ${LegalHold}
            "SiteStatusDescription" = ${SiteStatusDescription}
            "Owners" = ${Owners}
            "Privacy" = ${Privacy}
            "PrivacyDescription" = ${PrivacyDescription}
            "SiteSharing" = ${SiteSharing}
            "TeamsSiteSharingDescription" = ${TeamsSiteSharingDescription}
            "GroupSharing" = ${GroupSharing}
            "GroupSharingDescription" = ${GroupSharingDescription}
            "SiteLink" = ${SiteLink}
            "FileLink" = ${FileLink}
            "NoteBookLink" = ${NoteBookLink}
            "PlannerLink" = ${PlannerLink}
            "HasPendingApprovalTask" = ${HasPendingApprovalTask}
            "Id" = ${Id}
            "Name" = ${Name}
            "Description" = ${Description}
            "Phase" = ${Phase}
            "PhaseDescription" = ${PhaseDescription}
            "PolicyName" = ${PolicyName}
            "PolicyDescription" = ${PolicyDescription}
            "PolicyId" = ${PolicyId}
            "PrimaryContact" = ${PrimaryContact}
            "SecondaryContact" = ${SecondaryContact}
            "HubSite" = ${HubSite}
            "HubType" = ${HubType}
            "ClaimStatus" = ${ClaimStatus}
            "ClaimStatusDescription" = ${ClaimStatusDescription}
            "Type" = ${Type}
            "TypeDescription" = ${TypeDescription}
            "Classification" = ${Classification}
            "LockedBy" = ${LockedBy}
            "LockedByDescription" = ${LockedByDescription}
            "GeoLocation" = ${GeoLocation}
            "GeoLocationDescription" = ${GeoLocationDescription}
            "StorageLimit" = ${StorageLimit}
            "StorageUsed" = ${StorageUsed}
            "RenewalProfileName" = ${RenewalProfileName}
            "RenewalProfileId" = ${RenewalProfileId}
            "QuotaProfileName" = ${QuotaProfileName}
            "QuotaProfileId" = ${QuotaProfileId}
            "ExternalSharingProfileName" = ${ExternalSharingProfileName}
            "ExternalSharingProfileId" = ${ExternalSharingProfileId}
            "CreatedTime" = ${CreatedTime}
            "LeaseExpirationTime" = ${LeaseExpirationTime}
            "InactivityThresholdTime" = ${InactivityThresholdTime}
            "PhaseAssignees" = ${PhaseAssignees}
            "RenewalStartTime" = ${RenewalStartTime}
            "RenewDueDate" = ${RenewDueDate}
            "LastRenewalDate" = ${LastRenewalDate}
            "LastAccessedTime" = ${LastAccessedTime}
            "NextRenewalDate" = ${NextRenewalDate}
            "LastRenewalBy" = ${LastRenewalBy}
            "Metadatas" = ${Metadatas}
            "HasOngoingTasks" = ${HasOngoingTasks}
            "InsightsStatus" = ${InsightsStatus}
            "ElectionProfileId" = ${ElectionProfileId}
            "ElectionProfileName" = ${ElectionProfileName}
            "LastSyncTime" = ${LastSyncTime}
            "CreatedSource" = ${CreatedSource}
            "ErrorMessage" = ${ErrorMessage}
        }

        return $PSO
    }

}