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