google-apis-customsearch_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Apis
17
+ module CustomsearchV1
18
+ # Version of the google-apis-customsearch_v1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20200917"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,372 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module CustomsearchV1
24
+
25
+ class Promotion
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ class BodyLine
29
+ class Representation < Google::Apis::Core::JsonRepresentation; end
30
+
31
+ include Google::Apis::Core::JsonObjectSupport
32
+ end
33
+
34
+ class Image
35
+ class Representation < Google::Apis::Core::JsonRepresentation; end
36
+
37
+ include Google::Apis::Core::JsonObjectSupport
38
+ end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class Result
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ class Image
47
+ class Representation < Google::Apis::Core::JsonRepresentation; end
48
+
49
+ include Google::Apis::Core::JsonObjectSupport
50
+ end
51
+
52
+ class Label
53
+ class Representation < Google::Apis::Core::JsonRepresentation; end
54
+
55
+ include Google::Apis::Core::JsonObjectSupport
56
+ end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class Search
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ class Queries
65
+ class Representation < Google::Apis::Core::JsonRepresentation; end
66
+
67
+ class NextPage
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class PreviousPage
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class Request
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ include Google::Apis::Core::JsonObjectSupport
86
+ end
87
+
88
+ class SearchInformation
89
+ class Representation < Google::Apis::Core::JsonRepresentation; end
90
+
91
+ include Google::Apis::Core::JsonObjectSupport
92
+ end
93
+
94
+ class Spelling
95
+ class Representation < Google::Apis::Core::JsonRepresentation; end
96
+
97
+ include Google::Apis::Core::JsonObjectSupport
98
+ end
99
+
100
+ class Url
101
+ class Representation < Google::Apis::Core::JsonRepresentation; end
102
+
103
+ include Google::Apis::Core::JsonObjectSupport
104
+ end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class Promotion
110
+ # @private
111
+ class Representation < Google::Apis::Core::JsonRepresentation
112
+ collection :body_lines, as: 'bodyLines', class: Google::Apis::CustomsearchV1::Promotion::BodyLine, decorator: Google::Apis::CustomsearchV1::Promotion::BodyLine::Representation
113
+
114
+ property :display_link, as: 'displayLink'
115
+ property :html_title, as: 'htmlTitle'
116
+ property :image, as: 'image', class: Google::Apis::CustomsearchV1::Promotion::Image, decorator: Google::Apis::CustomsearchV1::Promotion::Image::Representation
117
+
118
+ property :link, as: 'link'
119
+ property :title, as: 'title'
120
+ end
121
+
122
+ class BodyLine
123
+ # @private
124
+ class Representation < Google::Apis::Core::JsonRepresentation
125
+ property :html_title, as: 'htmlTitle'
126
+ property :link, as: 'link'
127
+ property :title, as: 'title'
128
+ property :url, as: 'url'
129
+ end
130
+ end
131
+
132
+ class Image
133
+ # @private
134
+ class Representation < Google::Apis::Core::JsonRepresentation
135
+ property :height, as: 'height'
136
+ property :source, as: 'source'
137
+ property :width, as: 'width'
138
+ end
139
+ end
140
+ end
141
+
142
+ class Result
143
+ # @private
144
+ class Representation < Google::Apis::Core::JsonRepresentation
145
+ property :cache_id, as: 'cacheId'
146
+ property :display_link, as: 'displayLink'
147
+ property :file_format, as: 'fileFormat'
148
+ property :formatted_url, as: 'formattedUrl'
149
+ property :html_formatted_url, as: 'htmlFormattedUrl'
150
+ property :html_snippet, as: 'htmlSnippet'
151
+ property :html_title, as: 'htmlTitle'
152
+ property :image, as: 'image', class: Google::Apis::CustomsearchV1::Result::Image, decorator: Google::Apis::CustomsearchV1::Result::Image::Representation
153
+
154
+ property :kind, as: 'kind'
155
+ collection :labels, as: 'labels', class: Google::Apis::CustomsearchV1::Result::Label, decorator: Google::Apis::CustomsearchV1::Result::Label::Representation
156
+
157
+ property :link, as: 'link'
158
+ property :mime, as: 'mime'
159
+ hash :pagemap, as: 'pagemap'
160
+ property :snippet, as: 'snippet'
161
+ property :title, as: 'title'
162
+ end
163
+
164
+ class Image
165
+ # @private
166
+ class Representation < Google::Apis::Core::JsonRepresentation
167
+ property :byte_size, as: 'byteSize'
168
+ property :context_link, as: 'contextLink'
169
+ property :height, as: 'height'
170
+ property :thumbnail_height, as: 'thumbnailHeight'
171
+ property :thumbnail_link, as: 'thumbnailLink'
172
+ property :thumbnail_width, as: 'thumbnailWidth'
173
+ property :width, as: 'width'
174
+ end
175
+ end
176
+
177
+ class Label
178
+ # @private
179
+ class Representation < Google::Apis::Core::JsonRepresentation
180
+ property :display_name, as: 'displayName'
181
+ property :label_with_op, as: 'label_with_op'
182
+ property :name, as: 'name'
183
+ end
184
+ end
185
+ end
186
+
187
+ class Search
188
+ # @private
189
+ class Representation < Google::Apis::Core::JsonRepresentation
190
+ hash :context, as: 'context'
191
+ collection :items, as: 'items', class: Google::Apis::CustomsearchV1::Result, decorator: Google::Apis::CustomsearchV1::Result::Representation
192
+
193
+ property :kind, as: 'kind'
194
+ collection :promotions, as: 'promotions', class: Google::Apis::CustomsearchV1::Promotion, decorator: Google::Apis::CustomsearchV1::Promotion::Representation
195
+
196
+ property :queries, as: 'queries', class: Google::Apis::CustomsearchV1::Search::Queries, decorator: Google::Apis::CustomsearchV1::Search::Queries::Representation
197
+
198
+ property :search_information, as: 'searchInformation', class: Google::Apis::CustomsearchV1::Search::SearchInformation, decorator: Google::Apis::CustomsearchV1::Search::SearchInformation::Representation
199
+
200
+ property :spelling, as: 'spelling', class: Google::Apis::CustomsearchV1::Search::Spelling, decorator: Google::Apis::CustomsearchV1::Search::Spelling::Representation
201
+
202
+ property :url, as: 'url', class: Google::Apis::CustomsearchV1::Search::Url, decorator: Google::Apis::CustomsearchV1::Search::Url::Representation
203
+
204
+ end
205
+
206
+ class Queries
207
+ # @private
208
+ class Representation < Google::Apis::Core::JsonRepresentation
209
+ collection :next_page, as: 'nextPage', class: Google::Apis::CustomsearchV1::Search::Queries::NextPage, decorator: Google::Apis::CustomsearchV1::Search::Queries::NextPage::Representation
210
+
211
+ collection :previous_page, as: 'previousPage', class: Google::Apis::CustomsearchV1::Search::Queries::PreviousPage, decorator: Google::Apis::CustomsearchV1::Search::Queries::PreviousPage::Representation
212
+
213
+ collection :request, as: 'request', class: Google::Apis::CustomsearchV1::Search::Queries::Request, decorator: Google::Apis::CustomsearchV1::Search::Queries::Request::Representation
214
+
215
+ end
216
+
217
+ class NextPage
218
+ # @private
219
+ class Representation < Google::Apis::Core::JsonRepresentation
220
+ property :count, as: 'count'
221
+ property :cr, as: 'cr'
222
+ property :cx, as: 'cx'
223
+ property :date_restrict, as: 'dateRestrict'
224
+ property :disable_cn_tw_translation, as: 'disableCnTwTranslation'
225
+ property :exact_terms, as: 'exactTerms'
226
+ property :exclude_terms, as: 'excludeTerms'
227
+ property :file_type, as: 'fileType'
228
+ property :filter, as: 'filter'
229
+ property :gl, as: 'gl'
230
+ property :google_host, as: 'googleHost'
231
+ property :high_range, as: 'highRange'
232
+ property :hl, as: 'hl'
233
+ property :hq, as: 'hq'
234
+ property :img_color_type, as: 'imgColorType'
235
+ property :img_dominant_color, as: 'imgDominantColor'
236
+ property :img_size, as: 'imgSize'
237
+ property :img_type, as: 'imgType'
238
+ property :input_encoding, as: 'inputEncoding'
239
+ property :language, as: 'language'
240
+ property :link_site, as: 'linkSite'
241
+ property :low_range, as: 'lowRange'
242
+ property :or_terms, as: 'orTerms'
243
+ property :output_encoding, as: 'outputEncoding'
244
+ property :related_site, as: 'relatedSite'
245
+ property :rights, as: 'rights'
246
+ property :safe, as: 'safe'
247
+ property :search_terms, as: 'searchTerms'
248
+ property :search_type, as: 'searchType'
249
+ property :site_search, as: 'siteSearch'
250
+ property :site_search_filter, as: 'siteSearchFilter'
251
+ property :sort, as: 'sort'
252
+ property :start_index, as: 'startIndex'
253
+ property :start_page, as: 'startPage'
254
+ property :title, as: 'title'
255
+ property :total_results, :numeric_string => true, as: 'totalResults'
256
+ end
257
+ end
258
+
259
+ class PreviousPage
260
+ # @private
261
+ class Representation < Google::Apis::Core::JsonRepresentation
262
+ property :count, as: 'count'
263
+ property :cr, as: 'cr'
264
+ property :cx, as: 'cx'
265
+ property :date_restrict, as: 'dateRestrict'
266
+ property :disable_cn_tw_translation, as: 'disableCnTwTranslation'
267
+ property :exact_terms, as: 'exactTerms'
268
+ property :exclude_terms, as: 'excludeTerms'
269
+ property :file_type, as: 'fileType'
270
+ property :filter, as: 'filter'
271
+ property :gl, as: 'gl'
272
+ property :google_host, as: 'googleHost'
273
+ property :high_range, as: 'highRange'
274
+ property :hl, as: 'hl'
275
+ property :hq, as: 'hq'
276
+ property :img_color_type, as: 'imgColorType'
277
+ property :img_dominant_color, as: 'imgDominantColor'
278
+ property :img_size, as: 'imgSize'
279
+ property :img_type, as: 'imgType'
280
+ property :input_encoding, as: 'inputEncoding'
281
+ property :language, as: 'language'
282
+ property :link_site, as: 'linkSite'
283
+ property :low_range, as: 'lowRange'
284
+ property :or_terms, as: 'orTerms'
285
+ property :output_encoding, as: 'outputEncoding'
286
+ property :related_site, as: 'relatedSite'
287
+ property :rights, as: 'rights'
288
+ property :safe, as: 'safe'
289
+ property :search_terms, as: 'searchTerms'
290
+ property :search_type, as: 'searchType'
291
+ property :site_search, as: 'siteSearch'
292
+ property :site_search_filter, as: 'siteSearchFilter'
293
+ property :sort, as: 'sort'
294
+ property :start_index, as: 'startIndex'
295
+ property :start_page, as: 'startPage'
296
+ property :title, as: 'title'
297
+ property :total_results, :numeric_string => true, as: 'totalResults'
298
+ end
299
+ end
300
+
301
+ class Request
302
+ # @private
303
+ class Representation < Google::Apis::Core::JsonRepresentation
304
+ property :count, as: 'count'
305
+ property :cr, as: 'cr'
306
+ property :cx, as: 'cx'
307
+ property :date_restrict, as: 'dateRestrict'
308
+ property :disable_cn_tw_translation, as: 'disableCnTwTranslation'
309
+ property :exact_terms, as: 'exactTerms'
310
+ property :exclude_terms, as: 'excludeTerms'
311
+ property :file_type, as: 'fileType'
312
+ property :filter, as: 'filter'
313
+ property :gl, as: 'gl'
314
+ property :google_host, as: 'googleHost'
315
+ property :high_range, as: 'highRange'
316
+ property :hl, as: 'hl'
317
+ property :hq, as: 'hq'
318
+ property :img_color_type, as: 'imgColorType'
319
+ property :img_dominant_color, as: 'imgDominantColor'
320
+ property :img_size, as: 'imgSize'
321
+ property :img_type, as: 'imgType'
322
+ property :input_encoding, as: 'inputEncoding'
323
+ property :language, as: 'language'
324
+ property :link_site, as: 'linkSite'
325
+ property :low_range, as: 'lowRange'
326
+ property :or_terms, as: 'orTerms'
327
+ property :output_encoding, as: 'outputEncoding'
328
+ property :related_site, as: 'relatedSite'
329
+ property :rights, as: 'rights'
330
+ property :safe, as: 'safe'
331
+ property :search_terms, as: 'searchTerms'
332
+ property :search_type, as: 'searchType'
333
+ property :site_search, as: 'siteSearch'
334
+ property :site_search_filter, as: 'siteSearchFilter'
335
+ property :sort, as: 'sort'
336
+ property :start_index, as: 'startIndex'
337
+ property :start_page, as: 'startPage'
338
+ property :title, as: 'title'
339
+ property :total_results, :numeric_string => true, as: 'totalResults'
340
+ end
341
+ end
342
+ end
343
+
344
+ class SearchInformation
345
+ # @private
346
+ class Representation < Google::Apis::Core::JsonRepresentation
347
+ property :formatted_search_time, as: 'formattedSearchTime'
348
+ property :formatted_total_results, as: 'formattedTotalResults'
349
+ property :search_time, as: 'searchTime'
350
+ property :total_results, as: 'totalResults'
351
+ end
352
+ end
353
+
354
+ class Spelling
355
+ # @private
356
+ class Representation < Google::Apis::Core::JsonRepresentation
357
+ property :corrected_query, as: 'correctedQuery'
358
+ property :html_corrected_query, as: 'htmlCorrectedQuery'
359
+ end
360
+ end
361
+
362
+ class Url
363
+ # @private
364
+ class Representation < Google::Apis::Core::JsonRepresentation
365
+ property :template, as: 'template'
366
+ property :type, as: 'type'
367
+ end
368
+ end
369
+ end
370
+ end
371
+ end
372
+ end
@@ -0,0 +1,463 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module CustomsearchV1
23
+ # Custom Search API
24
+ #
25
+ # Searches over a website or collection of websites
26
+ #
27
+ # @example
28
+ # require 'google/apis/customsearch_v1'
29
+ #
30
+ # Customsearch = Google::Apis::CustomsearchV1 # Alias the module
31
+ # service = Customsearch::CustomSearchAPIService.new
32
+ #
33
+ # @see https://developers.google.com/custom-search/v1/introduction
34
+ class CustomSearchAPIService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://customsearch.googleapis.com/', '',
47
+ client_name: 'google-apis-customsearch_v1',
48
+ client_version: Google::Apis::CustomsearchV1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Returns metadata about the search performed, metadata about the engine used
53
+ # for the search, and the search results.
54
+ # @param [String] c2coff
55
+ # Enables or disables [Simplified and Traditional Chinese Search](https://
56
+ # developers.google.com/custom-search/docs/xml_results#chineseSearch). The
57
+ # default value for this parameter is 0 (zero), meaning that the feature is
58
+ # enabled. Supported values are: * `1`: Disabled * `0`: Enabled (default)
59
+ # @param [String] cr
60
+ # Restricts search results to documents originating in a particular country. You
61
+ # may use [Boolean operators](https://developers.google.com/custom-search/docs/
62
+ # xml_results_appendices#booleanOperators) in the cr parameter's value. Google
63
+ # Search determines the country of a document by analyzing: * the top-level
64
+ # domain (TLD) of the document's URL * the geographic location of the Web server'
65
+ # s IP address See the [Country Parameter Values](https://developers.google.com/
66
+ # custom-search/docs/xml_results_appendices#countryCollections) page for a list
67
+ # of valid values for this parameter.
68
+ # @param [String] cx
69
+ # The Programmable Search Engine ID to use for this request.
70
+ # @param [String] date_restrict
71
+ # Restricts results to URLs based on date. Supported values include: * `d[number]
72
+ # `: requests results from the specified number of past days. * `w[number]`:
73
+ # requests results from the specified number of past weeks. * `m[number]`:
74
+ # requests results from the specified number of past months. * `y[number]`:
75
+ # requests results from the specified number of past years.
76
+ # @param [String] exact_terms
77
+ # Identifies a phrase that all documents in the search results must contain.
78
+ # @param [String] exclude_terms
79
+ # Identifies a word or phrase that should not appear in any documents in the
80
+ # search results.
81
+ # @param [String] file_type
82
+ # Restricts results to files of a specified extension. A list of file types
83
+ # indexable by Google can be found in Search Console [Help Center](https://
84
+ # support.google.com/webmasters/answer/35287).
85
+ # @param [String] filter
86
+ # Controls turning on or off the duplicate content filter. * See [Automatic
87
+ # Filtering](https://developers.google.com/custom-search/docs/xml_results#
88
+ # automaticFiltering) for more information about Google's search results filters.
89
+ # Note that host crowding filtering applies only to multi-site searches. * By
90
+ # default, Google applies filtering to all search results to improve the quality
91
+ # of those results. Acceptable values are: * `0`: Turns off duplicate content
92
+ # filter. * `1`: Turns on duplicate content filter.
93
+ # @param [String] gl
94
+ # Geolocation of end user. * The `gl` parameter value is a two-letter country
95
+ # code. The `gl` parameter boosts search results whose country of origin matches
96
+ # the parameter value. See the [Country Codes](https://developers.google.com/
97
+ # custom-search/docs/xml_results_appendices#countryCodes) page for a list of
98
+ # valid values. * Specifying a `gl` parameter value should lead to more relevant
99
+ # results. This is particularly true for international customers and, even more
100
+ # specifically, for customers in English- speaking countries other than the
101
+ # United States.
102
+ # @param [String] googlehost
103
+ # **Deprecated**. Use the `gl` parameter for a similar effect. The local Google
104
+ # domain (for example, google.com, google.de, or google.fr) to use to perform
105
+ # the search.
106
+ # @param [String] high_range
107
+ # Specifies the ending value for a search range. * Use `lowRange` and `highRange`
108
+ # to append an inclusive search range of `lowRange...highRange` to the query.
109
+ # @param [String] hl
110
+ # Sets the user interface language. * Explicitly setting this parameter improves
111
+ # the performance and the quality of your search results. * See the [Interface
112
+ # Languages](https://developers.google.com/custom-search/docs/xml_results#
113
+ # wsInterfaceLanguages) section of [Internationalizing Queries and Results
114
+ # Presentation](https://developers.google.com/custom-search/docs/xml_results#
115
+ # wsInternationalizing) for more information, and (Supported Interface Languages)
116
+ # [https://developers.google.com/custom-search/docs/xml_results_appendices#
117
+ # interfaceLanguages] for a list of supported languages.
118
+ # @param [String] hq
119
+ # Appends the specified query terms to the query, as if they were combined with
120
+ # a logical AND operator.
121
+ # @param [String] img_color_type
122
+ # Returns black and white, grayscale, transparent, or color images. Acceptable
123
+ # values are: * `"color"` * `"gray"` * `"mono"`: black and white * `"trans"`:
124
+ # transparent background
125
+ # @param [String] img_dominant_color
126
+ # Returns images of a specific dominant color. Acceptable values are: * `"black"`
127
+ # * `"blue"` * `"brown"` * `"gray"` * `"green"` * `"orange"` * `"pink"` * `"
128
+ # purple"` * `"red"` * `"teal"` * `"white"` * `"yellow"`
129
+ # @param [String] img_size
130
+ # Returns images of a specified size. Acceptable values are: * `"huge"` * `"icon"
131
+ # ` * `"large"` * `"medium"` * `"small"` * `"xlarge"` * `"xxlarge"`
132
+ # @param [String] img_type
133
+ # Returns images of a type. Acceptable values are: * `"clipart"` * `"face"` * `"
134
+ # lineart"` * `"stock"` * `"photo"` * `"animated"`
135
+ # @param [String] link_site
136
+ # Specifies that all search results should contain a link to a particular URL.
137
+ # @param [String] low_range
138
+ # Specifies the starting value for a search range. Use `lowRange` and `highRange`
139
+ # to append an inclusive search range of `lowRange...highRange` to the query.
140
+ # @param [String] lr
141
+ # Restricts the search to documents written in a particular language (e.g., `lr=
142
+ # lang_ja`). Acceptable values are: * `"lang_ar"`: Arabic * `"lang_bg"`:
143
+ # Bulgarian * `"lang_ca"`: Catalan * `"lang_cs"`: Czech * `"lang_da"`: Danish * `
144
+ # "lang_de"`: German * `"lang_el"`: Greek * `"lang_en"`: English * `"lang_es"`:
145
+ # Spanish * `"lang_et"`: Estonian * `"lang_fi"`: Finnish * `"lang_fr"`: French *
146
+ # `"lang_hr"`: Croatian * `"lang_hu"`: Hungarian * `"lang_id"`: Indonesian * `"
147
+ # lang_is"`: Icelandic * `"lang_it"`: Italian * `"lang_iw"`: Hebrew * `"lang_ja"`
148
+ # : Japanese * `"lang_ko"`: Korean * `"lang_lt"`: Lithuanian * `"lang_lv"`:
149
+ # Latvian * `"lang_nl"`: Dutch * `"lang_no"`: Norwegian * `"lang_pl"`: Polish * `
150
+ # "lang_pt"`: Portuguese * `"lang_ro"`: Romanian * `"lang_ru"`: Russian * `"
151
+ # lang_sk"`: Slovak * `"lang_sl"`: Slovenian * `"lang_sr"`: Serbian * `"lang_sv"`
152
+ # : Swedish * `"lang_tr"`: Turkish * `"lang_zh-CN"`: Chinese (Simplified) * `"
153
+ # lang_zh-TW"`: Chinese (Traditional)
154
+ # @param [Fixnum] num
155
+ # Number of search results to return. * Valid values are integers between 1 and
156
+ # 10, inclusive.
157
+ # @param [String] or_terms
158
+ # Provides additional search terms to check for in a document, where each
159
+ # document in the search results must contain at least one of the additional
160
+ # search terms.
161
+ # @param [String] q
162
+ # Query
163
+ # @param [String] related_site
164
+ # Specifies that all search results should be pages that are related to the
165
+ # specified URL.
166
+ # @param [String] rights
167
+ # Filters based on licensing. Supported values include: `cc_publicdomain`, `
168
+ # cc_attribute`, `cc_sharealike`, `cc_noncommercial`, `cc_nonderived` and
169
+ # combinations of these. See [typical combinations](https://wiki.creativecommons.
170
+ # org/wiki/CC_Search_integration).
171
+ # @param [String] safe
172
+ # Search safety level. Acceptable values are: * `"active"`: Enables SafeSearch
173
+ # filtering. * `"off"`: Disables SafeSearch filtering. (default)
174
+ # @param [String] search_type
175
+ # Specifies the search type: `image`. If unspecified, results are limited to
176
+ # webpages. Acceptable values are: * `"image"`: custom image search.
177
+ # @param [String] site_search
178
+ # Specifies a given site which should always be included or excluded from
179
+ # results (see `siteSearchFilter` parameter, below).
180
+ # @param [String] site_search_filter
181
+ # Controls whether to include or exclude results from the site named in the `
182
+ # siteSearch` parameter. Acceptable values are: * `"e"`: exclude * `"i"`:
183
+ # include
184
+ # @param [String] sort
185
+ # The sort expression to apply to the results. The sort parameter specifies that
186
+ # the results be sorted according to the specified expression i.e. sort by date.
187
+ # [Example: sort=date](https://developers.google.com/custom-search/docs/
188
+ # structured_search#sort-by-attribute).
189
+ # @param [Fixnum] start
190
+ # The index of the first result to return. The default number of results per
191
+ # page is 10, so `&start=11` would start at the top of the second page of
192
+ # results. **Note**: The JSON API will never return more than 100 results, even
193
+ # if more than 100 documents match the query, so setting the sum of `start + num`
194
+ # to a number greater than 100 will produce an error. Also note that the
195
+ # maximum value for `num` is 10.
196
+ # @param [String] fields
197
+ # Selector specifying which fields to include in a partial response.
198
+ # @param [String] quota_user
199
+ # Available to use for quota purposes for server-side applications. Can be any
200
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
201
+ # @param [Google::Apis::RequestOptions] options
202
+ # Request-specific options
203
+ #
204
+ # @yield [result, err] Result & error if block supplied
205
+ # @yieldparam result [Google::Apis::CustomsearchV1::Search] parsed result object
206
+ # @yieldparam err [StandardError] error object if request failed
207
+ #
208
+ # @return [Google::Apis::CustomsearchV1::Search]
209
+ #
210
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
211
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
212
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
213
+ def list_cses(c2coff: nil, cr: nil, cx: nil, date_restrict: nil, exact_terms: nil, exclude_terms: nil, file_type: nil, filter: nil, gl: nil, googlehost: nil, high_range: nil, hl: nil, hq: nil, img_color_type: nil, img_dominant_color: nil, img_size: nil, img_type: nil, link_site: nil, low_range: nil, lr: nil, num: nil, or_terms: nil, q: nil, related_site: nil, rights: nil, safe: nil, search_type: nil, site_search: nil, site_search_filter: nil, sort: nil, start: nil, fields: nil, quota_user: nil, options: nil, &block)
214
+ command = make_simple_command(:get, 'customsearch/v1', options)
215
+ command.response_representation = Google::Apis::CustomsearchV1::Search::Representation
216
+ command.response_class = Google::Apis::CustomsearchV1::Search
217
+ command.query['c2coff'] = c2coff unless c2coff.nil?
218
+ command.query['cr'] = cr unless cr.nil?
219
+ command.query['cx'] = cx unless cx.nil?
220
+ command.query['dateRestrict'] = date_restrict unless date_restrict.nil?
221
+ command.query['exactTerms'] = exact_terms unless exact_terms.nil?
222
+ command.query['excludeTerms'] = exclude_terms unless exclude_terms.nil?
223
+ command.query['fileType'] = file_type unless file_type.nil?
224
+ command.query['filter'] = filter unless filter.nil?
225
+ command.query['gl'] = gl unless gl.nil?
226
+ command.query['googlehost'] = googlehost unless googlehost.nil?
227
+ command.query['highRange'] = high_range unless high_range.nil?
228
+ command.query['hl'] = hl unless hl.nil?
229
+ command.query['hq'] = hq unless hq.nil?
230
+ command.query['imgColorType'] = img_color_type unless img_color_type.nil?
231
+ command.query['imgDominantColor'] = img_dominant_color unless img_dominant_color.nil?
232
+ command.query['imgSize'] = img_size unless img_size.nil?
233
+ command.query['imgType'] = img_type unless img_type.nil?
234
+ command.query['linkSite'] = link_site unless link_site.nil?
235
+ command.query['lowRange'] = low_range unless low_range.nil?
236
+ command.query['lr'] = lr unless lr.nil?
237
+ command.query['num'] = num unless num.nil?
238
+ command.query['orTerms'] = or_terms unless or_terms.nil?
239
+ command.query['q'] = q unless q.nil?
240
+ command.query['relatedSite'] = related_site unless related_site.nil?
241
+ command.query['rights'] = rights unless rights.nil?
242
+ command.query['safe'] = safe unless safe.nil?
243
+ command.query['searchType'] = search_type unless search_type.nil?
244
+ command.query['siteSearch'] = site_search unless site_search.nil?
245
+ command.query['siteSearchFilter'] = site_search_filter unless site_search_filter.nil?
246
+ command.query['sort'] = sort unless sort.nil?
247
+ command.query['start'] = start unless start.nil?
248
+ command.query['fields'] = fields unless fields.nil?
249
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
250
+ execute_or_queue_command(command, &block)
251
+ end
252
+
253
+ # Returns metadata about the search performed, metadata about the engine used
254
+ # for the search, and the search results. Uses a small set of url patterns.
255
+ # @param [String] c2coff
256
+ # Enables or disables [Simplified and Traditional Chinese Search](https://
257
+ # developers.google.com/custom-search/docs/xml_results#chineseSearch). The
258
+ # default value for this parameter is 0 (zero), meaning that the feature is
259
+ # enabled. Supported values are: * `1`: Disabled * `0`: Enabled (default)
260
+ # @param [String] cr
261
+ # Restricts search results to documents originating in a particular country. You
262
+ # may use [Boolean operators](https://developers.google.com/custom-search/docs/
263
+ # xml_results_appendices#booleanOperators) in the cr parameter's value. Google
264
+ # Search determines the country of a document by analyzing: * the top-level
265
+ # domain (TLD) of the document's URL * the geographic location of the Web server'
266
+ # s IP address See the [Country Parameter Values](https://developers.google.com/
267
+ # custom-search/docs/xml_results_appendices#countryCollections) page for a list
268
+ # of valid values for this parameter.
269
+ # @param [String] cx
270
+ # The Programmable Search Engine ID to use for this request.
271
+ # @param [String] date_restrict
272
+ # Restricts results to URLs based on date. Supported values include: * `d[number]
273
+ # `: requests results from the specified number of past days. * `w[number]`:
274
+ # requests results from the specified number of past weeks. * `m[number]`:
275
+ # requests results from the specified number of past months. * `y[number]`:
276
+ # requests results from the specified number of past years.
277
+ # @param [String] exact_terms
278
+ # Identifies a phrase that all documents in the search results must contain.
279
+ # @param [String] exclude_terms
280
+ # Identifies a word or phrase that should not appear in any documents in the
281
+ # search results.
282
+ # @param [String] file_type
283
+ # Restricts results to files of a specified extension. A list of file types
284
+ # indexable by Google can be found in Search Console [Help Center](https://
285
+ # support.google.com/webmasters/answer/35287).
286
+ # @param [String] filter
287
+ # Controls turning on or off the duplicate content filter. * See [Automatic
288
+ # Filtering](https://developers.google.com/custom-search/docs/xml_results#
289
+ # automaticFiltering) for more information about Google's search results filters.
290
+ # Note that host crowding filtering applies only to multi-site searches. * By
291
+ # default, Google applies filtering to all search results to improve the quality
292
+ # of those results. Acceptable values are: * `0`: Turns off duplicate content
293
+ # filter. * `1`: Turns on duplicate content filter.
294
+ # @param [String] gl
295
+ # Geolocation of end user. * The `gl` parameter value is a two-letter country
296
+ # code. The `gl` parameter boosts search results whose country of origin matches
297
+ # the parameter value. See the [Country Codes](https://developers.google.com/
298
+ # custom-search/docs/xml_results_appendices#countryCodes) page for a list of
299
+ # valid values. * Specifying a `gl` parameter value should lead to more relevant
300
+ # results. This is particularly true for international customers and, even more
301
+ # specifically, for customers in English- speaking countries other than the
302
+ # United States.
303
+ # @param [String] googlehost
304
+ # **Deprecated**. Use the `gl` parameter for a similar effect. The local Google
305
+ # domain (for example, google.com, google.de, or google.fr) to use to perform
306
+ # the search.
307
+ # @param [String] high_range
308
+ # Specifies the ending value for a search range. * Use `lowRange` and `highRange`
309
+ # to append an inclusive search range of `lowRange...highRange` to the query.
310
+ # @param [String] hl
311
+ # Sets the user interface language. * Explicitly setting this parameter improves
312
+ # the performance and the quality of your search results. * See the [Interface
313
+ # Languages](https://developers.google.com/custom-search/docs/xml_results#
314
+ # wsInterfaceLanguages) section of [Internationalizing Queries and Results
315
+ # Presentation](https://developers.google.com/custom-search/docs/xml_results#
316
+ # wsInternationalizing) for more information, and (Supported Interface Languages)
317
+ # [https://developers.google.com/custom-search/docs/xml_results_appendices#
318
+ # interfaceLanguages] for a list of supported languages.
319
+ # @param [String] hq
320
+ # Appends the specified query terms to the query, as if they were combined with
321
+ # a logical AND operator.
322
+ # @param [String] img_color_type
323
+ # Returns black and white, grayscale, transparent, or color images. Acceptable
324
+ # values are: * `"color"` * `"gray"` * `"mono"`: black and white * `"trans"`:
325
+ # transparent background
326
+ # @param [String] img_dominant_color
327
+ # Returns images of a specific dominant color. Acceptable values are: * `"black"`
328
+ # * `"blue"` * `"brown"` * `"gray"` * `"green"` * `"orange"` * `"pink"` * `"
329
+ # purple"` * `"red"` * `"teal"` * `"white"` * `"yellow"`
330
+ # @param [String] img_size
331
+ # Returns images of a specified size. Acceptable values are: * `"huge"` * `"icon"
332
+ # ` * `"large"` * `"medium"` * `"small"` * `"xlarge"` * `"xxlarge"`
333
+ # @param [String] img_type
334
+ # Returns images of a type. Acceptable values are: * `"clipart"` * `"face"` * `"
335
+ # lineart"` * `"stock"` * `"photo"` * `"animated"`
336
+ # @param [String] link_site
337
+ # Specifies that all search results should contain a link to a particular URL.
338
+ # @param [String] low_range
339
+ # Specifies the starting value for a search range. Use `lowRange` and `highRange`
340
+ # to append an inclusive search range of `lowRange...highRange` to the query.
341
+ # @param [String] lr
342
+ # Restricts the search to documents written in a particular language (e.g., `lr=
343
+ # lang_ja`). Acceptable values are: * `"lang_ar"`: Arabic * `"lang_bg"`:
344
+ # Bulgarian * `"lang_ca"`: Catalan * `"lang_cs"`: Czech * `"lang_da"`: Danish * `
345
+ # "lang_de"`: German * `"lang_el"`: Greek * `"lang_en"`: English * `"lang_es"`:
346
+ # Spanish * `"lang_et"`: Estonian * `"lang_fi"`: Finnish * `"lang_fr"`: French *
347
+ # `"lang_hr"`: Croatian * `"lang_hu"`: Hungarian * `"lang_id"`: Indonesian * `"
348
+ # lang_is"`: Icelandic * `"lang_it"`: Italian * `"lang_iw"`: Hebrew * `"lang_ja"`
349
+ # : Japanese * `"lang_ko"`: Korean * `"lang_lt"`: Lithuanian * `"lang_lv"`:
350
+ # Latvian * `"lang_nl"`: Dutch * `"lang_no"`: Norwegian * `"lang_pl"`: Polish * `
351
+ # "lang_pt"`: Portuguese * `"lang_ro"`: Romanian * `"lang_ru"`: Russian * `"
352
+ # lang_sk"`: Slovak * `"lang_sl"`: Slovenian * `"lang_sr"`: Serbian * `"lang_sv"`
353
+ # : Swedish * `"lang_tr"`: Turkish * `"lang_zh-CN"`: Chinese (Simplified) * `"
354
+ # lang_zh-TW"`: Chinese (Traditional)
355
+ # @param [Fixnum] num
356
+ # Number of search results to return. * Valid values are integers between 1 and
357
+ # 10, inclusive.
358
+ # @param [String] or_terms
359
+ # Provides additional search terms to check for in a document, where each
360
+ # document in the search results must contain at least one of the additional
361
+ # search terms.
362
+ # @param [String] q
363
+ # Query
364
+ # @param [String] related_site
365
+ # Specifies that all search results should be pages that are related to the
366
+ # specified URL.
367
+ # @param [String] rights
368
+ # Filters based on licensing. Supported values include: `cc_publicdomain`, `
369
+ # cc_attribute`, `cc_sharealike`, `cc_noncommercial`, `cc_nonderived` and
370
+ # combinations of these. See [typical combinations](https://wiki.creativecommons.
371
+ # org/wiki/CC_Search_integration).
372
+ # @param [String] safe
373
+ # Search safety level. Acceptable values are: * `"active"`: Enables SafeSearch
374
+ # filtering. * `"off"`: Disables SafeSearch filtering. (default)
375
+ # @param [String] search_type
376
+ # Specifies the search type: `image`. If unspecified, results are limited to
377
+ # webpages. Acceptable values are: * `"image"`: custom image search.
378
+ # @param [String] site_search
379
+ # Specifies a given site which should always be included or excluded from
380
+ # results (see `siteSearchFilter` parameter, below).
381
+ # @param [String] site_search_filter
382
+ # Controls whether to include or exclude results from the site named in the `
383
+ # siteSearch` parameter. Acceptable values are: * `"e"`: exclude * `"i"`:
384
+ # include
385
+ # @param [String] sort
386
+ # The sort expression to apply to the results. The sort parameter specifies that
387
+ # the results be sorted according to the specified expression i.e. sort by date.
388
+ # [Example: sort=date](https://developers.google.com/custom-search/docs/
389
+ # structured_search#sort-by-attribute).
390
+ # @param [Fixnum] start
391
+ # The index of the first result to return. The default number of results per
392
+ # page is 10, so `&start=11` would start at the top of the second page of
393
+ # results. **Note**: The JSON API will never return more than 100 results, even
394
+ # if more than 100 documents match the query, so setting the sum of `start + num`
395
+ # to a number greater than 100 will produce an error. Also note that the
396
+ # maximum value for `num` is 10.
397
+ # @param [String] fields
398
+ # Selector specifying which fields to include in a partial response.
399
+ # @param [String] quota_user
400
+ # Available to use for quota purposes for server-side applications. Can be any
401
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
402
+ # @param [Google::Apis::RequestOptions] options
403
+ # Request-specific options
404
+ #
405
+ # @yield [result, err] Result & error if block supplied
406
+ # @yieldparam result [Google::Apis::CustomsearchV1::Search] parsed result object
407
+ # @yieldparam err [StandardError] error object if request failed
408
+ #
409
+ # @return [Google::Apis::CustomsearchV1::Search]
410
+ #
411
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
412
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
413
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
414
+ def list_cse_siterestricts(c2coff: nil, cr: nil, cx: nil, date_restrict: nil, exact_terms: nil, exclude_terms: nil, file_type: nil, filter: nil, gl: nil, googlehost: nil, high_range: nil, hl: nil, hq: nil, img_color_type: nil, img_dominant_color: nil, img_size: nil, img_type: nil, link_site: nil, low_range: nil, lr: nil, num: nil, or_terms: nil, q: nil, related_site: nil, rights: nil, safe: nil, search_type: nil, site_search: nil, site_search_filter: nil, sort: nil, start: nil, fields: nil, quota_user: nil, options: nil, &block)
415
+ command = make_simple_command(:get, 'customsearch/v1/siterestrict', options)
416
+ command.response_representation = Google::Apis::CustomsearchV1::Search::Representation
417
+ command.response_class = Google::Apis::CustomsearchV1::Search
418
+ command.query['c2coff'] = c2coff unless c2coff.nil?
419
+ command.query['cr'] = cr unless cr.nil?
420
+ command.query['cx'] = cx unless cx.nil?
421
+ command.query['dateRestrict'] = date_restrict unless date_restrict.nil?
422
+ command.query['exactTerms'] = exact_terms unless exact_terms.nil?
423
+ command.query['excludeTerms'] = exclude_terms unless exclude_terms.nil?
424
+ command.query['fileType'] = file_type unless file_type.nil?
425
+ command.query['filter'] = filter unless filter.nil?
426
+ command.query['gl'] = gl unless gl.nil?
427
+ command.query['googlehost'] = googlehost unless googlehost.nil?
428
+ command.query['highRange'] = high_range unless high_range.nil?
429
+ command.query['hl'] = hl unless hl.nil?
430
+ command.query['hq'] = hq unless hq.nil?
431
+ command.query['imgColorType'] = img_color_type unless img_color_type.nil?
432
+ command.query['imgDominantColor'] = img_dominant_color unless img_dominant_color.nil?
433
+ command.query['imgSize'] = img_size unless img_size.nil?
434
+ command.query['imgType'] = img_type unless img_type.nil?
435
+ command.query['linkSite'] = link_site unless link_site.nil?
436
+ command.query['lowRange'] = low_range unless low_range.nil?
437
+ command.query['lr'] = lr unless lr.nil?
438
+ command.query['num'] = num unless num.nil?
439
+ command.query['orTerms'] = or_terms unless or_terms.nil?
440
+ command.query['q'] = q unless q.nil?
441
+ command.query['relatedSite'] = related_site unless related_site.nil?
442
+ command.query['rights'] = rights unless rights.nil?
443
+ command.query['safe'] = safe unless safe.nil?
444
+ command.query['searchType'] = search_type unless search_type.nil?
445
+ command.query['siteSearch'] = site_search unless site_search.nil?
446
+ command.query['siteSearchFilter'] = site_search_filter unless site_search_filter.nil?
447
+ command.query['sort'] = sort unless sort.nil?
448
+ command.query['start'] = start unless start.nil?
449
+ command.query['fields'] = fields unless fields.nil?
450
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
451
+ execute_or_queue_command(command, &block)
452
+ end
453
+
454
+ protected
455
+
456
+ def apply_command_defaults(command)
457
+ command.query['key'] = key unless key.nil?
458
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
459
+ end
460
+ end
461
+ end
462
+ end
463
+ end