public ITrackEventRequest FillTrackEventGaps(ITrackEventRequest userRequest)
        {
            IUTEvent utEvent = userRequest.Event.DeepCopyUTEvent();

            //order matters!
            IUTSessionConfig mergedSessionConfig = this.SessionConfigMerger.FillSessionConfigGaps(userRequest.SessionConfig);

            utEvent = this.ApplyActiveInteraction(utEvent, mergedSessionConfig);
            utEvent = this.ApplyDeviceIdentifier(utEvent);

            return(new TrackEventParameters(mergedSessionConfig, utEvent));
        }
Ejemplo n.º 2
0
        public async Task <UTResponse> TrackEventAsync(ITrackEventRequest request, CancellationToken cancelToken = default(CancellationToken))
        {
            BaseValidator.CheckNullAndThrow(request, this.GetType().Name + ".EventRequest ");

            ITrackEventRequest requestCopy = request.DeepCopyTrackEventRequest();

            ITrackEventRequest autocompletedRequest = this.requestMerger.FillTrackEventGaps(requestCopy);

            if (this.InteractionNotExists())
            {
                UTResponse uTResponse = await this.CreateInteractionAndSentEventAsync(request.Event, cancelToken);

                return(uTResponse);
            }

            var urlBuilder = new TrackEventUrlBuilder <ITrackEventRequest>(this.utGrammar);
            var taskFlow   = new TrackEventTask(urlBuilder, this.httpClient);

            var response = await RestApiCallFlow.LoadRequestFromNetworkFlow(autocompletedRequest, taskFlow, cancelToken);

            this.CheckResponseForValidInteraction(response);

            return(response);
        }