updateWebACL method

Future<UpdateWebACLResponse> updateWebACL({
  1. required String changeToken,
  2. required String webACLId,
  3. WafAction? defaultAction,
  4. List<WebACLUpdate>? updates,
})

Implementation

Future<UpdateWebACLResponse> updateWebACL({
  required String changeToken,
  required String webACLId,
  WafAction? defaultAction,
  List<WebACLUpdate>? updates,
}) async {
  ArgumentError.checkNotNull(changeToken, 'changeToken');
  _s.validateStringLength(
    'changeToken',
    changeToken,
    1,
    128,
    isRequired: true,
  );
  ArgumentError.checkNotNull(webACLId, 'webACLId');
  _s.validateStringLength(
    'webACLId',
    webACLId,
    1,
    128,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSWAF_Regional_20161128.UpdateWebACL'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ChangeToken': changeToken,
      'WebACLId': webACLId,
      if (defaultAction != null) 'DefaultAction': defaultAction,
      if (updates != null) 'Updates': updates,
    },
  );

  return UpdateWebACLResponse.fromJson(jsonResponse.body);
}