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,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 6562a130ba038a0b92bd03a68b289828d08fed82efeb2c78075883e7dbcce73c
4
+ data.tar.gz: 2f336b2193d3205ec1c419928580ba9ed68c5571e76f2d335d1bdb85d4cf7ded
5
+ SHA512:
6
+ metadata.gz: 79030a119d861882c4c032978c894e6c12452ef6e3b2349bca4914c866df6ba258001d8cfbe28c3e155602a99d581c76de9e16ad375a674ea54253ede153396d
7
+ data.tar.gz: d83697a698ff488a9670d755e89577a0c827aed2f9a03a1b9f155799693576f590f4c16894323a43046c07178c1038cd902a4e7b6c412e6e5fa51e04fc9b3e9b
@@ -0,0 +1,13 @@
1
+ --hide-void-return
2
+ --no-private
3
+ --verbose
4
+ --title=google-apis-customsearch_v1
5
+ --markup-provider=redcarpet
6
+ --markup=markdown
7
+ --main OVERVIEW.md
8
+ lib/google/apis/customsearch_v1/*.rb
9
+ lib/google/apis/customsearch_v1.rb
10
+ -
11
+ OVERVIEW.md
12
+ CHANGELOG.md
13
+ LICENSE.md
@@ -0,0 +1,7 @@
1
+ # Release history for google-apis-customsearch_v1
2
+
3
+ ### v0.1.0 (2021-01-07)
4
+
5
+ * Regenerated using generator version 0.1.1
6
+ * Regenerated from discovery document revision 20200917
7
+
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,96 @@
1
+ # Simple REST client for version V1 of the Custom Search API
2
+
3
+ This is a simple client library for version V1 of the Custom Search API. It provides:
4
+
5
+ * A client object that connects to the HTTP/JSON REST endpoint for the service.
6
+ * Ruby objects for data structures related to the service.
7
+ * Integration with the googleauth gem for authentication using OAuth, API keys, and service accounts.
8
+ * Control of retry, pagination, and timeouts.
9
+
10
+ Note that although this client library is supported and will continue to be updated to track changes to the service, it is otherwise considered complete and not under active development. Many Google services, especially Google Cloud Platform services, may provide a more modern client that is under more active development and improvement. See the section below titled *Which client should I use?* for more information.
11
+
12
+ ## Getting started
13
+
14
+ ### Before you begin
15
+
16
+ There are a few setup steps you need to complete before you can use this library:
17
+
18
+ 1. If you don't already have a Google account, [sign up](https://www.google.com/accounts).
19
+ 2. If you have never created a Google APIs Console project, read about [Managing Projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects) and create a project in the [Google API Console](https://console.cloud.google.com/).
20
+ 3. Most APIs need to be enabled for your project. [Enable it](https://console.cloud.google.com/apis/library/customsearch.googleapis.com) in the console.
21
+
22
+ ### Installation
23
+
24
+ Add this line to your application's Gemfile:
25
+
26
+ ```ruby
27
+ gem 'google-apis-customsearch_v1', '~> 0.1'
28
+ ```
29
+
30
+ And then execute:
31
+
32
+ ```
33
+ $ bundle
34
+ ```
35
+
36
+ Or install it yourself as:
37
+
38
+ ```
39
+ $ gem install google-apis-customsearch_v1
40
+ ```
41
+
42
+ ### Creating a client object
43
+
44
+ Once the gem is installed, you can load the client code and instantiate a client.
45
+
46
+ ```ruby
47
+ # Load the client
48
+ require "google/apis/customsearch_v1"
49
+
50
+ # Create a client object
51
+ client = Google::Apis::CustomsearchV1::CustomSearchAPIService.new
52
+
53
+ # Authenticate calls
54
+ client.authentication = # ... use the googleauth gem to create credentials
55
+ ```
56
+
57
+ See the class reference docs for information on the methods you can call from a client.
58
+
59
+ ## Documentation
60
+
61
+ More detailed descriptions of the Google simple REST clients are available in two documents.
62
+
63
+ * The [Usage Guide](https://github.com/googleapis/google-api-ruby-client/blob/master/docs/usage-guide.md) discusses how to make API calls, how to use the provided data structures, and how to work the various features of the client library, including media upload and download, error handling, retries, pagination, and logging.
64
+ * The [Auth Guide](https://github.com/googleapis/google-api-ruby-client/blob/master/docs/auth-guide.md) discusses authentication in the client libraries, including API keys, OAuth 2.0, service accounts, and environment variables.
65
+
66
+ (Note: the above documents are written for the simple REST clients in general, and their examples may not reflect the Customsearch service in particular.)
67
+
68
+ For reference information on specific calls in the Custom Search API, see the {Google::Apis::CustomsearchV1::CustomSearchAPIService class reference docs}.
69
+
70
+ ## Which client should I use?
71
+
72
+ Google provides two types of Ruby API client libraries: **simple REST clients** and **modern clients**.
73
+
74
+ This library, `google-apis-customsearch_v1`, is a simple REST client. You can identify these clients by their gem names, which are always in the form `google-apis-<servicename>_<serviceversion>`. The simple REST clients connect to HTTP/JSON REST endpoints and are automatically generated from service discovery documents. They support most API functionality, but their class interfaces are sometimes awkward.
75
+
76
+ Modern clients are produced by a modern code generator, sometimes combined with hand-crafted functionality. Most modern clients connect to high-performance gRPC endpoints, although a few are backed by REST services. Modern clients are available for many Google services, especially Google Cloud Platform services, but do not yet support all the services covered by the simple clients.
77
+
78
+ Gem names for modern clients are often of the form `google-cloud-<service_name>`. (For example, [google-cloud-pubsub](https://rubygems.org/gems/google-cloud-pubsub).) Note that most modern clients also have corresponding "versioned" gems with names like `google-cloud-<service_name>-<version>`. (For example, [google-cloud-pubsub-v1](https://rubygems.org/gems/google-cloud-pubsub-v1).) The "versioned" gems can be used directly, but often provide lower-level interfaces. In most cases, the main gem is recommended.
79
+
80
+ **For most users, we recommend the modern client, if one is available.** Compared with simple clients, modern clients are generally much easier to use and more Ruby-like, support more advanced features such as streaming and long-running operations, and often provide much better performance. You may consider using a simple client instead, if a modern client is not yet available for the service you want to use, or if you are not able to use gRPC on your infrastructure.
81
+
82
+ The [product documentation](https://developers.google.com/custom-search/v1/introduction) may provide guidance regarding the preferred client library to use.
83
+
84
+ ## Supported Ruby versions
85
+
86
+ This library is supported on Ruby 2.5+.
87
+
88
+ Google provides official support for Ruby versions that are actively supported by Ruby Core -- that is, Ruby versions that are either in normal maintenance or in security maintenance, and not end of life. Currently, this means Ruby 2.5 and later. Older versions of Ruby _may_ still work, but are unsupported and not recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby support schedule.
89
+
90
+ ## License
91
+
92
+ This library is licensed under Apache 2.0. Full license text is available in the {file:LICENSE.md LICENSE}.
93
+
94
+ ## Support
95
+
96
+ Please [report bugs at the project on Github](https://github.com/google/google-api-ruby-client/issues). Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-api-ruby-client) about the client or APIs on [StackOverflow](http://stackoverflow.com).
@@ -0,0 +1,15 @@
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/customsearch_v1"
@@ -0,0 +1,33 @@
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/customsearch_v1/service.rb'
16
+ require 'google/apis/customsearch_v1/classes.rb'
17
+ require 'google/apis/customsearch_v1/representations.rb'
18
+ require 'google/apis/customsearch_v1/gem_version.rb'
19
+
20
+ module Google
21
+ module Apis
22
+ # Custom Search API
23
+ #
24
+ # Searches over a website or collection of websites
25
+ #
26
+ # @see https://developers.google.com/custom-search/v1/introduction
27
+ module CustomsearchV1
28
+ # Version of the Custom Search API this client connects to.
29
+ # This is NOT the gem version.
30
+ VERSION = 'V1'
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,1421 @@
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
+ # Promotion result.
26
+ class Promotion
27
+ include Google::Apis::Core::Hashable
28
+
29
+ # An array of block objects for this promotion. See [Google WebSearch Protocol
30
+ # reference](https://developers.google.com/custom-search/docs/xml_results) for
31
+ # more information.
32
+ # Corresponds to the JSON property `bodyLines`
33
+ # @return [Array<Google::Apis::CustomsearchV1::Promotion::BodyLine>]
34
+ attr_accessor :body_lines
35
+
36
+ # An abridged version of this search's result URL, e.g. www.example.com.
37
+ # Corresponds to the JSON property `displayLink`
38
+ # @return [String]
39
+ attr_accessor :display_link
40
+
41
+ # The title of the promotion, in HTML.
42
+ # Corresponds to the JSON property `htmlTitle`
43
+ # @return [String]
44
+ attr_accessor :html_title
45
+
46
+ # Image belonging to a promotion.
47
+ # Corresponds to the JSON property `image`
48
+ # @return [Google::Apis::CustomsearchV1::Promotion::Image]
49
+ attr_accessor :image
50
+
51
+ # The URL of the promotion.
52
+ # Corresponds to the JSON property `link`
53
+ # @return [String]
54
+ attr_accessor :link
55
+
56
+ # The title of the promotion.
57
+ # Corresponds to the JSON property `title`
58
+ # @return [String]
59
+ attr_accessor :title
60
+
61
+ def initialize(**args)
62
+ update!(**args)
63
+ end
64
+
65
+ # Update properties of this object
66
+ def update!(**args)
67
+ @body_lines = args[:body_lines] if args.key?(:body_lines)
68
+ @display_link = args[:display_link] if args.key?(:display_link)
69
+ @html_title = args[:html_title] if args.key?(:html_title)
70
+ @image = args[:image] if args.key?(:image)
71
+ @link = args[:link] if args.key?(:link)
72
+ @title = args[:title] if args.key?(:title)
73
+ end
74
+
75
+ # Block object belonging to a promotion.
76
+ class BodyLine
77
+ include Google::Apis::Core::Hashable
78
+
79
+ # The block object's text in HTML, if it has text.
80
+ # Corresponds to the JSON property `htmlTitle`
81
+ # @return [String]
82
+ attr_accessor :html_title
83
+
84
+ # The anchor text of the block object's link, if it has a link.
85
+ # Corresponds to the JSON property `link`
86
+ # @return [String]
87
+ attr_accessor :link
88
+
89
+ # The block object's text, if it has text.
90
+ # Corresponds to the JSON property `title`
91
+ # @return [String]
92
+ attr_accessor :title
93
+
94
+ # The URL of the block object's link, if it has one.
95
+ # Corresponds to the JSON property `url`
96
+ # @return [String]
97
+ attr_accessor :url
98
+
99
+ def initialize(**args)
100
+ update!(**args)
101
+ end
102
+
103
+ # Update properties of this object
104
+ def update!(**args)
105
+ @html_title = args[:html_title] if args.key?(:html_title)
106
+ @link = args[:link] if args.key?(:link)
107
+ @title = args[:title] if args.key?(:title)
108
+ @url = args[:url] if args.key?(:url)
109
+ end
110
+ end
111
+
112
+ # Image belonging to a promotion.
113
+ class Image
114
+ include Google::Apis::Core::Hashable
115
+
116
+ # Image height in pixels.
117
+ # Corresponds to the JSON property `height`
118
+ # @return [Fixnum]
119
+ attr_accessor :height
120
+
121
+ # URL of the image for this promotion link.
122
+ # Corresponds to the JSON property `source`
123
+ # @return [String]
124
+ attr_accessor :source
125
+
126
+ # Image width in pixels.
127
+ # Corresponds to the JSON property `width`
128
+ # @return [Fixnum]
129
+ attr_accessor :width
130
+
131
+ def initialize(**args)
132
+ update!(**args)
133
+ end
134
+
135
+ # Update properties of this object
136
+ def update!(**args)
137
+ @height = args[:height] if args.key?(:height)
138
+ @source = args[:source] if args.key?(:source)
139
+ @width = args[:width] if args.key?(:width)
140
+ end
141
+ end
142
+ end
143
+
144
+ # A custom search result.
145
+ class Result
146
+ include Google::Apis::Core::Hashable
147
+
148
+ # Indicates the ID of Google's cached version of the search result.
149
+ # Corresponds to the JSON property `cacheId`
150
+ # @return [String]
151
+ attr_accessor :cache_id
152
+
153
+ # An abridged version of this search result’s URL, e.g. www.example.com.
154
+ # Corresponds to the JSON property `displayLink`
155
+ # @return [String]
156
+ attr_accessor :display_link
157
+
158
+ # The file format of the search result.
159
+ # Corresponds to the JSON property `fileFormat`
160
+ # @return [String]
161
+ attr_accessor :file_format
162
+
163
+ # The URL displayed after the snippet for each search result.
164
+ # Corresponds to the JSON property `formattedUrl`
165
+ # @return [String]
166
+ attr_accessor :formatted_url
167
+
168
+ # The HTML-formatted URL displayed after the snippet for each search result.
169
+ # Corresponds to the JSON property `htmlFormattedUrl`
170
+ # @return [String]
171
+ attr_accessor :html_formatted_url
172
+
173
+ # The snippet of the search result, in HTML.
174
+ # Corresponds to the JSON property `htmlSnippet`
175
+ # @return [String]
176
+ attr_accessor :html_snippet
177
+
178
+ # The title of the search result, in HTML.
179
+ # Corresponds to the JSON property `htmlTitle`
180
+ # @return [String]
181
+ attr_accessor :html_title
182
+
183
+ # Image belonging to a custom search result.
184
+ # Corresponds to the JSON property `image`
185
+ # @return [Google::Apis::CustomsearchV1::Result::Image]
186
+ attr_accessor :image
187
+
188
+ # A unique identifier for the type of current object. For this API, it is `
189
+ # customsearch#result.`
190
+ # Corresponds to the JSON property `kind`
191
+ # @return [String]
192
+ attr_accessor :kind
193
+
194
+ # Encapsulates all information about [refinement labels](https://developers.
195
+ # google.com/custom-search/docs/xml_results).
196
+ # Corresponds to the JSON property `labels`
197
+ # @return [Array<Google::Apis::CustomsearchV1::Result::Label>]
198
+ attr_accessor :labels
199
+
200
+ # The full URL to which the search result is pointing, e.g. http://www.example.
201
+ # com/foo/bar.
202
+ # Corresponds to the JSON property `link`
203
+ # @return [String]
204
+ attr_accessor :link
205
+
206
+ # The MIME type of the search result.
207
+ # Corresponds to the JSON property `mime`
208
+ # @return [String]
209
+ attr_accessor :mime
210
+
211
+ # Contains [PageMap](https://developers.google.com/custom-search/docs/
212
+ # structured_data#pagemaps) information for this search result.
213
+ # Corresponds to the JSON property `pagemap`
214
+ # @return [Hash<String,Object>]
215
+ attr_accessor :pagemap
216
+
217
+ # The snippet of the search result, in plain text.
218
+ # Corresponds to the JSON property `snippet`
219
+ # @return [String]
220
+ attr_accessor :snippet
221
+
222
+ # The title of the search result, in plain text.
223
+ # Corresponds to the JSON property `title`
224
+ # @return [String]
225
+ attr_accessor :title
226
+
227
+ def initialize(**args)
228
+ update!(**args)
229
+ end
230
+
231
+ # Update properties of this object
232
+ def update!(**args)
233
+ @cache_id = args[:cache_id] if args.key?(:cache_id)
234
+ @display_link = args[:display_link] if args.key?(:display_link)
235
+ @file_format = args[:file_format] if args.key?(:file_format)
236
+ @formatted_url = args[:formatted_url] if args.key?(:formatted_url)
237
+ @html_formatted_url = args[:html_formatted_url] if args.key?(:html_formatted_url)
238
+ @html_snippet = args[:html_snippet] if args.key?(:html_snippet)
239
+ @html_title = args[:html_title] if args.key?(:html_title)
240
+ @image = args[:image] if args.key?(:image)
241
+ @kind = args[:kind] if args.key?(:kind)
242
+ @labels = args[:labels] if args.key?(:labels)
243
+ @link = args[:link] if args.key?(:link)
244
+ @mime = args[:mime] if args.key?(:mime)
245
+ @pagemap = args[:pagemap] if args.key?(:pagemap)
246
+ @snippet = args[:snippet] if args.key?(:snippet)
247
+ @title = args[:title] if args.key?(:title)
248
+ end
249
+
250
+ # Image belonging to a custom search result.
251
+ class Image
252
+ include Google::Apis::Core::Hashable
253
+
254
+ # The size of the image, in pixels.
255
+ # Corresponds to the JSON property `byteSize`
256
+ # @return [Fixnum]
257
+ attr_accessor :byte_size
258
+
259
+ # A URL pointing to the webpage hosting the image.
260
+ # Corresponds to the JSON property `contextLink`
261
+ # @return [String]
262
+ attr_accessor :context_link
263
+
264
+ # The height of the image, in pixels.
265
+ # Corresponds to the JSON property `height`
266
+ # @return [Fixnum]
267
+ attr_accessor :height
268
+
269
+ # The height of the thumbnail image, in pixels.
270
+ # Corresponds to the JSON property `thumbnailHeight`
271
+ # @return [Fixnum]
272
+ attr_accessor :thumbnail_height
273
+
274
+ # A URL to the thumbnail image.
275
+ # Corresponds to the JSON property `thumbnailLink`
276
+ # @return [String]
277
+ attr_accessor :thumbnail_link
278
+
279
+ # The width of the thumbnail image, in pixels.
280
+ # Corresponds to the JSON property `thumbnailWidth`
281
+ # @return [Fixnum]
282
+ attr_accessor :thumbnail_width
283
+
284
+ # The width of the image, in pixels.
285
+ # Corresponds to the JSON property `width`
286
+ # @return [Fixnum]
287
+ attr_accessor :width
288
+
289
+ def initialize(**args)
290
+ update!(**args)
291
+ end
292
+
293
+ # Update properties of this object
294
+ def update!(**args)
295
+ @byte_size = args[:byte_size] if args.key?(:byte_size)
296
+ @context_link = args[:context_link] if args.key?(:context_link)
297
+ @height = args[:height] if args.key?(:height)
298
+ @thumbnail_height = args[:thumbnail_height] if args.key?(:thumbnail_height)
299
+ @thumbnail_link = args[:thumbnail_link] if args.key?(:thumbnail_link)
300
+ @thumbnail_width = args[:thumbnail_width] if args.key?(:thumbnail_width)
301
+ @width = args[:width] if args.key?(:width)
302
+ end
303
+ end
304
+
305
+ # Refinement label associated with a custom search result.
306
+ class Label
307
+ include Google::Apis::Core::Hashable
308
+
309
+ # The display name of a refinement label. This is the name you should display in
310
+ # your user interface.
311
+ # Corresponds to the JSON property `displayName`
312
+ # @return [String]
313
+ attr_accessor :display_name
314
+
315
+ # Refinement label and the associated refinement operation.
316
+ # Corresponds to the JSON property `label_with_op`
317
+ # @return [String]
318
+ attr_accessor :label_with_op
319
+
320
+ # The name of a refinement label, which you can use to refine searches. Don't
321
+ # display this in your user interface; instead, use displayName.
322
+ # Corresponds to the JSON property `name`
323
+ # @return [String]
324
+ attr_accessor :name
325
+
326
+ def initialize(**args)
327
+ update!(**args)
328
+ end
329
+
330
+ # Update properties of this object
331
+ def update!(**args)
332
+ @display_name = args[:display_name] if args.key?(:display_name)
333
+ @label_with_op = args[:label_with_op] if args.key?(:label_with_op)
334
+ @name = args[:name] if args.key?(:name)
335
+ end
336
+ end
337
+ end
338
+
339
+ # Response to a custom search request.
340
+ class Search
341
+ include Google::Apis::Core::Hashable
342
+
343
+ # Metadata and refinements associated with the given search engine, including: *
344
+ # The name of the search engine that was used for the query. * A set of [facet
345
+ # objects](https://developers.google.com/custom-search/docs/refinements#create) (
346
+ # refinements) you can use for refining a search.
347
+ # Corresponds to the JSON property `context`
348
+ # @return [Hash<String,Object>]
349
+ attr_accessor :context
350
+
351
+ # The current set of custom search results.
352
+ # Corresponds to the JSON property `items`
353
+ # @return [Array<Google::Apis::CustomsearchV1::Result>]
354
+ attr_accessor :items
355
+
356
+ # Unique identifier for the type of current object. For this API, it is
357
+ # customsearch#search.
358
+ # Corresponds to the JSON property `kind`
359
+ # @return [String]
360
+ attr_accessor :kind
361
+
362
+ # The set of [promotions](https://developers.google.com/custom-search/docs/
363
+ # promotions). Present only if the custom search engine's configuration files
364
+ # define any promotions for the given query.
365
+ # Corresponds to the JSON property `promotions`
366
+ # @return [Array<Google::Apis::CustomsearchV1::Promotion>]
367
+ attr_accessor :promotions
368
+
369
+ # Query metadata for the previous, current, and next pages of results.
370
+ # Corresponds to the JSON property `queries`
371
+ # @return [Google::Apis::CustomsearchV1::Search::Queries]
372
+ attr_accessor :queries
373
+
374
+ # Metadata about a search operation.
375
+ # Corresponds to the JSON property `searchInformation`
376
+ # @return [Google::Apis::CustomsearchV1::Search::SearchInformation]
377
+ attr_accessor :search_information
378
+
379
+ # Spell correction information for a query.
380
+ # Corresponds to the JSON property `spelling`
381
+ # @return [Google::Apis::CustomsearchV1::Search::Spelling]
382
+ attr_accessor :spelling
383
+
384
+ # OpenSearch template and URL.
385
+ # Corresponds to the JSON property `url`
386
+ # @return [Google::Apis::CustomsearchV1::Search::Url]
387
+ attr_accessor :url
388
+
389
+ def initialize(**args)
390
+ update!(**args)
391
+ end
392
+
393
+ # Update properties of this object
394
+ def update!(**args)
395
+ @context = args[:context] if args.key?(:context)
396
+ @items = args[:items] if args.key?(:items)
397
+ @kind = args[:kind] if args.key?(:kind)
398
+ @promotions = args[:promotions] if args.key?(:promotions)
399
+ @queries = args[:queries] if args.key?(:queries)
400
+ @search_information = args[:search_information] if args.key?(:search_information)
401
+ @spelling = args[:spelling] if args.key?(:spelling)
402
+ @url = args[:url] if args.key?(:url)
403
+ end
404
+
405
+ # Query metadata for the previous, current, and next pages of results.
406
+ class Queries
407
+ include Google::Apis::Core::Hashable
408
+
409
+ # Metadata representing the next page of results, if applicable.
410
+ # Corresponds to the JSON property `nextPage`
411
+ # @return [Array<Google::Apis::CustomsearchV1::Search::Queries::NextPage>]
412
+ attr_accessor :next_page
413
+
414
+ # Metadata representing the previous page of results, if applicable.
415
+ # Corresponds to the JSON property `previousPage`
416
+ # @return [Array<Google::Apis::CustomsearchV1::Search::Queries::PreviousPage>]
417
+ attr_accessor :previous_page
418
+
419
+ # Metadata representing the current request.
420
+ # Corresponds to the JSON property `request`
421
+ # @return [Array<Google::Apis::CustomsearchV1::Search::Queries::Request>]
422
+ attr_accessor :request
423
+
424
+ def initialize(**args)
425
+ update!(**args)
426
+ end
427
+
428
+ # Update properties of this object
429
+ def update!(**args)
430
+ @next_page = args[:next_page] if args.key?(:next_page)
431
+ @previous_page = args[:previous_page] if args.key?(:previous_page)
432
+ @request = args[:request] if args.key?(:request)
433
+ end
434
+
435
+ # Custom search request metadata.
436
+ class NextPage
437
+ include Google::Apis::Core::Hashable
438
+
439
+ # Number of search results returned in this set.
440
+ # Corresponds to the JSON property `count`
441
+ # @return [Fixnum]
442
+ attr_accessor :count
443
+
444
+ # Restricts search results to documents originating in a particular country. You
445
+ # may use [Boolean operators](https://developers.google.com/custom-search/docs/
446
+ # xml_results#booleanOperators) in the `cr` parameter's value. Google WebSearch
447
+ # determines the country of a document by analyzing the following: * The top-
448
+ # level domain (TLD) of the document's URL. * The geographic location of the web
449
+ # server's IP address. See [Country (cr) Parameter Values](https://developers.
450
+ # google.com/custom-search/docs/xml_results#countryCollections) for a list of
451
+ # valid values for this parameter.
452
+ # Corresponds to the JSON property `cr`
453
+ # @return [String]
454
+ attr_accessor :cr
455
+
456
+ # The identifier of an engine created using the Programmable Search Engine [
457
+ # Control Panel](https://programmablesearchengine.google.com/). This is a custom
458
+ # property not defined in the OpenSearch spec. This parameter is **required**.
459
+ # Corresponds to the JSON property `cx`
460
+ # @return [String]
461
+ attr_accessor :cx
462
+
463
+ # Restricts results to URLs based on date. Supported values include: * `d[number]
464
+ # `: requests results from the specified number of past days. * `w[number]`:
465
+ # requests results from the specified number of past weeks. * `m[number]`:
466
+ # requests results from the specified number of past months. * `y[number]`:
467
+ # requests results from the specified number of past years.
468
+ # Corresponds to the JSON property `dateRestrict`
469
+ # @return [String]
470
+ attr_accessor :date_restrict
471
+
472
+ # Enables or disables the [Simplified and Traditional Chinese Search](https://
473
+ # developers.google.com/custom-search/docs/xml_results#chineseSearch) feature.
474
+ # Supported values are: * `0`: enabled (default) * `1`: disabled
475
+ # Corresponds to the JSON property `disableCnTwTranslation`
476
+ # @return [String]
477
+ attr_accessor :disable_cn_tw_translation
478
+
479
+ # Identifies a phrase that all documents in the search results must contain.
480
+ # Corresponds to the JSON property `exactTerms`
481
+ # @return [String]
482
+ attr_accessor :exact_terms
483
+
484
+ # Identifies a word or phrase that should not appear in any documents in the
485
+ # search results.
486
+ # Corresponds to the JSON property `excludeTerms`
487
+ # @return [String]
488
+ attr_accessor :exclude_terms
489
+
490
+ # Restricts results to files of a specified extension. Filetypes supported by
491
+ # Google include: * Adobe Portable Document Format (`pdf`) * Adobe PostScript (`
492
+ # ps`) * Lotus 1-2-3 (`wk1`, `wk2`, `wk3`, `wk4`, `wk5`, `wki`, `wks`, `wku`) *
493
+ # Lotus WordPro (`lwp`) * Macwrite (`mw`) * Microsoft Excel (`xls`) * Microsoft
494
+ # PowerPoint (`ppt`) * Microsoft Word (`doc`) * Microsoft Works (`wks`, `wps`, `
495
+ # wdb`) * Microsoft Write (`wri`) * Rich Text Format (`rtf`) * Shockwave Flash (`
496
+ # swf`) * Text (`ans`, `txt`). Additional filetypes may be added in the future.
497
+ # An up-to-date list can always be found in Google's [file type FAQ](https://
498
+ # support.google.com/webmasters/answer/35287).
499
+ # Corresponds to the JSON property `fileType`
500
+ # @return [String]
501
+ attr_accessor :file_type
502
+
503
+ # Activates or deactivates the automatic filtering of Google search results. See
504
+ # [Automatic Filtering](https://developers.google.com/custom-search/docs/
505
+ # xml_results#automaticFiltering) for more information about Google's search
506
+ # results filters. Valid values for this parameter are: * `0`: Disabled * `1`:
507
+ # Enabled (default) **Note**: By default, Google applies filtering to all search
508
+ # results to improve the quality of those results.
509
+ # Corresponds to the JSON property `filter`
510
+ # @return [String]
511
+ attr_accessor :filter
512
+
513
+ # Boosts search results whose country of origin matches the parameter value. See
514
+ # [Country Codes](https://developers.google.com/custom-search/docs/xml_results#
515
+ # countryCodes) for a list of valid values. Specifying a `gl` parameter value in
516
+ # WebSearch requests should improve the relevance of results. This is
517
+ # particularly true for international customers and, even more specifically, for
518
+ # customers in English-speaking countries other than the United States.
519
+ # Corresponds to the JSON property `gl`
520
+ # @return [String]
521
+ attr_accessor :gl
522
+
523
+ # Specifies the Google domain (for example, google.com, google.de, or google.fr)
524
+ # to which the search should be limited.
525
+ # Corresponds to the JSON property `googleHost`
526
+ # @return [String]
527
+ attr_accessor :google_host
528
+
529
+ # Specifies the ending value for a search range. Use `cse:lowRange` and `cse:
530
+ # highrange` to append an inclusive search range of `lowRange...highRange` to
531
+ # the query.
532
+ # Corresponds to the JSON property `highRange`
533
+ # @return [String]
534
+ attr_accessor :high_range
535
+
536
+ # Specifies the interface language (host language) of your user interface.
537
+ # Explicitly setting this parameter improves the performance and the quality of
538
+ # your search results. See the [Interface Languages](https://developers.google.
539
+ # com/custom-search/docs/xml_results#wsInterfaceLanguages) section of [
540
+ # Internationalizing Queries and Results Presentation](https://developers.google.
541
+ # com/custom-search/docs/xml_results#wsInternationalizing) for more information,
542
+ # and [Supported Interface Languages](https://developers.google.com/custom-
543
+ # search/docs/xml_results_appendices#interfaceLanguages) for a list of supported
544
+ # languages.
545
+ # Corresponds to the JSON property `hl`
546
+ # @return [String]
547
+ attr_accessor :hl
548
+
549
+ # Appends the specified query terms to the query, as if they were combined with
550
+ # a logical `AND` operator.
551
+ # Corresponds to the JSON property `hq`
552
+ # @return [String]
553
+ attr_accessor :hq
554
+
555
+ # Restricts results to images of a specified color type. Supported values are: *
556
+ # `mono` (black and white) * `gray` (grayscale) * `color` (color)
557
+ # Corresponds to the JSON property `imgColorType`
558
+ # @return [String]
559
+ attr_accessor :img_color_type
560
+
561
+ # Restricts results to images with a specific dominant color. Supported values
562
+ # are: * `red` * `orange` * `yellow` * `green` * `teal` * `blue` * `purple` * `
563
+ # pink` * `white` * `gray` * `black` * `brown`
564
+ # Corresponds to the JSON property `imgDominantColor`
565
+ # @return [String]
566
+ attr_accessor :img_dominant_color
567
+
568
+ # Restricts results to images of a specified size. Supported values are: * `icon`
569
+ # (small) * `small | medium | large | xlarge` (medium) * `xxlarge` (large) * `
570
+ # huge` (extra-large)
571
+ # Corresponds to the JSON property `imgSize`
572
+ # @return [String]
573
+ attr_accessor :img_size
574
+
575
+ # Restricts results to images of a specified type. Supported values are: * `
576
+ # clipart` (Clip art) * `face` (Face) * `lineart` (Line drawing) * `photo` (
577
+ # Photo) * `animated` (Animated) * `stock` (Stock)
578
+ # Corresponds to the JSON property `imgType`
579
+ # @return [String]
580
+ attr_accessor :img_type
581
+
582
+ # The character encoding supported for search requests.
583
+ # Corresponds to the JSON property `inputEncoding`
584
+ # @return [String]
585
+ attr_accessor :input_encoding
586
+
587
+ # The language of the search results.
588
+ # Corresponds to the JSON property `language`
589
+ # @return [String]
590
+ attr_accessor :language
591
+
592
+ # Specifies that all results should contain a link to a specific URL.
593
+ # Corresponds to the JSON property `linkSite`
594
+ # @return [String]
595
+ attr_accessor :link_site
596
+
597
+ # Specifies the starting value for a search range. Use `cse:lowRange` and `cse:
598
+ # highrange` to append an inclusive search range of `lowRange...highRange` to
599
+ # the query.
600
+ # Corresponds to the JSON property `lowRange`
601
+ # @return [String]
602
+ attr_accessor :low_range
603
+
604
+ # Provides additional search terms to check for in a document, where each
605
+ # document in the search results must contain at least one of the additional
606
+ # search terms. You can also use the [Boolean OR](https://developers.google.com/
607
+ # custom-search/docs/xml_results#BooleanOrqt) query term for this type of query.
608
+ # Corresponds to the JSON property `orTerms`
609
+ # @return [String]
610
+ attr_accessor :or_terms
611
+
612
+ # The character encoding supported for search results.
613
+ # Corresponds to the JSON property `outputEncoding`
614
+ # @return [String]
615
+ attr_accessor :output_encoding
616
+
617
+ # Specifies that all search results should be pages that are related to the
618
+ # specified URL. The parameter value should be a URL.
619
+ # Corresponds to the JSON property `relatedSite`
620
+ # @return [String]
621
+ attr_accessor :related_site
622
+
623
+ # Filters based on licensing. Supported values include: * `cc_publicdomain` * `
624
+ # cc_attribute` * `cc_sharealike` * `cc_noncommercial` * `cc_nonderived`
625
+ # Corresponds to the JSON property `rights`
626
+ # @return [String]
627
+ attr_accessor :rights
628
+
629
+ # Specifies the [SafeSearch level](https://developers.google.com/custom-search/
630
+ # docs/xml_results#safeSearchLevels) used for filtering out adult results. This
631
+ # is a custom property not defined in the OpenSearch spec. Valid parameter
632
+ # values are: * `"off"`: Disable SafeSearch * `"active"`: Enable SafeSearch
633
+ # Corresponds to the JSON property `safe`
634
+ # @return [String]
635
+ attr_accessor :safe
636
+
637
+ # The search terms entered by the user.
638
+ # Corresponds to the JSON property `searchTerms`
639
+ # @return [String]
640
+ attr_accessor :search_terms
641
+
642
+ # Allowed values are `web` or `image`. If unspecified, results are limited to
643
+ # webpages.
644
+ # Corresponds to the JSON property `searchType`
645
+ # @return [String]
646
+ attr_accessor :search_type
647
+
648
+ # Restricts results to URLs from a specified site.
649
+ # Corresponds to the JSON property `siteSearch`
650
+ # @return [String]
651
+ attr_accessor :site_search
652
+
653
+ # Specifies whether to include or exclude results from the site named in the `
654
+ # sitesearch` parameter. Supported values are: * `i`: include content from site *
655
+ # `e`: exclude content from site
656
+ # Corresponds to the JSON property `siteSearchFilter`
657
+ # @return [String]
658
+ attr_accessor :site_search_filter
659
+
660
+ # Specifies that results should be sorted according to the specified expression.
661
+ # For example, sort by date.
662
+ # Corresponds to the JSON property `sort`
663
+ # @return [String]
664
+ attr_accessor :sort
665
+
666
+ # The index of the current set of search results into the total set of results,
667
+ # where the index of the first result is 1.
668
+ # Corresponds to the JSON property `startIndex`
669
+ # @return [Fixnum]
670
+ attr_accessor :start_index
671
+
672
+ # The page number of this set of results, where the page length is set by the `
673
+ # count` property.
674
+ # Corresponds to the JSON property `startPage`
675
+ # @return [Fixnum]
676
+ attr_accessor :start_page
677
+
678
+ # A description of the query.
679
+ # Corresponds to the JSON property `title`
680
+ # @return [String]
681
+ attr_accessor :title
682
+
683
+ # Estimated number of total search results. May not be accurate.
684
+ # Corresponds to the JSON property `totalResults`
685
+ # @return [Fixnum]
686
+ attr_accessor :total_results
687
+
688
+ def initialize(**args)
689
+ update!(**args)
690
+ end
691
+
692
+ # Update properties of this object
693
+ def update!(**args)
694
+ @count = args[:count] if args.key?(:count)
695
+ @cr = args[:cr] if args.key?(:cr)
696
+ @cx = args[:cx] if args.key?(:cx)
697
+ @date_restrict = args[:date_restrict] if args.key?(:date_restrict)
698
+ @disable_cn_tw_translation = args[:disable_cn_tw_translation] if args.key?(:disable_cn_tw_translation)
699
+ @exact_terms = args[:exact_terms] if args.key?(:exact_terms)
700
+ @exclude_terms = args[:exclude_terms] if args.key?(:exclude_terms)
701
+ @file_type = args[:file_type] if args.key?(:file_type)
702
+ @filter = args[:filter] if args.key?(:filter)
703
+ @gl = args[:gl] if args.key?(:gl)
704
+ @google_host = args[:google_host] if args.key?(:google_host)
705
+ @high_range = args[:high_range] if args.key?(:high_range)
706
+ @hl = args[:hl] if args.key?(:hl)
707
+ @hq = args[:hq] if args.key?(:hq)
708
+ @img_color_type = args[:img_color_type] if args.key?(:img_color_type)
709
+ @img_dominant_color = args[:img_dominant_color] if args.key?(:img_dominant_color)
710
+ @img_size = args[:img_size] if args.key?(:img_size)
711
+ @img_type = args[:img_type] if args.key?(:img_type)
712
+ @input_encoding = args[:input_encoding] if args.key?(:input_encoding)
713
+ @language = args[:language] if args.key?(:language)
714
+ @link_site = args[:link_site] if args.key?(:link_site)
715
+ @low_range = args[:low_range] if args.key?(:low_range)
716
+ @or_terms = args[:or_terms] if args.key?(:or_terms)
717
+ @output_encoding = args[:output_encoding] if args.key?(:output_encoding)
718
+ @related_site = args[:related_site] if args.key?(:related_site)
719
+ @rights = args[:rights] if args.key?(:rights)
720
+ @safe = args[:safe] if args.key?(:safe)
721
+ @search_terms = args[:search_terms] if args.key?(:search_terms)
722
+ @search_type = args[:search_type] if args.key?(:search_type)
723
+ @site_search = args[:site_search] if args.key?(:site_search)
724
+ @site_search_filter = args[:site_search_filter] if args.key?(:site_search_filter)
725
+ @sort = args[:sort] if args.key?(:sort)
726
+ @start_index = args[:start_index] if args.key?(:start_index)
727
+ @start_page = args[:start_page] if args.key?(:start_page)
728
+ @title = args[:title] if args.key?(:title)
729
+ @total_results = args[:total_results] if args.key?(:total_results)
730
+ end
731
+ end
732
+
733
+ # Custom search request metadata.
734
+ class PreviousPage
735
+ include Google::Apis::Core::Hashable
736
+
737
+ # Number of search results returned in this set.
738
+ # Corresponds to the JSON property `count`
739
+ # @return [Fixnum]
740
+ attr_accessor :count
741
+
742
+ # Restricts search results to documents originating in a particular country. You
743
+ # may use [Boolean operators](https://developers.google.com/custom-search/docs/
744
+ # xml_results#booleanOperators) in the `cr` parameter's value. Google WebSearch
745
+ # determines the country of a document by analyzing the following: * The top-
746
+ # level domain (TLD) of the document's URL. * The geographic location of the web
747
+ # server's IP address. See [Country (cr) Parameter Values](https://developers.
748
+ # google.com/custom-search/docs/xml_results#countryCollections) for a list of
749
+ # valid values for this parameter.
750
+ # Corresponds to the JSON property `cr`
751
+ # @return [String]
752
+ attr_accessor :cr
753
+
754
+ # The identifier of an engine created using the Programmable Search Engine [
755
+ # Control Panel](https://programmablesearchengine.google.com/). This is a custom
756
+ # property not defined in the OpenSearch spec. This parameter is **required**.
757
+ # Corresponds to the JSON property `cx`
758
+ # @return [String]
759
+ attr_accessor :cx
760
+
761
+ # Restricts results to URLs based on date. Supported values include: * `d[number]
762
+ # `: requests results from the specified number of past days. * `w[number]`:
763
+ # requests results from the specified number of past weeks. * `m[number]`:
764
+ # requests results from the specified number of past months. * `y[number]`:
765
+ # requests results from the specified number of past years.
766
+ # Corresponds to the JSON property `dateRestrict`
767
+ # @return [String]
768
+ attr_accessor :date_restrict
769
+
770
+ # Enables or disables the [Simplified and Traditional Chinese Search](https://
771
+ # developers.google.com/custom-search/docs/xml_results#chineseSearch) feature.
772
+ # Supported values are: * `0`: enabled (default) * `1`: disabled
773
+ # Corresponds to the JSON property `disableCnTwTranslation`
774
+ # @return [String]
775
+ attr_accessor :disable_cn_tw_translation
776
+
777
+ # Identifies a phrase that all documents in the search results must contain.
778
+ # Corresponds to the JSON property `exactTerms`
779
+ # @return [String]
780
+ attr_accessor :exact_terms
781
+
782
+ # Identifies a word or phrase that should not appear in any documents in the
783
+ # search results.
784
+ # Corresponds to the JSON property `excludeTerms`
785
+ # @return [String]
786
+ attr_accessor :exclude_terms
787
+
788
+ # Restricts results to files of a specified extension. Filetypes supported by
789
+ # Google include: * Adobe Portable Document Format (`pdf`) * Adobe PostScript (`
790
+ # ps`) * Lotus 1-2-3 (`wk1`, `wk2`, `wk3`, `wk4`, `wk5`, `wki`, `wks`, `wku`) *
791
+ # Lotus WordPro (`lwp`) * Macwrite (`mw`) * Microsoft Excel (`xls`) * Microsoft
792
+ # PowerPoint (`ppt`) * Microsoft Word (`doc`) * Microsoft Works (`wks`, `wps`, `
793
+ # wdb`) * Microsoft Write (`wri`) * Rich Text Format (`rtf`) * Shockwave Flash (`
794
+ # swf`) * Text (`ans`, `txt`). Additional filetypes may be added in the future.
795
+ # An up-to-date list can always be found in Google's [file type FAQ](https://
796
+ # support.google.com/webmasters/answer/35287).
797
+ # Corresponds to the JSON property `fileType`
798
+ # @return [String]
799
+ attr_accessor :file_type
800
+
801
+ # Activates or deactivates the automatic filtering of Google search results. See
802
+ # [Automatic Filtering](https://developers.google.com/custom-search/docs/
803
+ # xml_results#automaticFiltering) for more information about Google's search
804
+ # results filters. Valid values for this parameter are: * `0`: Disabled * `1`:
805
+ # Enabled (default) **Note**: By default, Google applies filtering to all search
806
+ # results to improve the quality of those results.
807
+ # Corresponds to the JSON property `filter`
808
+ # @return [String]
809
+ attr_accessor :filter
810
+
811
+ # Boosts search results whose country of origin matches the parameter value. See
812
+ # [Country Codes](https://developers.google.com/custom-search/docs/xml_results#
813
+ # countryCodes) for a list of valid values. Specifying a `gl` parameter value in
814
+ # WebSearch requests should improve the relevance of results. This is
815
+ # particularly true for international customers and, even more specifically, for
816
+ # customers in English-speaking countries other than the United States.
817
+ # Corresponds to the JSON property `gl`
818
+ # @return [String]
819
+ attr_accessor :gl
820
+
821
+ # Specifies the Google domain (for example, google.com, google.de, or google.fr)
822
+ # to which the search should be limited.
823
+ # Corresponds to the JSON property `googleHost`
824
+ # @return [String]
825
+ attr_accessor :google_host
826
+
827
+ # Specifies the ending value for a search range. Use `cse:lowRange` and `cse:
828
+ # highrange` to append an inclusive search range of `lowRange...highRange` to
829
+ # the query.
830
+ # Corresponds to the JSON property `highRange`
831
+ # @return [String]
832
+ attr_accessor :high_range
833
+
834
+ # Specifies the interface language (host language) of your user interface.
835
+ # Explicitly setting this parameter improves the performance and the quality of
836
+ # your search results. See the [Interface Languages](https://developers.google.
837
+ # com/custom-search/docs/xml_results#wsInterfaceLanguages) section of [
838
+ # Internationalizing Queries and Results Presentation](https://developers.google.
839
+ # com/custom-search/docs/xml_results#wsInternationalizing) for more information,
840
+ # and [Supported Interface Languages](https://developers.google.com/custom-
841
+ # search/docs/xml_results_appendices#interfaceLanguages) for a list of supported
842
+ # languages.
843
+ # Corresponds to the JSON property `hl`
844
+ # @return [String]
845
+ attr_accessor :hl
846
+
847
+ # Appends the specified query terms to the query, as if they were combined with
848
+ # a logical `AND` operator.
849
+ # Corresponds to the JSON property `hq`
850
+ # @return [String]
851
+ attr_accessor :hq
852
+
853
+ # Restricts results to images of a specified color type. Supported values are: *
854
+ # `mono` (black and white) * `gray` (grayscale) * `color` (color)
855
+ # Corresponds to the JSON property `imgColorType`
856
+ # @return [String]
857
+ attr_accessor :img_color_type
858
+
859
+ # Restricts results to images with a specific dominant color. Supported values
860
+ # are: * `red` * `orange` * `yellow` * `green` * `teal` * `blue` * `purple` * `
861
+ # pink` * `white` * `gray` * `black` * `brown`
862
+ # Corresponds to the JSON property `imgDominantColor`
863
+ # @return [String]
864
+ attr_accessor :img_dominant_color
865
+
866
+ # Restricts results to images of a specified size. Supported values are: * `icon`
867
+ # (small) * `small | medium | large | xlarge` (medium) * `xxlarge` (large) * `
868
+ # huge` (extra-large)
869
+ # Corresponds to the JSON property `imgSize`
870
+ # @return [String]
871
+ attr_accessor :img_size
872
+
873
+ # Restricts results to images of a specified type. Supported values are: * `
874
+ # clipart` (Clip art) * `face` (Face) * `lineart` (Line drawing) * `photo` (
875
+ # Photo) * `animated` (Animated) * `stock` (Stock)
876
+ # Corresponds to the JSON property `imgType`
877
+ # @return [String]
878
+ attr_accessor :img_type
879
+
880
+ # The character encoding supported for search requests.
881
+ # Corresponds to the JSON property `inputEncoding`
882
+ # @return [String]
883
+ attr_accessor :input_encoding
884
+
885
+ # The language of the search results.
886
+ # Corresponds to the JSON property `language`
887
+ # @return [String]
888
+ attr_accessor :language
889
+
890
+ # Specifies that all results should contain a link to a specific URL.
891
+ # Corresponds to the JSON property `linkSite`
892
+ # @return [String]
893
+ attr_accessor :link_site
894
+
895
+ # Specifies the starting value for a search range. Use `cse:lowRange` and `cse:
896
+ # highrange` to append an inclusive search range of `lowRange...highRange` to
897
+ # the query.
898
+ # Corresponds to the JSON property `lowRange`
899
+ # @return [String]
900
+ attr_accessor :low_range
901
+
902
+ # Provides additional search terms to check for in a document, where each
903
+ # document in the search results must contain at least one of the additional
904
+ # search terms. You can also use the [Boolean OR](https://developers.google.com/
905
+ # custom-search/docs/xml_results#BooleanOrqt) query term for this type of query.
906
+ # Corresponds to the JSON property `orTerms`
907
+ # @return [String]
908
+ attr_accessor :or_terms
909
+
910
+ # The character encoding supported for search results.
911
+ # Corresponds to the JSON property `outputEncoding`
912
+ # @return [String]
913
+ attr_accessor :output_encoding
914
+
915
+ # Specifies that all search results should be pages that are related to the
916
+ # specified URL. The parameter value should be a URL.
917
+ # Corresponds to the JSON property `relatedSite`
918
+ # @return [String]
919
+ attr_accessor :related_site
920
+
921
+ # Filters based on licensing. Supported values include: * `cc_publicdomain` * `
922
+ # cc_attribute` * `cc_sharealike` * `cc_noncommercial` * `cc_nonderived`
923
+ # Corresponds to the JSON property `rights`
924
+ # @return [String]
925
+ attr_accessor :rights
926
+
927
+ # Specifies the [SafeSearch level](https://developers.google.com/custom-search/
928
+ # docs/xml_results#safeSearchLevels) used for filtering out adult results. This
929
+ # is a custom property not defined in the OpenSearch spec. Valid parameter
930
+ # values are: * `"off"`: Disable SafeSearch * `"active"`: Enable SafeSearch
931
+ # Corresponds to the JSON property `safe`
932
+ # @return [String]
933
+ attr_accessor :safe
934
+
935
+ # The search terms entered by the user.
936
+ # Corresponds to the JSON property `searchTerms`
937
+ # @return [String]
938
+ attr_accessor :search_terms
939
+
940
+ # Allowed values are `web` or `image`. If unspecified, results are limited to
941
+ # webpages.
942
+ # Corresponds to the JSON property `searchType`
943
+ # @return [String]
944
+ attr_accessor :search_type
945
+
946
+ # Restricts results to URLs from a specified site.
947
+ # Corresponds to the JSON property `siteSearch`
948
+ # @return [String]
949
+ attr_accessor :site_search
950
+
951
+ # Specifies whether to include or exclude results from the site named in the `
952
+ # sitesearch` parameter. Supported values are: * `i`: include content from site *
953
+ # `e`: exclude content from site
954
+ # Corresponds to the JSON property `siteSearchFilter`
955
+ # @return [String]
956
+ attr_accessor :site_search_filter
957
+
958
+ # Specifies that results should be sorted according to the specified expression.
959
+ # For example, sort by date.
960
+ # Corresponds to the JSON property `sort`
961
+ # @return [String]
962
+ attr_accessor :sort
963
+
964
+ # The index of the current set of search results into the total set of results,
965
+ # where the index of the first result is 1.
966
+ # Corresponds to the JSON property `startIndex`
967
+ # @return [Fixnum]
968
+ attr_accessor :start_index
969
+
970
+ # The page number of this set of results, where the page length is set by the `
971
+ # count` property.
972
+ # Corresponds to the JSON property `startPage`
973
+ # @return [Fixnum]
974
+ attr_accessor :start_page
975
+
976
+ # A description of the query.
977
+ # Corresponds to the JSON property `title`
978
+ # @return [String]
979
+ attr_accessor :title
980
+
981
+ # Estimated number of total search results. May not be accurate.
982
+ # Corresponds to the JSON property `totalResults`
983
+ # @return [Fixnum]
984
+ attr_accessor :total_results
985
+
986
+ def initialize(**args)
987
+ update!(**args)
988
+ end
989
+
990
+ # Update properties of this object
991
+ def update!(**args)
992
+ @count = args[:count] if args.key?(:count)
993
+ @cr = args[:cr] if args.key?(:cr)
994
+ @cx = args[:cx] if args.key?(:cx)
995
+ @date_restrict = args[:date_restrict] if args.key?(:date_restrict)
996
+ @disable_cn_tw_translation = args[:disable_cn_tw_translation] if args.key?(:disable_cn_tw_translation)
997
+ @exact_terms = args[:exact_terms] if args.key?(:exact_terms)
998
+ @exclude_terms = args[:exclude_terms] if args.key?(:exclude_terms)
999
+ @file_type = args[:file_type] if args.key?(:file_type)
1000
+ @filter = args[:filter] if args.key?(:filter)
1001
+ @gl = args[:gl] if args.key?(:gl)
1002
+ @google_host = args[:google_host] if args.key?(:google_host)
1003
+ @high_range = args[:high_range] if args.key?(:high_range)
1004
+ @hl = args[:hl] if args.key?(:hl)
1005
+ @hq = args[:hq] if args.key?(:hq)
1006
+ @img_color_type = args[:img_color_type] if args.key?(:img_color_type)
1007
+ @img_dominant_color = args[:img_dominant_color] if args.key?(:img_dominant_color)
1008
+ @img_size = args[:img_size] if args.key?(:img_size)
1009
+ @img_type = args[:img_type] if args.key?(:img_type)
1010
+ @input_encoding = args[:input_encoding] if args.key?(:input_encoding)
1011
+ @language = args[:language] if args.key?(:language)
1012
+ @link_site = args[:link_site] if args.key?(:link_site)
1013
+ @low_range = args[:low_range] if args.key?(:low_range)
1014
+ @or_terms = args[:or_terms] if args.key?(:or_terms)
1015
+ @output_encoding = args[:output_encoding] if args.key?(:output_encoding)
1016
+ @related_site = args[:related_site] if args.key?(:related_site)
1017
+ @rights = args[:rights] if args.key?(:rights)
1018
+ @safe = args[:safe] if args.key?(:safe)
1019
+ @search_terms = args[:search_terms] if args.key?(:search_terms)
1020
+ @search_type = args[:search_type] if args.key?(:search_type)
1021
+ @site_search = args[:site_search] if args.key?(:site_search)
1022
+ @site_search_filter = args[:site_search_filter] if args.key?(:site_search_filter)
1023
+ @sort = args[:sort] if args.key?(:sort)
1024
+ @start_index = args[:start_index] if args.key?(:start_index)
1025
+ @start_page = args[:start_page] if args.key?(:start_page)
1026
+ @title = args[:title] if args.key?(:title)
1027
+ @total_results = args[:total_results] if args.key?(:total_results)
1028
+ end
1029
+ end
1030
+
1031
+ # Custom search request metadata.
1032
+ class Request
1033
+ include Google::Apis::Core::Hashable
1034
+
1035
+ # Number of search results returned in this set.
1036
+ # Corresponds to the JSON property `count`
1037
+ # @return [Fixnum]
1038
+ attr_accessor :count
1039
+
1040
+ # Restricts search results to documents originating in a particular country. You
1041
+ # may use [Boolean operators](https://developers.google.com/custom-search/docs/
1042
+ # xml_results#booleanOperators) in the `cr` parameter's value. Google WebSearch
1043
+ # determines the country of a document by analyzing the following: * The top-
1044
+ # level domain (TLD) of the document's URL. * The geographic location of the web
1045
+ # server's IP address. See [Country (cr) Parameter Values](https://developers.
1046
+ # google.com/custom-search/docs/xml_results#countryCollections) for a list of
1047
+ # valid values for this parameter.
1048
+ # Corresponds to the JSON property `cr`
1049
+ # @return [String]
1050
+ attr_accessor :cr
1051
+
1052
+ # The identifier of an engine created using the Programmable Search Engine [
1053
+ # Control Panel](https://programmablesearchengine.google.com/). This is a custom
1054
+ # property not defined in the OpenSearch spec. This parameter is **required**.
1055
+ # Corresponds to the JSON property `cx`
1056
+ # @return [String]
1057
+ attr_accessor :cx
1058
+
1059
+ # Restricts results to URLs based on date. Supported values include: * `d[number]
1060
+ # `: requests results from the specified number of past days. * `w[number]`:
1061
+ # requests results from the specified number of past weeks. * `m[number]`:
1062
+ # requests results from the specified number of past months. * `y[number]`:
1063
+ # requests results from the specified number of past years.
1064
+ # Corresponds to the JSON property `dateRestrict`
1065
+ # @return [String]
1066
+ attr_accessor :date_restrict
1067
+
1068
+ # Enables or disables the [Simplified and Traditional Chinese Search](https://
1069
+ # developers.google.com/custom-search/docs/xml_results#chineseSearch) feature.
1070
+ # Supported values are: * `0`: enabled (default) * `1`: disabled
1071
+ # Corresponds to the JSON property `disableCnTwTranslation`
1072
+ # @return [String]
1073
+ attr_accessor :disable_cn_tw_translation
1074
+
1075
+ # Identifies a phrase that all documents in the search results must contain.
1076
+ # Corresponds to the JSON property `exactTerms`
1077
+ # @return [String]
1078
+ attr_accessor :exact_terms
1079
+
1080
+ # Identifies a word or phrase that should not appear in any documents in the
1081
+ # search results.
1082
+ # Corresponds to the JSON property `excludeTerms`
1083
+ # @return [String]
1084
+ attr_accessor :exclude_terms
1085
+
1086
+ # Restricts results to files of a specified extension. Filetypes supported by
1087
+ # Google include: * Adobe Portable Document Format (`pdf`) * Adobe PostScript (`
1088
+ # ps`) * Lotus 1-2-3 (`wk1`, `wk2`, `wk3`, `wk4`, `wk5`, `wki`, `wks`, `wku`) *
1089
+ # Lotus WordPro (`lwp`) * Macwrite (`mw`) * Microsoft Excel (`xls`) * Microsoft
1090
+ # PowerPoint (`ppt`) * Microsoft Word (`doc`) * Microsoft Works (`wks`, `wps`, `
1091
+ # wdb`) * Microsoft Write (`wri`) * Rich Text Format (`rtf`) * Shockwave Flash (`
1092
+ # swf`) * Text (`ans`, `txt`). Additional filetypes may be added in the future.
1093
+ # An up-to-date list can always be found in Google's [file type FAQ](https://
1094
+ # support.google.com/webmasters/answer/35287).
1095
+ # Corresponds to the JSON property `fileType`
1096
+ # @return [String]
1097
+ attr_accessor :file_type
1098
+
1099
+ # Activates or deactivates the automatic filtering of Google search results. See
1100
+ # [Automatic Filtering](https://developers.google.com/custom-search/docs/
1101
+ # xml_results#automaticFiltering) for more information about Google's search
1102
+ # results filters. Valid values for this parameter are: * `0`: Disabled * `1`:
1103
+ # Enabled (default) **Note**: By default, Google applies filtering to all search
1104
+ # results to improve the quality of those results.
1105
+ # Corresponds to the JSON property `filter`
1106
+ # @return [String]
1107
+ attr_accessor :filter
1108
+
1109
+ # Boosts search results whose country of origin matches the parameter value. See
1110
+ # [Country Codes](https://developers.google.com/custom-search/docs/xml_results#
1111
+ # countryCodes) for a list of valid values. Specifying a `gl` parameter value in
1112
+ # WebSearch requests should improve the relevance of results. This is
1113
+ # particularly true for international customers and, even more specifically, for
1114
+ # customers in English-speaking countries other than the United States.
1115
+ # Corresponds to the JSON property `gl`
1116
+ # @return [String]
1117
+ attr_accessor :gl
1118
+
1119
+ # Specifies the Google domain (for example, google.com, google.de, or google.fr)
1120
+ # to which the search should be limited.
1121
+ # Corresponds to the JSON property `googleHost`
1122
+ # @return [String]
1123
+ attr_accessor :google_host
1124
+
1125
+ # Specifies the ending value for a search range. Use `cse:lowRange` and `cse:
1126
+ # highrange` to append an inclusive search range of `lowRange...highRange` to
1127
+ # the query.
1128
+ # Corresponds to the JSON property `highRange`
1129
+ # @return [String]
1130
+ attr_accessor :high_range
1131
+
1132
+ # Specifies the interface language (host language) of your user interface.
1133
+ # Explicitly setting this parameter improves the performance and the quality of
1134
+ # your search results. See the [Interface Languages](https://developers.google.
1135
+ # com/custom-search/docs/xml_results#wsInterfaceLanguages) section of [
1136
+ # Internationalizing Queries and Results Presentation](https://developers.google.
1137
+ # com/custom-search/docs/xml_results#wsInternationalizing) for more information,
1138
+ # and [Supported Interface Languages](https://developers.google.com/custom-
1139
+ # search/docs/xml_results_appendices#interfaceLanguages) for a list of supported
1140
+ # languages.
1141
+ # Corresponds to the JSON property `hl`
1142
+ # @return [String]
1143
+ attr_accessor :hl
1144
+
1145
+ # Appends the specified query terms to the query, as if they were combined with
1146
+ # a logical `AND` operator.
1147
+ # Corresponds to the JSON property `hq`
1148
+ # @return [String]
1149
+ attr_accessor :hq
1150
+
1151
+ # Restricts results to images of a specified color type. Supported values are: *
1152
+ # `mono` (black and white) * `gray` (grayscale) * `color` (color)
1153
+ # Corresponds to the JSON property `imgColorType`
1154
+ # @return [String]
1155
+ attr_accessor :img_color_type
1156
+
1157
+ # Restricts results to images with a specific dominant color. Supported values
1158
+ # are: * `red` * `orange` * `yellow` * `green` * `teal` * `blue` * `purple` * `
1159
+ # pink` * `white` * `gray` * `black` * `brown`
1160
+ # Corresponds to the JSON property `imgDominantColor`
1161
+ # @return [String]
1162
+ attr_accessor :img_dominant_color
1163
+
1164
+ # Restricts results to images of a specified size. Supported values are: * `icon`
1165
+ # (small) * `small | medium | large | xlarge` (medium) * `xxlarge` (large) * `
1166
+ # huge` (extra-large)
1167
+ # Corresponds to the JSON property `imgSize`
1168
+ # @return [String]
1169
+ attr_accessor :img_size
1170
+
1171
+ # Restricts results to images of a specified type. Supported values are: * `
1172
+ # clipart` (Clip art) * `face` (Face) * `lineart` (Line drawing) * `photo` (
1173
+ # Photo) * `animated` (Animated) * `stock` (Stock)
1174
+ # Corresponds to the JSON property `imgType`
1175
+ # @return [String]
1176
+ attr_accessor :img_type
1177
+
1178
+ # The character encoding supported for search requests.
1179
+ # Corresponds to the JSON property `inputEncoding`
1180
+ # @return [String]
1181
+ attr_accessor :input_encoding
1182
+
1183
+ # The language of the search results.
1184
+ # Corresponds to the JSON property `language`
1185
+ # @return [String]
1186
+ attr_accessor :language
1187
+
1188
+ # Specifies that all results should contain a link to a specific URL.
1189
+ # Corresponds to the JSON property `linkSite`
1190
+ # @return [String]
1191
+ attr_accessor :link_site
1192
+
1193
+ # Specifies the starting value for a search range. Use `cse:lowRange` and `cse:
1194
+ # highrange` to append an inclusive search range of `lowRange...highRange` to
1195
+ # the query.
1196
+ # Corresponds to the JSON property `lowRange`
1197
+ # @return [String]
1198
+ attr_accessor :low_range
1199
+
1200
+ # Provides additional search terms to check for in a document, where each
1201
+ # document in the search results must contain at least one of the additional
1202
+ # search terms. You can also use the [Boolean OR](https://developers.google.com/
1203
+ # custom-search/docs/xml_results#BooleanOrqt) query term for this type of query.
1204
+ # Corresponds to the JSON property `orTerms`
1205
+ # @return [String]
1206
+ attr_accessor :or_terms
1207
+
1208
+ # The character encoding supported for search results.
1209
+ # Corresponds to the JSON property `outputEncoding`
1210
+ # @return [String]
1211
+ attr_accessor :output_encoding
1212
+
1213
+ # Specifies that all search results should be pages that are related to the
1214
+ # specified URL. The parameter value should be a URL.
1215
+ # Corresponds to the JSON property `relatedSite`
1216
+ # @return [String]
1217
+ attr_accessor :related_site
1218
+
1219
+ # Filters based on licensing. Supported values include: * `cc_publicdomain` * `
1220
+ # cc_attribute` * `cc_sharealike` * `cc_noncommercial` * `cc_nonderived`
1221
+ # Corresponds to the JSON property `rights`
1222
+ # @return [String]
1223
+ attr_accessor :rights
1224
+
1225
+ # Specifies the [SafeSearch level](https://developers.google.com/custom-search/
1226
+ # docs/xml_results#safeSearchLevels) used for filtering out adult results. This
1227
+ # is a custom property not defined in the OpenSearch spec. Valid parameter
1228
+ # values are: * `"off"`: Disable SafeSearch * `"active"`: Enable SafeSearch
1229
+ # Corresponds to the JSON property `safe`
1230
+ # @return [String]
1231
+ attr_accessor :safe
1232
+
1233
+ # The search terms entered by the user.
1234
+ # Corresponds to the JSON property `searchTerms`
1235
+ # @return [String]
1236
+ attr_accessor :search_terms
1237
+
1238
+ # Allowed values are `web` or `image`. If unspecified, results are limited to
1239
+ # webpages.
1240
+ # Corresponds to the JSON property `searchType`
1241
+ # @return [String]
1242
+ attr_accessor :search_type
1243
+
1244
+ # Restricts results to URLs from a specified site.
1245
+ # Corresponds to the JSON property `siteSearch`
1246
+ # @return [String]
1247
+ attr_accessor :site_search
1248
+
1249
+ # Specifies whether to include or exclude results from the site named in the `
1250
+ # sitesearch` parameter. Supported values are: * `i`: include content from site *
1251
+ # `e`: exclude content from site
1252
+ # Corresponds to the JSON property `siteSearchFilter`
1253
+ # @return [String]
1254
+ attr_accessor :site_search_filter
1255
+
1256
+ # Specifies that results should be sorted according to the specified expression.
1257
+ # For example, sort by date.
1258
+ # Corresponds to the JSON property `sort`
1259
+ # @return [String]
1260
+ attr_accessor :sort
1261
+
1262
+ # The index of the current set of search results into the total set of results,
1263
+ # where the index of the first result is 1.
1264
+ # Corresponds to the JSON property `startIndex`
1265
+ # @return [Fixnum]
1266
+ attr_accessor :start_index
1267
+
1268
+ # The page number of this set of results, where the page length is set by the `
1269
+ # count` property.
1270
+ # Corresponds to the JSON property `startPage`
1271
+ # @return [Fixnum]
1272
+ attr_accessor :start_page
1273
+
1274
+ # A description of the query.
1275
+ # Corresponds to the JSON property `title`
1276
+ # @return [String]
1277
+ attr_accessor :title
1278
+
1279
+ # Estimated number of total search results. May not be accurate.
1280
+ # Corresponds to the JSON property `totalResults`
1281
+ # @return [Fixnum]
1282
+ attr_accessor :total_results
1283
+
1284
+ def initialize(**args)
1285
+ update!(**args)
1286
+ end
1287
+
1288
+ # Update properties of this object
1289
+ def update!(**args)
1290
+ @count = args[:count] if args.key?(:count)
1291
+ @cr = args[:cr] if args.key?(:cr)
1292
+ @cx = args[:cx] if args.key?(:cx)
1293
+ @date_restrict = args[:date_restrict] if args.key?(:date_restrict)
1294
+ @disable_cn_tw_translation = args[:disable_cn_tw_translation] if args.key?(:disable_cn_tw_translation)
1295
+ @exact_terms = args[:exact_terms] if args.key?(:exact_terms)
1296
+ @exclude_terms = args[:exclude_terms] if args.key?(:exclude_terms)
1297
+ @file_type = args[:file_type] if args.key?(:file_type)
1298
+ @filter = args[:filter] if args.key?(:filter)
1299
+ @gl = args[:gl] if args.key?(:gl)
1300
+ @google_host = args[:google_host] if args.key?(:google_host)
1301
+ @high_range = args[:high_range] if args.key?(:high_range)
1302
+ @hl = args[:hl] if args.key?(:hl)
1303
+ @hq = args[:hq] if args.key?(:hq)
1304
+ @img_color_type = args[:img_color_type] if args.key?(:img_color_type)
1305
+ @img_dominant_color = args[:img_dominant_color] if args.key?(:img_dominant_color)
1306
+ @img_size = args[:img_size] if args.key?(:img_size)
1307
+ @img_type = args[:img_type] if args.key?(:img_type)
1308
+ @input_encoding = args[:input_encoding] if args.key?(:input_encoding)
1309
+ @language = args[:language] if args.key?(:language)
1310
+ @link_site = args[:link_site] if args.key?(:link_site)
1311
+ @low_range = args[:low_range] if args.key?(:low_range)
1312
+ @or_terms = args[:or_terms] if args.key?(:or_terms)
1313
+ @output_encoding = args[:output_encoding] if args.key?(:output_encoding)
1314
+ @related_site = args[:related_site] if args.key?(:related_site)
1315
+ @rights = args[:rights] if args.key?(:rights)
1316
+ @safe = args[:safe] if args.key?(:safe)
1317
+ @search_terms = args[:search_terms] if args.key?(:search_terms)
1318
+ @search_type = args[:search_type] if args.key?(:search_type)
1319
+ @site_search = args[:site_search] if args.key?(:site_search)
1320
+ @site_search_filter = args[:site_search_filter] if args.key?(:site_search_filter)
1321
+ @sort = args[:sort] if args.key?(:sort)
1322
+ @start_index = args[:start_index] if args.key?(:start_index)
1323
+ @start_page = args[:start_page] if args.key?(:start_page)
1324
+ @title = args[:title] if args.key?(:title)
1325
+ @total_results = args[:total_results] if args.key?(:total_results)
1326
+ end
1327
+ end
1328
+ end
1329
+
1330
+ # Metadata about a search operation.
1331
+ class SearchInformation
1332
+ include Google::Apis::Core::Hashable
1333
+
1334
+ # The time taken for the server to return search results, formatted according to
1335
+ # locale style.
1336
+ # Corresponds to the JSON property `formattedSearchTime`
1337
+ # @return [String]
1338
+ attr_accessor :formatted_search_time
1339
+
1340
+ # The total number of search results, formatted according to locale style.
1341
+ # Corresponds to the JSON property `formattedTotalResults`
1342
+ # @return [String]
1343
+ attr_accessor :formatted_total_results
1344
+
1345
+ # The time taken for the server to return search results.
1346
+ # Corresponds to the JSON property `searchTime`
1347
+ # @return [Float]
1348
+ attr_accessor :search_time
1349
+
1350
+ # The total number of search results returned by the query.
1351
+ # Corresponds to the JSON property `totalResults`
1352
+ # @return [String]
1353
+ attr_accessor :total_results
1354
+
1355
+ def initialize(**args)
1356
+ update!(**args)
1357
+ end
1358
+
1359
+ # Update properties of this object
1360
+ def update!(**args)
1361
+ @formatted_search_time = args[:formatted_search_time] if args.key?(:formatted_search_time)
1362
+ @formatted_total_results = args[:formatted_total_results] if args.key?(:formatted_total_results)
1363
+ @search_time = args[:search_time] if args.key?(:search_time)
1364
+ @total_results = args[:total_results] if args.key?(:total_results)
1365
+ end
1366
+ end
1367
+
1368
+ # Spell correction information for a query.
1369
+ class Spelling
1370
+ include Google::Apis::Core::Hashable
1371
+
1372
+ # The corrected query.
1373
+ # Corresponds to the JSON property `correctedQuery`
1374
+ # @return [String]
1375
+ attr_accessor :corrected_query
1376
+
1377
+ # The corrected query, formatted in HTML.
1378
+ # Corresponds to the JSON property `htmlCorrectedQuery`
1379
+ # @return [String]
1380
+ attr_accessor :html_corrected_query
1381
+
1382
+ def initialize(**args)
1383
+ update!(**args)
1384
+ end
1385
+
1386
+ # Update properties of this object
1387
+ def update!(**args)
1388
+ @corrected_query = args[:corrected_query] if args.key?(:corrected_query)
1389
+ @html_corrected_query = args[:html_corrected_query] if args.key?(:html_corrected_query)
1390
+ end
1391
+ end
1392
+
1393
+ # OpenSearch template and URL.
1394
+ class Url
1395
+ include Google::Apis::Core::Hashable
1396
+
1397
+ # The actual [OpenSearch template](http://www.opensearch.org/specifications/
1398
+ # opensearch/1.1#opensearch_url_template_syntax) for this API.
1399
+ # Corresponds to the JSON property `template`
1400
+ # @return [String]
1401
+ attr_accessor :template
1402
+
1403
+ # The MIME type of the OpenSearch URL template for the Custom Search JSON API.
1404
+ # Corresponds to the JSON property `type`
1405
+ # @return [String]
1406
+ attr_accessor :type
1407
+
1408
+ def initialize(**args)
1409
+ update!(**args)
1410
+ end
1411
+
1412
+ # Update properties of this object
1413
+ def update!(**args)
1414
+ @template = args[:template] if args.key?(:template)
1415
+ @type = args[:type] if args.key?(:type)
1416
+ end
1417
+ end
1418
+ end
1419
+ end
1420
+ end
1421
+ end