updateWirelessDevice method

Future<void> updateWirelessDevice({
  1. required String id,
  2. String? description,
  3. String? destinationName,
  4. LoRaWANUpdateDevice? loRaWAN,
  5. String? name,
  6. PositioningConfigStatus? positioning,
  7. SidewalkUpdateWirelessDevice? sidewalk,
})

Updates properties of a wireless device.

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

Parameter id : The ID of the resource to update.

Parameter description : A new description of the resource.

Parameter destinationName : The name of the new destination for the device.

Parameter loRaWAN : The updated wireless device's configuration.

Parameter name : The new name of the resource.

Parameter positioning : The integration status of the Device Location feature for LoRaWAN and Sidewalk devices.

Parameter sidewalk : The updated sidewalk properties.

Implementation

Future<void> updateWirelessDevice({
  required String id,
  String? description,
  String? destinationName,
  LoRaWANUpdateDevice? loRaWAN,
  String? name,
  PositioningConfigStatus? positioning,
  SidewalkUpdateWirelessDevice? sidewalk,
}) async {
  final $payload = <String, dynamic>{
    if (description != null) 'Description': description,
    if (destinationName != null) 'DestinationName': destinationName,
    if (loRaWAN != null) 'LoRaWAN': loRaWAN,
    if (name != null) 'Name': name,
    if (positioning != null) 'Positioning': positioning.value,
    if (sidewalk != null) 'Sidewalk': sidewalk,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri: '/wireless-devices/${Uri.encodeComponent(id)}',
    exceptionFnMap: _exceptionFns,
  );
}