updateIPSet method

Future<void> updateIPSet({
  1. required String detectorId,
  2. required String ipSetId,
  3. bool? activate,
  4. String? expectedBucketOwner,
  5. String? location,
  6. String? name,
})

Updates the IPSet specified by the IPSet ID.

May throw AccessDeniedException. May throw BadRequestException. May throw InternalServerErrorException.

Parameter detectorId : The detectorID that specifies the GuardDuty service whose IPSet you want to update.

To find the detectorId in the current Region, see the Settings page in the GuardDuty console, or run the ListDetectors API.

Parameter ipSetId : The unique ID that specifies the IPSet that you want to update.

Parameter activate : The updated Boolean value that specifies whether the IPSet is active or not.

Parameter expectedBucketOwner : The Amazon Web Services account ID that owns the Amazon S3 bucket specified in the location parameter.

Parameter location : The updated URI of the file that contains the IPSet.

Parameter name : The unique ID that specifies the IPSet that you want to update.

Implementation

Future<void> updateIPSet({
  required String detectorId,
  required String ipSetId,
  bool? activate,
  String? expectedBucketOwner,
  String? location,
  String? name,
}) async {
  final $payload = <String, dynamic>{
    if (activate != null) 'activate': activate,
    if (expectedBucketOwner != null)
      'expectedBucketOwner': expectedBucketOwner,
    if (location != null) 'location': location,
    if (name != null) 'name': name,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/detector/${Uri.encodeComponent(detectorId)}/ipset/${Uri.encodeComponent(ipSetId)}',
    exceptionFnMap: _exceptionFns,
  );
}