updateStandardsControl method

Future<void> updateStandardsControl({
  1. required String standardsControlArn,
  2. ControlStatus? controlStatus,
  3. String? disabledReason,
})

Used to control whether an individual security standard control is enabled or disabled.

May throw InternalException. May throw InvalidInputException. May throw InvalidAccessException. May throw ResourceNotFoundException.

Parameter standardsControlArn : The ARN of the security standard control to enable or disable.

Parameter controlStatus : The updated status of the security standard control.

Parameter disabledReason : A description of the reason why you are disabling a security standard control. If you are disabling a control, then this is required.

Implementation

Future<void> updateStandardsControl({
  required String standardsControlArn,
  ControlStatus? controlStatus,
  String? disabledReason,
}) async {
  ArgumentError.checkNotNull(standardsControlArn, 'standardsControlArn');
  final $payload = <String, dynamic>{
    if (controlStatus != null) 'ControlStatus': controlStatus.toValue(),
    if (disabledReason != null) 'DisabledReason': disabledReason,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri:
        '/standards/control/${standardsControlArn.split('/').map(Uri.encodeComponent).join('/')}',
    exceptionFnMap: _exceptionFns,
  );
}