deleteDataRepositoryAssociation method

Future<DeleteDataRepositoryAssociationResponse> deleteDataRepositoryAssociation({
  1. required String associationId,
  2. String? clientRequestToken,
  3. bool? deleteDataInFileSystem,
})

Deletes a data repository association on an Amazon FSx for Lustre file system. Deleting the data repository association unlinks the file system from the Amazon S3 bucket. When deleting a data repository association, you have the option of deleting the data in the file system that corresponds to the data repository association. Data repository associations are supported on all FSx for Lustre 2.12 and 2.15 file systems, excluding scratch_1 deployment type.

May throw BadRequest. May throw DataRepositoryAssociationNotFound. May throw IncompatibleParameterError. May throw InternalServerError. May throw ServiceLimitExceeded.

Parameter associationId : The ID of the data repository association that you want to delete.

Parameter deleteDataInFileSystem : Set to true to delete the data in the file system that corresponds to the data repository association.

Implementation

Future<DeleteDataRepositoryAssociationResponse>
    deleteDataRepositoryAssociation({
  required String associationId,
  String? clientRequestToken,
  bool? deleteDataInFileSystem,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'AWSSimbaAPIService_v20180301.DeleteDataRepositoryAssociation'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AssociationId': associationId,
      'ClientRequestToken':
          clientRequestToken ?? _s.generateIdempotencyToken(),
      if (deleteDataInFileSystem != null)
        'DeleteDataInFileSystem': deleteDataInFileSystem,
    },
  );

  return DeleteDataRepositoryAssociationResponse.fromJson(jsonResponse.body);
}