updateFuotaTask method

Future<void> updateFuotaTask({
  1. required String id,
  2. String? description,
  3. String? descriptor,
  4. String? firmwareUpdateImage,
  5. String? firmwareUpdateRole,
  6. int? fragmentIntervalMS,
  7. int? fragmentSizeBytes,
  8. LoRaWANFuotaTask? loRaWAN,
  9. String? name,
  10. int? redundancyPercent,
})

Updates properties of a FUOTA task.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Implementation

Future<void> updateFuotaTask({
  required String id,
  String? description,
  String? descriptor,
  String? firmwareUpdateImage,
  String? firmwareUpdateRole,
  int? fragmentIntervalMS,
  int? fragmentSizeBytes,
  LoRaWANFuotaTask? loRaWAN,
  String? name,
  int? redundancyPercent,
}) async {
  _s.validateNumRange(
    'fragmentIntervalMS',
    fragmentIntervalMS,
    1,
    1152921504606846976,
  );
  _s.validateNumRange(
    'fragmentSizeBytes',
    fragmentSizeBytes,
    1,
    1152921504606846976,
  );
  _s.validateNumRange(
    'redundancyPercent',
    redundancyPercent,
    0,
    100,
  );
  final $payload = <String, dynamic>{
    if (description != null) 'Description': description,
    if (descriptor != null) 'Descriptor': descriptor,
    if (firmwareUpdateImage != null)
      'FirmwareUpdateImage': firmwareUpdateImage,
    if (firmwareUpdateRole != null) 'FirmwareUpdateRole': firmwareUpdateRole,
    if (fragmentIntervalMS != null) 'FragmentIntervalMS': fragmentIntervalMS,
    if (fragmentSizeBytes != null) 'FragmentSizeBytes': fragmentSizeBytes,
    if (loRaWAN != null) 'LoRaWAN': loRaWAN,
    if (name != null) 'Name': name,
    if (redundancyPercent != null) 'RedundancyPercent': redundancyPercent,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri: '/fuota-tasks/${Uri.encodeComponent(id)}',
    exceptionFnMap: _exceptionFns,
  );
}