deleteAccessPolicy method

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

Deletes an OpenSearch Serverless access policy. For more information, see Data access control for Amazon OpenSearch Serverless.

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 policy.

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

Implementation

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