listHubContentVersions method

Future<ListHubContentVersionsResponse> listHubContentVersions({
  1. required String hubContentName,
  2. required HubContentType hubContentType,
  3. required String hubName,
  4. DateTime? creationTimeAfter,
  5. DateTime? creationTimeBefore,
  6. int? maxResults,
  7. String? maxSchemaVersion,
  8. String? minVersion,
  9. String? nextToken,
  10. HubContentSortBy? sortBy,
  11. SortOrder? sortOrder,
})

List hub content versions.

May throw ResourceNotFound.

Parameter hubContentName : The name of the hub content.

Parameter hubContentType : The type of hub content to list versions of.

Parameter hubName : The name of the hub to list the content versions of.

Parameter creationTimeAfter : Only list hub content versions that were created after the time specified.

Parameter creationTimeBefore : Only list hub content versions that were created before the time specified.

Parameter maxResults : The maximum number of hub content versions to list.

Parameter maxSchemaVersion : The upper bound of the hub content schema version.

Parameter minVersion : The lower bound of the hub content versions to list.

Parameter nextToken : If the response to a previous ListHubContentVersions request was truncated, the response includes a NextToken. To retrieve the next set of hub content versions, use the token in the next request.

Parameter sortBy : Sort hub content versions by either name or creation time.

Parameter sortOrder : Sort hub content versions by ascending or descending order.

Implementation

Future<ListHubContentVersionsResponse> listHubContentVersions({
  required String hubContentName,
  required HubContentType hubContentType,
  required String hubName,
  DateTime? creationTimeAfter,
  DateTime? creationTimeBefore,
  int? maxResults,
  String? maxSchemaVersion,
  String? minVersion,
  String? nextToken,
  HubContentSortBy? sortBy,
  SortOrder? sortOrder,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.ListHubContentVersions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'HubContentName': hubContentName,
      'HubContentType': hubContentType.value,
      'HubName': hubName,
      if (creationTimeAfter != null)
        'CreationTimeAfter': unixTimestampToJson(creationTimeAfter),
      if (creationTimeBefore != null)
        'CreationTimeBefore': unixTimestampToJson(creationTimeBefore),
      if (maxResults != null) 'MaxResults': maxResults,
      if (maxSchemaVersion != null) 'MaxSchemaVersion': maxSchemaVersion,
      if (minVersion != null) 'MinVersion': minVersion,
      if (nextToken != null) 'NextToken': nextToken,
      if (sortBy != null) 'SortBy': sortBy.value,
      if (sortOrder != null) 'SortOrder': sortOrder.value,
    },
  );

  return ListHubContentVersionsResponse.fromJson(jsonResponse.body);
}