Model/CreateEquipmentMailboxGallery.ps1

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

<#
CreateEquipmentMailboxGallery<PSCustomObject>
#>


function New-CreateEquipmentMailboxGallery {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${OfficeTenantId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Contacts},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${FullAccessUsers},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${EmailAddress},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${GlobalAddressList},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SendAs},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SendOnBehalf},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${MultiGeoLocationSetting},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${AddressBookPolicy},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Alias},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${BookingDelegateSetting},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${BookingOption},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Capacity},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ContactInformation},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Company},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Department},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${DisableAccountSetting},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${MailTip},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Tenant},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${GalleryType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${GalleryInternalName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${GalleryMetadata}
    )

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

        
        $PSO = [PSCustomObject]@{
            "OfficeTenantId" = ${OfficeTenantId}
            "Name" = ${Name}
            "Contacts" = ${Contacts}
            "FullAccessUsers" = ${FullAccessUsers}
            "EmailAddress" = ${EmailAddress}
            "GlobalAddressList" = ${GlobalAddressList}
            "SendAs" = ${SendAs}
            "SendOnBehalf" = ${SendOnBehalf}
            "MultiGeoLocationSetting" = ${MultiGeoLocationSetting}
            "AddressBookPolicy" = ${AddressBookPolicy}
            "Alias" = ${Alias}
            "BookingDelegateSetting" = ${BookingDelegateSetting}
            "BookingOption" = ${BookingOption}
            "Capacity" = ${Capacity}
            "ContactInformation" = ${ContactInformation}
            "Company" = ${Company}
            "Department" = ${Department}
            "DisableAccountSetting" = ${DisableAccountSetting}
            "MailTip" = ${MailTip}
            "Tenant" = ${Tenant}
            "GalleryType" = ${GalleryType}
            "GalleryInternalName" = ${GalleryInternalName}
            "GalleryMetadata" = ${GalleryMetadata}
        }

        return $PSO
    }
}

<#
CreateEquipmentMailboxGallery<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in CreateEquipmentMailboxGallery
        $AllProperties = $("OfficeTenantId", "Name", "Contacts", "FullAccessUsers", "EmailAddress", "GlobalAddressList", "MailboxEmail", "MailboxName", "SendAs", "SendOnBehalf", "MultiGeoLocationSetting", "AddressBookPolicy", "Alias", "BookingDelegateSetting", "BookingOption", "Capacity", "ContactInformation", "Company", "Department", "DisableAccountSetting", "MailTip", "Tenant", "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 "Name"))) { #optional property not found
            $Name = $null
        } else {
            $Name = $JsonParameters.PSobject.Properties["Name"].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 "FullAccessUsers"))) { #optional property not found
            $FullAccessUsers = $null
        } else {
            $FullAccessUsers = $JsonParameters.PSobject.Properties["FullAccessUsers"].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 "GlobalAddressList"))) { #optional property not found
            $GlobalAddressList = $null
        } else {
            $GlobalAddressList = $JsonParameters.PSobject.Properties["GlobalAddressList"].value
        }

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

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

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

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

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

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "MailTip"))) { #optional property not found
            $MailTip = $null
        } else {
            $MailTip = $JsonParameters.PSobject.Properties["MailTip"].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 "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}
            "Name" = ${Name}
            "Contacts" = ${Contacts}
            "FullAccessUsers" = ${FullAccessUsers}
            "EmailAddress" = ${EmailAddress}
            "GlobalAddressList" = ${GlobalAddressList}
            "MailboxEmail" = ${MailboxEmail}
            "MailboxName" = ${MailboxName}
            "SendAs" = ${SendAs}
            "SendOnBehalf" = ${SendOnBehalf}
            "MultiGeoLocationSetting" = ${MultiGeoLocationSetting}
            "AddressBookPolicy" = ${AddressBookPolicy}
            "Alias" = ${Alias}
            "BookingDelegateSetting" = ${BookingDelegateSetting}
            "BookingOption" = ${BookingOption}
            "Capacity" = ${Capacity}
            "ContactInformation" = ${ContactInformation}
            "Company" = ${Company}
            "Department" = ${Department}
            "DisableAccountSetting" = ${DisableAccountSetting}
            "MailTip" = ${MailTip}
            "Tenant" = ${Tenant}
            "GalleryType" = ${GalleryType}
            "GalleryInternalName" = ${GalleryInternalName}
            "GalleryMetadata" = ${GalleryMetadata}
        }

        return $PSO
    }

}