createControl method
Creates a new custom control in Audit Manager.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ValidationException.
Parameter controlMappingSources :
The data mapping sources for the control.
Parameter name :
The name of the 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 description of the control.
Parameter tags :
The tags that are associated with the control.
Parameter testingInformation :
The steps to follow to determine if the control is satisfied.
Implementation
Future<CreateControlResponse> createControl({
required List<CreateControlMappingSource> controlMappingSources,
required String name,
String? actionPlanInstructions,
String? actionPlanTitle,
String? description,
Map<String, String>? tags,
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 (tags != null) 'tags': tags,
if (testingInformation != null) 'testingInformation': testingInformation,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/controls',
exceptionFnMap: _exceptionFns,
);
return CreateControlResponse.fromJson(response);
}