Public/Set-GCUserCallForwarding.ps1

<#
.SYNOPSIS
    Sets the call forwarding settings for a user in Genesys Cloud.

.DESCRIPTION
    Replaces the call forwarding configuration for a specific user using a PUT request.
    API Endpoint: PUT /api/v2/users/{userId}/callforwarding

.PARAMETER UserId
    The unique identifier of the user.

.PARAMETER Body
    The request body containing the call forwarding settings. Accepts a hashtable or JSON string.

.EXAMPLE
    Set-GCUserCallForwarding -UserId '12345678-1234-1234-1234-123456789012' -Body @{ enabled = $true; phoneNumber = '+15551234567' }
    Sets call forwarding for the specified user.

.NOTES
    Genesys Cloud API: PUT /api/v2/users/{userId}/callforwarding
#>

function Set-GCUserCallForwarding {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory = $true)]
        [string]$UserId,

        [Parameter(Mandatory = $true)]
        [object]$Body
    )

    $endpoint = "users/$UserId/callforwarding"
    return Invoke-GCApiRequest -Endpoint $endpoint -Method PUT -Body $Body
}