stopAssessmentRun method
Stops the assessment run that is specified by the ARN of the assessment run.
May throw InternalException. May throw InvalidInputException. May throw AccessDeniedException. May throw NoSuchEntityException. May throw ServiceTemporarilyUnavailableException.
Parameter assessmentRunArn
:
The ARN of the assessment run that you want to stop.
Parameter stopAction
:
An input option that can be set to either START_EVALUATION or
SKIP_EVALUATION. START_EVALUATION (the default value), stops the AWS agent
from collecting data and begins the results evaluation and the findings
generation process. SKIP_EVALUATION cancels the assessment run
immediately, after which no findings are generated.
Implementation
Future<void> stopAssessmentRun({
required String assessmentRunArn,
StopAction? stopAction,
}) async {
ArgumentError.checkNotNull(assessmentRunArn, 'assessmentRunArn');
_s.validateStringLength(
'assessmentRunArn',
assessmentRunArn,
1,
300,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'InspectorService.StopAssessmentRun'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'assessmentRunArn': assessmentRunArn,
if (stopAction != null) 'stopAction': stopAction.toValue(),
},
);
}