updateDataTableMetadata method

Future<UpdateDataTableMetadataResponse> updateDataTableMetadata({
  1. required String dataTableId,
  2. required String instanceId,
  3. required String name,
  4. required String timeZone,
  5. required DataTableLockLevel valueLockLevel,
  6. String? description,
})

Updates the metadata properties of a data table. Accepts all fields similar to CreateDataTable, except for fields and tags. There are no other granular update endpoints. It does not act as a patch operation - all properties must be provided or defaults will be used. Fields follow the same requirements as CreateDataTable.

May throw AccessDeniedException. May throw ConflictException. May throw DuplicateResourceException. May throw InternalServiceException. May throw InvalidParameterException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter dataTableId : The unique identifier for the data table. Must also accept the table ARN with or without a version alias. If the version is provided as part of the identifier or ARN, the version must be $LATEST. Providing any other alias fails with an error.

Parameter instanceId : The unique identifier for the Amazon Connect instance.

Parameter name : The updated name for the data table. Must conform to Connect human readable string specification and have 1-127 characters. Must be unique for the instance using case-insensitive comparison.

Parameter timeZone : The updated IANA timezone identifier to use when resolving time based dynamic values.

Parameter valueLockLevel : The updated value lock level for the data table. One of DATA_TABLE, PRIMARY_VALUE, ATTRIBUTE, VALUE, and NONE.

Parameter description : The updated description for the data table. Must conform to Connect human readable string specification and have 0-250 characters.

Implementation

Future<UpdateDataTableMetadataResponse> updateDataTableMetadata({
  required String dataTableId,
  required String instanceId,
  required String name,
  required String timeZone,
  required DataTableLockLevel valueLockLevel,
  String? description,
}) async {
  final $payload = <String, dynamic>{
    'Name': name,
    'TimeZone': timeZone,
    'ValueLockLevel': valueLockLevel.value,
    if (description != null) 'Description': description,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/data-tables/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(dataTableId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateDataTableMetadataResponse.fromJson(response);
}