getNetworkProtocols method Null safety

Future<List<NetworkProtocol>> getNetworkProtocols()

This operation gets defined network protocols from a device. The device shall support the getNetworkProtocols command returning configured network protocols.

Implementation

Future<List<NetworkProtocol>> getNetworkProtocols() async {
  loggy.debug('getNetworkProtocols');

  final envelope = await Soap.retrieveEnvelope(
      uri, onvif.secureRequest(SoapRequest.networkProtocols()));

  if (envelope.body.networkProtocolsResponse == null) throw Exception();

  return envelope.body.networkProtocolsResponse!.networkProtocols;
}