getStatus method Null safety

Future<PtzStatus> getStatus(
  1. String profileToken
)

Operation to request PTZ status for the Node in the selected profile.

Implementation

Future<PtzStatus> getStatus(String profileToken) async {
  loggy.debug('getStatus');

  final envelope = await transport.sendRequest(uri,
      transport.securedEnvelope(soap.PtzRequest.getStatus(profileToken)));

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

  return GetStatusResponse.fromJson(envelope.body.response!).ptzStatus;
}