Skip to content

disable_organization_admin_account

disable_organization_admin_account(
    *, config_overrides: Optional[DetectiveClientConfig] = None
) -> None

Removes the Detective administrator account in the current Region. Deletes the organization behavior graph.

Can only be called by the organization management account.

Removing the Detective administrator account does not affect the delegated administrator account for Detective in Organizations.

To remove the delegated administrator account in Organizations, use the Organizations API. Removing the delegated administrator account also removes the Detective administrator account in all Regions, except for Regions where the Detective administrator account is the organization management account.

Raises:

Source code in docs_src/capo_detective/_services/detective.py
def disable_organization_admin_account(
    self, *, config_overrides: Optional[DetectiveClientConfig] = None
) -> None:
    """<p>Removes the Detective administrator account in the current Region. Deletes the organization behavior graph.</p> <p>Can only be called by the organization management account.</p> <p>Removing the Detective administrator account does not affect the delegated administrator account for Detective in Organizations.</p> <p>To remove the delegated administrator account in Organizations, use the Organizations API. Removing the delegated administrator account also removes the Detective administrator account in all Regions, except for Regions where the Detective administrator account is the organization management account.</p>

    Raises:
        capo_detective.errors.access_denied_exception.AccessDeniedException: <p>The request issuer does not have permission to access this resource or perform this operation.</p>
        capo_detective.errors.internal_server_exception.InternalServerException: <p>The request was valid but failed because of a problem with the service.</p>
        capo_detective.errors.too_many_requests_exception.TooManyRequestsException: <p>The request cannot be completed because too many other requests are occurring at the same time.</p>
        capo_detective.errors.validation_exception.ValidationException: <p>The request parameters are invalid.</p>
        capo_detective.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(req: "OperationRequest[None]") -> OperationResponse[None]:
        import capo_detective._operations.amazon_detective.disable_organization_admin_account

        output, http_response = (
            capo_detective._operations.amazon_detective.disable_organization_admin_account.disable_organization_admin_account(
                req.options
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DisableOrganizationAdminAccount")
    )

    response = execute_pipeline(
        OperationRequest(input=None, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output