updateControl method

Future<UpdateControlResponse> updateControl({
  1. required String controlId,
  2. required List<ControlMappingSource> controlMappingSources,
  3. required String name,
  4. String? actionPlanInstructions,
  5. String? actionPlanTitle,
  6. String? description,
  7. String? testingInformation,
})

Updates a custom control in Audit Manager.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter controlId : The identifier for the control.

Parameter controlMappingSources : The data mapping sources for the control.

Parameter name : The name of the updated control.

Parameter actionPlanInstructions : The recommended actions to carry out if the control isn't fulfilled.

Parameter actionPlanTitle : The title of the action plan for remediating the control.

Parameter description : The optional description of the control.

Parameter testingInformation : The steps that you should follow to determine if the control is met.

Implementation

Future<UpdateControlResponse> updateControl({
  required String controlId,
  required List<ControlMappingSource> controlMappingSources,
  required String name,
  String? actionPlanInstructions,
  String? actionPlanTitle,
  String? description,
  String? testingInformation,
}) async {
  final $payload = <String, dynamic>{
    'controlMappingSources': controlMappingSources,
    'name': name,
    if (actionPlanInstructions != null)
      'actionPlanInstructions': actionPlanInstructions,
    if (actionPlanTitle != null) 'actionPlanTitle': actionPlanTitle,
    if (description != null) 'description': description,
    if (testingInformation != null) 'testingInformation': testingInformation,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/controls/${Uri.encodeComponent(controlId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateControlResponse.fromJson(response);
}