restartDeviceWithHttpInfo method

Future<Response> restartDeviceWithHttpInfo({
  1. String? mode,
  2. String? uuidToken,
})

Restart the device

Reboots the device. The query parameter 'mode' selects between a 'soft' and an 'hard' reboot. A soft reboot will waits the termination of all processes before being restarted, while a hard one will not. When 'mode' is not provided, the default behaviour will be 'soft' mode.

Note: This method returns the HTTP Response.

Parameters:

  • String mode: Kind of device's reboot.

  • String uuidToken: Used for remote connections to device

Implementation

Future<Response> restartDeviceWithHttpInfo({
  String? mode,
  String? uuidToken,
}) async {
  // ignore: prefer_const_declarations
  final path = uuidToken != null
      ? '${LbSetupEnvironment.getApiEndpoint(iotUuid: uuidToken)}/device/restart'
      : '/device/restart';

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (mode != null) {
    queryParams.addAll(_queryParams('', 'mode', mode));
  }

  const contentTypes = <String>[];

  return apiClient.invokeAPI(
    path,
    'GET',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}