listTrialComponents method

Future<ListTrialComponentsResponse> listTrialComponents({
  1. DateTime? createdAfter,
  2. DateTime? createdBefore,
  3. String? experimentName,
  4. int? maxResults,
  5. String? nextToken,
  6. SortTrialComponentsBy? sortBy,
  7. SortOrder? sortOrder,
  8. String? sourceArn,
  9. String? trialName,
})

Lists the trial components in your account. You can sort the list by trial component name or creation time. You can filter the list to show only components that were created in a specific time range. You can also filter on one of the following:

  • ExperimentName
  • SourceArn
  • TrialName

May throw ResourceNotFound.

Parameter createdAfter : A filter that returns only components created after the specified time.

Parameter createdBefore : A filter that returns only components created before the specified time.

Parameter experimentName : A filter that returns only components that are part of the specified experiment. If you specify ExperimentName, you can't filter by SourceArn or TrialName.

Parameter maxResults : The maximum number of components to return in the response. The default value is 10.

Parameter nextToken : If the previous call to ListTrialComponents didn't return the full set of components, the call returns a token for getting the next set of components.

Parameter sortBy : The property used to sort results. The default value is CreationTime.

Parameter sortOrder : The sort order. The default value is Descending.

Parameter sourceArn : A filter that returns only components that have the specified source Amazon Resource Name (ARN). If you specify SourceArn, you can't filter by ExperimentName or TrialName.

Parameter trialName : A filter that returns only components that are part of the specified trial. If you specify TrialName, you can't filter by ExperimentName or SourceArn.

Implementation

Future<ListTrialComponentsResponse> listTrialComponents({
  DateTime? createdAfter,
  DateTime? createdBefore,
  String? experimentName,
  int? maxResults,
  String? nextToken,
  SortTrialComponentsBy? sortBy,
  SortOrder? sortOrder,
  String? sourceArn,
  String? trialName,
}) async {
  _s.validateStringLength(
    'experimentName',
    experimentName,
    1,
    120,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    8192,
  );
  _s.validateStringLength(
    'sourceArn',
    sourceArn,
    0,
    256,
  );
  _s.validateStringLength(
    'trialName',
    trialName,
    1,
    120,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.ListTrialComponents'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (createdAfter != null)
        'CreatedAfter': unixTimestampToJson(createdAfter),
      if (createdBefore != null)
        'CreatedBefore': unixTimestampToJson(createdBefore),
      if (experimentName != null) 'ExperimentName': experimentName,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (sortBy != null) 'SortBy': sortBy.toValue(),
      if (sortOrder != null) 'SortOrder': sortOrder.toValue(),
      if (sourceArn != null) 'SourceArn': sourceArn,
      if (trialName != null) 'TrialName': trialName,
    },
  );

  return ListTrialComponentsResponse.fromJson(jsonResponse.body);
}