Example #1
0
        private GetReportsResponse GetAnalyticsResponse(BaseClientService.Initializer initializer, PageViewsRequest request)
        {
            AnalyticsReportingService service = new AnalyticsReportingService(initializer);

            GetReportsRequest reportRequest = new GetReportsRequest
            {
                ReportRequests = new List <ReportRequest> {
                    RequestBuilders.GetReportRequest(request)
                }
            };

            ReportsResource.BatchGetRequest batchGetRequest = service.Reports.BatchGet(reportRequest);

            if (exceptionHandler != null)
            {
                batchGetRequest.AddExceptionHandler(exceptionHandler);
            }

            if (unsuccessfulResponseHandler != null)
            {
                batchGetRequest.AddUnsuccessfulResponseHandler(unsuccessfulResponseHandler);
            }

            return(batchGetRequest.Execute());
        }
Example #2
0
 public Services()
 {
     //todo:use IOC container
     MapperService                      = new MapperServices();
     RequestBuilder                     = new RequestBuilders();
     GoogleApiTextSearchService         = new GoogleApiService(ApiUrl.GooglePlacesApiTextSearchUrl);
     GoogleApiRadarSearchApiService     = new GoogleApiService(ApiUrl.GooglePlacesApiRadarSearchUrl);
     SpoonacularApiServiceComplexSearch = new SpoonacularApiServices(ApiUrl.SpoonacularApiComplexSearch);
 }
Example #3
0
 /// <summary>
 /// Gets the request builder of the specific type.
 /// </summary>
 /// <typeparam name="TRequestBuilder">The type of the request builder.</typeparam>
 /// <returns>
 /// Request builder implementation.
 /// </returns>
 public TRequestBuilder GetRequestBuilder <TRequestBuilder>() where TRequestBuilder : IRequestBuilder
 {
     return((TRequestBuilder)RequestBuilders[typeof(TRequestBuilder)]());
 }