Public/Get-GCEmailsRoutes.ps1

<#
.SYNOPSIS
    Retrieves a list of email routes for a domain.

.DESCRIPTION
    Returns a paginated list of email routes for the specified domain from Genesys Cloud.
    Uses the GET /api/v2/routing/email/domains/{domainName}/routes endpoint.

.PARAMETER DomainName
    The name of the email domain.

.PARAMETER PageSize
    The number of results per page. Defaults to 25.

.PARAMETER PageNumber
    The page number to retrieve. Defaults to 1.

.EXAMPLE
    Get-GCEmailsRoutes -DomainName 'example.com'

.NOTES
    Genesys Cloud API: GET /api/v2/routing/email/domains/{domainName}/routes
#>

function Get-GCEmailsRoutes {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory = $true)]
        [string]$DomainName,

        [Parameter()]
        [int]$PageSize = 25,

        [Parameter()]
        [int]$PageNumber = 1
    )

    $endpoint = "routing/email/domains/$DomainName/routes"
    $queryParams = @{
        pageSize   = $PageSize
        pageNumber = $PageNumber
    }

    return Invoke-GCApiRequest -Endpoint $endpoint -Method GET -QueryParameters $queryParams
}