associateTrialComponent method

Future<AssociateTrialComponentResponse> associateTrialComponent({
  1. required String trialComponentName,
  2. required String trialName,
})

Associates a trial component with a trial. A trial component can be associated with multiple trials. To disassociate a trial component from a trial, call the DisassociateTrialComponent API.

May throw ResourceNotFound. May throw ResourceLimitExceeded.

Parameter trialComponentName : The name of the component to associated with the trial.

Parameter trialName : The name of the trial to associate with.

Implementation

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

  return AssociateTrialComponentResponse.fromJson(jsonResponse.body);
}