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