listModelPackageGroups method

Future<ListModelPackageGroupsOutput> listModelPackageGroups({
  1. DateTime? creationTimeAfter,
  2. DateTime? creationTimeBefore,
  3. CrossAccountFilterOption? crossAccountFilterOption,
  4. int? maxResults,
  5. String? nameContains,
  6. String? nextToken,
  7. ModelPackageGroupSortBy? sortBy,
  8. SortOrder? sortOrder,
})

Gets a list of the model groups in your Amazon Web Services account.

Parameter creationTimeAfter : A filter that returns only model groups created after the specified time.

Parameter creationTimeBefore : A filter that returns only model groups created before the specified time.

Parameter crossAccountFilterOption : A filter that returns either model groups shared with you or model groups in your own account. When the value is CrossAccount, the results show the resources made discoverable to you from other accounts. When the value is SameAccount or null, the results show resources from your account. The default is SameAccount.

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

Parameter nameContains : A string in the model group name. This filter returns only model groups whose name contains the specified string.

Parameter nextToken : If the result of the previous ListModelPackageGroups request was truncated, the response includes a NextToken. To retrieve the next set of model groups, use the token in the next request.

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

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

Implementation

Future<ListModelPackageGroupsOutput> listModelPackageGroups({
  DateTime? creationTimeAfter,
  DateTime? creationTimeBefore,
  CrossAccountFilterOption? crossAccountFilterOption,
  int? maxResults,
  String? nameContains,
  String? nextToken,
  ModelPackageGroupSortBy? 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.ListModelPackageGroups'
  };
  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 (crossAccountFilterOption != null)
        'CrossAccountFilterOption': crossAccountFilterOption.value,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nameContains != null) 'NameContains': nameContains,
      if (nextToken != null) 'NextToken': nextToken,
      if (sortBy != null) 'SortBy': sortBy.value,
      if (sortOrder != null) 'SortOrder': sortOrder.value,
    },
  );

  return ListModelPackageGroupsOutput.fromJson(jsonResponse.body);
}