/// <summary> /// Execute async Delivery request /// </summary> /// <param name="request">Target Delivery request</param> /// <returns>Target Delivery Response</returns> internal Task <TargetDeliveryResponse> ExecuteRequestAsync(TargetDeliveryRequest request) { this.SetUrl(this.GetLocationHint(request)); Telemetry.AddTelemetry(request.DeliveryRequest, this.clientConfig); this.logger.LogRequest(request); var executeTask = this.deliveryApi.ExecuteAsync(this.clientConfig.OrganizationId, request.SessionId, request.DeliveryRequest); return(executeTask.ContinueWith(task => this.GetTargetDeliveryResponse(request, task.Result), TaskScheduler.Default)); }
/// <summary> /// Execute sync Delivery request /// </summary> /// <param name="request">Target Delivery request</param> /// <returns>Target Delivery Response</returns> internal TargetDeliveryResponse ExecuteRequest(TargetDeliveryRequest request) { this.SetUrl(this.GetLocationHint(request)); Telemetry.AddTelemetry(request.DeliveryRequest, this.clientConfig); this.logger.LogRequest(request); var response = this.deliveryApi.Execute(this.clientConfig.OrganizationId, request.SessionId, request.DeliveryRequest); return(this.GetTargetDeliveryResponse(request, response)); }