1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18namespace Google\Service;
19
20use Google\Client;
21
22/**
23 * Service definition for CustomSearchAPI (v1).
24 *
25 * <p>
26 * Searches over a website or collection of websites</p>
27 *
28 * <p>
29 * For more information about this service, see the API
30 * <a href="https://developers.google.com/custom-search/v1/introduction" target="_blank">Documentation</a>
31 * </p>
32 *
33 * @author Google, Inc.
34 */
35class CustomSearchAPI extends \Google\Service
36{
37
38
39  public $cse;
40  public $cse_siterestrict;
41
42  /**
43   * Constructs the internal representation of the CustomSearchAPI service.
44   *
45   * @param Client|array $clientOrConfig The client used to deliver requests, or a
46   *                                     config array to pass to a new Client instance.
47   * @param string $rootUrl The root URL used for requests to the service.
48   */
49  public function __construct($clientOrConfig = [], $rootUrl = null)
50  {
51    parent::__construct($clientOrConfig);
52    $this->rootUrl = $rootUrl ?: 'https://customsearch.googleapis.com/';
53    $this->servicePath = '';
54    $this->batchPath = 'batch';
55    $this->version = 'v1';
56    $this->serviceName = 'customsearch';
57
58    $this->cse = new CustomSearchAPI\Resource\Cse(
59        $this,
60        $this->serviceName,
61        'cse',
62        [
63          'methods' => [
64            'list' => [
65              'path' => 'customsearch/v1',
66              'httpMethod' => 'GET',
67              'parameters' => [
68                'c2coff' => [
69                  'location' => 'query',
70                  'type' => 'string',
71                ],
72                'cr' => [
73                  'location' => 'query',
74                  'type' => 'string',
75                ],
76                'cx' => [
77                  'location' => 'query',
78                  'type' => 'string',
79                ],
80                'dateRestrict' => [
81                  'location' => 'query',
82                  'type' => 'string',
83                ],
84                'exactTerms' => [
85                  'location' => 'query',
86                  'type' => 'string',
87                ],
88                'excludeTerms' => [
89                  'location' => 'query',
90                  'type' => 'string',
91                ],
92                'fileType' => [
93                  'location' => 'query',
94                  'type' => 'string',
95                ],
96                'filter' => [
97                  'location' => 'query',
98                  'type' => 'string',
99                ],
100                'gl' => [
101                  'location' => 'query',
102                  'type' => 'string',
103                ],
104                'googlehost' => [
105                  'location' => 'query',
106                  'type' => 'string',
107                ],
108                'highRange' => [
109                  'location' => 'query',
110                  'type' => 'string',
111                ],
112                'hl' => [
113                  'location' => 'query',
114                  'type' => 'string',
115                ],
116                'hq' => [
117                  'location' => 'query',
118                  'type' => 'string',
119                ],
120                'imgColorType' => [
121                  'location' => 'query',
122                  'type' => 'string',
123                ],
124                'imgDominantColor' => [
125                  'location' => 'query',
126                  'type' => 'string',
127                ],
128                'imgSize' => [
129                  'location' => 'query',
130                  'type' => 'string',
131                ],
132                'imgType' => [
133                  'location' => 'query',
134                  'type' => 'string',
135                ],
136                'linkSite' => [
137                  'location' => 'query',
138                  'type' => 'string',
139                ],
140                'lowRange' => [
141                  'location' => 'query',
142                  'type' => 'string',
143                ],
144                'lr' => [
145                  'location' => 'query',
146                  'type' => 'string',
147                ],
148                'num' => [
149                  'location' => 'query',
150                  'type' => 'integer',
151                ],
152                'orTerms' => [
153                  'location' => 'query',
154                  'type' => 'string',
155                ],
156                'q' => [
157                  'location' => 'query',
158                  'type' => 'string',
159                ],
160                'relatedSite' => [
161                  'location' => 'query',
162                  'type' => 'string',
163                ],
164                'rights' => [
165                  'location' => 'query',
166                  'type' => 'string',
167                ],
168                'safe' => [
169                  'location' => 'query',
170                  'type' => 'string',
171                ],
172                'searchType' => [
173                  'location' => 'query',
174                  'type' => 'string',
175                ],
176                'siteSearch' => [
177                  'location' => 'query',
178                  'type' => 'string',
179                ],
180                'siteSearchFilter' => [
181                  'location' => 'query',
182                  'type' => 'string',
183                ],
184                'sort' => [
185                  'location' => 'query',
186                  'type' => 'string',
187                ],
188                'start' => [
189                  'location' => 'query',
190                  'type' => 'integer',
191                ],
192              ],
193            ],
194          ]
195        ]
196    );
197    $this->cse_siterestrict = new CustomSearchAPI\Resource\CseSiterestrict(
198        $this,
199        $this->serviceName,
200        'siterestrict',
201        [
202          'methods' => [
203            'list' => [
204              'path' => 'customsearch/v1/siterestrict',
205              'httpMethod' => 'GET',
206              'parameters' => [
207                'c2coff' => [
208                  'location' => 'query',
209                  'type' => 'string',
210                ],
211                'cr' => [
212                  'location' => 'query',
213                  'type' => 'string',
214                ],
215                'cx' => [
216                  'location' => 'query',
217                  'type' => 'string',
218                ],
219                'dateRestrict' => [
220                  'location' => 'query',
221                  'type' => 'string',
222                ],
223                'exactTerms' => [
224                  'location' => 'query',
225                  'type' => 'string',
226                ],
227                'excludeTerms' => [
228                  'location' => 'query',
229                  'type' => 'string',
230                ],
231                'fileType' => [
232                  'location' => 'query',
233                  'type' => 'string',
234                ],
235                'filter' => [
236                  'location' => 'query',
237                  'type' => 'string',
238                ],
239                'gl' => [
240                  'location' => 'query',
241                  'type' => 'string',
242                ],
243                'googlehost' => [
244                  'location' => 'query',
245                  'type' => 'string',
246                ],
247                'highRange' => [
248                  'location' => 'query',
249                  'type' => 'string',
250                ],
251                'hl' => [
252                  'location' => 'query',
253                  'type' => 'string',
254                ],
255                'hq' => [
256                  'location' => 'query',
257                  'type' => 'string',
258                ],
259                'imgColorType' => [
260                  'location' => 'query',
261                  'type' => 'string',
262                ],
263                'imgDominantColor' => [
264                  'location' => 'query',
265                  'type' => 'string',
266                ],
267                'imgSize' => [
268                  'location' => 'query',
269                  'type' => 'string',
270                ],
271                'imgType' => [
272                  'location' => 'query',
273                  'type' => 'string',
274                ],
275                'linkSite' => [
276                  'location' => 'query',
277                  'type' => 'string',
278                ],
279                'lowRange' => [
280                  'location' => 'query',
281                  'type' => 'string',
282                ],
283                'lr' => [
284                  'location' => 'query',
285                  'type' => 'string',
286                ],
287                'num' => [
288                  'location' => 'query',
289                  'type' => 'integer',
290                ],
291                'orTerms' => [
292                  'location' => 'query',
293                  'type' => 'string',
294                ],
295                'q' => [
296                  'location' => 'query',
297                  'type' => 'string',
298                ],
299                'relatedSite' => [
300                  'location' => 'query',
301                  'type' => 'string',
302                ],
303                'rights' => [
304                  'location' => 'query',
305                  'type' => 'string',
306                ],
307                'safe' => [
308                  'location' => 'query',
309                  'type' => 'string',
310                ],
311                'searchType' => [
312                  'location' => 'query',
313                  'type' => 'string',
314                ],
315                'siteSearch' => [
316                  'location' => 'query',
317                  'type' => 'string',
318                ],
319                'siteSearchFilter' => [
320                  'location' => 'query',
321                  'type' => 'string',
322                ],
323                'sort' => [
324                  'location' => 'query',
325                  'type' => 'string',
326                ],
327                'start' => [
328                  'location' => 'query',
329                  'type' => 'integer',
330                ],
331              ],
332            ],
333          ]
334        ]
335    );
336  }
337}
338
339// Adding a class alias for backwards compatibility with the previous class name.
340class_alias(CustomSearchAPI::class, 'Google_Service_CustomSearchAPI');
341