Model/ChangeYammerSettingsCheckResult.ps1

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

<#
ChangeYammerSettingsCheckResult<PSCustomObject>
#>


function New-ChangeYammerSettingsCheckResult {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IsAppliedPolicy} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${OriginalPolicy},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${HasOngoingRenewTask} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${HasOngoingElectionTask} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${OriginalExternalSharingProfile},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${OriginalStorageManagementProfile},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${OriginalContactElectionProfile},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${OriginalRenewalProfile},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${YammerSiteUrl},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IsSiteLocked} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${YammerPrivacy} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Metadatas},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IsHiddenFromAddressListsEnabled} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IsHideFromOutlookClientsEnabled} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IsHaveExchangePermission} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IsAssignableToRole} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${YammerName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${YammerDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${PrimaryContact},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SecondaryContact},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Owners},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Members},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${CoOwners},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SiteTitle},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SiteId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Classification},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IsEnableSensitivityLabel} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SiteUrl},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${TenantId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Sensitivity},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${Privacy} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${EnvironmentName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${WorkspaceTypeWithValidated} = "Site",
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IsHybrid} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IsValid} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ErrorMessage},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${MessageCode} = "None"
    )

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

        
        $PSO = [PSCustomObject]@{
            "IsAppliedPolicy" = ${IsAppliedPolicy}
            "OriginalPolicy" = ${OriginalPolicy}
            "HasOngoingRenewTask" = ${HasOngoingRenewTask}
            "HasOngoingElectionTask" = ${HasOngoingElectionTask}
            "OriginalExternalSharingProfile" = ${OriginalExternalSharingProfile}
            "OriginalStorageManagementProfile" = ${OriginalStorageManagementProfile}
            "OriginalContactElectionProfile" = ${OriginalContactElectionProfile}
            "OriginalRenewalProfile" = ${OriginalRenewalProfile}
            "YammerSiteUrl" = ${YammerSiteUrl}
            "IsSiteLocked" = ${IsSiteLocked}
            "YammerPrivacy" = ${YammerPrivacy}
            "Metadatas" = ${Metadatas}
            "IsHiddenFromAddressListsEnabled" = ${IsHiddenFromAddressListsEnabled}
            "IsHideFromOutlookClientsEnabled" = ${IsHideFromOutlookClientsEnabled}
            "IsHaveExchangePermission" = ${IsHaveExchangePermission}
            "IsAssignableToRole" = ${IsAssignableToRole}
            "YammerName" = ${YammerName}
            "YammerDescription" = ${YammerDescription}
            "PrimaryContact" = ${PrimaryContact}
            "SecondaryContact" = ${SecondaryContact}
            "Owners" = ${Owners}
            "Members" = ${Members}
            "CoOwners" = ${CoOwners}
            "SiteTitle" = ${SiteTitle}
            "SiteId" = ${SiteId}
            "Classification" = ${Classification}
            "IsEnableSensitivityLabel" = ${IsEnableSensitivityLabel}
            "SiteUrl" = ${SiteUrl}
            "TenantId" = ${TenantId}
            "Sensitivity" = ${Sensitivity}
            "Privacy" = ${Privacy}
            "EnvironmentName" = ${EnvironmentName}
            "WorkspaceTypeWithValidated" = ${WorkspaceTypeWithValidated}
            "IsHybrid" = ${IsHybrid}
            "IsValid" = ${IsValid}
            "ErrorMessage" = ${ErrorMessage}
            "MessageCode" = ${MessageCode}
        }

        return $PSO
    }
}

<#
ChangeYammerSettingsCheckResult<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in ChangeYammerSettingsCheckResult
        $AllProperties = $("IsAppliedPolicy", "OriginalPolicy", "HasOngoingRenewTask", "HasOngoingElectionTask", "OriginalExternalSharingProfile", "OriginalStorageManagementProfile", "OriginalContactElectionProfile", "OriginalRenewalProfile", "YammerSiteUrl", "IsSiteLocked", "YammerPrivacy", "Metadatas", "IsHiddenFromAddressListsEnabled", "IsHideFromOutlookClientsEnabled", "IsHaveExchangePermission", "IsAssignableToRole", "YammerName", "YammerDescription", "PrimaryContact", "SecondaryContact", "Owners", "Members", "CoOwners", "SiteTitle", "SiteId", "Classification", "IsEnableSensitivityLabel", "SiteUrl", "TenantId", "Sensitivity", "Privacy", "EnvironmentName", "WorkspaceTypeWithValidated", "IsHybrid", "IsValid", "ErrorMessage", "MessageCode")
        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 "IsAppliedPolicy"))) { #optional property not found
            $IsAppliedPolicy = $null
        } else {
            $IsAppliedPolicy = $JsonParameters.PSobject.Properties["IsAppliedPolicy"].value
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "IsAppliedPolicy" = ${IsAppliedPolicy}
            "OriginalPolicy" = ${OriginalPolicy}
            "HasOngoingRenewTask" = ${HasOngoingRenewTask}
            "HasOngoingElectionTask" = ${HasOngoingElectionTask}
            "OriginalExternalSharingProfile" = ${OriginalExternalSharingProfile}
            "OriginalStorageManagementProfile" = ${OriginalStorageManagementProfile}
            "OriginalContactElectionProfile" = ${OriginalContactElectionProfile}
            "OriginalRenewalProfile" = ${OriginalRenewalProfile}
            "YammerSiteUrl" = ${YammerSiteUrl}
            "IsSiteLocked" = ${IsSiteLocked}
            "YammerPrivacy" = ${YammerPrivacy}
            "Metadatas" = ${Metadatas}
            "IsHiddenFromAddressListsEnabled" = ${IsHiddenFromAddressListsEnabled}
            "IsHideFromOutlookClientsEnabled" = ${IsHideFromOutlookClientsEnabled}
            "IsHaveExchangePermission" = ${IsHaveExchangePermission}
            "IsAssignableToRole" = ${IsAssignableToRole}
            "YammerName" = ${YammerName}
            "YammerDescription" = ${YammerDescription}
            "PrimaryContact" = ${PrimaryContact}
            "SecondaryContact" = ${SecondaryContact}
            "Owners" = ${Owners}
            "Members" = ${Members}
            "CoOwners" = ${CoOwners}
            "SiteTitle" = ${SiteTitle}
            "SiteId" = ${SiteId}
            "Classification" = ${Classification}
            "IsEnableSensitivityLabel" = ${IsEnableSensitivityLabel}
            "SiteUrl" = ${SiteUrl}
            "TenantId" = ${TenantId}
            "Sensitivity" = ${Sensitivity}
            "Privacy" = ${Privacy}
            "EnvironmentName" = ${EnvironmentName}
            "WorkspaceTypeWithValidated" = ${WorkspaceTypeWithValidated}
            "IsHybrid" = ${IsHybrid}
            "IsValid" = ${IsValid}
            "ErrorMessage" = ${ErrorMessage}
            "MessageCode" = ${MessageCode}
        }

        return $PSO
    }

}