getSystemSupportInformation method

Future<SystemInformation?> getSystemSupportInformation({
  1. String? writeLogToFolder,
})

This operation gets arbitrary device diagnostics information from the device.

Access Class: READ_SYSTEM_SECRET

Implementation

Future<SystemInformation?> getSystemSupportInformation({
  String? writeLogToFolder,
}) async {
  loggy.debug('getSystemSupportInformation');

  String? xmlString;

  final securedXml = transport
      .getSecuredEnvelope(
        soap.Body(
          request: DeviceManagementRequest.getSystemSupportInformation(),
        ),
      )
      .toXml(soap.Transport.builder);

  final response = await transport.sendLogRequest(uri, securedXml);

  try {
    xmlString = parseMtom(response, writeLogToFolder: writeLogToFolder);

    loggy.debug('\ngetSystemSupportInformation - RESPONSE:\n$xmlString');
  } catch (e) {
    loggy.debug('Error parsing MTOM: $e');
  }

  final responseEnvelope = soap.Envelope.fromXmlString(
    utf8.decode(response.data!, allowMalformed: true),
  );

  if (responseEnvelope.body.hasFault) {
    throw Exception(responseEnvelope.body.fault.toString());
  }

  return GetSystemSupportInformationResponse.fromJson(
    responseEnvelope.body.response!,
  ).supportInformation;
}