Model/ChangeSiteSettingCheckResult.ps1

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

<#
ChangeSiteSettingCheckResult<PSCustomObject>
#>


function New-ChangeSiteSettingCheckResult {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SiteId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Office365TenantId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PictureUri},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${GroupId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IsManagedbyGAO} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SiteUrl},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${AdminCenterUrl},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IsGroupSite} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SiteTitle},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SiteDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SiteTemplate},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${SiteTimeZoneId} = 0,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${SiteLocaleId} = 0,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SiteStorageSetting},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Classification},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Sensitivity},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${HubSiteSetting},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SiteSharingSetting},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IsEnableSensitivityLabel} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${GroupEmail},
        [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]
        ${TenantId},
        [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 => ChangeSiteSettingCheckResult' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        
        $PSO = [PSCustomObject]@{
            "SiteId" = ${SiteId}
            "Office365TenantId" = ${Office365TenantId}
            "PictureUri" = ${PictureUri}
            "GroupId" = ${GroupId}
            "IsManagedbyGAO" = ${IsManagedbyGAO}
            "SiteUrl" = ${SiteUrl}
            "AdminCenterUrl" = ${AdminCenterUrl}
            "IsGroupSite" = ${IsGroupSite}
            "SiteTitle" = ${SiteTitle}
            "SiteDescription" = ${SiteDescription}
            "SiteTemplate" = ${SiteTemplate}
            "SiteTimeZoneId" = ${SiteTimeZoneId}
            "SiteLocaleId" = ${SiteLocaleId}
            "SiteStorageSetting" = ${SiteStorageSetting}
            "Classification" = ${Classification}
            "Sensitivity" = ${Sensitivity}
            "HubSiteSetting" = ${HubSiteSetting}
            "SiteSharingSetting" = ${SiteSharingSetting}
            "IsEnableSensitivityLabel" = ${IsEnableSensitivityLabel}
            "GroupEmail" = ${GroupEmail}
            "PrimaryContact" = ${PrimaryContact}
            "SecondaryContact" = ${SecondaryContact}
            "Owners" = ${Owners}
            "Members" = ${Members}
            "CoOwners" = ${CoOwners}
            "TenantId" = ${TenantId}
            "Privacy" = ${Privacy}
            "EnvironmentName" = ${EnvironmentName}
            "WorkspaceTypeWithValidated" = ${WorkspaceTypeWithValidated}
            "IsHybrid" = ${IsHybrid}
            "IsValid" = ${IsValid}
            "ErrorMessage" = ${ErrorMessage}
            "MessageCode" = ${MessageCode}
        }

        return $PSO
    }
}

<#
ChangeSiteSettingCheckResult<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in ChangeSiteSettingCheckResult
        $AllProperties = $("SiteId", "Office365TenantId", "PictureUri", "GroupId", "IsManagedbyGAO", "SiteUrl", "AdminCenterUrl", "IsGroupSite", "SiteTitle", "SiteDescription", "SiteTemplate", "SiteTimeZoneId", "SiteLocaleId", "SiteStorageSetting", "Classification", "Sensitivity", "HubSiteSetting", "SiteSharingSetting", "IsEnableSensitivityLabel", "GroupEmail", "PrimaryContact", "SecondaryContact", "Owners", "Members", "CoOwners", "TenantId", "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 "SiteId"))) { #optional property not found
            $SiteId = $null
        } else {
            $SiteId = $JsonParameters.PSobject.Properties["SiteId"].value
        }

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

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

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

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

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

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

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

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

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "SiteSharingSetting"))) { #optional property not found
            $SiteSharingSetting = $null
        } else {
            $SiteSharingSetting = $JsonParameters.PSobject.Properties["SiteSharingSetting"].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 "GroupEmail"))) { #optional property not found
            $GroupEmail = $null
        } else {
            $GroupEmail = $JsonParameters.PSobject.Properties["GroupEmail"].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 "TenantId"))) { #optional property not found
            $TenantId = $null
        } else {
            $TenantId = $JsonParameters.PSobject.Properties["TenantId"].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]@{
            "SiteId" = ${SiteId}
            "Office365TenantId" = ${Office365TenantId}
            "PictureUri" = ${PictureUri}
            "GroupId" = ${GroupId}
            "IsManagedbyGAO" = ${IsManagedbyGAO}
            "SiteUrl" = ${SiteUrl}
            "AdminCenterUrl" = ${AdminCenterUrl}
            "IsGroupSite" = ${IsGroupSite}
            "SiteTitle" = ${SiteTitle}
            "SiteDescription" = ${SiteDescription}
            "SiteTemplate" = ${SiteTemplate}
            "SiteTimeZoneId" = ${SiteTimeZoneId}
            "SiteLocaleId" = ${SiteLocaleId}
            "SiteStorageSetting" = ${SiteStorageSetting}
            "Classification" = ${Classification}
            "Sensitivity" = ${Sensitivity}
            "HubSiteSetting" = ${HubSiteSetting}
            "SiteSharingSetting" = ${SiteSharingSetting}
            "IsEnableSensitivityLabel" = ${IsEnableSensitivityLabel}
            "GroupEmail" = ${GroupEmail}
            "PrimaryContact" = ${PrimaryContact}
            "SecondaryContact" = ${SecondaryContact}
            "Owners" = ${Owners}
            "Members" = ${Members}
            "CoOwners" = ${CoOwners}
            "TenantId" = ${TenantId}
            "Privacy" = ${Privacy}
            "EnvironmentName" = ${EnvironmentName}
            "WorkspaceTypeWithValidated" = ${WorkspaceTypeWithValidated}
            "IsHybrid" = ${IsHybrid}
            "IsValid" = ${IsValid}
            "ErrorMessage" = ${ErrorMessage}
            "MessageCode" = ${MessageCode}
        }

        return $PSO
    }

}