Public/Get-GCUserPresence.ps1

<#
.SYNOPSIS
    Retrieves the presence of a user from a specific source in Genesys Cloud.

.DESCRIPTION
    Queries the Genesys Cloud API to retrieve the presence status of a specific user
    from a given presence source.
    API Endpoint: GET /api/v2/users/{userId}/presences/{sourceId}

.PARAMETER UserId
    The unique identifier of the user.

.PARAMETER SourceId
    The presence source identifier (e.g., 'PURECLOUD', 'MICROSOFT').

.EXAMPLE
    Get-GCUserPresence -UserId '12345678-1234-1234-1234-123456789012' -SourceId 'PURECLOUD'
    Retrieves the Genesys Cloud presence for the specified user.

.NOTES
    Genesys Cloud API: GET /api/v2/users/{userId}/presences/{sourceId}
#>

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

        [Parameter(Mandatory = $true)]
        [string]$SourceId
    )

    $endpoint = "users/$UserId/presences/$SourceId"
    return Invoke-GCApiRequest -Endpoint $endpoint -Method GET
}