1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18namespace Google\Service\CustomSearchAPI\Resource;
19
20use Google\Service\CustomSearchAPI\Search;
21
22/**
23 * The "siterestrict" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $customsearchService = new Google\Service\CustomSearchAPI(...);
27 *   $siterestrict = $customsearchService->siterestrict;
28 *  </code>
29 */
30class CseSiterestrict extends \Google\Service\Resource
31{
32  /**
33   * Returns metadata about the search performed, metadata about the engine used
34   * for the search, and the search results. Uses a small set of url patterns.
35   * (siterestrict.listCseSiterestrict)
36   *
37   * @param array $optParams Optional parameters.
38   *
39   * @opt_param string c2coff Enables or disables [Simplified and Traditional
40   * Chinese Search](https://developers.google.com/custom-
41   * search/docs/json_api_reference#chineseSearch). The default value for this
42   * parameter is 0 (zero), meaning that the feature is enabled. Supported values
43   * are: * `1`: Disabled * `0`: Enabled (default)
44   * @opt_param string cr Restricts search results to documents originating in a
45   * particular country. You may use [Boolean
46   * operators](https://developers.google.com/custom-
47   * search/docs/json_api_reference#booleanOperators) in the cr parameter's value.
48   * Google Search determines the country of a document by analyzing: * the top-
49   * level domain (TLD) of the document's URL * the geographic location of the Web
50   * server's IP address See the [Country Parameter
51   * Values](https://developers.google.com/custom-
52   * search/docs/json_api_reference#countryCollections) page for a list of valid
53   * values for this parameter.
54   * @opt_param string cx The Programmable Search Engine ID to use for this
55   * request.
56   * @opt_param string dateRestrict Restricts results to URLs based on date.
57   * Supported values include: * `d[number]`: requests results from the specified
58   * number of past days. * `w[number]`: requests results from the specified
59   * number of past weeks. * `m[number]`: requests results from the specified
60   * number of past months. * `y[number]`: requests results from the specified
61   * number of past years.
62   * @opt_param string exactTerms Identifies a phrase that all documents in the
63   * search results must contain.
64   * @opt_param string excludeTerms Identifies a word or phrase that should not
65   * appear in any documents in the search results.
66   * @opt_param string fileType Restricts results to files of a specified
67   * extension. A list of file types indexable by Google can be found in Search
68   * Console [Help Center](https://support.google.com/webmasters/answer/35287).
69   * @opt_param string filter Controls turning on or off the duplicate content
70   * filter. * See [Automatic Filtering](https://developers.google.com/custom-
71   * search/docs/json_api_reference#automaticFiltering) for more information about
72   * Google's search results filters. Note that host crowding filtering applies
73   * only to multi-site searches. * By default, Google applies filtering to all
74   * search results to improve the quality of those results. Acceptable values
75   * are: * `0`: Turns off duplicate content filter. * `1`: Turns on duplicate
76   * content filter.
77   * @opt_param string gl Geolocation of end user. * The `gl` parameter value is a
78   * two-letter country code. The `gl` parameter boosts search results whose
79   * country of origin matches the parameter value. See the [Country
80   * Codes](https://developers.google.com/custom-
81   * search/docs/json_api_reference#countryCodes) page for a list of valid values.
82   * * Specifying a `gl` parameter value should lead to more relevant results.
83   * This is particularly true for international customers and, even more
84   * specifically, for customers in English- speaking countries other than the
85   * United States.
86   * @opt_param string googlehost **Deprecated**. Use the `gl` parameter for a
87   * similar effect. The local Google domain (for example, google.com, google.de,
88   * or google.fr) to use to perform the search.
89   * @opt_param string highRange Specifies the ending value for a search range. *
90   * Use `lowRange` and `highRange` to append an inclusive search range of
91   * `lowRange...highRange` to the query.
92   * @opt_param string hl Sets the user interface language. * Explicitly setting
93   * this parameter improves the performance and the quality of your search
94   * results. * See the [Interface Languages](https://developers.google.com
95   * /custom-search/docs/json_api_reference#wsInterfaceLanguages) section of
96   * [Internationalizing Queries and Results
97   * Presentation](https://developers.google.com/custom-
98   * search/docs/json_api_reference#wsInternationalizing) for more information,
99   * and [Supported Interface Languages](https://developers.google.com/custom-
100   * search/docs/json_api_reference#interfaceLanguages) for a list of supported
101   * languages.
102   * @opt_param string hq Appends the specified query terms to the query, as if
103   * they were combined with a logical AND operator.
104   * @opt_param string imgColorType Returns black and white, grayscale,
105   * transparent, or color images. Acceptable values are: * `"color"` * `"gray"` *
106   * `"mono"`: black and white * `"trans"`: transparent background
107   * @opt_param string imgDominantColor Returns images of a specific dominant
108   * color. Acceptable values are: * `"black"` * `"blue"` * `"brown"` * `"gray"` *
109   * `"green"` * `"orange"` * `"pink"` * `"purple"` * `"red"` * `"teal"` *
110   * `"white"` * `"yellow"`
111   * @opt_param string imgSize Returns images of a specified size. Acceptable
112   * values are: * `"huge"` * `"icon"` * `"large"` * `"medium"` * `"small"` *
113   * `"xlarge"` * `"xxlarge"`
114   * @opt_param string imgType Returns images of a type. Acceptable values are: *
115   * `"clipart"` * `"face"` * `"lineart"` * `"stock"` * `"photo"` * `"animated"`
116   * @opt_param string linkSite Specifies that all search results should contain a
117   * link to a particular URL.
118   * @opt_param string lowRange Specifies the starting value for a search range.
119   * Use `lowRange` and `highRange` to append an inclusive search range of
120   * `lowRange...highRange` to the query.
121   * @opt_param string lr Restricts the search to documents written in a
122   * particular language (e.g., `lr=lang_ja`). Acceptable values are: *
123   * `"lang_ar"`: Arabic * `"lang_bg"`: Bulgarian * `"lang_ca"`: Catalan *
124   * `"lang_cs"`: Czech * `"lang_da"`: Danish * `"lang_de"`: German * `"lang_el"`:
125   * Greek * `"lang_en"`: English * `"lang_es"`: Spanish * `"lang_et"`: Estonian *
126   * `"lang_fi"`: Finnish * `"lang_fr"`: French * `"lang_hr"`: Croatian *
127   * `"lang_hu"`: Hungarian * `"lang_id"`: Indonesian * `"lang_is"`: Icelandic *
128   * `"lang_it"`: Italian * `"lang_iw"`: Hebrew * `"lang_ja"`: Japanese *
129   * `"lang_ko"`: Korean * `"lang_lt"`: Lithuanian * `"lang_lv"`: Latvian *
130   * `"lang_nl"`: Dutch * `"lang_no"`: Norwegian * `"lang_pl"`: Polish *
131   * `"lang_pt"`: Portuguese * `"lang_ro"`: Romanian * `"lang_ru"`: Russian *
132   * `"lang_sk"`: Slovak * `"lang_sl"`: Slovenian * `"lang_sr"`: Serbian *
133   * `"lang_sv"`: Swedish * `"lang_tr"`: Turkish * `"lang_zh-CN"`: Chinese
134   * (Simplified) * `"lang_zh-TW"`: Chinese (Traditional)
135   * @opt_param int num Number of search results to return. * Valid values are
136   * integers between 1 and 10, inclusive.
137   * @opt_param string orTerms Provides additional search terms to check for in a
138   * document, where each document in the search results must contain at least one
139   * of the additional search terms.
140   * @opt_param string q Query
141   * @opt_param string relatedSite Specifies that all search results should be
142   * pages that are related to the specified URL.
143   * @opt_param string rights Filters based on licensing. Supported values
144   * include: `cc_publicdomain`, `cc_attribute`, `cc_sharealike`,
145   * `cc_noncommercial`, `cc_nonderived` and combinations of these. See [typical
146   * combinations](https://wiki.creativecommons.org/wiki/CC_Search_integration).
147   * @opt_param string safe Search safety level. Acceptable values are: *
148   * `"active"`: Enables SafeSearch filtering. * `"off"`: Disables SafeSearch
149   * filtering. (default)
150   * @opt_param string searchType Specifies the search type: `image`. If
151   * unspecified, results are limited to webpages. Acceptable values are: *
152   * `"image"`: custom image search.
153   * @opt_param string siteSearch Specifies a given site which should always be
154   * included or excluded from results (see `siteSearchFilter` parameter, below).
155   * @opt_param string siteSearchFilter Controls whether to include or exclude
156   * results from the site named in the `siteSearch` parameter. Acceptable values
157   * are: * `"e"`: exclude * `"i"`: include
158   * @opt_param string sort The sort expression to apply to the results. The sort
159   * parameter specifies that the results be sorted according to the specified
160   * expression i.e. sort by date. [Example:
161   * sort=date](https://developers.google.com/custom-search/docs/structured_search
162   * #sort-by-attribute).
163   * @opt_param string start The index of the first result to return. The default
164   * number of results per page is 10, so `=11` would start at the top of the
165   * second page of results. **Note**: The JSON API will never return more than
166   * 100 results, even if more than 100 documents match the query, so setting the
167   * sum of `start + num` to a number greater than 100 will produce an error. Also
168   * note that the maximum value for `num` is 10.
169   * @return Search
170   */
171  public function listCseSiterestrict($optParams = [])
172  {
173    $params = [];
174    $params = array_merge($params, $optParams);
175    return $this->call('list', [$params], Search::class);
176  }
177}
178
179// Adding a class alias for backwards compatibility with the previous class name.
180class_alias(CseSiterestrict::class, 'Google_Service_CustomSearchAPI_Resource_CseSiterestrict');
181