deleteCollectionGroup method

Future<void> deleteCollectionGroup({
  1. required String id,
  2. String? clientToken,
})

Deletes a collection group. You can only delete empty collection groups that contain no collections. For more information, see Creating and managing Amazon OpenSearch Serverless collections.

May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter id : The unique identifier of the collection group to delete.

Parameter clientToken : Unique, case-sensitive identifier to ensure idempotency of the request.

Implementation

Future<void> deleteCollectionGroup({
  required String id,
  String? clientToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'OpenSearchServerless.DeleteCollectionGroup'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'id': id,
      'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    },
  );
}