Model/CreateSharedMailboxGallery.ps1

#
# Cloud Governance Api
# Contact: support@avepoint.com
#

<#
CreateSharedMailboxGallery<PSCustomObject>
#>


function New-CreateSharedMailboxGallery {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ContactInformation},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${MultiGeoLocationSetting},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${LanguageDataTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${TimeZone},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${EmailForwarding},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${AutoMappingSettings},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SentItems},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${AutomaticReplies},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Policies},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${GroupEmailAddress},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${GlobalAddressList},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SendAs},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SendOnBehalf},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${OfficeTenantId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${GroupNameAndDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${GroupContact},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Owners},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Members},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Tenant},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ElectionProfile},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${RenewalProfile},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${GalleryType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${GalleryInternalName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${GalleryMetadata}
    )

    Process {
        'Creating PSCustomObject: Cloud.Governance.Client => CreateSharedMailboxGallery' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        
        $PSO = [PSCustomObject]@{
            "ContactInformation" = ${ContactInformation}
            "MultiGeoLocationSetting" = ${MultiGeoLocationSetting}
            "LanguageDataTime" = ${LanguageDataTime}
            "TimeZone" = ${TimeZone}
            "EmailForwarding" = ${EmailForwarding}
            "AutoMappingSettings" = ${AutoMappingSettings}
            "SentItems" = ${SentItems}
            "AutomaticReplies" = ${AutomaticReplies}
            "Policies" = ${Policies}
            "GroupEmailAddress" = ${GroupEmailAddress}
            "GlobalAddressList" = ${GlobalAddressList}
            "SendAs" = ${SendAs}
            "SendOnBehalf" = ${SendOnBehalf}
            "OfficeTenantId" = ${OfficeTenantId}
            "GroupNameAndDescription" = ${GroupNameAndDescription}
            "GroupContact" = ${GroupContact}
            "Owners" = ${Owners}
            "Members" = ${Members}
            "Tenant" = ${Tenant}
            "ElectionProfile" = ${ElectionProfile}
            "RenewalProfile" = ${RenewalProfile}
            "GalleryType" = ${GalleryType}
            "GalleryInternalName" = ${GalleryInternalName}
            "GalleryMetadata" = ${GalleryMetadata}
        }

        return $PSO
    }
}

<#
CreateSharedMailboxGallery<PSCustomObject>
#>

function ConvertFrom-JsonToCreateSharedMailboxGallery {
    Param(
        [AllowEmptyString()]
        [string]$Json
    )

    Process {
        'Converting JSON to PSCustomObject: Cloud.Governance.Client => CreateSharedMailboxGallery' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in CreateSharedMailboxGallery
        $AllProperties = $("ContactInformation", "MultiGeoLocationSetting", "LanguageDataTime", "TimeZone", "EmailForwarding", "AutoMappingSettings", "SentItems", "AutomaticReplies", "Policies", "GroupEmailAddress", "GlobalAddressList", "GroupEmail", "SendAs", "SendOnBehalf", "OfficeTenantId", "GroupNameAndDescription", "GroupContact", "Owners", "Members", "Tenant", "ElectionProfile", "RenewalProfile", "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 "ContactInformation"))) { #optional property not found
            $ContactInformation = $null
        } else {
            $ContactInformation = $JsonParameters.PSobject.Properties["ContactInformation"].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 "LanguageDataTime"))) { #optional property not found
            $LanguageDataTime = $null
        } else {
            $LanguageDataTime = $JsonParameters.PSobject.Properties["LanguageDataTime"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "TimeZone"))) { #optional property not found
            $TimeZone = $null
        } else {
            $TimeZone = $JsonParameters.PSobject.Properties["TimeZone"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "EmailForwarding"))) { #optional property not found
            $EmailForwarding = $null
        } else {
            $EmailForwarding = $JsonParameters.PSobject.Properties["EmailForwarding"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "AutoMappingSettings"))) { #optional property not found
            $AutoMappingSettings = $null
        } else {
            $AutoMappingSettings = $JsonParameters.PSobject.Properties["AutoMappingSettings"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "SentItems"))) { #optional property not found
            $SentItems = $null
        } else {
            $SentItems = $JsonParameters.PSobject.Properties["SentItems"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "AutomaticReplies"))) { #optional property not found
            $AutomaticReplies = $null
        } else {
            $AutomaticReplies = $JsonParameters.PSobject.Properties["AutomaticReplies"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "Policies"))) { #optional property not found
            $Policies = $null
        } else {
            $Policies = $JsonParameters.PSobject.Properties["Policies"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "GroupEmailAddress"))) { #optional property not found
            $GroupEmailAddress = $null
        } else {
            $GroupEmailAddress = $JsonParameters.PSobject.Properties["GroupEmailAddress"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "GlobalAddressList"))) { #optional property not found
            $GlobalAddressList = $null
        } else {
            $GlobalAddressList = $JsonParameters.PSobject.Properties["GlobalAddressList"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "GroupEmail"))) { #optional property not found
            $GroupEmail = $null
        } else {
            $GroupEmail = $JsonParameters.PSobject.Properties["GroupEmail"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "SendAs"))) { #optional property not found
            $SendAs = $null
        } else {
            $SendAs = $JsonParameters.PSobject.Properties["SendAs"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "SendOnBehalf"))) { #optional property not found
            $SendOnBehalf = $null
        } else {
            $SendOnBehalf = $JsonParameters.PSobject.Properties["SendOnBehalf"].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 "GroupNameAndDescription"))) { #optional property not found
            $GroupNameAndDescription = $null
        } else {
            $GroupNameAndDescription = $JsonParameters.PSobject.Properties["GroupNameAndDescription"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "GroupContact"))) { #optional property not found
            $GroupContact = $null
        } else {
            $GroupContact = $JsonParameters.PSobject.Properties["GroupContact"].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 "Tenant"))) { #optional property not found
            $Tenant = $null
        } else {
            $Tenant = $JsonParameters.PSobject.Properties["Tenant"].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 "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]@{
            "ContactInformation" = ${ContactInformation}
            "MultiGeoLocationSetting" = ${MultiGeoLocationSetting}
            "LanguageDataTime" = ${LanguageDataTime}
            "TimeZone" = ${TimeZone}
            "EmailForwarding" = ${EmailForwarding}
            "AutoMappingSettings" = ${AutoMappingSettings}
            "SentItems" = ${SentItems}
            "AutomaticReplies" = ${AutomaticReplies}
            "Policies" = ${Policies}
            "GroupEmailAddress" = ${GroupEmailAddress}
            "GlobalAddressList" = ${GlobalAddressList}
            "GroupEmail" = ${GroupEmail}
            "SendAs" = ${SendAs}
            "SendOnBehalf" = ${SendOnBehalf}
            "OfficeTenantId" = ${OfficeTenantId}
            "GroupNameAndDescription" = ${GroupNameAndDescription}
            "GroupContact" = ${GroupContact}
            "Owners" = ${Owners}
            "Members" = ${Members}
            "Tenant" = ${Tenant}
            "ElectionProfile" = ${ElectionProfile}
            "RenewalProfile" = ${RenewalProfile}
            "GalleryType" = ${GalleryType}
            "GalleryInternalName" = ${GalleryInternalName}
            "GalleryMetadata" = ${GalleryMetadata}
        }

        return $PSO
    }

}