PluginProbe
Authorizer / 2.6.10
Authorizer v2.6.10
3.15.3 3.15.2 3.15.1 3.15.0 3.14.3 3.14.4 3.14.2 3.14.1 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.9.0 2.9.1 2.9.10 2.9.11 2.9.12 2.9.13 2.9.2 2.9.3 2.9.6 All 126 releases
authorizer / vendor / google-api-php-client / src / Google / Service / Translate.php

Translate.php in Authorizer 2.6.10, at vendor/google-api-php-client/src/Google/Service/Translate.php

368 lines 9.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 * use this file except in compliance with the License. You may obtain a copy of
5 * 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, WITHOUT
11 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 * License for the specific language governing permissions and limitations under
13 * the License.
14 */
15
16 /**
17 * Service definition for Translate (v2).
18 *
19 * <p>
20 * Lets you translate text from one language to another</p>
21 *
22 * <p>
23 * For more information about this service, see the API
24 * <a href="https://developers.google.com/translate/v2/using_rest" target="_blank">Documentation</a>
25 * </p>
26 *
27 * @author Google, Inc.
28 */
29 class Google_Service_Translate extends Google_Service
30 {
31
32
33 public $detections;
34 public $languages;
35 public $translations;
36
37
38 /**
39 * Constructs the internal representation of the Translate service.
40 *
41 * @param Google_Client $client
42 */
43 public function __construct(Google_Client $client)
44 {
45 parent::__construct($client);
46 $this->rootUrl = 'https://www.googleapis.com/';
47 $this->servicePath = 'language/translate/';
48 $this->version = 'v2';
49 $this->serviceName = 'translate';
50
51 $this->detections = new Google_Service_Translate_Detections_Resource(
52 $this,
53 $this->serviceName,
54 'detections',
55 array(
56 'methods' => array(
57 'list' => array(
58 'path' => 'v2/detect',
59 'httpMethod' => 'GET',
60 'parameters' => array(
61 'q' => array(
62 'location' => 'query',
63 'type' => 'string',
64 'repeated' => true,
65 'required' => true,
66 ),
67 ),
68 ),
69 )
70 )
71 );
72 $this->languages = new Google_Service_Translate_Languages_Resource(
73 $this,
74 $this->serviceName,
75 'languages',
76 array(
77 'methods' => array(
78 'list' => array(
79 'path' => 'v2/languages',
80 'httpMethod' => 'GET',
81 'parameters' => array(
82 'target' => array(
83 'location' => 'query',
84 'type' => 'string',
85 ),
86 ),
87 ),
88 )
89 )
90 );
91 $this->translations = new Google_Service_Translate_Translations_Resource(
92 $this,
93 $this->serviceName,
94 'translations',
95 array(
96 'methods' => array(
97 'list' => array(
98 'path' => 'v2',
99 'httpMethod' => 'GET',
100 'parameters' => array(
101 'q' => array(
102 'location' => 'query',
103 'type' => 'string',
104 'repeated' => true,
105 'required' => true,
106 ),
107 'target' => array(
108 'location' => 'query',
109 'type' => 'string',
110 'required' => true,
111 ),
112 'cid' => array(
113 'location' => 'query',
114 'type' => 'string',
115 'repeated' => true,
116 ),
117 'format' => array(
118 'location' => 'query',
119 'type' => 'string',
120 ),
121 'source' => array(
122 'location' => 'query',
123 'type' => 'string',
124 ),
125 ),
126 ),
127 )
128 )
129 );
130 }
131 }
132
133
134 /**
135 * The "detections" collection of methods.
136 * Typical usage is:
137 * <code>
138 * $translateService = new Google_Service_Translate(...);
139 * $detections = $translateService->detections;
140 * </code>
141 */
142 class Google_Service_Translate_Detections_Resource extends Google_Service_Resource
143 {
144
145 /**
146 * Detect the language of text. (detections.listDetections)
147 *
148 * @param string $q The text to detect
149 * @param array $optParams Optional parameters.
150 * @return Google_Service_Translate_DetectionsListResponse
151 */
152 public function listDetections($q, $optParams = array())
153 {
154 $params = array('q' => $q);
155 $params = array_merge($params, $optParams);
156 return $this->call('list', array($params), "Google_Service_Translate_DetectionsListResponse");
157 }
158 }
159
160 /**
161 * The "languages" collection of methods.
162 * Typical usage is:
163 * <code>
164 * $translateService = new Google_Service_Translate(...);
165 * $languages = $translateService->languages;
166 * </code>
167 */
168 class Google_Service_Translate_Languages_Resource extends Google_Service_Resource
169 {
170
171 /**
172 * List the source/target languages supported by the API
173 * (languages.listLanguages)
174 *
175 * @param array $optParams Optional parameters.
176 *
177 * @opt_param string target the language and collation in which the localized
178 * results should be returned
179 * @return Google_Service_Translate_LanguagesListResponse
180 */
181 public function listLanguages($optParams = array())
182 {
183 $params = array();
184 $params = array_merge($params, $optParams);
185 return $this->call('list', array($params), "Google_Service_Translate_LanguagesListResponse");
186 }
187 }
188
189 /**
190 * The "translations" collection of methods.
191 * Typical usage is:
192 * <code>
193 * $translateService = new Google_Service_Translate(...);
194 * $translations = $translateService->translations;
195 * </code>
196 */
197 class Google_Service_Translate_Translations_Resource extends Google_Service_Resource
198 {
199
200 /**
201 * Returns text translations from one language to another.
202 * (translations.listTranslations)
203 *
204 * @param string $q The text to translate
205 * @param string $target The target language into which the text should be
206 * translated
207 * @param array $optParams Optional parameters.
208 *
209 * @opt_param string cid The customization id for translate
210 * @opt_param string format The format of the text
211 * @opt_param string source The source language of the text
212 * @return Google_Service_Translate_TranslationsListResponse
213 */
214 public function listTranslations($q, $target, $optParams = array())
215 {
216 $params = array('q' => $q, 'target' => $target);
217 $params = array_merge($params, $optParams);
218 return $this->call('list', array($params), "Google_Service_Translate_TranslationsListResponse");
219 }
220 }
221
222
223
224
225 class Google_Service_Translate_DetectionsListResponse extends Google_Collection
226 {
227 protected $collection_key = 'detections';
228 protected $internal_gapi_mappings = array(
229 );
230 protected $detectionsType = 'Google_Service_Translate_DetectionsResourceItems';
231 protected $detectionsDataType = 'array';
232
233
234 public function setDetections($detections)
235 {
236 $this->detections = $detections;
237 }
238 public function getDetections()
239 {
240 return $this->detections;
241 }
242 }
243
244 class Google_Service_Translate_DetectionsResourceItems extends Google_Model
245 {
246 protected $internal_gapi_mappings = array(
247 );
248 public $confidence;
249 public $isReliable;
250 public $language;
251
252
253 public function setConfidence($confidence)
254 {
255 $this->confidence = $confidence;
256 }
257 public function getConfidence()
258 {
259 return $this->confidence;
260 }
261 public function setIsReliable($isReliable)
262 {
263 $this->isReliable = $isReliable;
264 }
265 public function getIsReliable()
266 {
267 return $this->isReliable;
268 }
269 public function setLanguage($language)
270 {
271 $this->language = $language;
272 }
273 public function getLanguage()
274 {
275 return $this->language;
276 }
277 }
278
279 class Google_Service_Translate_LanguagesListResponse extends Google_Collection
280 {
281 protected $collection_key = 'languages';
282 protected $internal_gapi_mappings = array(
283 );
284 protected $languagesType = 'Google_Service_Translate_LanguagesResource';
285 protected $languagesDataType = 'array';
286
287
288 public function setLanguages($languages)
289 {
290 $this->languages = $languages;
291 }
292 public function getLanguages()
293 {
294 return $this->languages;
295 }
296 }
297
298 class Google_Service_Translate_LanguagesResource extends Google_Model
299 {
300 protected $internal_gapi_mappings = array(
301 );
302 public $language;
303 public $name;
304
305
306 public function setLanguage($language)
307 {
308 $this->language = $language;
309 }
310 public function getLanguage()
311 {
312 return $this->language;
313 }
314 public function setName($name)
315 {
316 $this->name = $name;
317 }
318 public function getName()
319 {
320 return $this->name;
321 }
322 }
323
324 class Google_Service_Translate_TranslationsListResponse extends Google_Collection
325 {
326 protected $collection_key = 'translations';
327 protected $internal_gapi_mappings = array(
328 );
329 protected $translationsType = 'Google_Service_Translate_TranslationsResource';
330 protected $translationsDataType = 'array';
331
332
333 public function setTranslations($translations)
334 {
335 $this->translations = $translations;
336 }
337 public function getTranslations()
338 {
339 return $this->translations;
340 }
341 }
342
343 class Google_Service_Translate_TranslationsResource extends Google_Model
344 {
345 protected $internal_gapi_mappings = array(
346 );
347 public $detectedSourceLanguage;
348 public $translatedText;
349
350
351 public function setDetectedSourceLanguage($detectedSourceLanguage)
352 {
353 $this->detectedSourceLanguage = $detectedSourceLanguage;
354 }
355 public function getDetectedSourceLanguage()
356 {
357 return $this->detectedSourceLanguage;
358 }
359 public function setTranslatedText($translatedText)
360 {
361 $this->translatedText = $translatedText;
362 }
363 public function getTranslatedText()
364 {
365 return $this->translatedText;
366 }
367 }
368