Skip to content

list_sessions async

list_sessions(
    approval_team_arn: ApprovalTeamArn,
    *,
    config_overrides: Optional[AsyncMPAClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[Token] = None,
    filters: Optional[Filters] = None,
) -> ListSessionsResponse

Returns a list of approval sessions. For more information, see Session in the Multi-party approval User Guide.

Parameters:

  • approval_team_arn (ApprovalTeamArn) –

    Amazon Resource Name (ARN) for the approval team.

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

    The maximum number of items to return in the response. If more results exist than the specified MaxResults value, a token is included in the response so that you can retrieve the remaining results.

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

    If present, indicates that more output is available than is included in the current response. Use this value in the NextToken request parameter in a next call to the operation to get more output. You can repeat this until the NextToken response element returns null.

  • filters (Optional[Filters], default: None ) –

    An array of Filter objects. Contains the filter to apply when listing sessions.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action. Check your permissions, and try again.

  • InternalServerException –

    The service encountered an internal error. Try your request again. If the problem persists, contact Amazon Web Services Support.

  • ResourceNotFoundException –

    The specified resource doesn't exist. Check the resource ID, and try again.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The input fails to satisfy the constraints specified by an Amazon Web Services service.

  • UnknownServiceError –

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

Source code in docs_src/capo_mpa/_services/async_mpa.py
async def list_sessions(
    self,
    approval_team_arn: "capo_mpa.types.approval_team_arn.ApprovalTeamArn",
    *,
    config_overrides: Optional[AsyncMPAClientConfig] = None,
    max_results: Optional["capo_mpa.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_mpa.types.token.Token"] = None,
    filters: Optional["capo_mpa.types.filters.Filters"] = None,
) -> "capo_mpa.types.list_sessions_response.ListSessionsResponse":
    """<p>Returns a list of approval sessions. For more information, see <a href="https://docs.aws.amazon.com/mpa/latest/userguide/mpa-concepts.html">Session</a> in the <i>Multi-party approval User Guide</i>.</p>

    Args:
        approval_team_arn: <p>Amazon Resource Name (ARN) for the approval team.</p>
        max_results: <p>The maximum number of items to return in the response. If more results exist than the specified <code>MaxResults</code> value, a token is included in the response so that you can retrieve the remaining results.</p>
        next_token: <p>If present, indicates that more output is available than is included in the current response. Use this value in the <code>NextToken</code> request parameter in a next call to the operation to get more output. You can repeat this until the <code>NextToken</code> response element returns <code>null</code>.</p>
        filters: <p>An array of <code>Filter</code> objects. Contains the filter to apply when listing sessions.</p>

    Raises:
        capo_mpa.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. Check your permissions, and try again.</p>
        capo_mpa.errors.internal_server_exception.InternalServerException: <p>The service encountered an internal error. Try your request again. If the problem persists, contact Amazon Web Services Support.</p>
        capo_mpa.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource doesn't exist. Check the resource ID, and try again.</p>
        capo_mpa.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_mpa.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_mpa.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mpa.types.list_sessions_request.ListSessionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_mpa.types.list_sessions_response.ListSessionsResponse"
    ]:
        import capo_mpa._operations.aws_fluffy_core_service.list_sessions

        (
            output,
            http_response,
        ) = await capo_mpa._operations.aws_fluffy_core_service.list_sessions.async_list_sessions(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_mpa.types.list_sessions_response.ListSessionsResponse",
    ) -> dict[str, Any]:
        import capo_mpa.types.list_sessions_response

        return capo_mpa.types.list_sessions_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListSessions", redact_output=_redact_output),
    )
    input_: capo_mpa.types.list_sessions_request.ListSessionsRequest = {
        "approval_team_arn": approval_team_arn
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if filters is not None:
        input_["filters"] = filters

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