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