Public/Set-GCAuthorizationRole.ps1

<#
.SYNOPSIS
    Updates an existing authorization role.

.DESCRIPTION
    Updates the specified authorization role in Genesys Cloud.
    Uses the PUT /api/v2/authorization/roles/{roleId} endpoint.

.PARAMETER RoleId
    The unique identifier of the role to update.

.PARAMETER Body
    The updated role definition object.

.EXAMPLE
    $roleBody = @{ name = 'Updated Role'; description = 'Updated description' }
    Set-GCAuthorizationRole -RoleId 'a1b2c3d4-e5f6-7890-abcd-ef1234567890' -Body $roleBody

.NOTES
    Genesys Cloud API: PUT /api/v2/authorization/roles/{roleId}
#>

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

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

    $endpoint = "authorization/roles/$RoleId"
    return Invoke-GCApiRequest -Endpoint $endpoint -Method PUT -Body $Body
}