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