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