updateIPSet method

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

Updates the IPSet specified by the IPSet ID.

May throw BadRequestException. May throw InternalServerErrorException.

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

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 location : The updated URI of the file that contains the IPSet. For example: https://s3.us-west-2.amazonaws.com/my-bucket/my-object-key.

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? location,
  String? name,
}) async {
  ArgumentError.checkNotNull(detectorId, 'detectorId');
  _s.validateStringLength(
    'detectorId',
    detectorId,
    1,
    300,
    isRequired: true,
  );
  ArgumentError.checkNotNull(ipSetId, 'ipSetId');
  _s.validateStringLength(
    'location',
    location,
    1,
    300,
  );
  _s.validateStringLength(
    'name',
    name,
    1,
    300,
  );
  final $payload = <String, dynamic>{
    if (activate != null) 'activate': activate,
    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,
  );
}