Model/ChangeSharedMailboxPermissionCheckResult.ps1
|
# # Cloud Governance Api # Contact: support@avepoint.com # <# ChangeSharedMailboxPermissionCheckResult<PSCustomObject> #> function New-ChangeSharedMailboxPermissionCheckResult { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${SendAsPermissions}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${SendOnBehalfPermissions}, [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 => ChangeSharedMailboxPermissionCheckResult' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ "SendAsPermissions" = ${SendAsPermissions} "SendOnBehalfPermissions" = ${SendOnBehalfPermissions} "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 } } <# ChangeSharedMailboxPermissionCheckResult<PSCustomObject> #> function ConvertFrom-JsonToChangeSharedMailboxPermissionCheckResult { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: Cloud.Governance.Client => ChangeSharedMailboxPermissionCheckResult' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in ChangeSharedMailboxPermissionCheckResult $AllProperties = $("SendAsPermissions", "SendOnBehalfPermissions", "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 "SendAsPermissions"))) { #optional property not found $SendAsPermissions = $null } else { $SendAsPermissions = $JsonParameters.PSobject.Properties["SendAsPermissions"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "SendOnBehalfPermissions"))) { #optional property not found $SendOnBehalfPermissions = $null } else { $SendOnBehalfPermissions = $JsonParameters.PSobject.Properties["SendOnBehalfPermissions"].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]@{ "SendAsPermissions" = ${SendAsPermissions} "SendOnBehalfPermissions" = ${SendOnBehalfPermissions} "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 } } |