deleteTrialComponent method

Future<DeleteTrialComponentResponse> deleteTrialComponent({
  1. required String trialComponentName,
})

Deletes the specified trial component. A trial component must be disassociated from all trials before the trial component can be deleted. To disassociate a trial component from a trial, call the DisassociateTrialComponent API.

May throw ResourceNotFound.

Parameter trialComponentName : The name of the component to delete.

Implementation

Future<DeleteTrialComponentResponse> deleteTrialComponent({
  required String trialComponentName,
}) async {
  ArgumentError.checkNotNull(trialComponentName, 'trialComponentName');
  _s.validateStringLength(
    'trialComponentName',
    trialComponentName,
    1,
    120,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.DeleteTrialComponent'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'TrialComponentName': trialComponentName,
    },
  );

  return DeleteTrialComponentResponse.fromJson(jsonResponse.body);
}