createRecordingJob method Null safety

Future<CreateRecordingJobResponse> createRecordingJob(
  1. RecordingJobConfiguration recordingJobConfiguration
)

CreateRecordingJob shall create a new recording job.

The JobConfiguration returned from CreateRecordingJob shall be identical to the JobConfiguration passed into CreateRecordingJob, except for the ReceiverToken and the AutoCreateReceiver. In the returned structure, the ReceiverToken shall be present and valid and the AutoCreateReceiver field shall be omitted.

Implementation

Future<CreateRecordingJobResponse> createRecordingJob(
    RecordingJobConfiguration recordingJobConfiguration) async {
  loggy.debug('createRecording');

  final envelope = await transport.sendRequest(
      uri,
      transport.securedEnvelope(soap.RecordingsRequest.createRecordingJob(
          recordingJobConfiguration)));

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

  return CreateRecordingJobResponse.fromJson(envelope.body.response!);
}