Public/Set-GCUserGeolocation.ps1

<#
.SYNOPSIS
    Updates the geolocation of a user for a specific client in Genesys Cloud.

.DESCRIPTION
    Partially updates the geolocation information for a specific user and client
    combination using a PATCH request.
    API Endpoint: PATCH /api/v2/users/{userId}/geolocations/{clientId}

.PARAMETER UserId
    The unique identifier of the user.

.PARAMETER ClientId
    The client identifier for the geolocation source.

.PARAMETER Body
    The request body containing the geolocation update. Accepts a hashtable or JSON string.

.EXAMPLE
    Set-GCUserGeolocation -UserId '12345678-1234-1234-1234-123456789012' -ClientId 'client-id' -Body @{ latitude = 40.7128; longitude = -74.0060 }
    Updates the geolocation for the specified user and client.

.NOTES
    Genesys Cloud API: PATCH /api/v2/users/{userId}/geolocations/{clientId}
#>

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

        [Parameter(Mandatory = $true)]
        [string]$ClientId,

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

    $endpoint = "users/$UserId/geolocations/$ClientId"
    return Invoke-GCApiRequest -Endpoint $endpoint -Method PATCH -Body $Body
}