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