updateCollectionGroup method

Future<UpdateCollectionGroupResponse> updateCollectionGroup({
  1. required String id,
  2. CollectionGroupCapacityLimits? capacityLimits,
  3. String? clientToken,
  4. String? description,
})

Updates the description and capacity limits of a collection group.

May throw ConflictException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ValidationException.

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

Parameter capacityLimits : Updated capacity limits for the collection group, in OpenSearch Compute Units (OCUs).

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

Parameter description : A new description for the collection group.

Implementation

Future<UpdateCollectionGroupResponse> updateCollectionGroup({
  required String id,
  CollectionGroupCapacityLimits? capacityLimits,
  String? clientToken,
  String? description,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'OpenSearchServerless.UpdateCollectionGroup'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'id': id,
      if (capacityLimits != null) 'capacityLimits': capacityLimits,
      'clientToken': clientToken ?? _s.generateIdempotencyToken(),
      if (description != null) 'description': description,
    },
  );

  return UpdateCollectionGroupResponse.fromJson(jsonResponse.body);
}