Public/Set-GCAnalyticsDataRetentionSettings.ps1

<#
.SYNOPSIS
    Updates analytics data retention settings.

.DESCRIPTION
    Sets or updates the analytics data retention settings for the Genesys Cloud organization.
    Calls PUT /api/v2/analytics/dataretention/settings.

.PARAMETER Body
    The mandatory request body containing the data retention settings to apply.

.EXAMPLE
    $retentionBody = @{
        retentionDays = 90
        mediaDeleteDays = 30
        analyticsExportEnabled = $true
    }
    Set-GCAnalyticsDataRetentionSettings -Body $retentionBody

.NOTES
    Genesys Cloud API: PUT /api/v2/analytics/dataretention/settings
#>

function Set-GCAnalyticsDataRetentionSettings {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory = $true)]
        [object]$Body
    )

    $endpoint = "analytics/dataretention/settings"
    return Invoke-GCApiRequest -Endpoint $endpoint -Method PUT -Body $Body
}