Public/Get-GCOutboundCallAnalysisResponseSets.ps1

<#
.SYNOPSIS
    Retrieves a list of outbound call analysis response sets from Genesys Cloud.

.DESCRIPTION
    Queries the Genesys Cloud API to retrieve a paginated list of outbound call analysis response sets.
    These define how the system responds to different call analysis results (e.g., answering machine, busy, etc.).
    Supports filtering by name and sorting options.
    API Endpoint: GET /api/v2/outbound/callanalysisresponsesets

.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'.

.PARAMETER Name
    Filter call analysis response sets by name. Supports partial matching.

.EXAMPLE
    Get-GCOutboundCallAnalysisResponseSets
    Retrieves the first page of call analysis response sets with default page size.

.EXAMPLE
    Get-GCOutboundCallAnalysisResponseSets -Name 'Default Response Set' -PageSize 50
    Retrieves call analysis response sets matching the name 'Default Response Set'.

.NOTES
    Genesys Cloud API: GET /api/v2/outbound/callanalysisresponsesets
#>

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

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

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

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

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

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

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

    $endpoint = "outbound/callanalysisresponsesets"
    return Invoke-GCApiRequest -Endpoint $endpoint -Method GET -QueryParameters $queryParams
}