Public/Get-GCTelephonyDidPools.ps1

<#
.SYNOPSIS
    Retrieves a list of DID pools from Genesys Cloud.

.DESCRIPTION
    Queries the Genesys Cloud API to retrieve a paginated list of DID (Direct Inward Dialing)
    pools configured in the telephony system.
    API Endpoint: GET /api/v2/telephony/providers/edges/didpools

.PARAMETER PageSize
    The number of results per page. Default is 25.

.PARAMETER PageNumber
    The page number to retrieve. Default is 1.

.PARAMETER SortBy
    The field to sort results by.

.PARAMETER SortOrder
    The sort order for results. Valid values are 'ascending' or 'descending'.

.EXAMPLE
    Get-GCTelephonyDidPools
    Retrieves the first page of DID pools with default page size.

.EXAMPLE
    Get-GCTelephonyDidPools -PageSize 50 -SortBy 'startPhoneNumber'
    Retrieves DID pools sorted by start phone number with 50 results per page.

.NOTES
    Genesys Cloud API: GET /api/v2/telephony/providers/edges/didpools
#>

function Get-GCTelephonyDidPools {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory = $false)]
        [int]$PageSize = 25,

        [Parameter(Mandatory = $false)]
        [int]$PageNumber = 1,

        [Parameter(Mandatory = $false)]
        [string]$SortBy,

        [Parameter(Mandatory = $false)]
        [string]$SortOrder
    )

    $queryParams = @{
        pageSize   = $PageSize
        pageNumber = $PageNumber
    }

    if ($SortBy) { $queryParams['sortBy'] = $SortBy }
    if ($SortOrder) { $queryParams['sortOrder'] = $SortOrder }

    $endpoint = "telephony/providers/edges/didpools"
    return Invoke-GCApiRequest -Endpoint $endpoint -Method GET -QueryParameters $queryParams
}