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