Public/Set-GCFlow.ps1

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

.DESCRIPTION
    Updates an architect flow by its unique identifier using the Genesys Cloud API.
    The body should contain the complete updated flow definition.
    API Endpoint: PUT /api/v2/flows/{flowId}

.PARAMETER FlowId
    The unique identifier of the flow to update.

.PARAMETER Body
    The updated flow definition object.

.EXAMPLE
    $flowBody = @{ name = 'Updated Flow'; type = 'inboundcall'; description = 'Updated description' }
    Set-GCFlow -FlowId 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' -Body $flowBody
    Updates the specified flow with the new definition.

.NOTES
    Genesys Cloud API: PUT /api/v2/flows/{flowId}
#>

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

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

    $endpoint = "flows/$FlowId"
    return Invoke-GCApiRequest -Endpoint $endpoint -Method PUT -Body $Body
}