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