Model/InviteGuestGallery.ps1
# # Cloud Governance Api # Contact: support@avepoint.com # <# InviteGuestGallery<PSCustomObject> #> function New-InviteGuestGallery { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${OfficeTenantId}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${DisplayName}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${Contacts}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${EmailAddress}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${FirstName}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${LastName}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${WelcomeMessage}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${JobTitle}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${Department}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${CompanyName}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${UsageLocation}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${ContactInformation}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${Manager}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${ElectionProfile}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${RenewalProfile}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${PrimaryContact}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${SecondaryContact}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${AddToGroups}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${MultipleInvite}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${InviteGuestUserScope}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${LimitDomains}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${GalleryType}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${GalleryInternalName}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${GalleryMetadata} ) Process { 'Creating PSCustomObject: Cloud.Governance.Client => InviteGuestGallery' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ "OfficeTenantId" = ${OfficeTenantId} "DisplayName" = ${DisplayName} "Contacts" = ${Contacts} "EmailAddress" = ${EmailAddress} "FirstName" = ${FirstName} "LastName" = ${LastName} "WelcomeMessage" = ${WelcomeMessage} "JobTitle" = ${JobTitle} "Department" = ${Department} "CompanyName" = ${CompanyName} "UsageLocation" = ${UsageLocation} "ContactInformation" = ${ContactInformation} "Manager" = ${Manager} "ElectionProfile" = ${ElectionProfile} "RenewalProfile" = ${RenewalProfile} "PrimaryContact" = ${PrimaryContact} "SecondaryContact" = ${SecondaryContact} "AddToGroups" = ${AddToGroups} "MultipleInvite" = ${MultipleInvite} "InviteGuestUserScope" = ${InviteGuestUserScope} "LimitDomains" = ${LimitDomains} "GalleryType" = ${GalleryType} "GalleryInternalName" = ${GalleryInternalName} "GalleryMetadata" = ${GalleryMetadata} } return $PSO } } <# InviteGuestGallery<PSCustomObject> #> function ConvertFrom-JsonToInviteGuestGallery { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: Cloud.Governance.Client => InviteGuestGallery' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in InviteGuestGallery $AllProperties = $("OfficeTenantId", "DisplayName", "GuestDisplayName", "Contacts", "EmailAddress", "FirstName", "LastName", "WelcomeMessage", "JobTitle", "Department", "CompanyName", "UsageLocation", "ContactInformation", "Manager", "ElectionProfile", "RenewalProfile", "PrimaryContact", "SecondaryContact", "AddToGroups", "MultipleInvite", "InviteGuestUserScope", "LimitDomains", "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 "OfficeTenantId"))) { #optional property not found $OfficeTenantId = $null } else { $OfficeTenantId = $JsonParameters.PSobject.Properties["OfficeTenantId"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "DisplayName"))) { #optional property not found $DisplayName = $null } else { $DisplayName = $JsonParameters.PSobject.Properties["DisplayName"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "GuestDisplayName"))) { #optional property not found $GuestDisplayName = $null } else { $GuestDisplayName = $JsonParameters.PSobject.Properties["GuestDisplayName"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "Contacts"))) { #optional property not found $Contacts = $null } else { $Contacts = $JsonParameters.PSobject.Properties["Contacts"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "EmailAddress"))) { #optional property not found $EmailAddress = $null } else { $EmailAddress = $JsonParameters.PSobject.Properties["EmailAddress"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "FirstName"))) { #optional property not found $FirstName = $null } else { $FirstName = $JsonParameters.PSobject.Properties["FirstName"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "LastName"))) { #optional property not found $LastName = $null } else { $LastName = $JsonParameters.PSobject.Properties["LastName"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "WelcomeMessage"))) { #optional property not found $WelcomeMessage = $null } else { $WelcomeMessage = $JsonParameters.PSobject.Properties["WelcomeMessage"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "JobTitle"))) { #optional property not found $JobTitle = $null } else { $JobTitle = $JsonParameters.PSobject.Properties["JobTitle"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "Department"))) { #optional property not found $Department = $null } else { $Department = $JsonParameters.PSobject.Properties["Department"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "CompanyName"))) { #optional property not found $CompanyName = $null } else { $CompanyName = $JsonParameters.PSobject.Properties["CompanyName"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "UsageLocation"))) { #optional property not found $UsageLocation = $null } else { $UsageLocation = $JsonParameters.PSobject.Properties["UsageLocation"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "ContactInformation"))) { #optional property not found $ContactInformation = $null } else { $ContactInformation = $JsonParameters.PSobject.Properties["ContactInformation"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "Manager"))) { #optional property not found $Manager = $null } else { $Manager = $JsonParameters.PSobject.Properties["Manager"].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 "RenewalProfile"))) { #optional property not found $RenewalProfile = $null } else { $RenewalProfile = $JsonParameters.PSobject.Properties["RenewalProfile"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "PrimaryContact"))) { #optional property not found $PrimaryContact = $null } else { $PrimaryContact = $JsonParameters.PSobject.Properties["PrimaryContact"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "SecondaryContact"))) { #optional property not found $SecondaryContact = $null } else { $SecondaryContact = $JsonParameters.PSobject.Properties["SecondaryContact"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "AddToGroups"))) { #optional property not found $AddToGroups = $null } else { $AddToGroups = $JsonParameters.PSobject.Properties["AddToGroups"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "MultipleInvite"))) { #optional property not found $MultipleInvite = $null } else { $MultipleInvite = $JsonParameters.PSobject.Properties["MultipleInvite"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "InviteGuestUserScope"))) { #optional property not found $InviteGuestUserScope = $null } else { $InviteGuestUserScope = $JsonParameters.PSobject.Properties["InviteGuestUserScope"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "LimitDomains"))) { #optional property not found $LimitDomains = $null } else { $LimitDomains = $JsonParameters.PSobject.Properties["LimitDomains"].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]@{ "OfficeTenantId" = ${OfficeTenantId} "DisplayName" = ${DisplayName} "GuestDisplayName" = ${GuestDisplayName} "Contacts" = ${Contacts} "EmailAddress" = ${EmailAddress} "FirstName" = ${FirstName} "LastName" = ${LastName} "WelcomeMessage" = ${WelcomeMessage} "JobTitle" = ${JobTitle} "Department" = ${Department} "CompanyName" = ${CompanyName} "UsageLocation" = ${UsageLocation} "ContactInformation" = ${ContactInformation} "Manager" = ${Manager} "ElectionProfile" = ${ElectionProfile} "RenewalProfile" = ${RenewalProfile} "PrimaryContact" = ${PrimaryContact} "SecondaryContact" = ${SecondaryContact} "AddToGroups" = ${AddToGroups} "MultipleInvite" = ${MultipleInvite} "InviteGuestUserScope" = ${InviteGuestUserScope} "LimitDomains" = ${LimitDomains} "GalleryType" = ${GalleryType} "GalleryInternalName" = ${GalleryInternalName} "GalleryMetadata" = ${GalleryMetadata} } return $PSO } } |