listNotebookSessions method

Future<ListNotebookSessionsResponse> listNotebookSessions({
  1. required String notebookId,
  2. int? maxResults,
  3. String? nextToken,
})

Lists, in descending order, the sessions that have been created in a notebook that are in an active state like CREATING, CREATED, IDLE or BUSY. Newer sessions are listed first; older sessions are listed later.

May throw InternalServerException. May throw InvalidRequestException. May throw ResourceNotFoundException.

Parameter notebookId : The ID of the notebook to list sessions for.

Parameter maxResults : The maximum number of notebook sessions to return.

Parameter nextToken : A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

Implementation

Future<ListNotebookSessionsResponse> listNotebookSessions({
  required String notebookId,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonAthena.ListNotebookSessions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'NotebookId': notebookId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListNotebookSessionsResponse.fromJson(jsonResponse.body);
}