deleteResourcePolicy method

Future<DeleteResourcePolicyResponse> deleteResourcePolicy({
  1. required String resourceArn,
  2. String? expectedRevisionId,
})

Removes the resource policy associated with a knowledge base. After deletion, other AWS accounts can no longer access the knowledge base using cross-account permissions.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter resourceArn : The Amazon Resource Name (ARN) of the knowledge base to remove the resource policy from.

Parameter expectedRevisionId : The expected revision identifier of the resource policy. Use this to prevent conflicts when multiple users update the same policy concurrently.

Implementation

Future<DeleteResourcePolicyResponse> deleteResourcePolicy({
  required String resourceArn,
  String? expectedRevisionId,
}) async {
  final $query = <String, List<String>>{
    if (expectedRevisionId != null)
      'expectedRevisionId': [expectedRevisionId],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri: '/resourcepolicy/${Uri.encodeComponent(resourceArn)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return DeleteResourcePolicyResponse.fromJson(response);
}