createFuotaTask method
Creates a FUOTA task.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Implementation
Future<CreateFuotaTaskResponse> createFuotaTask({
required String firmwareUpdateImage,
required String firmwareUpdateRole,
String? clientRequestToken,
String? description,
String? descriptor,
int? fragmentIntervalMS,
int? fragmentSizeBytes,
LoRaWANFuotaTask? loRaWAN,
String? name,
int? redundancyPercent,
List<Tag>? tags,
}) async {
_s.validateNumRange(
'fragmentIntervalMS',
fragmentIntervalMS,
1,
1152921504606846976,
);
_s.validateNumRange(
'fragmentSizeBytes',
fragmentSizeBytes,
1,
1152921504606846976,
);
_s.validateNumRange(
'redundancyPercent',
redundancyPercent,
0,
100,
);
final $payload = <String, dynamic>{
'FirmwareUpdateImage': firmwareUpdateImage,
'FirmwareUpdateRole': firmwareUpdateRole,
'ClientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
if (description != null) 'Description': description,
if (descriptor != null) 'Descriptor': descriptor,
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,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/fuota-tasks',
exceptionFnMap: _exceptionFns,
);
return CreateFuotaTaskResponse.fromJson(response);
}