updateDataTableAttribute method
Updates all properties for an attribute using all properties from CreateDataTableAttribute. There are no other granular update endpoints. It does not act as a patch operation - all properties must be provided. System managed attributes are not mutable by customers. Changing an attribute's validation does not invalidate existing values since validation only runs when values are created or updated.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServiceException.
May throw InvalidParameterException.
May throw InvalidRequestException.
May throw LimitExceededException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
Parameter attributeName :
The current name of the attribute to update. Used as an identifier since
attribute names can be changed.
Parameter dataTableId :
The unique identifier for the data table. Must also accept the table ARN
with or without a version alias.
Parameter instanceId :
The unique identifier for the Amazon Connect instance.
Parameter name :
The new name for the attribute. Must conform to Connect human readable
string specification and be unique within the data table.
Parameter valueType :
The updated value type for the attribute. When changing value types,
existing values are not deleted but may return default values if
incompatible.
Parameter description :
The updated description for the attribute.
Parameter primary :
Whether the attribute should be treated as a primary key. Converting to
primary attribute requires existing values to maintain uniqueness.
Parameter validation :
The updated validation rules for the attribute. Changes do not affect
existing values until they are modified.
Implementation
Future<UpdateDataTableAttributeResponse> updateDataTableAttribute({
required String attributeName,
required String dataTableId,
required String instanceId,
required String name,
required DataTableAttributeValueType valueType,
String? description,
bool? primary,
Validation? validation,
}) async {
final $payload = <String, dynamic>{
'Name': name,
'ValueType': valueType.value,
if (description != null) 'Description': description,
if (primary != null) 'Primary': primary,
if (validation != null) 'Validation': validation,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/data-tables/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(dataTableId)}/attributes/${Uri.encodeComponent(attributeName)}',
exceptionFnMap: _exceptionFns,
);
return UpdateDataTableAttributeResponse.fromJson(response);
}