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 Document (v1).
24 *
25 * <p>
26 * Service to parse structured information from unstructured or semi-structured
27 * documents using state-of-the-art Google AI such as natural language, computer
28 * vision, translation, and AutoML.</p>
29 *
30 * <p>
31 * For more information about this service, see the API
32 * <a href="https://cloud.google.com/document-ai/docs/" target="_blank">Documentation</a>
33 * </p>
34 *
35 * @author Google, Inc.
36 */
37class Document 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
43  public $operations;
44  public $projects_locations;
45  public $projects_locations_operations;
46  public $projects_locations_processors;
47  public $projects_locations_processors_humanReviewConfig;
48  public $projects_locations_processors_processorVersions;
49  public $projects_operations;
50  public $uiv1beta3_projects_locations;
51  public $uiv1beta3_projects_locations_operations;
52
53  /**
54   * Constructs the internal representation of the Document service.
55   *
56   * @param Client|array $clientOrConfig The client used to deliver requests, or a
57   *                                     config array to pass to a new Client instance.
58   * @param string $rootUrl The root URL used for requests to the service.
59   */
60  public function __construct($clientOrConfig = [], $rootUrl = null)
61  {
62    parent::__construct($clientOrConfig);
63    $this->rootUrl = $rootUrl ?: 'https://documentai.googleapis.com/';
64    $this->servicePath = '';
65    $this->batchPath = 'batch';
66    $this->version = 'v1';
67    $this->serviceName = 'documentai';
68
69    $this->operations = new Document\Resource\Operations(
70        $this,
71        $this->serviceName,
72        'operations',
73        [
74          'methods' => [
75            'delete' => [
76              'path' => 'v1/{+name}',
77              'httpMethod' => 'DELETE',
78              'parameters' => [
79                'name' => [
80                  'location' => 'path',
81                  'type' => 'string',
82                  'required' => true,
83                ],
84              ],
85            ],
86          ]
87        ]
88    );
89    $this->projects_locations = new Document\Resource\ProjectsLocations(
90        $this,
91        $this->serviceName,
92        'locations',
93        [
94          'methods' => [
95            'fetchProcessorTypes' => [
96              'path' => 'v1/{+parent}:fetchProcessorTypes',
97              'httpMethod' => 'GET',
98              'parameters' => [
99                'parent' => [
100                  'location' => 'path',
101                  'type' => 'string',
102                  'required' => true,
103                ],
104              ],
105            ],'get' => [
106              'path' => 'v1/{+name}',
107              'httpMethod' => 'GET',
108              'parameters' => [
109                'name' => [
110                  'location' => 'path',
111                  'type' => 'string',
112                  'required' => true,
113                ],
114              ],
115            ],'list' => [
116              'path' => 'v1/{+name}/locations',
117              'httpMethod' => 'GET',
118              'parameters' => [
119                'name' => [
120                  'location' => 'path',
121                  'type' => 'string',
122                  'required' => true,
123                ],
124                'filter' => [
125                  'location' => 'query',
126                  'type' => 'string',
127                ],
128                'pageSize' => [
129                  'location' => 'query',
130                  'type' => 'integer',
131                ],
132                'pageToken' => [
133                  'location' => 'query',
134                  'type' => 'string',
135                ],
136              ],
137            ],
138          ]
139        ]
140    );
141    $this->projects_locations_operations = new Document\Resource\ProjectsLocationsOperations(
142        $this,
143        $this->serviceName,
144        'operations',
145        [
146          'methods' => [
147            'cancel' => [
148              'path' => 'v1/{+name}:cancel',
149              'httpMethod' => 'POST',
150              'parameters' => [
151                'name' => [
152                  'location' => 'path',
153                  'type' => 'string',
154                  'required' => true,
155                ],
156              ],
157            ],'get' => [
158              'path' => 'v1/{+name}',
159              'httpMethod' => 'GET',
160              'parameters' => [
161                'name' => [
162                  'location' => 'path',
163                  'type' => 'string',
164                  'required' => true,
165                ],
166              ],
167            ],'list' => [
168              'path' => 'v1/{+name}',
169              'httpMethod' => 'GET',
170              'parameters' => [
171                'name' => [
172                  'location' => 'path',
173                  'type' => 'string',
174                  'required' => true,
175                ],
176                'filter' => [
177                  'location' => 'query',
178                  'type' => 'string',
179                ],
180                'pageSize' => [
181                  'location' => 'query',
182                  'type' => 'integer',
183                ],
184                'pageToken' => [
185                  'location' => 'query',
186                  'type' => 'string',
187                ],
188              ],
189            ],
190          ]
191        ]
192    );
193    $this->projects_locations_processors = new Document\Resource\ProjectsLocationsProcessors(
194        $this,
195        $this->serviceName,
196        'processors',
197        [
198          'methods' => [
199            'batchProcess' => [
200              'path' => 'v1/{+name}:batchProcess',
201              'httpMethod' => 'POST',
202              'parameters' => [
203                'name' => [
204                  'location' => 'path',
205                  'type' => 'string',
206                  'required' => true,
207                ],
208              ],
209            ],'create' => [
210              'path' => 'v1/{+parent}/processors',
211              'httpMethod' => 'POST',
212              'parameters' => [
213                'parent' => [
214                  'location' => 'path',
215                  'type' => 'string',
216                  'required' => true,
217                ],
218              ],
219            ],'delete' => [
220              'path' => 'v1/{+name}',
221              'httpMethod' => 'DELETE',
222              'parameters' => [
223                'name' => [
224                  'location' => 'path',
225                  'type' => 'string',
226                  'required' => true,
227                ],
228              ],
229            ],'disable' => [
230              'path' => 'v1/{+name}:disable',
231              'httpMethod' => 'POST',
232              'parameters' => [
233                'name' => [
234                  'location' => 'path',
235                  'type' => 'string',
236                  'required' => true,
237                ],
238              ],
239            ],'enable' => [
240              'path' => 'v1/{+name}:enable',
241              'httpMethod' => 'POST',
242              'parameters' => [
243                'name' => [
244                  'location' => 'path',
245                  'type' => 'string',
246                  'required' => true,
247                ],
248              ],
249            ],'get' => [
250              'path' => 'v1/{+name}',
251              'httpMethod' => 'GET',
252              'parameters' => [
253                'name' => [
254                  'location' => 'path',
255                  'type' => 'string',
256                  'required' => true,
257                ],
258              ],
259            ],'list' => [
260              'path' => 'v1/{+parent}/processors',
261              'httpMethod' => 'GET',
262              'parameters' => [
263                'parent' => [
264                  'location' => 'path',
265                  'type' => 'string',
266                  'required' => true,
267                ],
268                'pageSize' => [
269                  'location' => 'query',
270                  'type' => 'integer',
271                ],
272                'pageToken' => [
273                  'location' => 'query',
274                  'type' => 'string',
275                ],
276              ],
277            ],'process' => [
278              'path' => 'v1/{+name}:process',
279              'httpMethod' => 'POST',
280              'parameters' => [
281                'name' => [
282                  'location' => 'path',
283                  'type' => 'string',
284                  'required' => true,
285                ],
286              ],
287            ],'setDefaultProcessorVersion' => [
288              'path' => 'v1/{+processor}:setDefaultProcessorVersion',
289              'httpMethod' => 'POST',
290              'parameters' => [
291                'processor' => [
292                  'location' => 'path',
293                  'type' => 'string',
294                  'required' => true,
295                ],
296              ],
297            ],
298          ]
299        ]
300    );
301    $this->projects_locations_processors_humanReviewConfig = new Document\Resource\ProjectsLocationsProcessorsHumanReviewConfig(
302        $this,
303        $this->serviceName,
304        'humanReviewConfig',
305        [
306          'methods' => [
307            'reviewDocument' => [
308              'path' => 'v1/{+humanReviewConfig}:reviewDocument',
309              'httpMethod' => 'POST',
310              'parameters' => [
311                'humanReviewConfig' => [
312                  'location' => 'path',
313                  'type' => 'string',
314                  'required' => true,
315                ],
316              ],
317            ],
318          ]
319        ]
320    );
321    $this->projects_locations_processors_processorVersions = new Document\Resource\ProjectsLocationsProcessorsProcessorVersions(
322        $this,
323        $this->serviceName,
324        'processorVersions',
325        [
326          'methods' => [
327            'batchProcess' => [
328              'path' => 'v1/{+name}:batchProcess',
329              'httpMethod' => 'POST',
330              'parameters' => [
331                'name' => [
332                  'location' => 'path',
333                  'type' => 'string',
334                  'required' => true,
335                ],
336              ],
337            ],'delete' => [
338              'path' => 'v1/{+name}',
339              'httpMethod' => 'DELETE',
340              'parameters' => [
341                'name' => [
342                  'location' => 'path',
343                  'type' => 'string',
344                  'required' => true,
345                ],
346              ],
347            ],'deploy' => [
348              'path' => 'v1/{+name}:deploy',
349              'httpMethod' => 'POST',
350              'parameters' => [
351                'name' => [
352                  'location' => 'path',
353                  'type' => 'string',
354                  'required' => true,
355                ],
356              ],
357            ],'get' => [
358              'path' => 'v1/{+name}',
359              'httpMethod' => 'GET',
360              'parameters' => [
361                'name' => [
362                  'location' => 'path',
363                  'type' => 'string',
364                  'required' => true,
365                ],
366              ],
367            ],'list' => [
368              'path' => 'v1/{+parent}/processorVersions',
369              'httpMethod' => 'GET',
370              'parameters' => [
371                'parent' => [
372                  'location' => 'path',
373                  'type' => 'string',
374                  'required' => true,
375                ],
376                'pageSize' => [
377                  'location' => 'query',
378                  'type' => 'integer',
379                ],
380                'pageToken' => [
381                  'location' => 'query',
382                  'type' => 'string',
383                ],
384              ],
385            ],'process' => [
386              'path' => 'v1/{+name}:process',
387              'httpMethod' => 'POST',
388              'parameters' => [
389                'name' => [
390                  'location' => 'path',
391                  'type' => 'string',
392                  'required' => true,
393                ],
394              ],
395            ],'undeploy' => [
396              'path' => 'v1/{+name}:undeploy',
397              'httpMethod' => 'POST',
398              'parameters' => [
399                'name' => [
400                  'location' => 'path',
401                  'type' => 'string',
402                  'required' => true,
403                ],
404              ],
405            ],
406          ]
407        ]
408    );
409    $this->projects_operations = new Document\Resource\ProjectsOperations(
410        $this,
411        $this->serviceName,
412        'operations',
413        [
414          'methods' => [
415            'get' => [
416              'path' => 'v1/{+name}',
417              'httpMethod' => 'GET',
418              'parameters' => [
419                'name' => [
420                  'location' => 'path',
421                  'type' => 'string',
422                  'required' => true,
423                ],
424              ],
425            ],
426          ]
427        ]
428    );
429    $this->uiv1beta3_projects_locations = new Document\Resource\Uiv1beta3ProjectsLocations(
430        $this,
431        $this->serviceName,
432        'locations',
433        [
434          'methods' => [
435            'get' => [
436              'path' => 'uiv1beta3/{+name}',
437              'httpMethod' => 'GET',
438              'parameters' => [
439                'name' => [
440                  'location' => 'path',
441                  'type' => 'string',
442                  'required' => true,
443                ],
444              ],
445            ],'list' => [
446              'path' => 'uiv1beta3/{+name}/locations',
447              'httpMethod' => 'GET',
448              'parameters' => [
449                'name' => [
450                  'location' => 'path',
451                  'type' => 'string',
452                  'required' => true,
453                ],
454                'filter' => [
455                  'location' => 'query',
456                  'type' => 'string',
457                ],
458                'pageSize' => [
459                  'location' => 'query',
460                  'type' => 'integer',
461                ],
462                'pageToken' => [
463                  'location' => 'query',
464                  'type' => 'string',
465                ],
466              ],
467            ],
468          ]
469        ]
470    );
471    $this->uiv1beta3_projects_locations_operations = new Document\Resource\Uiv1beta3ProjectsLocationsOperations(
472        $this,
473        $this->serviceName,
474        'operations',
475        [
476          'methods' => [
477            'cancel' => [
478              'path' => 'uiv1beta3/{+name}:cancel',
479              'httpMethod' => 'POST',
480              'parameters' => [
481                'name' => [
482                  'location' => 'path',
483                  'type' => 'string',
484                  'required' => true,
485                ],
486              ],
487            ],'get' => [
488              'path' => 'uiv1beta3/{+name}',
489              'httpMethod' => 'GET',
490              'parameters' => [
491                'name' => [
492                  'location' => 'path',
493                  'type' => 'string',
494                  'required' => true,
495                ],
496              ],
497            ],'list' => [
498              'path' => 'uiv1beta3/{+name}',
499              'httpMethod' => 'GET',
500              'parameters' => [
501                'name' => [
502                  'location' => 'path',
503                  'type' => 'string',
504                  'required' => true,
505                ],
506                'filter' => [
507                  'location' => 'query',
508                  'type' => 'string',
509                ],
510                'pageSize' => [
511                  'location' => 'query',
512                  'type' => 'integer',
513                ],
514                'pageToken' => [
515                  'location' => 'query',
516                  'type' => 'string',
517                ],
518              ],
519            ],
520          ]
521        ]
522    );
523  }
524}
525
526// Adding a class alias for backwards compatibility with the previous class name.
527class_alias(Document::class, 'Google_Service_Document');
528