updateExperiment method

Future<UpdateExperimentResponse> updateExperiment({
  1. required String experimentName,
  2. String? description,
  3. String? displayName,
})

Adds, updates, or removes the description of an experiment. Updates the display name of an experiment.

May throw ConflictException. May throw ResourceNotFound.

Parameter experimentName : The name of the experiment to update.

Parameter description : The description of the experiment.

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

Implementation

Future<UpdateExperimentResponse> updateExperiment({
  required String experimentName,
  String? description,
  String? displayName,
}) async {
  ArgumentError.checkNotNull(experimentName, 'experimentName');
  _s.validateStringLength(
    'experimentName',
    experimentName,
    1,
    120,
    isRequired: true,
  );
  _s.validateStringLength(
    'description',
    description,
    0,
    3072,
  );
  _s.validateStringLength(
    'displayName',
    displayName,
    1,
    120,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.UpdateExperiment'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ExperimentName': experimentName,
      if (description != null) 'Description': description,
      if (displayName != null) 'DisplayName': displayName,
    },
  );

  return UpdateExperimentResponse.fromJson(jsonResponse.body);
}