listEndpoints method

Future<ListEndpointsOutput> listEndpoints({
  1. DateTime? creationTimeAfter,
  2. DateTime? creationTimeBefore,
  3. DateTime? lastModifiedTimeAfter,
  4. DateTime? lastModifiedTimeBefore,
  5. int? maxResults,
  6. String? nameContains,
  7. String? nextToken,
  8. EndpointSortKey? sortBy,
  9. OrderKey? sortOrder,
  10. EndpointStatus? statusEquals,
})

Lists endpoints.

Parameter creationTimeAfter : A filter that returns only endpoints with a creation time greater than or equal to the specified time (timestamp).

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

Parameter lastModifiedTimeAfter : A filter that returns only endpoints that were modified after the specified timestamp.

Parameter lastModifiedTimeBefore : A filter that returns only endpoints that were modified before the specified timestamp.

Parameter maxResults : The maximum number of endpoints to return in the response.

Parameter nameContains : A string in endpoint names. This filter returns only endpoints whose name contains the specified string.

Parameter nextToken : If the result of a ListEndpoints request was truncated, the response includes a NextToken. To retrieve the next set of endpoints, use the token in the next request.

Parameter sortBy : Sorts the list of results. The default is CreationTime.

Parameter sortOrder : The sort order for results. The default is Descending.

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

Implementation

Future<ListEndpointsOutput> listEndpoints({
  DateTime? creationTimeAfter,
  DateTime? creationTimeBefore,
  DateTime? lastModifiedTimeAfter,
  DateTime? lastModifiedTimeBefore,
  int? maxResults,
  String? nameContains,
  String? nextToken,
  EndpointSortKey? sortBy,
  OrderKey? sortOrder,
  EndpointStatus? statusEquals,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nameContains',
    nameContains,
    0,
    63,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    8192,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.ListEndpoints'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (creationTimeAfter != null)
        'CreationTimeAfter': unixTimestampToJson(creationTimeAfter),
      if (creationTimeBefore != null)
        'CreationTimeBefore': unixTimestampToJson(creationTimeBefore),
      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 (sortBy != null) 'SortBy': sortBy.toValue(),
      if (sortOrder != null) 'SortOrder': sortOrder.toValue(),
      if (statusEquals != null) 'StatusEquals': statusEquals.toValue(),
    },
  );

  return ListEndpointsOutput.fromJson(jsonResponse.body);
}