stopExperimentRun method
Stops a running experiment. Stopping an experiment run ends audience exposure and returns users to the currently deployed feature flag configuration.
May throw BadRequestException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
Parameter applicationIdentifier :
The application ID or name.
Parameter experimentDefinitionIdentifier :
The experiment definition ID or name.
Parameter run :
The run number to stop.
Parameter deploymentParameters :
The deployment parameters for the stop operation.
Parameter result :
The result of the experiment run, including an executive summary and
reasons for or against launching.
Implementation
Future<ExperimentRun> stopExperimentRun({
required String applicationIdentifier,
required String experimentDefinitionIdentifier,
required int run,
DeploymentParameters? deploymentParameters,
ExperimentRunResult? result,
}) async {
_s.validateNumRange(
'run',
run,
1,
1152921504606846976,
isRequired: true,
);
final $payload = <String, dynamic>{
if (deploymentParameters != null)
'DeploymentParameters': deploymentParameters,
if (result != null) 'Result': result,
};
final response = await _protocol.send(
payload: $payload,
method: 'PATCH',
requestUri:
'/applications/${Uri.encodeComponent(applicationIdentifier)}/experimentdefinitions/${Uri.encodeComponent(experimentDefinitionIdentifier)}/experimentruns/${Uri.encodeComponent(run.toString())}/stop',
exceptionFnMap: _exceptionFns,
);
return ExperimentRun.fromJson(response);
}