Skip to content

disassociate_members

disassociate_members(
    *,
    config_overrides: Optional[SecurityHubClientConfig] = None,
    account_ids: Optional[AccountIdList] = None,
) -> DisassociateMembersResponse

Disassociates the specified member accounts from the associated administrator account.

Can be used to disassociate both accounts that are managed using Organizations and accounts that were invited manually.

Parameters:

  • account_ids (Optional[AccountIdList], default: None ) –

    The account IDs of the member accounts to disassociate from the administrator account.

Raises:

  • AccessDeniedException –

    You don't have permission to perform the action specified in the request.

  • 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 member accounts from administrator account The following example dissociates the specified member accounts from the associated administrator account.

>>> client.disassociate_members(account_ids=['123456789012', '111122223333'])
Source code in docs_src/capo_securityhub/_services/security_hub.py
def disassociate_members(
    self,
    *,
    config_overrides: Optional[SecurityHubClientConfig] = None,
    account_ids: Optional[
        "capo_securityhub.types.account_id_list.AccountIdList"
    ] = None,
) -> "capo_securityhub.types.disassociate_members_response.DisassociateMembersResponse":
    """<p>Disassociates the specified member accounts from the associated administrator account.</p> <p>Can be used to disassociate both accounts that are managed using Organizations and accounts that were invited manually.</p>

    Args:
        account_ids: <p>The account IDs of the member accounts to disassociate from the administrator account.</p>

    Raises:
        capo_securityhub.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action specified in the request.</p>
        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 member accounts from administrator account
        The following example dissociates the specified member accounts from the associated administrator account.

        >>> client.disassociate_members(account_ids=['123456789012', '111122223333'])
    """

    def _handler(
        req: "OperationRequest[capo_securityhub.types.disassociate_members_request.DisassociateMembersRequest]",
    ) -> OperationResponse[
        "capo_securityhub.types.disassociate_members_response.DisassociateMembersResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.disassociate_members

        output, http_response = (
            capo_securityhub._operations.security_hub_api_service.disassociate_members.disassociate_members(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DisassociateMembers")
    )
    input_: capo_securityhub.types.disassociate_members_request.DisassociateMembersRequest = {}
    if account_ids is not None:
        input_["account_ids"] = account_ids

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