source: vendor/google/apiclient-services/src/Translate.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 7 days ago

Upload project files

  • Property mode set to 100644
File size: 26.1 KB
Line 
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 Translate (v3).
24 *
25 * <p>
26 * Integrates text translation into your website or application.</p>
27 *
28 * <p>
29 * For more information about this service, see the API
30 * <a href="https://cloud.google.com/translate/docs/quickstarts" target="_blank">Documentation</a>
31 * </p>
32 *
33 * @author Google, Inc.
34 */
35class Translate extends \Google\Service
36{
37 /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
38 const CLOUD_PLATFORM =
39 "https://www.googleapis.com/auth/cloud-platform";
40 /** Translate text from one language to another using Google Translate. */
41 const CLOUD_TRANSLATION =
42 "https://www.googleapis.com/auth/cloud-translation";
43
44 public $projects;
45 public $projects_locations;
46 public $projects_locations_adaptiveMtDatasets;
47 public $projects_locations_adaptiveMtDatasets_adaptiveMtFiles;
48 public $projects_locations_adaptiveMtDatasets_adaptiveMtFiles_adaptiveMtSentences;
49 public $projects_locations_adaptiveMtDatasets_adaptiveMtSentences;
50 public $projects_locations_datasets;
51 public $projects_locations_datasets_examples;
52 public $projects_locations_glossaries;
53 public $projects_locations_glossaries_glossaryEntries;
54 public $projects_locations_models;
55 public $projects_locations_operations;
56 public $rootUrlTemplate;
57
58 /**
59 * Constructs the internal representation of the Translate service.
60 *
61 * @param Client|array $clientOrConfig The client used to deliver requests, or a
62 * config array to pass to a new Client instance.
63 * @param string $rootUrl The root URL used for requests to the service.
64 */
65 public function __construct($clientOrConfig = [], $rootUrl = null)
66 {
67 parent::__construct($clientOrConfig);
68 $this->rootUrl = $rootUrl ?: 'https://translation.googleapis.com/';
69 $this->rootUrlTemplate = $rootUrl ?: 'https://translation.UNIVERSE_DOMAIN/';
70 $this->servicePath = '';
71 $this->batchPath = 'batch';
72 $this->version = 'v3';
73 $this->serviceName = 'translate';
74
75 $this->projects = new Translate\Resource\Projects(
76 $this,
77 $this->serviceName,
78 'projects',
79 [
80 'methods' => [
81 'detectLanguage' => [
82 'path' => 'v3/{+parent}:detectLanguage',
83 'httpMethod' => 'POST',
84 'parameters' => [
85 'parent' => [
86 'location' => 'path',
87 'type' => 'string',
88 'required' => true,
89 ],
90 ],
91 ],'getSupportedLanguages' => [
92 'path' => 'v3/{+parent}/supportedLanguages',
93 'httpMethod' => 'GET',
94 'parameters' => [
95 'parent' => [
96 'location' => 'path',
97 'type' => 'string',
98 'required' => true,
99 ],
100 'displayLanguageCode' => [
101 'location' => 'query',
102 'type' => 'string',
103 ],
104 'model' => [
105 'location' => 'query',
106 'type' => 'string',
107 ],
108 ],
109 ],'romanizeText' => [
110 'path' => 'v3/{+parent}:romanizeText',
111 'httpMethod' => 'POST',
112 'parameters' => [
113 'parent' => [
114 'location' => 'path',
115 'type' => 'string',
116 'required' => true,
117 ],
118 ],
119 ],'translateText' => [
120 'path' => 'v3/{+parent}:translateText',
121 'httpMethod' => 'POST',
122 'parameters' => [
123 'parent' => [
124 'location' => 'path',
125 'type' => 'string',
126 'required' => true,
127 ],
128 ],
129 ],
130 ]
131 ]
132 );
133 $this->projects_locations = new Translate\Resource\ProjectsLocations(
134 $this,
135 $this->serviceName,
136 'locations',
137 [
138 'methods' => [
139 'adaptiveMtTranslate' => [
140 'path' => 'v3/{+parent}:adaptiveMtTranslate',
141 'httpMethod' => 'POST',
142 'parameters' => [
143 'parent' => [
144 'location' => 'path',
145 'type' => 'string',
146 'required' => true,
147 ],
148 ],
149 ],'batchTranslateDocument' => [
150 'path' => 'v3/{+parent}:batchTranslateDocument',
151 'httpMethod' => 'POST',
152 'parameters' => [
153 'parent' => [
154 'location' => 'path',
155 'type' => 'string',
156 'required' => true,
157 ],
158 ],
159 ],'batchTranslateText' => [
160 'path' => 'v3/{+parent}:batchTranslateText',
161 'httpMethod' => 'POST',
162 'parameters' => [
163 'parent' => [
164 'location' => 'path',
165 'type' => 'string',
166 'required' => true,
167 ],
168 ],
169 ],'detectLanguage' => [
170 'path' => 'v3/{+parent}:detectLanguage',
171 'httpMethod' => 'POST',
172 'parameters' => [
173 'parent' => [
174 'location' => 'path',
175 'type' => 'string',
176 'required' => true,
177 ],
178 ],
179 ],'get' => [
180 'path' => 'v3/{+name}',
181 'httpMethod' => 'GET',
182 'parameters' => [
183 'name' => [
184 'location' => 'path',
185 'type' => 'string',
186 'required' => true,
187 ],
188 ],
189 ],'getSupportedLanguages' => [
190 'path' => 'v3/{+parent}/supportedLanguages',
191 'httpMethod' => 'GET',
192 'parameters' => [
193 'parent' => [
194 'location' => 'path',
195 'type' => 'string',
196 'required' => true,
197 ],
198 'displayLanguageCode' => [
199 'location' => 'query',
200 'type' => 'string',
201 ],
202 'model' => [
203 'location' => 'query',
204 'type' => 'string',
205 ],
206 ],
207 ],'list' => [
208 'path' => 'v3/{+name}/locations',
209 'httpMethod' => 'GET',
210 'parameters' => [
211 'name' => [
212 'location' => 'path',
213 'type' => 'string',
214 'required' => true,
215 ],
216 'filter' => [
217 'location' => 'query',
218 'type' => 'string',
219 ],
220 'pageSize' => [
221 'location' => 'query',
222 'type' => 'integer',
223 ],
224 'pageToken' => [
225 'location' => 'query',
226 'type' => 'string',
227 ],
228 ],
229 ],'romanizeText' => [
230 'path' => 'v3/{+parent}:romanizeText',
231 'httpMethod' => 'POST',
232 'parameters' => [
233 'parent' => [
234 'location' => 'path',
235 'type' => 'string',
236 'required' => true,
237 ],
238 ],
239 ],'translateDocument' => [
240 'path' => 'v3/{+parent}:translateDocument',
241 'httpMethod' => 'POST',
242 'parameters' => [
243 'parent' => [
244 'location' => 'path',
245 'type' => 'string',
246 'required' => true,
247 ],
248 ],
249 ],'translateText' => [
250 'path' => 'v3/{+parent}:translateText',
251 'httpMethod' => 'POST',
252 'parameters' => [
253 'parent' => [
254 'location' => 'path',
255 'type' => 'string',
256 'required' => true,
257 ],
258 ],
259 ],
260 ]
261 ]
262 );
263 $this->projects_locations_adaptiveMtDatasets = new Translate\Resource\ProjectsLocationsAdaptiveMtDatasets(
264 $this,
265 $this->serviceName,
266 'adaptiveMtDatasets',
267 [
268 'methods' => [
269 'create' => [
270 'path' => 'v3/{+parent}/adaptiveMtDatasets',
271 'httpMethod' => 'POST',
272 'parameters' => [
273 'parent' => [
274 'location' => 'path',
275 'type' => 'string',
276 'required' => true,
277 ],
278 ],
279 ],'delete' => [
280 'path' => 'v3/{+name}',
281 'httpMethod' => 'DELETE',
282 'parameters' => [
283 'name' => [
284 'location' => 'path',
285 'type' => 'string',
286 'required' => true,
287 ],
288 ],
289 ],'get' => [
290 'path' => 'v3/{+name}',
291 'httpMethod' => 'GET',
292 'parameters' => [
293 'name' => [
294 'location' => 'path',
295 'type' => 'string',
296 'required' => true,
297 ],
298 ],
299 ],'importAdaptiveMtFile' => [
300 'path' => 'v3/{+parent}:importAdaptiveMtFile',
301 'httpMethod' => 'POST',
302 'parameters' => [
303 'parent' => [
304 'location' => 'path',
305 'type' => 'string',
306 'required' => true,
307 ],
308 ],
309 ],'list' => [
310 'path' => 'v3/{+parent}/adaptiveMtDatasets',
311 'httpMethod' => 'GET',
312 'parameters' => [
313 'parent' => [
314 'location' => 'path',
315 'type' => 'string',
316 'required' => true,
317 ],
318 'filter' => [
319 'location' => 'query',
320 'type' => 'string',
321 ],
322 'pageSize' => [
323 'location' => 'query',
324 'type' => 'integer',
325 ],
326 'pageToken' => [
327 'location' => 'query',
328 'type' => 'string',
329 ],
330 ],
331 ],
332 ]
333 ]
334 );
335 $this->projects_locations_adaptiveMtDatasets_adaptiveMtFiles = new Translate\Resource\ProjectsLocationsAdaptiveMtDatasetsAdaptiveMtFiles(
336 $this,
337 $this->serviceName,
338 'adaptiveMtFiles',
339 [
340 'methods' => [
341 'delete' => [
342 'path' => 'v3/{+name}',
343 'httpMethod' => 'DELETE',
344 'parameters' => [
345 'name' => [
346 'location' => 'path',
347 'type' => 'string',
348 'required' => true,
349 ],
350 ],
351 ],'get' => [
352 'path' => 'v3/{+name}',
353 'httpMethod' => 'GET',
354 'parameters' => [
355 'name' => [
356 'location' => 'path',
357 'type' => 'string',
358 'required' => true,
359 ],
360 ],
361 ],'list' => [
362 'path' => 'v3/{+parent}/adaptiveMtFiles',
363 'httpMethod' => 'GET',
364 'parameters' => [
365 'parent' => [
366 'location' => 'path',
367 'type' => 'string',
368 'required' => true,
369 ],
370 'pageSize' => [
371 'location' => 'query',
372 'type' => 'integer',
373 ],
374 'pageToken' => [
375 'location' => 'query',
376 'type' => 'string',
377 ],
378 ],
379 ],
380 ]
381 ]
382 );
383 $this->projects_locations_adaptiveMtDatasets_adaptiveMtFiles_adaptiveMtSentences = new Translate\Resource\ProjectsLocationsAdaptiveMtDatasetsAdaptiveMtFilesAdaptiveMtSentences(
384 $this,
385 $this->serviceName,
386 'adaptiveMtSentences',
387 [
388 'methods' => [
389 'list' => [
390 'path' => 'v3/{+parent}/adaptiveMtSentences',
391 'httpMethod' => 'GET',
392 'parameters' => [
393 'parent' => [
394 'location' => 'path',
395 'type' => 'string',
396 'required' => true,
397 ],
398 'pageSize' => [
399 'location' => 'query',
400 'type' => 'integer',
401 ],
402 'pageToken' => [
403 'location' => 'query',
404 'type' => 'string',
405 ],
406 ],
407 ],
408 ]
409 ]
410 );
411 $this->projects_locations_adaptiveMtDatasets_adaptiveMtSentences = new Translate\Resource\ProjectsLocationsAdaptiveMtDatasetsAdaptiveMtSentences(
412 $this,
413 $this->serviceName,
414 'adaptiveMtSentences',
415 [
416 'methods' => [
417 'list' => [
418 'path' => 'v3/{+parent}/adaptiveMtSentences',
419 'httpMethod' => 'GET',
420 'parameters' => [
421 'parent' => [
422 'location' => 'path',
423 'type' => 'string',
424 'required' => true,
425 ],
426 'pageSize' => [
427 'location' => 'query',
428 'type' => 'integer',
429 ],
430 'pageToken' => [
431 'location' => 'query',
432 'type' => 'string',
433 ],
434 ],
435 ],
436 ]
437 ]
438 );
439 $this->projects_locations_datasets = new Translate\Resource\ProjectsLocationsDatasets(
440 $this,
441 $this->serviceName,
442 'datasets',
443 [
444 'methods' => [
445 'create' => [
446 'path' => 'v3/{+parent}/datasets',
447 'httpMethod' => 'POST',
448 'parameters' => [
449 'parent' => [
450 'location' => 'path',
451 'type' => 'string',
452 'required' => true,
453 ],
454 ],
455 ],'delete' => [
456 'path' => 'v3/{+name}',
457 'httpMethod' => 'DELETE',
458 'parameters' => [
459 'name' => [
460 'location' => 'path',
461 'type' => 'string',
462 'required' => true,
463 ],
464 ],
465 ],'exportData' => [
466 'path' => 'v3/{+dataset}:exportData',
467 'httpMethod' => 'POST',
468 'parameters' => [
469 'dataset' => [
470 'location' => 'path',
471 'type' => 'string',
472 'required' => true,
473 ],
474 ],
475 ],'get' => [
476 'path' => 'v3/{+name}',
477 'httpMethod' => 'GET',
478 'parameters' => [
479 'name' => [
480 'location' => 'path',
481 'type' => 'string',
482 'required' => true,
483 ],
484 ],
485 ],'importData' => [
486 'path' => 'v3/{+dataset}:importData',
487 'httpMethod' => 'POST',
488 'parameters' => [
489 'dataset' => [
490 'location' => 'path',
491 'type' => 'string',
492 'required' => true,
493 ],
494 ],
495 ],'list' => [
496 'path' => 'v3/{+parent}/datasets',
497 'httpMethod' => 'GET',
498 'parameters' => [
499 'parent' => [
500 'location' => 'path',
501 'type' => 'string',
502 'required' => true,
503 ],
504 'pageSize' => [
505 'location' => 'query',
506 'type' => 'integer',
507 ],
508 'pageToken' => [
509 'location' => 'query',
510 'type' => 'string',
511 ],
512 ],
513 ],
514 ]
515 ]
516 );
517 $this->projects_locations_datasets_examples = new Translate\Resource\ProjectsLocationsDatasetsExamples(
518 $this,
519 $this->serviceName,
520 'examples',
521 [
522 'methods' => [
523 'list' => [
524 'path' => 'v3/{+parent}/examples',
525 'httpMethod' => 'GET',
526 'parameters' => [
527 'parent' => [
528 'location' => 'path',
529 'type' => 'string',
530 'required' => true,
531 ],
532 'filter' => [
533 'location' => 'query',
534 'type' => 'string',
535 ],
536 'pageSize' => [
537 'location' => 'query',
538 'type' => 'integer',
539 ],
540 'pageToken' => [
541 'location' => 'query',
542 'type' => 'string',
543 ],
544 ],
545 ],
546 ]
547 ]
548 );
549 $this->projects_locations_glossaries = new Translate\Resource\ProjectsLocationsGlossaries(
550 $this,
551 $this->serviceName,
552 'glossaries',
553 [
554 'methods' => [
555 'create' => [
556 'path' => 'v3/{+parent}/glossaries',
557 'httpMethod' => 'POST',
558 'parameters' => [
559 'parent' => [
560 'location' => 'path',
561 'type' => 'string',
562 'required' => true,
563 ],
564 ],
565 ],'delete' => [
566 'path' => 'v3/{+name}',
567 'httpMethod' => 'DELETE',
568 'parameters' => [
569 'name' => [
570 'location' => 'path',
571 'type' => 'string',
572 'required' => true,
573 ],
574 ],
575 ],'get' => [
576 'path' => 'v3/{+name}',
577 'httpMethod' => 'GET',
578 'parameters' => [
579 'name' => [
580 'location' => 'path',
581 'type' => 'string',
582 'required' => true,
583 ],
584 ],
585 ],'list' => [
586 'path' => 'v3/{+parent}/glossaries',
587 'httpMethod' => 'GET',
588 'parameters' => [
589 'parent' => [
590 'location' => 'path',
591 'type' => 'string',
592 'required' => true,
593 ],
594 'filter' => [
595 'location' => 'query',
596 'type' => 'string',
597 ],
598 'pageSize' => [
599 'location' => 'query',
600 'type' => 'integer',
601 ],
602 'pageToken' => [
603 'location' => 'query',
604 'type' => 'string',
605 ],
606 ],
607 ],'patch' => [
608 'path' => 'v3/{+name}',
609 'httpMethod' => 'PATCH',
610 'parameters' => [
611 'name' => [
612 'location' => 'path',
613 'type' => 'string',
614 'required' => true,
615 ],
616 'updateMask' => [
617 'location' => 'query',
618 'type' => 'string',
619 ],
620 ],
621 ],
622 ]
623 ]
624 );
625 $this->projects_locations_glossaries_glossaryEntries = new Translate\Resource\ProjectsLocationsGlossariesGlossaryEntries(
626 $this,
627 $this->serviceName,
628 'glossaryEntries',
629 [
630 'methods' => [
631 'create' => [
632 'path' => 'v3/{+parent}/glossaryEntries',
633 'httpMethod' => 'POST',
634 'parameters' => [
635 'parent' => [
636 'location' => 'path',
637 'type' => 'string',
638 'required' => true,
639 ],
640 ],
641 ],'delete' => [
642 'path' => 'v3/{+name}',
643 'httpMethod' => 'DELETE',
644 'parameters' => [
645 'name' => [
646 'location' => 'path',
647 'type' => 'string',
648 'required' => true,
649 ],
650 ],
651 ],'get' => [
652 'path' => 'v3/{+name}',
653 'httpMethod' => 'GET',
654 'parameters' => [
655 'name' => [
656 'location' => 'path',
657 'type' => 'string',
658 'required' => true,
659 ],
660 ],
661 ],'list' => [
662 'path' => 'v3/{+parent}/glossaryEntries',
663 'httpMethod' => 'GET',
664 'parameters' => [
665 'parent' => [
666 'location' => 'path',
667 'type' => 'string',
668 'required' => true,
669 ],
670 'pageSize' => [
671 'location' => 'query',
672 'type' => 'integer',
673 ],
674 'pageToken' => [
675 'location' => 'query',
676 'type' => 'string',
677 ],
678 ],
679 ],'patch' => [
680 'path' => 'v3/{+name}',
681 'httpMethod' => 'PATCH',
682 'parameters' => [
683 'name' => [
684 'location' => 'path',
685 'type' => 'string',
686 'required' => true,
687 ],
688 ],
689 ],
690 ]
691 ]
692 );
693 $this->projects_locations_models = new Translate\Resource\ProjectsLocationsModels(
694 $this,
695 $this->serviceName,
696 'models',
697 [
698 'methods' => [
699 'create' => [
700 'path' => 'v3/{+parent}/models',
701 'httpMethod' => 'POST',
702 'parameters' => [
703 'parent' => [
704 'location' => 'path',
705 'type' => 'string',
706 'required' => true,
707 ],
708 ],
709 ],'delete' => [
710 'path' => 'v3/{+name}',
711 'httpMethod' => 'DELETE',
712 'parameters' => [
713 'name' => [
714 'location' => 'path',
715 'type' => 'string',
716 'required' => true,
717 ],
718 ],
719 ],'get' => [
720 'path' => 'v3/{+name}',
721 'httpMethod' => 'GET',
722 'parameters' => [
723 'name' => [
724 'location' => 'path',
725 'type' => 'string',
726 'required' => true,
727 ],
728 ],
729 ],'list' => [
730 'path' => 'v3/{+parent}/models',
731 'httpMethod' => 'GET',
732 'parameters' => [
733 'parent' => [
734 'location' => 'path',
735 'type' => 'string',
736 'required' => true,
737 ],
738 'filter' => [
739 'location' => 'query',
740 'type' => 'string',
741 ],
742 'pageSize' => [
743 'location' => 'query',
744 'type' => 'integer',
745 ],
746 'pageToken' => [
747 'location' => 'query',
748 'type' => 'string',
749 ],
750 ],
751 ],
752 ]
753 ]
754 );
755 $this->projects_locations_operations = new Translate\Resource\ProjectsLocationsOperations(
756 $this,
757 $this->serviceName,
758 'operations',
759 [
760 'methods' => [
761 'cancel' => [
762 'path' => 'v3/{+name}:cancel',
763 'httpMethod' => 'POST',
764 'parameters' => [
765 'name' => [
766 'location' => 'path',
767 'type' => 'string',
768 'required' => true,
769 ],
770 ],
771 ],'delete' => [
772 'path' => 'v3/{+name}',
773 'httpMethod' => 'DELETE',
774 'parameters' => [
775 'name' => [
776 'location' => 'path',
777 'type' => 'string',
778 'required' => true,
779 ],
780 ],
781 ],'get' => [
782 'path' => 'v3/{+name}',
783 'httpMethod' => 'GET',
784 'parameters' => [
785 'name' => [
786 'location' => 'path',
787 'type' => 'string',
788 'required' => true,
789 ],
790 ],
791 ],'list' => [
792 'path' => 'v3/{+name}/operations',
793 'httpMethod' => 'GET',
794 'parameters' => [
795 'name' => [
796 'location' => 'path',
797 'type' => 'string',
798 'required' => true,
799 ],
800 'filter' => [
801 'location' => 'query',
802 'type' => 'string',
803 ],
804 'pageSize' => [
805 'location' => 'query',
806 'type' => 'integer',
807 ],
808 'pageToken' => [
809 'location' => 'query',
810 'type' => 'string',
811 ],
812 ],
813 ],'wait' => [
814 'path' => 'v3/{+name}:wait',
815 'httpMethod' => 'POST',
816 'parameters' => [
817 'name' => [
818 'location' => 'path',
819 'type' => 'string',
820 'required' => true,
821 ],
822 ],
823 ],
824 ]
825 ]
826 );
827 }
828}
829
830// Adding a class alias for backwards compatibility with the previous class name.
831class_alias(Translate::class, 'Google_Service_Translate');
Note: See TracBrowser for help on using the repository browser.