updateTrial method

Future<UpdateTrialResponse> updateTrial({
  1. required String trialName,
  2. String? displayName,
})

Updates the display name of a trial.

May throw ConflictException. May throw ResourceNotFound.

Parameter trialName : The name of the trial to update.

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

Implementation

Future<UpdateTrialResponse> updateTrial({
  required String trialName,
  String? displayName,
}) async {
  ArgumentError.checkNotNull(trialName, 'trialName');
  _s.validateStringLength(
    'trialName',
    trialName,
    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.UpdateTrial'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'TrialName': trialName,
      if (displayName != null) 'DisplayName': displayName,
    },
  );

  return UpdateTrialResponse.fromJson(jsonResponse.body);
}