listNotebookInstances method

Future<ListNotebookInstancesOutput> listNotebookInstances({
  1. String? additionalCodeRepositoryEquals,
  2. DateTime? creationTimeAfter,
  3. DateTime? creationTimeBefore,
  4. String? defaultCodeRepositoryContains,
  5. DateTime? lastModifiedTimeAfter,
  6. DateTime? lastModifiedTimeBefore,
  7. int? maxResults,
  8. String? nameContains,
  9. String? nextToken,
  10. String? notebookInstanceLifecycleConfigNameContains,
  11. NotebookInstanceSortKey? sortBy,
  12. NotebookInstanceSortOrder? sortOrder,
  13. NotebookInstanceStatus? statusEquals,
})

Returns a list of the Amazon SageMaker notebook instances in the requester's account in an AWS Region.

Parameter additionalCodeRepositoryEquals : A filter that returns only notebook instances with associated with the specified git repository.

Parameter creationTimeAfter : A filter that returns only notebook instances that were created after the specified time (timestamp).

Parameter creationTimeBefore : A filter that returns only notebook instances that were created before the specified time (timestamp).

Parameter defaultCodeRepositoryContains : A string in the name or URL of a Git repository associated with this notebook instance. This filter returns only notebook instances associated with a git repository with a name that contains the specified string.

Parameter lastModifiedTimeAfter : A filter that returns only notebook instances that were modified after the specified time (timestamp).

Parameter lastModifiedTimeBefore : A filter that returns only notebook instances that were modified before the specified time (timestamp).

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

Parameter nameContains : A string in the notebook instances' name. This filter returns only notebook instances whose name contains the specified string.

Parameter nextToken : If the previous call to the ListNotebookInstances is truncated, the response includes a NextToken. You can use this token in your subsequent ListNotebookInstances request to fetch the next set of notebook instances.

Parameter notebookInstanceLifecycleConfigNameContains : A string in the name of a notebook instances lifecycle configuration associated with this notebook instance. This filter returns only notebook instances associated with a lifecycle configuration with a name that contains the specified string.

Parameter sortBy : The field to sort results by. The default is Name.

Parameter sortOrder : The sort order for results.

Parameter statusEquals : A filter that returns only notebook instances with the specified status.

Implementation

Future<ListNotebookInstancesOutput> listNotebookInstances({
  String? additionalCodeRepositoryEquals,
  DateTime? creationTimeAfter,
  DateTime? creationTimeBefore,
  String? defaultCodeRepositoryContains,
  DateTime? lastModifiedTimeAfter,
  DateTime? lastModifiedTimeBefore,
  int? maxResults,
  String? nameContains,
  String? nextToken,
  String? notebookInstanceLifecycleConfigNameContains,
  NotebookInstanceSortKey? sortBy,
  NotebookInstanceSortOrder? sortOrder,
  NotebookInstanceStatus? statusEquals,
}) async {
  _s.validateStringLength(
    'additionalCodeRepositoryEquals',
    additionalCodeRepositoryEquals,
    1,
    1024,
  );
  _s.validateStringLength(
    'defaultCodeRepositoryContains',
    defaultCodeRepositoryContains,
    0,
    1024,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nameContains',
    nameContains,
    0,
    63,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    8192,
  );
  _s.validateStringLength(
    'notebookInstanceLifecycleConfigNameContains',
    notebookInstanceLifecycleConfigNameContains,
    0,
    63,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.ListNotebookInstances'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (additionalCodeRepositoryEquals != null)
        'AdditionalCodeRepositoryEquals': additionalCodeRepositoryEquals,
      if (creationTimeAfter != null)
        'CreationTimeAfter': unixTimestampToJson(creationTimeAfter),
      if (creationTimeBefore != null)
        'CreationTimeBefore': unixTimestampToJson(creationTimeBefore),
      if (defaultCodeRepositoryContains != null)
        'DefaultCodeRepositoryContains': defaultCodeRepositoryContains,
      if (lastModifiedTimeAfter != null)
        'LastModifiedTimeAfter': unixTimestampToJson(lastModifiedTimeAfter),
      if (lastModifiedTimeBefore != null)
        'LastModifiedTimeBefore': unixTimestampToJson(lastModifiedTimeBefore),
      if (maxResults != null) 'MaxResults': maxResults,
      if (nameContains != null) 'NameContains': nameContains,
      if (nextToken != null) 'NextToken': nextToken,
      if (notebookInstanceLifecycleConfigNameContains != null)
        'NotebookInstanceLifecycleConfigNameContains':
            notebookInstanceLifecycleConfigNameContains,
      if (sortBy != null) 'SortBy': sortBy.toValue(),
      if (sortOrder != null) 'SortOrder': sortOrder.toValue(),
      if (statusEquals != null) 'StatusEquals': statusEquals.toValue(),
    },
  );

  return ListNotebookInstancesOutput.fromJson(jsonResponse.body);
}