コード例 #1
0
        private async Task <ReportingDownloadOperation> SubmitDownloadAsyncImpl(ReportRequest request)
        {
            var submitRequest = new SubmitGenerateReportRequest {
                ReportRequest = request,
            };
            SubmitGenerateReportResponse response;

            using (var apiService = new ServiceClient <IReportingService>(_authorizationData, _apiEnvironment))
            {
                try
                {
                    response = await apiService.CallAsync((s, r) => s.SubmitGenerateReportAsync(r), submitRequest).ConfigureAwait(false);
                }
                catch (Exception e)
                {
                    throw new CouldNotSubmitReportingDownloadException("Submit download operation failed.", e);
                }
            }

            return(new ReportingDownloadOperation(response.ReportRequestId, _authorizationData, response.TrackingId, _apiEnvironment)
            {
                StatusPollIntervalInMilliseconds = StatusPollIntervalInMilliseconds,
                DownloadHttpTimeout = DownloadHttpTimeout
            });
        }
コード例 #2
0
        // Request the report and returns the ReportRequestId that can be used to check report
        // status and then used to download the report.

        private async Task <string> SubmitGenerateReportAsync(ReportRequest report)
        {
            var request = new SubmitGenerateReportRequest
            {
                ReportRequest = report
            };

            return((await Service.CallAsync((s, r) => s.SubmitGenerateReportAsync(r), request)).ReportRequestId);
        }
コード例 #3
0
        private async Task <SubmitGenerateReportResponse> SubmitReportAsync(ApiAuthentication auth, ReportRequest reportRequest, long?customerId, long?accountId)
        {
            var request = new SubmitGenerateReportRequest
            {
                ReportRequest     = reportRequest,
                CustomerId        = customerId.HasValue ? string.Format("{0}", customerId.Value) : "",
                CustomerAccountId = accountId.HasValue ? string.Format("{0}", accountId.Value) : "",
            };

            try
            {
                SetAuthHelper.SetAuth(auth, request);

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

            return(null);
        }
コード例 #4
0
        private async Task<ReportingDownloadOperation> SubmitDownloadAsyncImpl(ReportRequest request)
        {
            var submitRequest = new SubmitGenerateReportRequest {ReportRequest = request,};
            SubmitGenerateReportResponse response;

            using (var apiService = new ServiceClient<IReportingService>(_authorizationData))
            {
                response = await apiService.CallAsync((s, r) => s.SubmitGenerateReportAsync(r), submitRequest).ConfigureAwait(false);
            }

            return new ReportingDownloadOperation(response.ReportRequestId, _authorizationData, response.TrackingId) {StatusPollIntervalInMilliseconds = StatusPollIntervalInMilliseconds};
        }
コード例 #5
0
        // Request the report and returns the ReportRequestId that can be used to check report
        // status and then used to download the report.

        private async Task<string> SubmitGenerateReportAsync(ReportRequest report)
        {
            var request = new SubmitGenerateReportRequest
            {
                ReportRequest = report
            };

            return (await Service.CallAsync((s, r) => s.SubmitGenerateReportAsync(r),request)).ReportRequestId;
        }
コード例 #6
0
        private async Task<ReportingDownloadOperation> SubmitDownloadAsyncImpl(ReportRequest request)
        {
            var submitRequest = new SubmitGenerateReportRequest {ReportRequest = request,};
            SubmitGenerateReportResponse response;

            using (var apiService = new ServiceClient<IReportingService>(_authorizationData, _apiEnvironment))
            {
                try
                {
                    response = await apiService.CallAsync((s, r) => s.SubmitGenerateReportAsync(r), submitRequest).ConfigureAwait(false);
                }
                catch (Exception e)
                {
                    throw new CouldNotSubmitReportingDownloadException("Submit download operation failed.", e);
                }               
            }

            return new ReportingDownloadOperation(response.ReportRequestId, _authorizationData, response.TrackingId, _apiEnvironment) {StatusPollIntervalInMilliseconds = StatusPollIntervalInMilliseconds};
        }