Public/Set-GCTelephonyPhone.ps1

<#
.SYNOPSIS
    Updates an existing phone in Genesys Cloud.

.DESCRIPTION
    Sends a PUT request to the Genesys Cloud API to replace the configuration
    of a specific phone device.
    API Endpoint: PUT /api/v2/telephony/providers/edges/phones/{phoneId}

.PARAMETER PhoneId
    The unique identifier of the phone to update.

.PARAMETER Body
    The request body containing the full updated phone configuration.
    Should conform to the Genesys Cloud phone schema.

.EXAMPLE
    $phoneBody = @{
        name = 'Lobby Phone - Updated'
        site = @{ id = 'site-123' }
        phoneBaseSettings = @{ id = 'phone-base-456' }
        version = 2
    }
    Set-GCTelephonyPhone -PhoneId 'phone-abc123' -Body $phoneBody
    Updates the specified phone with the new configuration.

.NOTES
    Genesys Cloud API: PUT /api/v2/telephony/providers/edges/phones/{phoneId}
#>

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

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

    $endpoint = "telephony/providers/edges/phones/$PhoneId"
    return Invoke-GCApiRequest -Endpoint $endpoint -Method PUT -Body $Body
}