Public/Remove-GCRoutingQueue.ps1

<#
.SYNOPSIS
    Deletes a routing queue from Genesys Cloud.

.DESCRIPTION
    Removes a routing queue from Genesys Cloud by sending a DELETE request.
    Optionally supports force deletion to remove the queue even if it has active members.
    API Endpoint: DELETE /api/v2/routing/queues/{queueId}

.PARAMETER QueueId
    The unique identifier of the routing queue to delete.

.PARAMETER ForceDelete
    When set to $true, forces deletion of the queue even if it has active members.

.EXAMPLE
    Remove-GCRoutingQueue -QueueId '12345678-1234-1234-1234-123456789012'
    Deletes the routing queue with the specified ID.

.EXAMPLE
    Remove-GCRoutingQueue -QueueId '12345678-1234-1234-1234-123456789012' -ForceDelete $true
    Force deletes the routing queue even if it has active members.

.NOTES
    Genesys Cloud API: DELETE /api/v2/routing/queues/{queueId}
#>

function Remove-GCRoutingQueue {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory = $true)]
        [string]$QueueId,

        [Parameter(Mandatory = $false)]
        [bool]$ForceDelete
    )

    $queryParams = @{}
    if ($PSBoundParameters.ContainsKey('ForceDelete')) { $queryParams['forceDelete'] = $ForceDelete }

    $endpoint = "routing/queues/$QueueId"
    return Invoke-GCApiRequest -Endpoint $endpoint -Method DELETE -QueryParameters $queryParams
}