Skip to content

list_members async

list_members(
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    only_associated: Optional[Boolean] = None,
    max_results: Optional[CrossAccountMaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListMembersResponse

Lists details about all member accounts for the current Security Hub CSPM administrator account.

The results include both member accounts that belong to an organization and member accounts that were invited manually.

Parameters:

  • only_associated (Optional[Boolean], default: None ) –

    Specifies which member accounts to include in the response based on their relationship status with the administrator account. The default value is TRUE.

    If OnlyAssociated is set to TRUE, the response includes member accounts whose relationship status with the administrator account is set to ENABLED.

    If OnlyAssociated is set to FALSE, the response includes all existing member accounts.

  • max_results (Optional[CrossAccountMaxResults], default: None ) –

    The maximum number of items to return in the response.

  • next_token (Optional[NextToken], default: None ) –

    The token that is required for pagination. On your first call to the ListMembers operation, set the value of this parameter to NULL.

    For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.

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.

  • UnknownServiceError –

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

Source code in docs_src/capo_securityhub/_services/async_security_hub.py
async def list_members(
    self,
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    only_associated: Optional["capo_securityhub.types.boolean.Boolean"] = None,
    max_results: Optional[
        "capo_securityhub.types.cross_account_max_results.CrossAccountMaxResults"
    ] = None,
    next_token: Optional["capo_securityhub.types.next_token.NextToken"] = None,
) -> "capo_securityhub.types.list_members_response.ListMembersResponse":
    """<p>Lists details about all member accounts for the current Security Hub CSPM administrator account.</p> <p>The results include both member accounts that belong to an organization and member accounts that were invited manually.</p>

    Args:
        only_associated: <p>Specifies which member accounts to include in the response based on their relationship status with the administrator account. The default value is <code>TRUE</code>.</p> <p>If <code>OnlyAssociated</code> is set to <code>TRUE</code>, the response includes member accounts whose relationship status with the administrator account is set to <code>ENABLED</code>.</p> <p>If <code>OnlyAssociated</code> is set to <code>FALSE</code>, the response includes all existing member accounts. </p>
        max_results: <p>The maximum number of items to return in the response. </p>
        next_token: <p>The token that is required for pagination. On your first call to the <code>ListMembers</code> operation, set the value of this parameter to <code>NULL</code>.</p> <p>For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.</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.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityhub.types.list_members_request.ListMembersRequest]",
    ) -> AsyncOperationResponse[
        "capo_securityhub.types.list_members_response.ListMembersResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.list_members

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListMembers")
    )
    input_: capo_securityhub.types.list_members_request.ListMembersRequest = {}
    if only_associated is not None:
        input_["only_associated"] = only_associated
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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