getHostname method Null safety

Future<HostnameInformation> getHostname()

Implementation

Future<HostnameInformation> getHostname() async {
  loggy.debug('getHostname');

  final envelope = await Soap.retrieveEnvelope(
    uri,
    SoapRequest.envelope(null, SoapRequest.hostname()),
  );

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

  return envelope.body.hostnameResponse!.hostnameInformation;
}