updateTable method

Future<UpdateTableResponse> updateTable({
  1. required String databaseName,
  2. required String tableName,
  3. MagneticStoreWriteProperties? magneticStoreWriteProperties,
  4. RetentionProperties? retentionProperties,
  5. Schema? schema,
})

Modifies the retention duration of the memory store and magnetic store for your Timestream table. Note that the change in retention duration takes effect immediately. For example, if the retention period of the memory store was initially set to 2 hours and then changed to 24 hours, the memory store will be capable of holding 24 hours of data, but will be populated with 24 hours of data 22 hours after this change was made. Timestream does not retrieve data from the magnetic store to populate the memory store.

See code sample for details.

May throw AccessDeniedException. May throw InternalServerException. May throw InvalidEndpointException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter databaseName : The name of the Timestream database.

Parameter tableName : The name of the Timestream table.

Parameter magneticStoreWriteProperties : Contains properties to set on the table when enabling magnetic store writes.

Parameter retentionProperties : The retention duration of the memory store and the magnetic store.

Parameter schema : The schema of the table.

Implementation

Future<UpdateTableResponse> updateTable({
  required String databaseName,
  required String tableName,
  MagneticStoreWriteProperties? magneticStoreWriteProperties,
  RetentionProperties? retentionProperties,
  Schema? schema,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'Timestream_20181101.UpdateTable'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DatabaseName': databaseName,
      'TableName': tableName,
      if (magneticStoreWriteProperties != null)
        'MagneticStoreWriteProperties': magneticStoreWriteProperties,
      if (retentionProperties != null)
        'RetentionProperties': retentionProperties,
      if (schema != null) 'Schema': schema,
    },
  );

  return UpdateTableResponse.fromJson(jsonResponse.body);
}