updateAssessmentTarget method

Future<void> updateAssessmentTarget({
  1. required String assessmentTargetArn,
  2. required String assessmentTargetName,
  3. String? resourceGroupArn,
})

Updates the assessment target that is specified by the ARN of the assessment target.

If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the assessment target.

May throw InternalException. May throw InvalidInputException. May throw AccessDeniedException. May throw NoSuchEntityException. May throw ServiceTemporarilyUnavailableException.

Parameter assessmentTargetArn : The ARN of the assessment target that you want to update.

Parameter assessmentTargetName : The name of the assessment target that you want to update.

Parameter resourceGroupArn : The ARN of the resource group that is used to specify the new resource group to associate with the assessment target.

Implementation

Future<void> updateAssessmentTarget({
  required String assessmentTargetArn,
  required String assessmentTargetName,
  String? resourceGroupArn,
}) async {
  ArgumentError.checkNotNull(assessmentTargetArn, 'assessmentTargetArn');
  _s.validateStringLength(
    'assessmentTargetArn',
    assessmentTargetArn,
    1,
    300,
    isRequired: true,
  );
  ArgumentError.checkNotNull(assessmentTargetName, 'assessmentTargetName');
  _s.validateStringLength(
    'assessmentTargetName',
    assessmentTargetName,
    1,
    140,
    isRequired: true,
  );
  _s.validateStringLength(
    'resourceGroupArn',
    resourceGroupArn,
    1,
    300,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'InspectorService.UpdateAssessmentTarget'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'assessmentTargetArn': assessmentTargetArn,
      'assessmentTargetName': assessmentTargetName,
      if (resourceGroupArn != null) 'resourceGroupArn': resourceGroupArn,
    },
  );
}