updateMitigationAction method
Future<UpdateMitigationActionResponse>
updateMitigationAction({
- required String actionName,
- MitigationActionParams? actionParams,
- String? roleArn,
Updates the definition for the specified mitigation action.
May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw InternalFailureException.
Parameter actionName
:
The friendly name for the mitigation action. You cannot change the name by
using UpdateMitigationAction
. Instead, you must delete and
recreate the mitigation action with the new name.
Parameter actionParams
:
Defines the type of action and the parameters for that action.
Parameter roleArn
:
The ARN of the IAM role that is used to apply the mitigation action.
Implementation
Future<UpdateMitigationActionResponse> updateMitigationAction({
required String actionName,
MitigationActionParams? actionParams,
String? roleArn,
}) async {
ArgumentError.checkNotNull(actionName, 'actionName');
_s.validateStringLength(
'actionName',
actionName,
0,
128,
isRequired: true,
);
_s.validateStringLength(
'roleArn',
roleArn,
20,
2048,
);
final $payload = <String, dynamic>{
if (actionParams != null) 'actionParams': actionParams,
if (roleArn != null) 'roleArn': roleArn,
};
final response = await _protocol.send(
payload: $payload,
method: 'PATCH',
requestUri:
'/mitigationactions/actions/${Uri.encodeComponent(actionName)}',
exceptionFnMap: _exceptionFns,
);
return UpdateMitigationActionResponse.fromJson(response);
}