/// <summary>
        /// Lists sites with Ad Experience Report statuses of "Failing" or "Warning".
        /// Documentation https://developers.google.com/adexperiencereport/v1/reference/violatingSites/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 Adexperiencereport service.</param>
        /// <returns>ViolatingSitesResponseResponse</returns>
        public static ViolatingSitesResponse List(AdexperiencereportService service)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

                // Make the request.
                return(service.ViolatingSites.List().Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request ViolatingSites.List failed.", ex);
            }
        }
Example #2
0
        /// <summary>
        /// Gets a summary of the ad experience rating of a site.
        /// Documentation https://developers.google.com/adexperiencereport/v1/reference/sites/get
        /// 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 Adexperiencereport service.</param>
        /// <param name="name">The required site name. It should be the site property whose ad experiencesmay have been reviewed, and it should be URL-encoded. For example,sites/https%3A%2F%2Fwww.google.com. The server will return an error ofBAD_REQUEST if this field is not filled in. Note that if the site propertyis not yet verified in Search Console, the reportUrl field returned by theAPI will lead to the verification page, prompting the user to go throughthat process before they can gain access to the Ad Experience Report.</param>
        /// <returns>SiteSummaryResponseResponse</returns>
        public static SiteSummaryResponse Get(AdexperiencereportService service, string name)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (name == null)
                {
                    throw new ArgumentNullException(name);
                }

                // Make the request.
                return(service.Sites.Get(name).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Sites.Get failed.", ex);
            }
        }