Public/Get-GCWfmSchedules.ps1

<#
.SYNOPSIS
    Retrieves a list of schedules for a management unit from Genesys Cloud.

.DESCRIPTION
    Queries the Genesys Cloud API to retrieve a paginated list of schedules
    associated with a specific management unit.
    API Endpoint: GET /api/v2/workforcemanagement/managementunits/{managementUnitId}/schedules

.PARAMETER ManagementUnitId
    The unique identifier of the management unit whose schedules to retrieve.

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

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

.EXAMPLE
    Get-GCWfmSchedules -ManagementUnitId 'abc123-def456'
    Retrieves the first page of schedules for the specified management unit.

.EXAMPLE
    Get-GCWfmSchedules -ManagementUnitId 'abc123-def456' -PageSize 50 -PageNumber 2
    Retrieves the second page of schedules with 50 results per page.

.NOTES
    Genesys Cloud API: GET /api/v2/workforcemanagement/managementunits/{managementUnitId}/schedules
#>

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

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

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

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

    $endpoint = "workforcemanagement/managementunits/$ManagementUnitId/schedules"
    return Invoke-GCApiRequest -Endpoint $endpoint -Method GET -QueryParameters $queryParams
}