Disables a custom detection rule by deleting its association. This operation is idempotent.
Parameters:
-
rule_id
(RuleId)
–
The unique identifier for the custom detection rule.
-
association_id
(AssociationId)
–
The unique identifier for the association to delete.
Raises:
Source code in docs_src/capo_guardduty/_services/async_guard_duty.py
| async def delete_custom_detection_rule_association(
self,
rule_id: "capo_guardduty.types.rule_id.RuleId",
association_id: "capo_guardduty.types.association_id.AssociationId",
*,
config_overrides: Optional[AsyncGuardDutyClientConfig] = None,
) -> "capo_guardduty.types.delete_custom_detection_rule_association_response.DeleteCustomDetectionRuleAssociationResponse":
"""<p>Disables a custom detection rule by deleting its association. This operation is idempotent.</p>
Args:
rule_id: <p>The unique identifier for the custom detection rule.</p>
association_id: <p>The unique identifier for the association to delete.</p>
Raises:
capo_guardduty.errors.access_denied_exception.AccessDeniedException: <p>An access denied exception object.</p>
capo_guardduty.errors.bad_request_exception.BadRequestException: <p>A bad request exception object.</p>
capo_guardduty.errors.internal_server_error_exception.InternalServerErrorException: <p>An internal server error exception object.</p>
capo_guardduty.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource can't be found.</p>
capo_guardduty.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_guardduty.types.delete_custom_detection_rule_association_request.DeleteCustomDetectionRuleAssociationRequest]",
) -> AsyncOperationResponse[
"capo_guardduty.types.delete_custom_detection_rule_association_response.DeleteCustomDetectionRuleAssociationResponse"
]:
import capo_guardduty._operations.guard_duty_api_service.delete_custom_detection_rule_association
(
output,
http_response,
) = await capo_guardduty._operations.guard_duty_api_service.delete_custom_detection_rule_association.async_delete_custom_detection_rule_association(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteCustomDetectionRuleAssociation")
)
input_: capo_guardduty.types.delete_custom_detection_rule_association_request.DeleteCustomDetectionRuleAssociationRequest = {
"rule_id": rule_id,
"association_id": association_id,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|