Skip to content

disassociate_from_administrator_account async

disassociate_from_administrator_account(
    *, config_overrides: Optional[AsyncSecurityHubClientConfig] = None
) -> DisassociateFromAdministratorAccountResponse

Disassociates the current Security Hub CSPM member account from the associated administrator account.

This operation is only used by accounts that are not part of an organization. For organization accounts, only the administrator account can disassociate a member account.

Raises:

  • InternalException –

    Internal server error.

  • InvalidAccessException –

    The account doesn't have permission to perform this action.

  • InvalidInputException –

    The request was rejected because you supplied an invalid or out-of-range value for an input parameter.

  • LimitExceededException –

    The request was rejected because it attempted to create resources beyond the current Amazon Web Services account or throttling limits. The error code describes the limit exceeded.

  • ResourceNotFoundException –

    The request was rejected because we can't find the specified resource.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To disassociate requesting account from administrator account The following example dissociates the requesting account from its associated administrator account.

>>> await client.disassociate_from_administrator_account()
Source code in docs_src/capo_securityhub/_services/async_security_hub.py
async def disassociate_from_administrator_account(
    self, *, config_overrides: Optional[AsyncSecurityHubClientConfig] = None
) -> "capo_securityhub.types.disassociate_from_administrator_account_response.DisassociateFromAdministratorAccountResponse":
    """<p>Disassociates the current Security Hub CSPM member account from the associated administrator account.</p> <p>This operation is only used by accounts that are not part of an organization. For organization accounts, only the administrator account can disassociate a member account.</p>

    Raises:
        capo_securityhub.errors.internal_exception.InternalException: <p>Internal server error.</p>
        capo_securityhub.errors.invalid_access_exception.InvalidAccessException: <p>The account doesn't have permission to perform this action.</p>
        capo_securityhub.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because you supplied an invalid or out-of-range value for an input parameter.</p>
        capo_securityhub.errors.limit_exceeded_exception.LimitExceededException: <p>The request was rejected because it attempted to create resources beyond the current Amazon Web Services account or throttling limits. The error code describes the limit exceeded.</p>
        capo_securityhub.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was rejected because we can't find the specified resource.</p>
        capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To disassociate requesting account from administrator account
        The following example dissociates the requesting account from its associated administrator account.

        >>> await client.disassociate_from_administrator_account()
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityhub.types.disassociate_from_administrator_account_request.DisassociateFromAdministratorAccountRequest]",
    ) -> AsyncOperationResponse[
        "capo_securityhub.types.disassociate_from_administrator_account_response.DisassociateFromAdministratorAccountResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.disassociate_from_administrator_account

        (
            output,
            http_response,
        ) = await capo_securityhub._operations.security_hub_api_service.disassociate_from_administrator_account.async_disassociate_from_administrator_account(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DisassociateFromAdministratorAccount")
    )
    input_: capo_securityhub.types.disassociate_from_administrator_account_request.DisassociateFromAdministratorAccountRequest = {}

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output