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