updateDatastore method

Future<void> updateDatastore({
  1. required String datastoreName,
  2. DatastoreStorage? datastoreStorage,
  3. FileFormatConfiguration? fileFormatConfiguration,
  4. RetentionPeriod? retentionPeriod,
})

Updates the settings of a data store.

May throw InvalidRequestException. May throw ResourceNotFoundException. May throw InternalFailureException. May throw ServiceUnavailableException. May throw ThrottlingException.

Parameter datastoreName : The name of the data store to be updated.

Parameter datastoreStorage : Where data store data is stored. You can choose one of serviceManagedS3 or customerManagedS3 storage. If not specified, the default isserviceManagedS3. You cannot change this storage option after the data store is created.

Parameter fileFormatConfiguration : Contains the configuration information of file formats. AWS IoT Analytics data stores support JSON and Parquet.

The default file format is JSON. You can specify only one format.

You can't change the file format after you create the data store.

Parameter retentionPeriod : How long, in days, message data is kept for the data store. The retention period cannot be updated if the data store's S3 storage is customer-managed.

Implementation

Future<void> updateDatastore({
  required String datastoreName,
  DatastoreStorage? datastoreStorage,
  FileFormatConfiguration? fileFormatConfiguration,
  RetentionPeriod? retentionPeriod,
}) async {
  ArgumentError.checkNotNull(datastoreName, 'datastoreName');
  _s.validateStringLength(
    'datastoreName',
    datastoreName,
    1,
    128,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    if (datastoreStorage != null) 'datastoreStorage': datastoreStorage,
    if (fileFormatConfiguration != null)
      'fileFormatConfiguration': fileFormatConfiguration,
    if (retentionPeriod != null) 'retentionPeriod': retentionPeriod,
  };
  await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/datastores/${Uri.encodeComponent(datastoreName)}',
    exceptionFnMap: _exceptionFns,
  );
}