Skip to content

list_members

list_members(
    graph_arn: GraphArn,
    *,
    config_overrides: Optional[DetectiveClientConfig] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[MemberResultsLimit] = None,
) -> ListMembersResponse

Retrieves the list of member accounts for a behavior graph.

For invited accounts, the results do not include member accounts that were removed from the behavior graph.

For the organization behavior graph, the results do not include organization accounts that the Detective administrator account has not enabled as member accounts.

Parameters:

  • graph_arn (GraphArn) –

    The ARN of the behavior graph for which to retrieve the list of member accounts.

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

    For requests to retrieve the next page of member account results, the pagination token that was returned with the previous page of results. The initial request does not include a pagination token.

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

    The maximum number of member accounts to include in the response. The total must be less than the overall limit on the number of results to return, which is currently 200.

Raises:

Source code in docs_src/capo_detective/_services/detective.py
def list_members(
    self,
    graph_arn: "capo_detective.types.graph_arn.GraphArn",
    *,
    config_overrides: Optional[DetectiveClientConfig] = None,
    next_token: Optional[
        "capo_detective.types.pagination_token.PaginationToken"
    ] = None,
    max_results: Optional[
        "capo_detective.types.member_results_limit.MemberResultsLimit"
    ] = None,
) -> "capo_detective.types.list_members_response.ListMembersResponse":
    """<p>Retrieves the list of member accounts for a behavior graph.</p> <p>For invited accounts, the results do not include member accounts that were removed from the behavior graph.</p> <p>For the organization behavior graph, the results do not include organization accounts that the Detective administrator account has not enabled as member accounts.</p>

    Args:
        graph_arn: <p>The ARN of the behavior graph for which to retrieve the list of member accounts.</p>
        next_token: <p>For requests to retrieve the next page of member account results, the pagination token that was returned with the previous page of results. The initial request does not include a pagination token.</p>
        max_results: <p>The maximum number of member accounts to include in the response. The total must be less than the overall limit on the number of results to return, which is currently 200.</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.resource_not_found_exception.ResourceNotFoundException: <p>The request refers to a nonexistent resource.</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[capo_detective.types.list_members_request.ListMembersRequest]",
    ) -> OperationResponse[
        "capo_detective.types.list_members_response.ListMembersResponse"
    ]:
        import capo_detective._operations.amazon_detective.list_members

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

    def _redact_output(
        output: "capo_detective.types.list_members_response.ListMembersResponse",
    ) -> dict[str, Any]:
        import capo_detective.types.list_members_response

        return capo_detective.types.list_members_response.redact_sensitive(output)

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

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