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 Vision (v1).
24 *
25 * <p>
26 * Integrates Google Vision features, including image labeling, face, logo, and
27 * landmark detection, optical character recognition (OCR), and detection of
28 * explicit content, into applications.</p>
29 *
30 * <p>
31 * For more information about this service, see the API
32 * <a href="https://cloud.google.com/vision/" target="_blank">Documentation</a>
33 * </p>
34 *
35 * @author Google, Inc.
36 */
37class Vision extends \Google\Service
38{
39  /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
40  const CLOUD_PLATFORM =
41      "https://www.googleapis.com/auth/cloud-platform";
42  /** Apply machine learning models to understand and label images. */
43  const CLOUD_VISION =
44      "https://www.googleapis.com/auth/cloud-vision";
45
46  public $files;
47  public $images;
48  public $locations_operations;
49  public $operations;
50  public $projects_files;
51  public $projects_images;
52  public $projects_locations_files;
53  public $projects_locations_images;
54  public $projects_locations_operations;
55  public $projects_locations_productSets;
56  public $projects_locations_productSets_products;
57  public $projects_locations_products;
58  public $projects_locations_products_referenceImages;
59  public $projects_operations;
60
61  /**
62   * Constructs the internal representation of the Vision service.
63   *
64   * @param Client|array $clientOrConfig The client used to deliver requests, or a
65   *                                     config array to pass to a new Client instance.
66   * @param string $rootUrl The root URL used for requests to the service.
67   */
68  public function __construct($clientOrConfig = [], $rootUrl = null)
69  {
70    parent::__construct($clientOrConfig);
71    $this->rootUrl = $rootUrl ?: 'https://vision.googleapis.com/';
72    $this->servicePath = '';
73    $this->batchPath = 'batch';
74    $this->version = 'v1';
75    $this->serviceName = 'vision';
76
77    $this->files = new Vision\Resource\Files(
78        $this,
79        $this->serviceName,
80        'files',
81        [
82          'methods' => [
83            'annotate' => [
84              'path' => 'v1/files:annotate',
85              'httpMethod' => 'POST',
86              'parameters' => [],
87            ],'asyncBatchAnnotate' => [
88              'path' => 'v1/files:asyncBatchAnnotate',
89              'httpMethod' => 'POST',
90              'parameters' => [],
91            ],
92          ]
93        ]
94    );
95    $this->images = new Vision\Resource\Images(
96        $this,
97        $this->serviceName,
98        'images',
99        [
100          'methods' => [
101            'annotate' => [
102              'path' => 'v1/images:annotate',
103              'httpMethod' => 'POST',
104              'parameters' => [],
105            ],'asyncBatchAnnotate' => [
106              'path' => 'v1/images:asyncBatchAnnotate',
107              'httpMethod' => 'POST',
108              'parameters' => [],
109            ],
110          ]
111        ]
112    );
113    $this->locations_operations = new Vision\Resource\LocationsOperations(
114        $this,
115        $this->serviceName,
116        'operations',
117        [
118          'methods' => [
119            'get' => [
120              'path' => 'v1/{+name}',
121              'httpMethod' => 'GET',
122              'parameters' => [
123                'name' => [
124                  'location' => 'path',
125                  'type' => 'string',
126                  'required' => true,
127                ],
128              ],
129            ],
130          ]
131        ]
132    );
133    $this->operations = new Vision\Resource\Operations(
134        $this,
135        $this->serviceName,
136        'operations',
137        [
138          'methods' => [
139            'cancel' => [
140              'path' => 'v1/{+name}:cancel',
141              'httpMethod' => 'POST',
142              'parameters' => [
143                'name' => [
144                  'location' => 'path',
145                  'type' => 'string',
146                  'required' => true,
147                ],
148              ],
149            ],'delete' => [
150              'path' => 'v1/{+name}',
151              'httpMethod' => 'DELETE',
152              'parameters' => [
153                'name' => [
154                  'location' => 'path',
155                  'type' => 'string',
156                  'required' => true,
157                ],
158              ],
159            ],'get' => [
160              'path' => 'v1/{+name}',
161              'httpMethod' => 'GET',
162              'parameters' => [
163                'name' => [
164                  'location' => 'path',
165                  'type' => 'string',
166                  'required' => true,
167                ],
168              ],
169            ],'list' => [
170              'path' => 'v1/{+name}',
171              'httpMethod' => 'GET',
172              'parameters' => [
173                'name' => [
174                  'location' => 'path',
175                  'type' => 'string',
176                  'required' => true,
177                ],
178                'filter' => [
179                  'location' => 'query',
180                  'type' => 'string',
181                ],
182                'pageSize' => [
183                  'location' => 'query',
184                  'type' => 'integer',
185                ],
186                'pageToken' => [
187                  'location' => 'query',
188                  'type' => 'string',
189                ],
190              ],
191            ],
192          ]
193        ]
194    );
195    $this->projects_files = new Vision\Resource\ProjectsFiles(
196        $this,
197        $this->serviceName,
198        'files',
199        [
200          'methods' => [
201            'annotate' => [
202              'path' => 'v1/{+parent}/files:annotate',
203              'httpMethod' => 'POST',
204              'parameters' => [
205                'parent' => [
206                  'location' => 'path',
207                  'type' => 'string',
208                  'required' => true,
209                ],
210              ],
211            ],'asyncBatchAnnotate' => [
212              'path' => 'v1/{+parent}/files:asyncBatchAnnotate',
213              'httpMethod' => 'POST',
214              'parameters' => [
215                'parent' => [
216                  'location' => 'path',
217                  'type' => 'string',
218                  'required' => true,
219                ],
220              ],
221            ],
222          ]
223        ]
224    );
225    $this->projects_images = new Vision\Resource\ProjectsImages(
226        $this,
227        $this->serviceName,
228        'images',
229        [
230          'methods' => [
231            'annotate' => [
232              'path' => 'v1/{+parent}/images:annotate',
233              'httpMethod' => 'POST',
234              'parameters' => [
235                'parent' => [
236                  'location' => 'path',
237                  'type' => 'string',
238                  'required' => true,
239                ],
240              ],
241            ],'asyncBatchAnnotate' => [
242              'path' => 'v1/{+parent}/images:asyncBatchAnnotate',
243              'httpMethod' => 'POST',
244              'parameters' => [
245                'parent' => [
246                  'location' => 'path',
247                  'type' => 'string',
248                  'required' => true,
249                ],
250              ],
251            ],
252          ]
253        ]
254    );
255    $this->projects_locations_files = new Vision\Resource\ProjectsLocationsFiles(
256        $this,
257        $this->serviceName,
258        'files',
259        [
260          'methods' => [
261            'annotate' => [
262              'path' => 'v1/{+parent}/files:annotate',
263              'httpMethod' => 'POST',
264              'parameters' => [
265                'parent' => [
266                  'location' => 'path',
267                  'type' => 'string',
268                  'required' => true,
269                ],
270              ],
271            ],'asyncBatchAnnotate' => [
272              'path' => 'v1/{+parent}/files:asyncBatchAnnotate',
273              'httpMethod' => 'POST',
274              'parameters' => [
275                'parent' => [
276                  'location' => 'path',
277                  'type' => 'string',
278                  'required' => true,
279                ],
280              ],
281            ],
282          ]
283        ]
284    );
285    $this->projects_locations_images = new Vision\Resource\ProjectsLocationsImages(
286        $this,
287        $this->serviceName,
288        'images',
289        [
290          'methods' => [
291            'annotate' => [
292              'path' => 'v1/{+parent}/images:annotate',
293              'httpMethod' => 'POST',
294              'parameters' => [
295                'parent' => [
296                  'location' => 'path',
297                  'type' => 'string',
298                  'required' => true,
299                ],
300              ],
301            ],'asyncBatchAnnotate' => [
302              'path' => 'v1/{+parent}/images:asyncBatchAnnotate',
303              'httpMethod' => 'POST',
304              'parameters' => [
305                'parent' => [
306                  'location' => 'path',
307                  'type' => 'string',
308                  'required' => true,
309                ],
310              ],
311            ],
312          ]
313        ]
314    );
315    $this->projects_locations_operations = new Vision\Resource\ProjectsLocationsOperations(
316        $this,
317        $this->serviceName,
318        'operations',
319        [
320          'methods' => [
321            'get' => [
322              'path' => 'v1/{+name}',
323              'httpMethod' => 'GET',
324              'parameters' => [
325                'name' => [
326                  'location' => 'path',
327                  'type' => 'string',
328                  'required' => true,
329                ],
330              ],
331            ],
332          ]
333        ]
334    );
335    $this->projects_locations_productSets = new Vision\Resource\ProjectsLocationsProductSets(
336        $this,
337        $this->serviceName,
338        'productSets',
339        [
340          'methods' => [
341            'addProduct' => [
342              'path' => 'v1/{+name}:addProduct',
343              'httpMethod' => 'POST',
344              'parameters' => [
345                'name' => [
346                  'location' => 'path',
347                  'type' => 'string',
348                  'required' => true,
349                ],
350              ],
351            ],'create' => [
352              'path' => 'v1/{+parent}/productSets',
353              'httpMethod' => 'POST',
354              'parameters' => [
355                'parent' => [
356                  'location' => 'path',
357                  'type' => 'string',
358                  'required' => true,
359                ],
360                'productSetId' => [
361                  'location' => 'query',
362                  'type' => 'string',
363                ],
364              ],
365            ],'delete' => [
366              'path' => 'v1/{+name}',
367              'httpMethod' => 'DELETE',
368              'parameters' => [
369                'name' => [
370                  'location' => 'path',
371                  'type' => 'string',
372                  'required' => true,
373                ],
374              ],
375            ],'get' => [
376              'path' => 'v1/{+name}',
377              'httpMethod' => 'GET',
378              'parameters' => [
379                'name' => [
380                  'location' => 'path',
381                  'type' => 'string',
382                  'required' => true,
383                ],
384              ],
385            ],'import' => [
386              'path' => 'v1/{+parent}/productSets:import',
387              'httpMethod' => 'POST',
388              'parameters' => [
389                'parent' => [
390                  'location' => 'path',
391                  'type' => 'string',
392                  'required' => true,
393                ],
394              ],
395            ],'list' => [
396              'path' => 'v1/{+parent}/productSets',
397              'httpMethod' => 'GET',
398              'parameters' => [
399                'parent' => [
400                  'location' => 'path',
401                  'type' => 'string',
402                  'required' => true,
403                ],
404                'pageSize' => [
405                  'location' => 'query',
406                  'type' => 'integer',
407                ],
408                'pageToken' => [
409                  'location' => 'query',
410                  'type' => 'string',
411                ],
412              ],
413            ],'patch' => [
414              'path' => 'v1/{+name}',
415              'httpMethod' => 'PATCH',
416              'parameters' => [
417                'name' => [
418                  'location' => 'path',
419                  'type' => 'string',
420                  'required' => true,
421                ],
422                'updateMask' => [
423                  'location' => 'query',
424                  'type' => 'string',
425                ],
426              ],
427            ],'removeProduct' => [
428              'path' => 'v1/{+name}:removeProduct',
429              'httpMethod' => 'POST',
430              'parameters' => [
431                'name' => [
432                  'location' => 'path',
433                  'type' => 'string',
434                  'required' => true,
435                ],
436              ],
437            ],
438          ]
439        ]
440    );
441    $this->projects_locations_productSets_products = new Vision\Resource\ProjectsLocationsProductSetsProducts(
442        $this,
443        $this->serviceName,
444        'products',
445        [
446          'methods' => [
447            'list' => [
448              'path' => 'v1/{+name}/products',
449              'httpMethod' => 'GET',
450              'parameters' => [
451                'name' => [
452                  'location' => 'path',
453                  'type' => 'string',
454                  'required' => true,
455                ],
456                'pageSize' => [
457                  'location' => 'query',
458                  'type' => 'integer',
459                ],
460                'pageToken' => [
461                  'location' => 'query',
462                  'type' => 'string',
463                ],
464              ],
465            ],
466          ]
467        ]
468    );
469    $this->projects_locations_products = new Vision\Resource\ProjectsLocationsProducts(
470        $this,
471        $this->serviceName,
472        'products',
473        [
474          'methods' => [
475            'create' => [
476              'path' => 'v1/{+parent}/products',
477              'httpMethod' => 'POST',
478              'parameters' => [
479                'parent' => [
480                  'location' => 'path',
481                  'type' => 'string',
482                  'required' => true,
483                ],
484                'productId' => [
485                  'location' => 'query',
486                  'type' => 'string',
487                ],
488              ],
489            ],'delete' => [
490              'path' => 'v1/{+name}',
491              'httpMethod' => 'DELETE',
492              'parameters' => [
493                'name' => [
494                  'location' => 'path',
495                  'type' => 'string',
496                  'required' => true,
497                ],
498              ],
499            ],'get' => [
500              'path' => 'v1/{+name}',
501              'httpMethod' => 'GET',
502              'parameters' => [
503                'name' => [
504                  'location' => 'path',
505                  'type' => 'string',
506                  'required' => true,
507                ],
508              ],
509            ],'list' => [
510              'path' => 'v1/{+parent}/products',
511              'httpMethod' => 'GET',
512              'parameters' => [
513                'parent' => [
514                  'location' => 'path',
515                  'type' => 'string',
516                  'required' => true,
517                ],
518                'pageSize' => [
519                  'location' => 'query',
520                  'type' => 'integer',
521                ],
522                'pageToken' => [
523                  'location' => 'query',
524                  'type' => 'string',
525                ],
526              ],
527            ],'patch' => [
528              'path' => 'v1/{+name}',
529              'httpMethod' => 'PATCH',
530              'parameters' => [
531                'name' => [
532                  'location' => 'path',
533                  'type' => 'string',
534                  'required' => true,
535                ],
536                'updateMask' => [
537                  'location' => 'query',
538                  'type' => 'string',
539                ],
540              ],
541            ],'purge' => [
542              'path' => 'v1/{+parent}/products:purge',
543              'httpMethod' => 'POST',
544              'parameters' => [
545                'parent' => [
546                  'location' => 'path',
547                  'type' => 'string',
548                  'required' => true,
549                ],
550              ],
551            ],
552          ]
553        ]
554    );
555    $this->projects_locations_products_referenceImages = new Vision\Resource\ProjectsLocationsProductsReferenceImages(
556        $this,
557        $this->serviceName,
558        'referenceImages',
559        [
560          'methods' => [
561            'create' => [
562              'path' => 'v1/{+parent}/referenceImages',
563              'httpMethod' => 'POST',
564              'parameters' => [
565                'parent' => [
566                  'location' => 'path',
567                  'type' => 'string',
568                  'required' => true,
569                ],
570                'referenceImageId' => [
571                  'location' => 'query',
572                  'type' => 'string',
573                ],
574              ],
575            ],'delete' => [
576              'path' => 'v1/{+name}',
577              'httpMethod' => 'DELETE',
578              'parameters' => [
579                'name' => [
580                  'location' => 'path',
581                  'type' => 'string',
582                  'required' => true,
583                ],
584              ],
585            ],'get' => [
586              'path' => 'v1/{+name}',
587              'httpMethod' => 'GET',
588              'parameters' => [
589                'name' => [
590                  'location' => 'path',
591                  'type' => 'string',
592                  'required' => true,
593                ],
594              ],
595            ],'list' => [
596              'path' => 'v1/{+parent}/referenceImages',
597              'httpMethod' => 'GET',
598              'parameters' => [
599                'parent' => [
600                  'location' => 'path',
601                  'type' => 'string',
602                  'required' => true,
603                ],
604                'pageSize' => [
605                  'location' => 'query',
606                  'type' => 'integer',
607                ],
608                'pageToken' => [
609                  'location' => 'query',
610                  'type' => 'string',
611                ],
612              ],
613            ],
614          ]
615        ]
616    );
617    $this->projects_operations = new Vision\Resource\ProjectsOperations(
618        $this,
619        $this->serviceName,
620        'operations',
621        [
622          'methods' => [
623            'get' => [
624              'path' => 'v1/{+name}',
625              'httpMethod' => 'GET',
626              'parameters' => [
627                'name' => [
628                  'location' => 'path',
629                  'type' => 'string',
630                  'required' => true,
631                ],
632              ],
633            ],
634          ]
635        ]
636    );
637  }
638}
639
640// Adding a class alias for backwards compatibility with the previous class name.
641class_alias(Vision::class, 'Google_Service_Vision');
642