deleteLifecyclePolicy method

Future<void> deleteLifecyclePolicy({
  1. required String name,
  2. required LifecyclePolicyType type,
  3. String? clientToken,
})

Deletes an OpenSearch Serverless lifecycle policy. For more information, see Deleting data lifecycle policies.

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

Parameter name : The name of the policy to delete.

Parameter type : The type of lifecycle policy.

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

Implementation

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