Deletes an access control rule for the specified WorkMail organization.
Deleting already deleted and non-existing rules does not produce an error. In those cases, the service sends back an HTTP 200 response with an empty HTTP body.
Parameters:
Raises:
Source code in docs_src/capo_workmail/_services/work_mail.py
| def delete_access_control_rule(
self,
organization_id: "capo_workmail.types.organization_id.OrganizationId",
name: "capo_workmail.types.access_control_rule_name.AccessControlRuleName",
*,
config_overrides: Optional[WorkMailClientConfig] = None,
) -> "capo_workmail.types.delete_access_control_rule_response.DeleteAccessControlRuleResponse":
"""<p>Deletes an access control rule for the specified WorkMail organization.</p> <note> <p>Deleting already deleted and non-existing rules does not produce an error. In those cases, the service sends back an HTTP 200 response with an empty HTTP body.</p> </note>
Args:
organization_id: <p>The identifier for the organization.</p>
name: <p>The name of the access control rule.</p>
Raises:
capo_workmail.errors.organization_not_found_exception.OrganizationNotFoundException: <p>An operation received a valid organization identifier that either doesn't belong or exist in the system.</p>
capo_workmail.errors.organization_state_exception.OrganizationStateException: <p>The organization must have a valid state to perform certain operations on the organization or its members.</p>
capo_workmail.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_workmail.types.delete_access_control_rule_request.DeleteAccessControlRuleRequest]",
) -> OperationResponse[
"capo_workmail.types.delete_access_control_rule_response.DeleteAccessControlRuleResponse"
]:
import capo_workmail._operations.work_mail_service.delete_access_control_rule
output, http_response = (
capo_workmail._operations.work_mail_service.delete_access_control_rule.delete_access_control_rule(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteAccessControlRule")
)
input_: capo_workmail.types.delete_access_control_rule_request.DeleteAccessControlRuleRequest = {
"organization_id": organization_id,
"name": name,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|