listHubContents method
List the contents of a hub.
May throw ResourceNotFound.
Parameter hubContentType :
The type of hub content to list.
Parameter hubName :
The name of the hub to list the contents of.
Parameter creationTimeAfter :
Only list hub content that was created after the time specified.
Parameter creationTimeBefore :
Only list hub content that was created before the time specified.
Parameter maxResults :
The maximum amount of hub content to list.
Parameter maxSchemaVersion :
The upper bound of the hub content schema verion.
Parameter nameContains :
Only list hub content if the name contains the specified string.
Parameter nextToken :
If the response to a previous ListHubContents request was
truncated, the response includes a NextToken. To retrieve the
next set of hub content, use the token in the next request.
Parameter sortBy :
Sort hub content versions by either name or creation time.
Parameter sortOrder :
Sort hubs by ascending or descending order.
Implementation
Future<ListHubContentsResponse> listHubContents({
required HubContentType hubContentType,
required String hubName,
DateTime? creationTimeAfter,
DateTime? creationTimeBefore,
int? maxResults,
String? maxSchemaVersion,
String? nameContains,
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.ListHubContents'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'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 (nameContains != null) 'NameContains': nameContains,
if (nextToken != null) 'NextToken': nextToken,
if (sortBy != null) 'SortBy': sortBy.value,
if (sortOrder != null) 'SortOrder': sortOrder.value,
},
);
return ListHubContentsResponse.fromJson(jsonResponse.body);
}