Exemplo n.º 1
0
        /// <summary>
        /// Retrieves the authenticated user's list of performance metrics.
        /// Documentation https://developers.google.com/adexchangebuyer/v1.4/reference/performanceReport/list
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated AdExchangeBuyer service.</param>
        /// <param name="accountId">The account id to get the reports.</param>
        /// <param name="endDateTime">The end time of the report in ISO 8601 timestamp format using UTC.</param>
        /// <param name="startDateTime">The start time of the report in ISO 8601 timestamp format using UTC.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>PerformanceReportListResponse</returns>
        public static PerformanceReportList List(AdExchangeBuyerService service, string accountId, string endDateTime, string startDateTime, PerformanceReportListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (accountId == null)
                {
                    throw new ArgumentNullException(accountId);
                }
                if (endDateTime == null)
                {
                    throw new ArgumentNullException(endDateTime);
                }
                if (startDateTime == null)
                {
                    throw new ArgumentNullException(startDateTime);
                }

                // Building the initial request.
                var request = service.PerformanceReport.List(accountId, endDateTime, startDateTime);

                // Applying optional parameters to the request.
                request = (PerformanceReportResource.ListRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request PerformanceReport.List failed.", ex);
            }
        }
        /// <summary>
        /// Gets the requested product.
        /// Documentation https://developers.google.com/adexchangebuyer/v1.4/reference/products/search
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated AdExchangeBuyer service.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>GetOffersResponseResponse</returns>
        public static GetOffersResponse Search(AdExchangeBuyerService service, ProductsSearchOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

                // Building the initial request.
                var request = service.Products.Search();

                // Applying optional parameters to the request.
                request = (ProductsResource.SearchRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Products.Search failed.", ex);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission.
        /// Documentation https://developers.google.com/adexchangebuyer/v1.4/reference/creatives/list
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated AdExchangeBuyer service.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>CreativesListResponse</returns>
        public static CreativesList List(AdExchangeBuyerService service, CreativesListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

                // Building the initial request.
                var request = service.Creatives.List();

                // Applying optional parameters to the request.
                request = (CreativesResource.ListRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Creatives.List failed.", ex);
            }
        }