public ITrackDownloadRequest FillTrackDownloadGaps(ITrackDownloadRequest userRequest) { var utDownload = userRequest.Download.DeepCopyUTDownload(); //order matters! IUTSessionConfig mergedSessionConfig = this.SessionConfigMerger.FillSessionConfigGaps(userRequest.SessionConfig); var utEvent = this.ApplyActiveInteraction(utDownload, mergedSessionConfig); utEvent = this.ApplyDeviceIdentifier(utEvent); utDownload = new UTDownload(utEvent); return(new TrackDownloadParameters(mergedSessionConfig, utDownload)); }
public async Task <UTResponse> TrackDownloadEventAsync(ITrackDownloadRequest request, CancellationToken cancelToken = default(CancellationToken)) { BaseValidator.CheckNullAndThrow(request, this.GetType().Name + ".DownloadRequest"); ITrackDownloadRequest requestCopy = request.DeepCopyTrackDownloadRequest(); ITrackDownloadRequest autocompletedRequest = this.requestMerger.FillTrackDownloadGaps(requestCopy); //FIXME: @igk if (this.InteractionNotExists()) { return(await this.CreateInteractionAndSentEventAsync(request.Download, cancelToken)); } var urlBuilder = new TrackEventUrlBuilder <ITrackDownloadRequest>(this.utGrammar); var taskFlow = new TrackDownloadTask(urlBuilder, this.httpClient); var response = await RestApiCallFlow.LoadRequestFromNetworkFlow(autocompletedRequest, taskFlow, cancelToken); this.CheckResponseForValidInteraction(response); return(response); }