| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 | [role="xpack"][[java-rest-high-security-delete-role-mapping]]=== Delete Role Mapping API[[java-rest-high-security-delete-role-mapping-execution]]==== ExecutionDeletion of a role mapping can be performed using the `security().deleteRoleMapping()`method:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests}/SecurityDocumentationIT.java[delete-role-mapping-execute]--------------------------------------------------[[java-rest-high-security-delete-role-mapping-response]]==== ResponseThe returned `DeleteRoleMappingResponse` contains a single field, `found`. If the mappingis successfully found and deleted, found is set to true. Otherwise, found is set to false.["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests}/SecurityDocumentationIT.java[delete-role-mapping-response]--------------------------------------------------<1> `found` is a boolean indicating whether the role mapping was found and deleted[[java-rest-high-security-delete-role-mapping-async]]==== Asynchronous ExecutionThis request can be executed asynchronously using the `security().deleteRoleMappingAsync()`method:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests}/SecurityDocumentationIT.java[delete-role-mapping-execute-async]--------------------------------------------------<1> The `DeleteRoleMappingRequest` to execute and the `ActionListener` to use whenthe execution completesThe asynchronous method does not block and returns immediately. Once the requesthas completed the `ActionListener` is called back using the `onResponse` methodif the execution successfully completed or using the `onFailure` method ifit failed.A typical listener for a `DeleteRoleMappingResponse` looks like:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests}/SecurityDocumentationIT.java[delete-role-mapping-execute-listener]--------------------------------------------------<1> Called when the execution is successfully completed. The response isprovided as an argument<2> Called in case of failure. The raised exception is provided as an argument
 |