Skip to content

list_invitations

list_invitations(
    *,
    config_overrides: Optional[DetectiveClientConfig] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[MemberResultsLimit] = None,
) -> ListInvitationsResponse

Retrieves the list of open and accepted behavior graph invitations for the member account. This operation can only be called by an invited member account.

Open invitations are invitations that the member account has not responded to.

The results do not include behavior graphs for which the member account declined the invitation. The results also do not include behavior graphs that the member account resigned from or was removed from.

Parameters:

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

    For requests to retrieve the next page of 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 behavior graph invitations to return 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_invitations(
    self,
    *,
    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_invitations_response.ListInvitationsResponse":
    """<p>Retrieves the list of open and accepted behavior graph invitations for the member account. This operation can only be called by an invited member account.</p> <p>Open invitations are invitations that the member account has not responded to.</p> <p>The results do not include behavior graphs for which the member account declined the invitation. The results also do not include behavior graphs that the member account resigned from or was removed from.</p>

    Args:
        next_token: <p>For requests to retrieve the next page of 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 behavior graph invitations to return 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.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_invitations_request.ListInvitationsRequest]",
    ) -> OperationResponse[
        "capo_detective.types.list_invitations_response.ListInvitationsResponse"
    ]:
        import capo_detective._operations.amazon_detective.list_invitations

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

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

        return capo_detective.types.list_invitations_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListInvitations", redact_output=_redact_output),
    )
    input_: capo_detective.types.list_invitations_request.ListInvitationsRequest = {}
    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