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