예제 #1
0
        // Checks the status of a report request. Returns a data object that contains both
        // report status and download URL.

        private async Task <ReportRequestStatus> PollGenerateReportAsync(string reportId)
        {
            var request = new PollGenerateReportRequest
            {
                ReportRequestId = reportId
            };

            return((await Service.CallAsync((s, r) => s.PollGenerateReportAsync(r), request)).ReportRequestStatus);
        }
        public async Task<ReportingOperationStatus> GetCurrentStatus(ServiceClient<IReportingService> reportingServiceClient)
        {
            var request = new PollGenerateReportRequest {ReportRequestId = _requestId,};

            var response = await reportingServiceClient.CallAsync((s, r) => s.PollGenerateReportAsync(r), request).ConfigureAwait(false);

            return new ReportingOperationStatus
                   {
                       TrackingId = response.TrackingId,
                       Status = response.ReportRequestStatus.Status,
                       ResultFileUrl = response.ReportRequestStatus.ReportDownloadUrl,
                   };
        }
예제 #3
0
        public async Task <ReportingOperationStatus> GetCurrentStatus(ServiceClient <IReportingService> reportingServiceClient)
        {
            var request = new PollGenerateReportRequest {
                ReportRequestId = _requestId,
            };

            var response = await reportingServiceClient.CallAsync((s, r) => s.PollGenerateReportAsync(r), request).ConfigureAwait(false);

            return(new ReportingOperationStatus
            {
                TrackingId = response.TrackingId,
                Status = response.ReportRequestStatus.Status,
                ResultFileUrl = response.ReportRequestStatus.ReportDownloadUrl,
            });
        }
        public async Task <PollGenerateReportResponse> PollGenerateReportAsync(ApiAuthentication auth, string reportRequestId, long?customerId, long?accountId)
        {
            var request = new PollGenerateReportRequest
            {
                ReportRequestId   = reportRequestId,
                CustomerId        = customerId.HasValue ? string.Format("{0}", customerId.Value) : "",
                CustomerAccountId = accountId.HasValue ? string.Format("{0}", accountId.Value) : "",
            };

            try
            {
                SetAuthHelper.SetAuth(auth, request);

                return(await Check().PollGenerateReportAsync(request));
            }
            catch (Exception ex)
            {
                Log(new LogEventArgs(ServiceType.Reporting, "PollGenerateReportAsync", ex.Message, new { Request = request }, ex));
            }

            return(null);
        }
        // Checks the status of a report request. Returns a data object that contains both
        // report status and download URL. 

        private async Task<ReportRequestStatus> PollGenerateReportAsync(string reportId)
        {
            var request = new PollGenerateReportRequest
            {
                ReportRequestId = reportId
            };

            return (await Service.CallAsync((s, r) => s.PollGenerateReportAsync(r), request)).ReportRequestStatus;
        }