/// <summary>
        /// Lists the Safe Browsing threat lists available for download.
        /// Documentation https://developers.google.com/safebrowsing/v4/reference/threatLists/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 safebrowsing service.</param>
        /// <returns>ListThreatListsResponseResponse</returns>
        public static ListThreatListsResponse List(safebrowsingService service)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

                // Make the request.
                return(service.ThreatLists.List().Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request ThreatLists.List failed.", ex);
            }
        }
Example #2
0
        /// <summary>
        /// Finds the threat entries that match the Safe Browsing lists.
        /// Documentation https://developers.google.com/safebrowsing/v4/reference/threatMatches/find
        /// 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 safebrowsing service.</param>
        /// <param name="body">A valid safebrowsing v4 body.</param>
        /// <returns>FindThreatMatchesResponseResponse</returns>
        public static FindThreatMatchesResponse Find(safebrowsingService service, FindThreatMatchesRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }

                // Make the request.
                return(service.ThreatMatches.Find(body).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request ThreatMatches.Find failed.", ex);
            }
        }