Public/ContactCustomFields/Update-AspireContactCustomField.ps1

<#
.SYNOPSIS
    Updates an existing contact custom field in the Aspire API.
.DESCRIPTION
    Uses Invoke-AspireRequest to perform a PUT request to the /ContactCustomFields endpoint.
.PARAMETER ContactCustomFieldValueID
    The ID of the contact custom field value to update (required).
.PARAMETER ColumnValue
    Optional value for the custom field.
.OUTPUTS
    The response from the API containing the updated custom field ID.
.EXAMPLE
    Update-AspireContactCustomField -ContactCustomFieldValueID 1 -ColumnValue "New Value"
#>

function Update-AspireContactCustomField {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory = $true)]
        [int]$ContactCustomFieldValueID,
        [string]$ColumnValue = $null
    )

    $body = @{
        ContactCustomFieldValueID = $ContactCustomFieldValueID
    }

    if ($ColumnValue) {
        $body.ColumnValue = $ColumnValue
    }

    return Invoke-AspireRequest -Method PUT -Path "/ContactCustomFields" -Body $body -ApiVersion $null
}