Model/CreateSiteGallery.ps1
# # Cloud Governance Api # Contact: support@avepoint.com # <# CreateSiteGallery<PSCustomObject> #> function New-CreateSiteGallery { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${ContentTypes}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${SiteTitleAndDescription}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${SiteUrlSetting}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${SiteTimeZone}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${SiteTemplate}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${SiteOfficeTenant}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${SiteLanguage}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${SiteContacts}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${ExternalSharingProfile}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${QuotaProfile}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${SiteDesign}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${SiteAdmins}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${SiteInformationIcon}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${SiteDepthLimit}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${DpmPlanSetting}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${PermissionSetting}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${SiteCloudGovernancePanel}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${SiteClassificationAndSensitivityLabel}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${SiteHubSite}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${MultiGeoLocationSetting}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${RenewalProfile}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${ElectionProfile}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${FullUrl}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${GalleryType}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${GalleryInternalName}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${GalleryMetadata} ) Process { 'Creating PSCustomObject: Cloud.Governance.Client => CreateSiteGallery' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ "ContentTypes" = ${ContentTypes} "SiteTitleAndDescription" = ${SiteTitleAndDescription} "SiteUrlSetting" = ${SiteUrlSetting} "SiteTimeZone" = ${SiteTimeZone} "SiteTemplate" = ${SiteTemplate} "SiteOfficeTenant" = ${SiteOfficeTenant} "SiteLanguage" = ${SiteLanguage} "SiteContacts" = ${SiteContacts} "ExternalSharingProfile" = ${ExternalSharingProfile} "QuotaProfile" = ${QuotaProfile} "SiteDesign" = ${SiteDesign} "SiteAdmins" = ${SiteAdmins} "SiteInformationIcon" = ${SiteInformationIcon} "SiteDepthLimit" = ${SiteDepthLimit} "DpmPlanSetting" = ${DpmPlanSetting} "PermissionSetting" = ${PermissionSetting} "SiteCloudGovernancePanel" = ${SiteCloudGovernancePanel} "SiteClassificationAndSensitivityLabel" = ${SiteClassificationAndSensitivityLabel} "SiteHubSite" = ${SiteHubSite} "MultiGeoLocationSetting" = ${MultiGeoLocationSetting} "RenewalProfile" = ${RenewalProfile} "ElectionProfile" = ${ElectionProfile} "FullUrl" = ${FullUrl} "GalleryType" = ${GalleryType} "GalleryInternalName" = ${GalleryInternalName} "GalleryMetadata" = ${GalleryMetadata} } return $PSO } } <# CreateSiteGallery<PSCustomObject> #> function ConvertFrom-JsonToCreateSiteGallery { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: Cloud.Governance.Client => CreateSiteGallery' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in CreateSiteGallery $AllProperties = $("ContentTypes", "SiteTitleAndDescription", "SiteUrlSetting", "SiteTimeZone", "SiteTemplate", "SiteOfficeTenant", "SiteLanguage", "SiteContacts", "ExternalSharingProfile", "QuotaProfile", "SiteDesign", "SiteAdmins", "SiteInformationIcon", "SiteDepthLimit", "DpmPlanSetting", "PermissionSetting", "SiteCloudGovernancePanel", "SiteClassificationAndSensitivityLabel", "SiteHubSite", "MultiGeoLocationSetting", "RenewalProfile", "ElectionProfile", "FullUrl", "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 "ContentTypes"))) { #optional property not found $ContentTypes = $null } else { $ContentTypes = $JsonParameters.PSobject.Properties["ContentTypes"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "SiteTitleAndDescription"))) { #optional property not found $SiteTitleAndDescription = $null } else { $SiteTitleAndDescription = $JsonParameters.PSobject.Properties["SiteTitleAndDescription"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "SiteUrlSetting"))) { #optional property not found $SiteUrlSetting = $null } else { $SiteUrlSetting = $JsonParameters.PSobject.Properties["SiteUrlSetting"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "SiteTimeZone"))) { #optional property not found $SiteTimeZone = $null } else { $SiteTimeZone = $JsonParameters.PSobject.Properties["SiteTimeZone"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "SiteTemplate"))) { #optional property not found $SiteTemplate = $null } else { $SiteTemplate = $JsonParameters.PSobject.Properties["SiteTemplate"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "SiteOfficeTenant"))) { #optional property not found $SiteOfficeTenant = $null } else { $SiteOfficeTenant = $JsonParameters.PSobject.Properties["SiteOfficeTenant"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "SiteLanguage"))) { #optional property not found $SiteLanguage = $null } else { $SiteLanguage = $JsonParameters.PSobject.Properties["SiteLanguage"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "SiteContacts"))) { #optional property not found $SiteContacts = $null } else { $SiteContacts = $JsonParameters.PSobject.Properties["SiteContacts"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "ExternalSharingProfile"))) { #optional property not found $ExternalSharingProfile = $null } else { $ExternalSharingProfile = $JsonParameters.PSobject.Properties["ExternalSharingProfile"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "QuotaProfile"))) { #optional property not found $QuotaProfile = $null } else { $QuotaProfile = $JsonParameters.PSobject.Properties["QuotaProfile"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "SiteDesign"))) { #optional property not found $SiteDesign = $null } else { $SiteDesign = $JsonParameters.PSobject.Properties["SiteDesign"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "SiteAdmins"))) { #optional property not found $SiteAdmins = $null } else { $SiteAdmins = $JsonParameters.PSobject.Properties["SiteAdmins"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "SiteInformationIcon"))) { #optional property not found $SiteInformationIcon = $null } else { $SiteInformationIcon = $JsonParameters.PSobject.Properties["SiteInformationIcon"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "SiteDepthLimit"))) { #optional property not found $SiteDepthLimit = $null } else { $SiteDepthLimit = $JsonParameters.PSobject.Properties["SiteDepthLimit"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "DpmPlanSetting"))) { #optional property not found $DpmPlanSetting = $null } else { $DpmPlanSetting = $JsonParameters.PSobject.Properties["DpmPlanSetting"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "PermissionSetting"))) { #optional property not found $PermissionSetting = $null } else { $PermissionSetting = $JsonParameters.PSobject.Properties["PermissionSetting"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "SiteCloudGovernancePanel"))) { #optional property not found $SiteCloudGovernancePanel = $null } else { $SiteCloudGovernancePanel = $JsonParameters.PSobject.Properties["SiteCloudGovernancePanel"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "SiteClassificationAndSensitivityLabel"))) { #optional property not found $SiteClassificationAndSensitivityLabel = $null } else { $SiteClassificationAndSensitivityLabel = $JsonParameters.PSobject.Properties["SiteClassificationAndSensitivityLabel"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "SiteHubSite"))) { #optional property not found $SiteHubSite = $null } else { $SiteHubSite = $JsonParameters.PSobject.Properties["SiteHubSite"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "MultiGeoLocationSetting"))) { #optional property not found $MultiGeoLocationSetting = $null } else { $MultiGeoLocationSetting = $JsonParameters.PSobject.Properties["MultiGeoLocationSetting"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "RenewalProfile"))) { #optional property not found $RenewalProfile = $null } else { $RenewalProfile = $JsonParameters.PSobject.Properties["RenewalProfile"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "ElectionProfile"))) { #optional property not found $ElectionProfile = $null } else { $ElectionProfile = $JsonParameters.PSobject.Properties["ElectionProfile"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "FullUrl"))) { #optional property not found $FullUrl = $null } else { $FullUrl = $JsonParameters.PSobject.Properties["FullUrl"].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]@{ "ContentTypes" = ${ContentTypes} "SiteTitleAndDescription" = ${SiteTitleAndDescription} "SiteUrlSetting" = ${SiteUrlSetting} "SiteTimeZone" = ${SiteTimeZone} "SiteTemplate" = ${SiteTemplate} "SiteOfficeTenant" = ${SiteOfficeTenant} "SiteLanguage" = ${SiteLanguage} "SiteContacts" = ${SiteContacts} "ExternalSharingProfile" = ${ExternalSharingProfile} "QuotaProfile" = ${QuotaProfile} "SiteDesign" = ${SiteDesign} "SiteAdmins" = ${SiteAdmins} "SiteInformationIcon" = ${SiteInformationIcon} "SiteDepthLimit" = ${SiteDepthLimit} "DpmPlanSetting" = ${DpmPlanSetting} "PermissionSetting" = ${PermissionSetting} "SiteCloudGovernancePanel" = ${SiteCloudGovernancePanel} "SiteClassificationAndSensitivityLabel" = ${SiteClassificationAndSensitivityLabel} "SiteHubSite" = ${SiteHubSite} "MultiGeoLocationSetting" = ${MultiGeoLocationSetting} "RenewalProfile" = ${RenewalProfile} "ElectionProfile" = ${ElectionProfile} "FullUrl" = ${FullUrl} "GalleryType" = ${GalleryType} "GalleryInternalName" = ${GalleryInternalName} "GalleryMetadata" = ${GalleryMetadata} } return $PSO } } |