deleteResourcePolicy method
Removes an existing policy from a bot or bot alias. If the resource doesn't have a policy attached, Amazon Lex returns an exception.
May throw InternalServerException.
May throw PreconditionFailedException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter resourceArn :
The Amazon Resource Name (ARN) of the bot or bot alias that has the
resource policy attached.
Parameter expectedRevisionId :
The identifier of the revision to edit. If this ID doesn't match the
current revision number, Amazon Lex returns an exception
If you don't specify a revision ID, Amazon Lex will delete the current policy.
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: '/policy/${Uri.encodeComponent(resourceArn)}',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return DeleteResourcePolicyResponse.fromJson(response);
}