updateTrialComponent method

Future<UpdateTrialComponentResponse> updateTrialComponent({
  1. required String trialComponentName,
  2. String? displayName,
  3. DateTime? endTime,
  4. Map<String, TrialComponentArtifact>? inputArtifacts,
  5. List<String>? inputArtifactsToRemove,
  6. Map<String, TrialComponentArtifact>? outputArtifacts,
  7. List<String>? outputArtifactsToRemove,
  8. Map<String, TrialComponentParameterValue>? parameters,
  9. List<String>? parametersToRemove,
  10. DateTime? startTime,
  11. TrialComponentStatus? status,
})

Updates one or more properties of a trial component.

May throw ConflictException. May throw ResourceNotFound.

Parameter trialComponentName : The name of the component to update.

Parameter displayName : The name of the component as displayed. The name doesn't need to be unique. If DisplayName isn't specified, TrialComponentName is displayed.

Parameter endTime : When the component ended.

Parameter inputArtifacts : Replaces all of the component's input artifacts with the specified artifacts.

Parameter inputArtifactsToRemove : The input artifacts to remove from the component.

Parameter outputArtifacts : Replaces all of the component's output artifacts with the specified artifacts.

Parameter outputArtifactsToRemove : The output artifacts to remove from the component.

Parameter parameters : Replaces all of the component's hyperparameters with the specified hyperparameters.

Parameter parametersToRemove : The hyperparameters to remove from the component.

Parameter startTime : When the component started.

Parameter status : The new status of the component.

Implementation

Future<UpdateTrialComponentResponse> updateTrialComponent({
  required String trialComponentName,
  String? displayName,
  DateTime? endTime,
  Map<String, TrialComponentArtifact>? inputArtifacts,
  List<String>? inputArtifactsToRemove,
  Map<String, TrialComponentArtifact>? outputArtifacts,
  List<String>? outputArtifactsToRemove,
  Map<String, TrialComponentParameterValue>? parameters,
  List<String>? parametersToRemove,
  DateTime? startTime,
  TrialComponentStatus? status,
}) async {
  ArgumentError.checkNotNull(trialComponentName, 'trialComponentName');
  _s.validateStringLength(
    'trialComponentName',
    trialComponentName,
    1,
    120,
    isRequired: true,
  );
  _s.validateStringLength(
    'displayName',
    displayName,
    1,
    120,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.UpdateTrialComponent'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'TrialComponentName': trialComponentName,
      if (displayName != null) 'DisplayName': displayName,
      if (endTime != null) 'EndTime': unixTimestampToJson(endTime),
      if (inputArtifacts != null) 'InputArtifacts': inputArtifacts,
      if (inputArtifactsToRemove != null)
        'InputArtifactsToRemove': inputArtifactsToRemove,
      if (outputArtifacts != null) 'OutputArtifacts': outputArtifacts,
      if (outputArtifactsToRemove != null)
        'OutputArtifactsToRemove': outputArtifactsToRemove,
      if (parameters != null) 'Parameters': parameters,
      if (parametersToRemove != null)
        'ParametersToRemove': parametersToRemove,
      if (startTime != null) 'StartTime': unixTimestampToJson(startTime),
      if (status != null) 'Status': status,
    },
  );

  return UpdateTrialComponentResponse.fromJson(jsonResponse.body);
}