Initial commit: Complete WooCommerce Smart Google Pricing plugin with vendor dependencies

This commit is contained in:
2025-12-23 07:48:45 +01:00
commit 9b66109ca1
32472 changed files with 4065017 additions and 0 deletions

View File

@@ -0,0 +1,186 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class AdaptiveMtDataset extends \Google\Model
{
/**
* Output only. Timestamp when this dataset was created.
*
* @var string
*/
public $createTime;
/**
* The name of the dataset to show in the interface. The name can be up to 32
* characters long and can consist only of ASCII Latin letters A-Z and a-z,
* underscores (_), and ASCII digits 0-9.
*
* @var string
*/
public $displayName;
/**
* The number of examples in the dataset.
*
* @var int
*/
public $exampleCount;
/**
* Required. The resource name of the dataset, in form of `projects/{project-
* number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset_id}`
*
* @var string
*/
public $name;
/**
* The BCP-47 language code of the source language.
*
* @var string
*/
public $sourceLanguageCode;
/**
* The BCP-47 language code of the target language.
*
* @var string
*/
public $targetLanguageCode;
/**
* Output only. Timestamp when this dataset was last updated.
*
* @var string
*/
public $updateTime;
/**
* Output only. Timestamp when this dataset was created.
*
* @param string $createTime
*/
public function setCreateTime($createTime)
{
$this->createTime = $createTime;
}
/**
* @return string
*/
public function getCreateTime()
{
return $this->createTime;
}
/**
* The name of the dataset to show in the interface. The name can be up to 32
* characters long and can consist only of ASCII Latin letters A-Z and a-z,
* underscores (_), and ASCII digits 0-9.
*
* @param string $displayName
*/
public function setDisplayName($displayName)
{
$this->displayName = $displayName;
}
/**
* @return string
*/
public function getDisplayName()
{
return $this->displayName;
}
/**
* The number of examples in the dataset.
*
* @param int $exampleCount
*/
public function setExampleCount($exampleCount)
{
$this->exampleCount = $exampleCount;
}
/**
* @return int
*/
public function getExampleCount()
{
return $this->exampleCount;
}
/**
* Required. The resource name of the dataset, in form of `projects/{project-
* number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset_id}`
*
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* The BCP-47 language code of the source language.
*
* @param string $sourceLanguageCode
*/
public function setSourceLanguageCode($sourceLanguageCode)
{
$this->sourceLanguageCode = $sourceLanguageCode;
}
/**
* @return string
*/
public function getSourceLanguageCode()
{
return $this->sourceLanguageCode;
}
/**
* The BCP-47 language code of the target language.
*
* @param string $targetLanguageCode
*/
public function setTargetLanguageCode($targetLanguageCode)
{
$this->targetLanguageCode = $targetLanguageCode;
}
/**
* @return string
*/
public function getTargetLanguageCode()
{
return $this->targetLanguageCode;
}
/**
* Output only. Timestamp when this dataset was last updated.
*
* @param string $updateTime
*/
public function setUpdateTime($updateTime)
{
$this->updateTime = $updateTime;
}
/**
* @return string
*/
public function getUpdateTime()
{
return $this->updateTime;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(AdaptiveMtDataset::class, 'Google_Service_Translate_AdaptiveMtDataset');

View File

@@ -0,0 +1,140 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class AdaptiveMtFile extends \Google\Model
{
/**
* Output only. Timestamp when this file was created.
*
* @var string
*/
public $createTime;
/**
* The file's display name.
*
* @var string
*/
public $displayName;
/**
* The number of entries that the file contains.
*
* @var int
*/
public $entryCount;
/**
* Required. The resource name of the file, in form of `projects/{project-
* number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptive
* MtFiles/{file}`
*
* @var string
*/
public $name;
/**
* Output only. Timestamp when this file was last updated.
*
* @var string
*/
public $updateTime;
/**
* Output only. Timestamp when this file was created.
*
* @param string $createTime
*/
public function setCreateTime($createTime)
{
$this->createTime = $createTime;
}
/**
* @return string
*/
public function getCreateTime()
{
return $this->createTime;
}
/**
* The file's display name.
*
* @param string $displayName
*/
public function setDisplayName($displayName)
{
$this->displayName = $displayName;
}
/**
* @return string
*/
public function getDisplayName()
{
return $this->displayName;
}
/**
* The number of entries that the file contains.
*
* @param int $entryCount
*/
public function setEntryCount($entryCount)
{
$this->entryCount = $entryCount;
}
/**
* @return int
*/
public function getEntryCount()
{
return $this->entryCount;
}
/**
* Required. The resource name of the file, in form of `projects/{project-
* number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptive
* MtFiles/{file}`
*
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Output only. Timestamp when this file was last updated.
*
* @param string $updateTime
*/
public function setUpdateTime($updateTime)
{
$this->updateTime = $updateTime;
}
/**
* @return string
*/
public function getUpdateTime()
{
return $this->updateTime;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(AdaptiveMtFile::class, 'Google_Service_Translate_AdaptiveMtFile');

View File

@@ -0,0 +1,140 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class AdaptiveMtSentence extends \Google\Model
{
/**
* Output only. Timestamp when this sentence was created.
*
* @var string
*/
public $createTime;
/**
* Required. The resource name of the file, in form of `projects/{project-
* number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptive
* MtFiles/{file}/adaptiveMtSentences/{sentence}`
*
* @var string
*/
public $name;
/**
* Required. The source sentence.
*
* @var string
*/
public $sourceSentence;
/**
* Required. The target sentence.
*
* @var string
*/
public $targetSentence;
/**
* Output only. Timestamp when this sentence was last updated.
*
* @var string
*/
public $updateTime;
/**
* Output only. Timestamp when this sentence was created.
*
* @param string $createTime
*/
public function setCreateTime($createTime)
{
$this->createTime = $createTime;
}
/**
* @return string
*/
public function getCreateTime()
{
return $this->createTime;
}
/**
* Required. The resource name of the file, in form of `projects/{project-
* number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptive
* MtFiles/{file}/adaptiveMtSentences/{sentence}`
*
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Required. The source sentence.
*
* @param string $sourceSentence
*/
public function setSourceSentence($sourceSentence)
{
$this->sourceSentence = $sourceSentence;
}
/**
* @return string
*/
public function getSourceSentence()
{
return $this->sourceSentence;
}
/**
* Required. The target sentence.
*
* @param string $targetSentence
*/
public function setTargetSentence($targetSentence)
{
$this->targetSentence = $targetSentence;
}
/**
* @return string
*/
public function getTargetSentence()
{
return $this->targetSentence;
}
/**
* Output only. Timestamp when this sentence was last updated.
*
* @param string $updateTime
*/
public function setUpdateTime($updateTime)
{
$this->updateTime = $updateTime;
}
/**
* @return string
*/
public function getUpdateTime()
{
return $this->updateTime;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(AdaptiveMtSentence::class, 'Google_Service_Translate_AdaptiveMtSentence');

View File

@@ -0,0 +1,111 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class AdaptiveMtTranslateRequest extends \Google\Collection
{
protected $collection_key = 'content';
/**
* Required. The content of the input in string format.
*
* @var string[]
*/
public $content;
/**
* Required. The resource name for the dataset to use for adaptive MT.
* `projects/{project}/locations/{location-id}/adaptiveMtDatasets/{dataset}`
*
* @var string
*/
public $dataset;
protected $glossaryConfigType = GlossaryConfig::class;
protected $glossaryConfigDataType = '';
protected $referenceSentenceConfigType = ReferenceSentenceConfig::class;
protected $referenceSentenceConfigDataType = '';
/**
* Required. The content of the input in string format.
*
* @param string[] $content
*/
public function setContent($content)
{
$this->content = $content;
}
/**
* @return string[]
*/
public function getContent()
{
return $this->content;
}
/**
* Required. The resource name for the dataset to use for adaptive MT.
* `projects/{project}/locations/{location-id}/adaptiveMtDatasets/{dataset}`
*
* @param string $dataset
*/
public function setDataset($dataset)
{
$this->dataset = $dataset;
}
/**
* @return string
*/
public function getDataset()
{
return $this->dataset;
}
/**
* Optional. Glossary to be applied. The glossary must be within the same
* region (have the same location-id) as the model, otherwise an
* INVALID_ARGUMENT (400) error is returned.
*
* @param GlossaryConfig $glossaryConfig
*/
public function setGlossaryConfig(GlossaryConfig $glossaryConfig)
{
$this->glossaryConfig = $glossaryConfig;
}
/**
* @return GlossaryConfig
*/
public function getGlossaryConfig()
{
return $this->glossaryConfig;
}
/**
* Configuration for caller provided reference sentences.
*
* @param ReferenceSentenceConfig $referenceSentenceConfig
*/
public function setReferenceSentenceConfig(ReferenceSentenceConfig $referenceSentenceConfig)
{
$this->referenceSentenceConfig = $referenceSentenceConfig;
}
/**
* @return ReferenceSentenceConfig
*/
public function getReferenceSentenceConfig()
{
return $this->referenceSentenceConfig;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(AdaptiveMtTranslateRequest::class, 'Google_Service_Translate_AdaptiveMtTranslateRequest');

View File

@@ -0,0 +1,86 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class AdaptiveMtTranslateResponse extends \Google\Collection
{
protected $collection_key = 'translations';
protected $glossaryTranslationsType = AdaptiveMtTranslation::class;
protected $glossaryTranslationsDataType = 'array';
/**
* Output only. The translation's language code.
*
* @var string
*/
public $languageCode;
protected $translationsType = AdaptiveMtTranslation::class;
protected $translationsDataType = 'array';
/**
* Text translation response if a glossary is provided in the request. This
* could be the same as 'translation' above if no terms apply.
*
* @param AdaptiveMtTranslation[] $glossaryTranslations
*/
public function setGlossaryTranslations($glossaryTranslations)
{
$this->glossaryTranslations = $glossaryTranslations;
}
/**
* @return AdaptiveMtTranslation[]
*/
public function getGlossaryTranslations()
{
return $this->glossaryTranslations;
}
/**
* Output only. The translation's language code.
*
* @param string $languageCode
*/
public function setLanguageCode($languageCode)
{
$this->languageCode = $languageCode;
}
/**
* @return string
*/
public function getLanguageCode()
{
return $this->languageCode;
}
/**
* Output only. The translation.
*
* @param AdaptiveMtTranslation[] $translations
*/
public function setTranslations($translations)
{
$this->translations = $translations;
}
/**
* @return AdaptiveMtTranslation[]
*/
public function getTranslations()
{
return $this->translations;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(AdaptiveMtTranslateResponse::class, 'Google_Service_Translate_AdaptiveMtTranslateResponse');

View File

@@ -0,0 +1,48 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class AdaptiveMtTranslation extends \Google\Model
{
/**
* Output only. The translated text.
*
* @var string
*/
public $translatedText;
/**
* Output only. The translated text.
*
* @param string $translatedText
*/
public function setTranslatedText($translatedText)
{
$this->translatedText = $translatedText;
}
/**
* @return string
*/
public function getTranslatedText()
{
return $this->translatedText;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(AdaptiveMtTranslation::class, 'Google_Service_Translate_AdaptiveMtTranslation');

View File

@@ -0,0 +1,54 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class BatchDocumentInputConfig extends \Google\Model
{
protected $gcsSourceType = GcsSource::class;
protected $gcsSourceDataType = '';
/**
* Google Cloud Storage location for the source input. This can be a single
* file (for example, `gs://translation-test/input.docx`) or a wildcard (for
* example, `gs://translation-test`). File mime type is determined based on
* extension. Supported mime type includes: - `pdf`, application/pdf - `docx`,
* application/vnd.openxmlformats-officedocument.wordprocessingml.document -
* `pptx`, application/vnd.openxmlformats-
* officedocument.presentationml.presentation - `xlsx`,
* application/vnd.openxmlformats-officedocument.spreadsheetml.sheet The max
* file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB. The max
* file size to support for `.pdf` is 1GB and the max page limit is 1000
* pages. The max file size to support for all input documents is 1GB.
*
* @param GcsSource $gcsSource
*/
public function setGcsSource(GcsSource $gcsSource)
{
$this->gcsSource = $gcsSource;
}
/**
* @return GcsSource
*/
public function getGcsSource()
{
return $this->gcsSource;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(BatchDocumentInputConfig::class, 'Google_Service_Translate_BatchDocumentInputConfig');

View File

@@ -0,0 +1,78 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class BatchDocumentOutputConfig extends \Google\Model
{
protected $gcsDestinationType = GcsDestination::class;
protected $gcsDestinationDataType = '';
/**
* Google Cloud Storage destination for output content. For every single input
* document (for example, gs://a/b/c.[extension]), we generate at most 2 * n
* output files. (n is the # of target_language_codes in the
* BatchTranslateDocumentRequest). While the input documents are being
* processed, we write/update an index file `index.csv` under
* `gcs_destination.output_uri_prefix` (for example,
* gs://translation_output/index.csv) The index file is generated/updated as
* new files are being translated. The format is:
* input_document,target_language_code,translation_output,error_output,
* glossary_translation_output,glossary_error_output `input_document` is one
* file we matched using gcs_source.input_uri. `target_language_code` is
* provided in the request. `translation_output` contains the translations.
* (details provided below) `error_output` contains the error message during
* processing of the file. Both translations_file and errors_file could be
* empty strings if we have no content to output.
* `glossary_translation_output` and `glossary_error_output` are the
* translated output/error when we apply glossaries. They could also be empty
* if we have no content to output. Once a row is present in index.csv, the
* input/output matching never changes. Callers should also expect all the
* content in input_file are processed and ready to be consumed (that is, no
* partial output file is written). Since index.csv will be keeping updated
* during the process, please make sure there is no custom retention policy
* applied on the output bucket that may avoid file updating.
* (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) The
* naming format of translation output files follows (for target language code
* [trg]): `translation_output`:
* `gs://translation_output/a_b_c_[trg]_translation.[extension]`
* `glossary_translation_output`:
* `gs://translation_test/a_b_c_[trg]_glossary_translation.[extension]`. The
* output document will maintain the same file format as the input document.
* The naming format of error output files follows (for target language code
* [trg]): `error_output`: `gs://translation_test/a_b_c_[trg]_errors.txt`
* `glossary_error_output`:
* `gs://translation_test/a_b_c_[trg]_glossary_translation.txt`. The error
* output is a txt file containing error details.
*
* @param GcsDestination $gcsDestination
*/
public function setGcsDestination(GcsDestination $gcsDestination)
{
$this->gcsDestination = $gcsDestination;
}
/**
* @return GcsDestination
*/
public function getGcsDestination()
{
return $this->gcsDestination;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(BatchDocumentOutputConfig::class, 'Google_Service_Translate_BatchDocumentOutputConfig');

View File

@@ -0,0 +1,280 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class BatchTranslateDocumentRequest extends \Google\Collection
{
protected $collection_key = 'targetLanguageCodes';
/**
* Optional. This flag is to support user customized attribution. If not
* provided, the default is `Machine Translated by Google`. Customized
* attribution should follow rules in
* https://cloud.google.com/translate/attribution#attribution_and_logos
*
* @var string
*/
public $customizedAttribution;
/**
* Optional. If true, enable auto rotation correction in DVS.
*
* @var bool
*/
public $enableRotationCorrection;
/**
* Optional. If true, use the text removal server to remove the shadow text on
* background image for native pdf translation. Shadow removal feature can
* only be enabled when is_translate_native_pdf_only: false &&
* pdf_native_only: false
*
* @var bool
*/
public $enableShadowRemovalNativePdf;
/**
* Optional. The file format conversion map that is applied to all input
* files. The map key is the original mime_type. The map value is the target
* mime_type of translated documents. Supported file format conversion
* includes: - `application/pdf` to `application/vnd.openxmlformats-
* officedocument.wordprocessingml.document` If nothing specified, output
* files will be in the same format as the original file.
*
* @var string[]
*/
public $formatConversions;
protected $glossariesType = TranslateTextGlossaryConfig::class;
protected $glossariesDataType = 'map';
protected $inputConfigsType = BatchDocumentInputConfig::class;
protected $inputConfigsDataType = 'array';
/**
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is the model name. Value can be a built-in general model,
* or an AutoML Translation model. The value format depends on model type: -
* AutoML Translation models: `projects/{project-number-or-
* id}/locations/{location-id}/models/{model-id}` - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-
* id}/models/general/nmt`, If the map is empty or a specific model is not
* requested for a language pair, then default google model (nmt) is used.
*
* @var string[]
*/
public $models;
protected $outputConfigType = BatchDocumentOutputConfig::class;
protected $outputConfigDataType = '';
/**
* Required. The ISO-639 language code of the input document if known, for
* example, "en-US" or "sr-Latn". Supported language codes are listed in
* [Language Support](https://cloud.google.com/translate/docs/languages).
*
* @var string
*/
public $sourceLanguageCode;
/**
* Required. The ISO-639 language code to use for translation of the input
* document. Specify up to 10 language codes here.
*
* @var string[]
*/
public $targetLanguageCodes;
/**
* Optional. This flag is to support user customized attribution. If not
* provided, the default is `Machine Translated by Google`. Customized
* attribution should follow rules in
* https://cloud.google.com/translate/attribution#attribution_and_logos
*
* @param string $customizedAttribution
*/
public function setCustomizedAttribution($customizedAttribution)
{
$this->customizedAttribution = $customizedAttribution;
}
/**
* @return string
*/
public function getCustomizedAttribution()
{
return $this->customizedAttribution;
}
/**
* Optional. If true, enable auto rotation correction in DVS.
*
* @param bool $enableRotationCorrection
*/
public function setEnableRotationCorrection($enableRotationCorrection)
{
$this->enableRotationCorrection = $enableRotationCorrection;
}
/**
* @return bool
*/
public function getEnableRotationCorrection()
{
return $this->enableRotationCorrection;
}
/**
* Optional. If true, use the text removal server to remove the shadow text on
* background image for native pdf translation. Shadow removal feature can
* only be enabled when is_translate_native_pdf_only: false &&
* pdf_native_only: false
*
* @param bool $enableShadowRemovalNativePdf
*/
public function setEnableShadowRemovalNativePdf($enableShadowRemovalNativePdf)
{
$this->enableShadowRemovalNativePdf = $enableShadowRemovalNativePdf;
}
/**
* @return bool
*/
public function getEnableShadowRemovalNativePdf()
{
return $this->enableShadowRemovalNativePdf;
}
/**
* Optional. The file format conversion map that is applied to all input
* files. The map key is the original mime_type. The map value is the target
* mime_type of translated documents. Supported file format conversion
* includes: - `application/pdf` to `application/vnd.openxmlformats-
* officedocument.wordprocessingml.document` If nothing specified, output
* files will be in the same format as the original file.
*
* @param string[] $formatConversions
*/
public function setFormatConversions($formatConversions)
{
$this->formatConversions = $formatConversions;
}
/**
* @return string[]
*/
public function getFormatConversions()
{
return $this->formatConversions;
}
/**
* Optional. Glossaries to be applied. It's keyed by target language code.
*
* @param TranslateTextGlossaryConfig[] $glossaries
*/
public function setGlossaries($glossaries)
{
$this->glossaries = $glossaries;
}
/**
* @return TranslateTextGlossaryConfig[]
*/
public function getGlossaries()
{
return $this->glossaries;
}
/**
* Required. Input configurations. The total number of files matched should be
* <= 100. The total content size to translate should be <= 100M Unicode
* codepoints. The files must use UTF-8 encoding.
*
* @param BatchDocumentInputConfig[] $inputConfigs
*/
public function setInputConfigs($inputConfigs)
{
$this->inputConfigs = $inputConfigs;
}
/**
* @return BatchDocumentInputConfig[]
*/
public function getInputConfigs()
{
return $this->inputConfigs;
}
/**
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is the model name. Value can be a built-in general model,
* or an AutoML Translation model. The value format depends on model type: -
* AutoML Translation models: `projects/{project-number-or-
* id}/locations/{location-id}/models/{model-id}` - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-
* id}/models/general/nmt`, If the map is empty or a specific model is not
* requested for a language pair, then default google model (nmt) is used.
*
* @param string[] $models
*/
public function setModels($models)
{
$this->models = $models;
}
/**
* @return string[]
*/
public function getModels()
{
return $this->models;
}
/**
* Required. Output configuration. If 2 input configs match to the same file
* (that is, same input path), we don't generate output for duplicate inputs.
*
* @param BatchDocumentOutputConfig $outputConfig
*/
public function setOutputConfig(BatchDocumentOutputConfig $outputConfig)
{
$this->outputConfig = $outputConfig;
}
/**
* @return BatchDocumentOutputConfig
*/
public function getOutputConfig()
{
return $this->outputConfig;
}
/**
* Required. The ISO-639 language code of the input document if known, for
* example, "en-US" or "sr-Latn". Supported language codes are listed in
* [Language Support](https://cloud.google.com/translate/docs/languages).
*
* @param string $sourceLanguageCode
*/
public function setSourceLanguageCode($sourceLanguageCode)
{
$this->sourceLanguageCode = $sourceLanguageCode;
}
/**
* @return string
*/
public function getSourceLanguageCode()
{
return $this->sourceLanguageCode;
}
/**
* Required. The ISO-639 language code to use for translation of the input
* document. Specify up to 10 language codes here.
*
* @param string[] $targetLanguageCodes
*/
public function setTargetLanguageCodes($targetLanguageCodes)
{
$this->targetLanguageCodes = $targetLanguageCodes;
}
/**
* @return string[]
*/
public function getTargetLanguageCodes()
{
return $this->targetLanguageCodes;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(BatchTranslateDocumentRequest::class, 'Google_Service_Translate_BatchTranslateDocumentRequest');

View File

@@ -0,0 +1,199 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class BatchTranslateTextRequest extends \Google\Collection
{
protected $collection_key = 'targetLanguageCodes';
protected $glossariesType = TranslateTextGlossaryConfig::class;
protected $glossariesDataType = 'map';
protected $inputConfigsType = InputConfig::class;
protected $inputConfigsDataType = 'array';
/**
* Optional. The labels with user-defined metadata for the request. Label keys
* and values can be no longer than 63 characters (Unicode codepoints), can
* only contain lowercase letters, numeric characters, underscores and dashes.
* International characters are allowed. Label values are optional. Label keys
* must start with a letter. See
* https://cloud.google.com/translate/docs/advanced/labels for more
* information.
*
* @var string[]
*/
public $labels;
/**
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is model name. Value can be a built-in general model, or
* an AutoML Translation model. The value format depends on model type: -
* AutoML Translation models: `projects/{project-number-or-
* id}/locations/{location-id}/models/{model-id}` - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-
* id}/models/general/nmt`, If the map is empty or a specific model is not
* requested for a language pair, then default google model (nmt) is used.
*
* @var string[]
*/
public $models;
protected $outputConfigType = OutputConfig::class;
protected $outputConfigDataType = '';
/**
* Required. Source language code.
*
* @var string
*/
public $sourceLanguageCode;
/**
* Required. Specify up to 10 language codes here.
*
* @var string[]
*/
public $targetLanguageCodes;
/**
* Optional. Glossaries to be applied for translation. It's keyed by target
* language code.
*
* @param TranslateTextGlossaryConfig[] $glossaries
*/
public function setGlossaries($glossaries)
{
$this->glossaries = $glossaries;
}
/**
* @return TranslateTextGlossaryConfig[]
*/
public function getGlossaries()
{
return $this->glossaries;
}
/**
* Required. Input configurations. The total number of files matched should be
* <= 100. The total content size should be <= 100M Unicode codepoints. The
* files must use UTF-8 encoding.
*
* @param InputConfig[] $inputConfigs
*/
public function setInputConfigs($inputConfigs)
{
$this->inputConfigs = $inputConfigs;
}
/**
* @return InputConfig[]
*/
public function getInputConfigs()
{
return $this->inputConfigs;
}
/**
* Optional. The labels with user-defined metadata for the request. Label keys
* and values can be no longer than 63 characters (Unicode codepoints), can
* only contain lowercase letters, numeric characters, underscores and dashes.
* International characters are allowed. Label values are optional. Label keys
* must start with a letter. See
* https://cloud.google.com/translate/docs/advanced/labels for more
* information.
*
* @param string[] $labels
*/
public function setLabels($labels)
{
$this->labels = $labels;
}
/**
* @return string[]
*/
public function getLabels()
{
return $this->labels;
}
/**
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is model name. Value can be a built-in general model, or
* an AutoML Translation model. The value format depends on model type: -
* AutoML Translation models: `projects/{project-number-or-
* id}/locations/{location-id}/models/{model-id}` - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-
* id}/models/general/nmt`, If the map is empty or a specific model is not
* requested for a language pair, then default google model (nmt) is used.
*
* @param string[] $models
*/
public function setModels($models)
{
$this->models = $models;
}
/**
* @return string[]
*/
public function getModels()
{
return $this->models;
}
/**
* Required. Output configuration. If 2 input configs match to the same file
* (that is, same input path), we don't generate output for duplicate inputs.
*
* @param OutputConfig $outputConfig
*/
public function setOutputConfig(OutputConfig $outputConfig)
{
$this->outputConfig = $outputConfig;
}
/**
* @return OutputConfig
*/
public function getOutputConfig()
{
return $this->outputConfig;
}
/**
* Required. Source language code.
*
* @param string $sourceLanguageCode
*/
public function setSourceLanguageCode($sourceLanguageCode)
{
$this->sourceLanguageCode = $sourceLanguageCode;
}
/**
* @return string
*/
public function getSourceLanguageCode()
{
return $this->sourceLanguageCode;
}
/**
* Required. Specify up to 10 language codes here.
*
* @param string[] $targetLanguageCodes
*/
public function setTargetLanguageCodes($targetLanguageCodes)
{
$this->targetLanguageCodes = $targetLanguageCodes;
}
/**
* @return string[]
*/
public function getTargetLanguageCodes()
{
return $this->targetLanguageCodes;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(BatchTranslateTextRequest::class, 'Google_Service_Translate_BatchTranslateTextRequest');

View File

@@ -0,0 +1,25 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class CancelOperationRequest extends \Google\Model
{
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(CancelOperationRequest::class, 'Google_Service_Translate_CancelOperationRequest');

View File

@@ -0,0 +1,252 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class Dataset extends \Google\Model
{
/**
* Output only. Timestamp when this dataset was created.
*
* @var string
*/
public $createTime;
/**
* The name of the dataset to show in the interface. The name can be up to 32
* characters long and can consist only of ASCII Latin letters A-Z and a-z,
* underscores (_), and ASCII digits 0-9.
*
* @var string
*/
public $displayName;
/**
* Output only. The number of examples in the dataset.
*
* @var int
*/
public $exampleCount;
/**
* The resource name of the dataset, in form of `projects/{project-number-or-
* id}/locations/{location_id}/datasets/{dataset_id}`
*
* @var string
*/
public $name;
/**
* The BCP-47 language code of the source language.
*
* @var string
*/
public $sourceLanguageCode;
/**
* The BCP-47 language code of the target language.
*
* @var string
*/
public $targetLanguageCode;
/**
* Output only. Number of test examples (sentence pairs).
*
* @var int
*/
public $testExampleCount;
/**
* Output only. Number of training examples (sentence pairs).
*
* @var int
*/
public $trainExampleCount;
/**
* Output only. Timestamp when this dataset was last updated.
*
* @var string
*/
public $updateTime;
/**
* Output only. Number of validation examples (sentence pairs).
*
* @var int
*/
public $validateExampleCount;
/**
* Output only. Timestamp when this dataset was created.
*
* @param string $createTime
*/
public function setCreateTime($createTime)
{
$this->createTime = $createTime;
}
/**
* @return string
*/
public function getCreateTime()
{
return $this->createTime;
}
/**
* The name of the dataset to show in the interface. The name can be up to 32
* characters long and can consist only of ASCII Latin letters A-Z and a-z,
* underscores (_), and ASCII digits 0-9.
*
* @param string $displayName
*/
public function setDisplayName($displayName)
{
$this->displayName = $displayName;
}
/**
* @return string
*/
public function getDisplayName()
{
return $this->displayName;
}
/**
* Output only. The number of examples in the dataset.
*
* @param int $exampleCount
*/
public function setExampleCount($exampleCount)
{
$this->exampleCount = $exampleCount;
}
/**
* @return int
*/
public function getExampleCount()
{
return $this->exampleCount;
}
/**
* The resource name of the dataset, in form of `projects/{project-number-or-
* id}/locations/{location_id}/datasets/{dataset_id}`
*
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* The BCP-47 language code of the source language.
*
* @param string $sourceLanguageCode
*/
public function setSourceLanguageCode($sourceLanguageCode)
{
$this->sourceLanguageCode = $sourceLanguageCode;
}
/**
* @return string
*/
public function getSourceLanguageCode()
{
return $this->sourceLanguageCode;
}
/**
* The BCP-47 language code of the target language.
*
* @param string $targetLanguageCode
*/
public function setTargetLanguageCode($targetLanguageCode)
{
$this->targetLanguageCode = $targetLanguageCode;
}
/**
* @return string
*/
public function getTargetLanguageCode()
{
return $this->targetLanguageCode;
}
/**
* Output only. Number of test examples (sentence pairs).
*
* @param int $testExampleCount
*/
public function setTestExampleCount($testExampleCount)
{
$this->testExampleCount = $testExampleCount;
}
/**
* @return int
*/
public function getTestExampleCount()
{
return $this->testExampleCount;
}
/**
* Output only. Number of training examples (sentence pairs).
*
* @param int $trainExampleCount
*/
public function setTrainExampleCount($trainExampleCount)
{
$this->trainExampleCount = $trainExampleCount;
}
/**
* @return int
*/
public function getTrainExampleCount()
{
return $this->trainExampleCount;
}
/**
* Output only. Timestamp when this dataset was last updated.
*
* @param string $updateTime
*/
public function setUpdateTime($updateTime)
{
$this->updateTime = $updateTime;
}
/**
* @return string
*/
public function getUpdateTime()
{
return $this->updateTime;
}
/**
* Output only. Number of validation examples (sentence pairs).
*
* @param int $validateExampleCount
*/
public function setValidateExampleCount($validateExampleCount)
{
$this->validateExampleCount = $validateExampleCount;
}
/**
* @return int
*/
public function getValidateExampleCount()
{
return $this->validateExampleCount;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Dataset::class, 'Google_Service_Translate_Dataset');

View File

@@ -0,0 +1,45 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class DatasetInputConfig extends \Google\Collection
{
protected $collection_key = 'inputFiles';
protected $inputFilesType = InputFile::class;
protected $inputFilesDataType = 'array';
/**
* Files containing the sentence pairs to be imported to the dataset.
*
* @param InputFile[] $inputFiles
*/
public function setInputFiles($inputFiles)
{
$this->inputFiles = $inputFiles;
}
/**
* @return InputFile[]
*/
public function getInputFiles()
{
return $this->inputFiles;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(DatasetInputConfig::class, 'Google_Service_Translate_DatasetInputConfig');

View File

@@ -0,0 +1,44 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class DatasetOutputConfig extends \Google\Model
{
protected $gcsDestinationType = GcsOutputDestination::class;
protected $gcsDestinationDataType = '';
/**
* Google Cloud Storage destination to write the output.
*
* @param GcsOutputDestination $gcsDestination
*/
public function setGcsDestination(GcsOutputDestination $gcsDestination)
{
$this->gcsDestination = $gcsDestination;
}
/**
* @return GcsOutputDestination
*/
public function getGcsDestination()
{
return $this->gcsDestination;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(DatasetOutputConfig::class, 'Google_Service_Translate_DatasetOutputConfig');

View File

@@ -0,0 +1,138 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class DetectLanguageRequest extends \Google\Model
{
/**
* The content of the input stored as a string.
*
* @var string
*/
public $content;
/**
* Optional. The labels with user-defined metadata for the request. Label keys
* and values can be no longer than 63 characters (Unicode codepoints), can
* only contain lowercase letters, numeric characters, underscores and dashes.
* International characters are allowed. Label values are optional. Label keys
* must start with a letter. See
* https://cloud.google.com/translate/docs/advanced/labels for more
* information.
*
* @var string[]
*/
public $labels;
/**
* Optional. The format of the source text, for example, "text/html",
* "text/plain". If left blank, the MIME type defaults to "text/html".
*
* @var string
*/
public $mimeType;
/**
* Optional. The language detection model to be used. Format:
* `projects/{project-number-or-id}/locations/{location-id}/models/language-
* detection/{model-id}` Only one language detection model is currently
* supported: `projects/{project-number-or-id}/locations/{location-
* id}/models/language-detection/default`. If not specified, the default model
* is used.
*
* @var string
*/
public $model;
/**
* The content of the input stored as a string.
*
* @param string $content
*/
public function setContent($content)
{
$this->content = $content;
}
/**
* @return string
*/
public function getContent()
{
return $this->content;
}
/**
* Optional. The labels with user-defined metadata for the request. Label keys
* and values can be no longer than 63 characters (Unicode codepoints), can
* only contain lowercase letters, numeric characters, underscores and dashes.
* International characters are allowed. Label values are optional. Label keys
* must start with a letter. See
* https://cloud.google.com/translate/docs/advanced/labels for more
* information.
*
* @param string[] $labels
*/
public function setLabels($labels)
{
$this->labels = $labels;
}
/**
* @return string[]
*/
public function getLabels()
{
return $this->labels;
}
/**
* Optional. The format of the source text, for example, "text/html",
* "text/plain". If left blank, the MIME type defaults to "text/html".
*
* @param string $mimeType
*/
public function setMimeType($mimeType)
{
$this->mimeType = $mimeType;
}
/**
* @return string
*/
public function getMimeType()
{
return $this->mimeType;
}
/**
* Optional. The language detection model to be used. Format:
* `projects/{project-number-or-id}/locations/{location-id}/models/language-
* detection/{model-id}` Only one language detection model is currently
* supported: `projects/{project-number-or-id}/locations/{location-
* id}/models/language-detection/default`. If not specified, the default model
* is used.
*
* @param string $model
*/
public function setModel($model)
{
$this->model = $model;
}
/**
* @return string
*/
public function getModel()
{
return $this->model;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(DetectLanguageRequest::class, 'Google_Service_Translate_DetectLanguageRequest');

View File

@@ -0,0 +1,46 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class DetectLanguageResponse extends \Google\Collection
{
protected $collection_key = 'languages';
protected $languagesType = DetectedLanguage::class;
protected $languagesDataType = 'array';
/**
* The most probable language detected by the Translation API. For each
* request, the Translation API will always return only one result.
*
* @param DetectedLanguage[] $languages
*/
public function setLanguages($languages)
{
$this->languages = $languages;
}
/**
* @return DetectedLanguage[]
*/
public function getLanguages()
{
return $this->languages;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(DetectLanguageResponse::class, 'Google_Service_Translate_DetectLanguageResponse');

View File

@@ -0,0 +1,72 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class DetectedLanguage extends \Google\Model
{
/**
* The confidence of the detection result for this language.
*
* @var float
*/
public $confidence;
/**
* The ISO-639 language code of the source content in the request, detected
* automatically.
*
* @var string
*/
public $languageCode;
/**
* The confidence of the detection result for this language.
*
* @param float $confidence
*/
public function setConfidence($confidence)
{
$this->confidence = $confidence;
}
/**
* @return float
*/
public function getConfidence()
{
return $this->confidence;
}
/**
* The ISO-639 language code of the source content in the request, detected
* automatically.
*
* @param string $languageCode
*/
public function setLanguageCode($languageCode)
{
$this->languageCode = $languageCode;
}
/**
* @return string
*/
public function getLanguageCode()
{
return $this->languageCode;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(DetectedLanguage::class, 'Google_Service_Translate_DetectedLanguage');

View File

@@ -0,0 +1,101 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class DocumentInputConfig extends \Google\Model
{
/**
* Document's content represented as a stream of bytes.
*
* @var string
*/
public $content;
protected $gcsSourceType = GcsSource::class;
protected $gcsSourceDataType = '';
/**
* Specifies the input document's mime_type. If not specified it will be
* determined using the file extension for gcs_source provided files. For a
* file provided through bytes content the mime_type must be provided.
* Currently supported mime types are: - application/pdf -
* application/vnd.openxmlformats-officedocument.wordprocessingml.document -
* application/vnd.openxmlformats-officedocument.presentationml.presentation -
* application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
*
* @var string
*/
public $mimeType;
/**
* Document's content represented as a stream of bytes.
*
* @param string $content
*/
public function setContent($content)
{
$this->content = $content;
}
/**
* @return string
*/
public function getContent()
{
return $this->content;
}
/**
* Google Cloud Storage location. This must be a single file. For example:
* gs://example_bucket/example_file.pdf
*
* @param GcsSource $gcsSource
*/
public function setGcsSource(GcsSource $gcsSource)
{
$this->gcsSource = $gcsSource;
}
/**
* @return GcsSource
*/
public function getGcsSource()
{
return $this->gcsSource;
}
/**
* Specifies the input document's mime_type. If not specified it will be
* determined using the file extension for gcs_source provided files. For a
* file provided through bytes content the mime_type must be provided.
* Currently supported mime types are: - application/pdf -
* application/vnd.openxmlformats-officedocument.wordprocessingml.document -
* application/vnd.openxmlformats-officedocument.presentationml.presentation -
* application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
*
* @param string $mimeType
*/
public function setMimeType($mimeType)
{
$this->mimeType = $mimeType;
}
/**
* @return string
*/
public function getMimeType()
{
return $this->mimeType;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(DocumentInputConfig::class, 'Google_Service_Translate_DocumentInputConfig');

View File

@@ -0,0 +1,105 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class DocumentOutputConfig extends \Google\Model
{
protected $gcsDestinationType = GcsDestination::class;
protected $gcsDestinationDataType = '';
/**
* Optional. Specifies the translated document's mime_type. If not specified,
* the translated file's mime type will be the same as the input file's mime
* type. Currently only support the output mime type to be the same as input
* mime type. - application/pdf - application/vnd.openxmlformats-
* officedocument.wordprocessingml.document - application/vnd.openxmlformats-
* officedocument.presentationml.presentation -
* application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
*
* @var string
*/
public $mimeType;
/**
* Optional. Google Cloud Storage destination for the translation output,
* e.g., `gs://my_bucket/my_directory/`. The destination directory provided
* does not have to be empty, but the bucket must exist. If a file with the
* same name as the output file already exists in the destination an error
* will be returned. For a DocumentInputConfig.contents provided document, the
* output file will have the name "output_[trg]_translations.[ext]", where -
* [trg] corresponds to the translated file's language code, - [ext]
* corresponds to the translated file's extension according to its mime type.
* For a DocumentInputConfig.gcs_uri provided document, the output file will
* have a name according to its URI. For example: an input file with URI:
* `gs://a/b/c.[extension]` stored in a gcs_destination bucket with name
* "my_bucket" will have an output URI:
* `gs://my_bucket/a_b_c_[trg]_translations.[ext]`, where - [trg] corresponds
* to the translated file's language code, - [ext] corresponds to the
* translated file's extension according to its mime type. If the document was
* directly provided through the request, then the output document will have
* the format: `gs://my_bucket/translated_document_[trg]_translations.[ext]`,
* where - [trg] corresponds to the translated file's language code, - [ext]
* corresponds to the translated file's extension according to its mime type.
* If a glossary was provided, then the output URI for the glossary
* translation will be equal to the default output URI but have
* `glossary_translations` instead of `translations`. For the previous
* example, its glossary URI would be:
* `gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]`. Thus the max
* number of output files will be 2 (Translated document, Glossary translated
* document). Callers should expect no partial outputs. If there is any error
* during document translation, no output will be stored in the Cloud Storage
* bucket.
*
* @param GcsDestination $gcsDestination
*/
public function setGcsDestination(GcsDestination $gcsDestination)
{
$this->gcsDestination = $gcsDestination;
}
/**
* @return GcsDestination
*/
public function getGcsDestination()
{
return $this->gcsDestination;
}
/**
* Optional. Specifies the translated document's mime_type. If not specified,
* the translated file's mime type will be the same as the input file's mime
* type. Currently only support the output mime type to be the same as input
* mime type. - application/pdf - application/vnd.openxmlformats-
* officedocument.wordprocessingml.document - application/vnd.openxmlformats-
* officedocument.presentationml.presentation -
* application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
*
* @param string $mimeType
*/
public function setMimeType($mimeType)
{
$this->mimeType = $mimeType;
}
/**
* @return string
*/
public function getMimeType()
{
return $this->mimeType;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(DocumentOutputConfig::class, 'Google_Service_Translate_DocumentOutputConfig');

View File

@@ -0,0 +1,103 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class DocumentTranslation extends \Google\Collection
{
protected $collection_key = 'byteStreamOutputs';
/**
* The array of translated documents. It is expected to be size 1 for now. We
* may produce multiple translated documents in the future for other type of
* file formats.
*
* @var string[]
*/
public $byteStreamOutputs;
/**
* The detected language for the input document. If the user did not provide
* the source language for the input document, this field will have the
* language code automatically detected. If the source language was passed,
* auto-detection of the language does not occur and this field is empty.
*
* @var string
*/
public $detectedLanguageCode;
/**
* The translated document's mime type.
*
* @var string
*/
public $mimeType;
/**
* The array of translated documents. It is expected to be size 1 for now. We
* may produce multiple translated documents in the future for other type of
* file formats.
*
* @param string[] $byteStreamOutputs
*/
public function setByteStreamOutputs($byteStreamOutputs)
{
$this->byteStreamOutputs = $byteStreamOutputs;
}
/**
* @return string[]
*/
public function getByteStreamOutputs()
{
return $this->byteStreamOutputs;
}
/**
* The detected language for the input document. If the user did not provide
* the source language for the input document, this field will have the
* language code automatically detected. If the source language was passed,
* auto-detection of the language does not occur and this field is empty.
*
* @param string $detectedLanguageCode
*/
public function setDetectedLanguageCode($detectedLanguageCode)
{
$this->detectedLanguageCode = $detectedLanguageCode;
}
/**
* @return string
*/
public function getDetectedLanguageCode()
{
return $this->detectedLanguageCode;
}
/**
* The translated document's mime type.
*
* @param string $mimeType
*/
public function setMimeType($mimeType)
{
$this->mimeType = $mimeType;
}
/**
* @return string
*/
public function getMimeType()
{
return $this->mimeType;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(DocumentTranslation::class, 'Google_Service_Translate_DocumentTranslation');

View File

@@ -0,0 +1,118 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class Example extends \Google\Model
{
/**
* Output only. The resource name of the example, in form of
* `projects/{project-number-or-
* id}/locations/{location_id}/datasets/{dataset_id}/examples/{example_id}`
*
* @var string
*/
public $name;
/**
* Sentence in source language.
*
* @var string
*/
public $sourceText;
/**
* Sentence in target language.
*
* @var string
*/
public $targetText;
/**
* Output only. Usage of the sentence pair. Options are TRAIN|VALIDATION|TEST.
*
* @var string
*/
public $usage;
/**
* Output only. The resource name of the example, in form of
* `projects/{project-number-or-
* id}/locations/{location_id}/datasets/{dataset_id}/examples/{example_id}`
*
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Sentence in source language.
*
* @param string $sourceText
*/
public function setSourceText($sourceText)
{
$this->sourceText = $sourceText;
}
/**
* @return string
*/
public function getSourceText()
{
return $this->sourceText;
}
/**
* Sentence in target language.
*
* @param string $targetText
*/
public function setTargetText($targetText)
{
$this->targetText = $targetText;
}
/**
* @return string
*/
public function getTargetText()
{
return $this->targetText;
}
/**
* Output only. Usage of the sentence pair. Options are TRAIN|VALIDATION|TEST.
*
* @param string $usage
*/
public function setUsage($usage)
{
$this->usage = $usage;
}
/**
* @return string
*/
public function getUsage()
{
return $this->usage;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Example::class, 'Google_Service_Translate_Example');

View File

@@ -0,0 +1,44 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class ExportDataRequest extends \Google\Model
{
protected $outputConfigType = DatasetOutputConfig::class;
protected $outputConfigDataType = '';
/**
* Required. The config for the output content.
*
* @param DatasetOutputConfig $outputConfig
*/
public function setOutputConfig(DatasetOutputConfig $outputConfig)
{
$this->outputConfig = $outputConfig;
}
/**
* @return DatasetOutputConfig
*/
public function getOutputConfig()
{
return $this->outputConfig;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ExportDataRequest::class, 'Google_Service_Translate_ExportDataRequest');

View File

@@ -0,0 +1,92 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class FileInputSource extends \Google\Model
{
/**
* Required. The file's byte contents.
*
* @var string
*/
public $content;
/**
* Required. The file's display name.
*
* @var string
*/
public $displayName;
/**
* Required. The file's mime type.
*
* @var string
*/
public $mimeType;
/**
* Required. The file's byte contents.
*
* @param string $content
*/
public function setContent($content)
{
$this->content = $content;
}
/**
* @return string
*/
public function getContent()
{
return $this->content;
}
/**
* Required. The file's display name.
*
* @param string $displayName
*/
public function setDisplayName($displayName)
{
$this->displayName = $displayName;
}
/**
* @return string
*/
public function getDisplayName()
{
return $this->displayName;
}
/**
* Required. The file's mime type.
*
* @param string $mimeType
*/
public function setMimeType($mimeType)
{
$this->mimeType = $mimeType;
}
/**
* @return string
*/
public function getMimeType()
{
return $this->mimeType;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(FileInputSource::class, 'Google_Service_Translate_FileInputSource');

View File

@@ -0,0 +1,56 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class GcsDestination extends \Google\Model
{
/**
* Required. The bucket used in 'output_uri_prefix' must exist and there must
* be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with
* "/" and start with "gs://". One 'output_uri_prefix' can only be used by one
* batch translation job at a time. Otherwise an INVALID_ARGUMENT (400) error
* is returned.
*
* @var string
*/
public $outputUriPrefix;
/**
* Required. The bucket used in 'output_uri_prefix' must exist and there must
* be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with
* "/" and start with "gs://". One 'output_uri_prefix' can only be used by one
* batch translation job at a time. Otherwise an INVALID_ARGUMENT (400) error
* is returned.
*
* @param string $outputUriPrefix
*/
public function setOutputUriPrefix($outputUriPrefix)
{
$this->outputUriPrefix = $outputUriPrefix;
}
/**
* @return string
*/
public function getOutputUriPrefix()
{
return $this->outputUriPrefix;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GcsDestination::class, 'Google_Service_Translate_GcsDestination');

View File

@@ -0,0 +1,48 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class GcsInputSource extends \Google\Model
{
/**
* Required. Source data URI. For example, `gs://my_bucket/my_object`.
*
* @var string
*/
public $inputUri;
/**
* Required. Source data URI. For example, `gs://my_bucket/my_object`.
*
* @param string $inputUri
*/
public function setInputUri($inputUri)
{
$this->inputUri = $inputUri;
}
/**
* @return string
*/
public function getInputUri()
{
return $this->inputUri;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GcsInputSource::class, 'Google_Service_Translate_GcsInputSource');

View File

@@ -0,0 +1,52 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class GcsOutputDestination extends \Google\Model
{
/**
* Required. Google Cloud Storage URI to output directory. For example,
* `gs://bucket/directory`. The requesting user must have write permission to
* the bucket. The directory will be created if it doesn't exist.
*
* @var string
*/
public $outputUriPrefix;
/**
* Required. Google Cloud Storage URI to output directory. For example,
* `gs://bucket/directory`. The requesting user must have write permission to
* the bucket. The directory will be created if it doesn't exist.
*
* @param string $outputUriPrefix
*/
public function setOutputUriPrefix($outputUriPrefix)
{
$this->outputUriPrefix = $outputUriPrefix;
}
/**
* @return string
*/
public function getOutputUriPrefix()
{
return $this->outputUriPrefix;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GcsOutputDestination::class, 'Google_Service_Translate_GcsOutputDestination');

View File

@@ -0,0 +1,48 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class GcsSource extends \Google\Model
{
/**
* Required. Source data URI. For example, `gs://my_bucket/my_object`.
*
* @var string
*/
public $inputUri;
/**
* Required. Source data URI. For example, `gs://my_bucket/my_object`.
*
* @param string $inputUri
*/
public function setInputUri($inputUri)
{
$this->inputUri = $inputUri;
}
/**
* @return string
*/
public function getInputUri()
{
return $this->inputUri;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GcsSource::class, 'Google_Service_Translate_GcsSource');

View File

@@ -0,0 +1,195 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class Glossary extends \Google\Model
{
/**
* Optional. The display name of the glossary.
*
* @var string
*/
public $displayName;
/**
* Output only. When the glossary creation was finished.
*
* @var string
*/
public $endTime;
/**
* Output only. The number of entries defined in the glossary.
*
* @var int
*/
public $entryCount;
protected $inputConfigType = GlossaryInputConfig::class;
protected $inputConfigDataType = '';
protected $languageCodesSetType = LanguageCodesSet::class;
protected $languageCodesSetDataType = '';
protected $languagePairType = LanguageCodePair::class;
protected $languagePairDataType = '';
/**
* Required. The resource name of the glossary. Glossary names have the form
* `projects/{project-number-or-id}/locations/{location-
* id}/glossaries/{glossary-id}`.
*
* @var string
*/
public $name;
/**
* Output only. When CreateGlossary was called.
*
* @var string
*/
public $submitTime;
/**
* Optional. The display name of the glossary.
*
* @param string $displayName
*/
public function setDisplayName($displayName)
{
$this->displayName = $displayName;
}
/**
* @return string
*/
public function getDisplayName()
{
return $this->displayName;
}
/**
* Output only. When the glossary creation was finished.
*
* @param string $endTime
*/
public function setEndTime($endTime)
{
$this->endTime = $endTime;
}
/**
* @return string
*/
public function getEndTime()
{
return $this->endTime;
}
/**
* Output only. The number of entries defined in the glossary.
*
* @param int $entryCount
*/
public function setEntryCount($entryCount)
{
$this->entryCount = $entryCount;
}
/**
* @return int
*/
public function getEntryCount()
{
return $this->entryCount;
}
/**
* Required. Provides examples to build the glossary from. Total glossary must
* not exceed 10M Unicode codepoints.
*
* @param GlossaryInputConfig $inputConfig
*/
public function setInputConfig(GlossaryInputConfig $inputConfig)
{
$this->inputConfig = $inputConfig;
}
/**
* @return GlossaryInputConfig
*/
public function getInputConfig()
{
return $this->inputConfig;
}
/**
* Used with equivalent term set glossaries.
*
* @param LanguageCodesSet $languageCodesSet
*/
public function setLanguageCodesSet(LanguageCodesSet $languageCodesSet)
{
$this->languageCodesSet = $languageCodesSet;
}
/**
* @return LanguageCodesSet
*/
public function getLanguageCodesSet()
{
return $this->languageCodesSet;
}
/**
* Used with unidirectional glossaries.
*
* @param LanguageCodePair $languagePair
*/
public function setLanguagePair(LanguageCodePair $languagePair)
{
$this->languagePair = $languagePair;
}
/**
* @return LanguageCodePair
*/
public function getLanguagePair()
{
return $this->languagePair;
}
/**
* Required. The resource name of the glossary. Glossary names have the form
* `projects/{project-number-or-id}/locations/{location-
* id}/glossaries/{glossary-id}`.
*
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Output only. When CreateGlossary was called.
*
* @param string $submitTime
*/
public function setSubmitTime($submitTime)
{
$this->submitTime = $submitTime;
}
/**
* @return string
*/
public function getSubmitTime()
{
return $this->submitTime;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Glossary::class, 'Google_Service_Translate_Glossary');

View File

@@ -0,0 +1,102 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class GlossaryConfig extends \Google\Model
{
/**
* Optional. If set to true, the glossary will be used for contextual
* translation.
*
* @var bool
*/
public $contextualTranslationEnabled;
/**
* Required. The `glossary` to be applied for this translation. The format
* depends on the glossary: - User-provided custom glossary:
* `projects/{project-number-or-id}/locations/{location-
* id}/glossaries/{glossary-id}`
*
* @var string
*/
public $glossary;
/**
* Optional. Indicates match is case insensitive. The default value is `false`
* if missing.
*
* @var bool
*/
public $ignoreCase;
/**
* Optional. If set to true, the glossary will be used for contextual
* translation.
*
* @param bool $contextualTranslationEnabled
*/
public function setContextualTranslationEnabled($contextualTranslationEnabled)
{
$this->contextualTranslationEnabled = $contextualTranslationEnabled;
}
/**
* @return bool
*/
public function getContextualTranslationEnabled()
{
return $this->contextualTranslationEnabled;
}
/**
* Required. The `glossary` to be applied for this translation. The format
* depends on the glossary: - User-provided custom glossary:
* `projects/{project-number-or-id}/locations/{location-
* id}/glossaries/{glossary-id}`
*
* @param string $glossary
*/
public function setGlossary($glossary)
{
$this->glossary = $glossary;
}
/**
* @return string
*/
public function getGlossary()
{
return $this->glossary;
}
/**
* Optional. Indicates match is case insensitive. The default value is `false`
* if missing.
*
* @param bool $ignoreCase
*/
public function setIgnoreCase($ignoreCase)
{
$this->ignoreCase = $ignoreCase;
}
/**
* @return bool
*/
public function getIgnoreCase()
{
return $this->ignoreCase;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GlossaryConfig::class, 'Google_Service_Translate_GlossaryConfig');

View File

@@ -0,0 +1,108 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class GlossaryEntry extends \Google\Model
{
/**
* Describes the glossary entry.
*
* @var string
*/
public $description;
/**
* Identifier. The resource name of the entry. Format:
* `projects/locations/glossaries/glossaryEntries`
*
* @var string
*/
public $name;
protected $termsPairType = GlossaryTermsPair::class;
protected $termsPairDataType = '';
protected $termsSetType = GlossaryTermsSet::class;
protected $termsSetDataType = '';
/**
* Describes the glossary entry.
*
* @param string $description
*/
public function setDescription($description)
{
$this->description = $description;
}
/**
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* Identifier. The resource name of the entry. Format:
* `projects/locations/glossaries/glossaryEntries`
*
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Used for an unidirectional glossary.
*
* @param GlossaryTermsPair $termsPair
*/
public function setTermsPair(GlossaryTermsPair $termsPair)
{
$this->termsPair = $termsPair;
}
/**
* @return GlossaryTermsPair
*/
public function getTermsPair()
{
return $this->termsPair;
}
/**
* Used for an equivalent term sets glossary.
*
* @param GlossaryTermsSet $termsSet
*/
public function setTermsSet(GlossaryTermsSet $termsSet)
{
$this->termsSet = $termsSet;
}
/**
* @return GlossaryTermsSet
*/
public function getTermsSet()
{
return $this->termsSet;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GlossaryEntry::class, 'Google_Service_Translate_GlossaryEntry');

View File

@@ -0,0 +1,56 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class GlossaryInputConfig extends \Google\Model
{
protected $gcsSourceType = GcsSource::class;
protected $gcsSourceDataType = '';
/**
* Required. Google Cloud Storage location of glossary data. File format is
* determined based on the filename extension. API returns
* [google.rpc.Code.INVALID_ARGUMENT] for unsupported URI-s and file formats.
* Wildcards are not allowed. This must be a single file in one of the
* following formats: For unidirectional glossaries: - TSV/CSV
* (`.tsv`/`.csv`): Two column file, tab- or comma-separated. The first column
* is source text. The second column is target text. No headers in this file.
* The first row contains data and not column names. - TMX (`.tmx`): TMX file
* with parallel data defining source/target term pairs. For equivalent term
* sets glossaries: - CSV (`.csv`): Multi-column CSV file defining equivalent
* glossary terms in multiple languages. See documentation for more
* information -
* [glossaries](https://cloud.google.com/translate/docs/advanced/glossary).
*
* @param GcsSource $gcsSource
*/
public function setGcsSource(GcsSource $gcsSource)
{
$this->gcsSource = $gcsSource;
}
/**
* @return GcsSource
*/
public function getGcsSource()
{
return $this->gcsSource;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GlossaryInputConfig::class, 'Google_Service_Translate_GlossaryInputConfig');

View File

@@ -0,0 +1,70 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class GlossaryTerm extends \Google\Model
{
/**
* The language for this glossary term.
*
* @var string
*/
public $languageCode;
/**
* The text for the glossary term.
*
* @var string
*/
public $text;
/**
* The language for this glossary term.
*
* @param string $languageCode
*/
public function setLanguageCode($languageCode)
{
$this->languageCode = $languageCode;
}
/**
* @return string
*/
public function getLanguageCode()
{
return $this->languageCode;
}
/**
* The text for the glossary term.
*
* @param string $text
*/
public function setText($text)
{
$this->text = $text;
}
/**
* @return string
*/
public function getText()
{
return $this->text;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GlossaryTerm::class, 'Google_Service_Translate_GlossaryTerm');

View File

@@ -0,0 +1,62 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class GlossaryTermsPair extends \Google\Model
{
protected $sourceTermType = GlossaryTerm::class;
protected $sourceTermDataType = '';
protected $targetTermType = GlossaryTerm::class;
protected $targetTermDataType = '';
/**
* The source term is the term that will get match in the text,
*
* @param GlossaryTerm $sourceTerm
*/
public function setSourceTerm(GlossaryTerm $sourceTerm)
{
$this->sourceTerm = $sourceTerm;
}
/**
* @return GlossaryTerm
*/
public function getSourceTerm()
{
return $this->sourceTerm;
}
/**
* The term that will replace the match source term.
*
* @param GlossaryTerm $targetTerm
*/
public function setTargetTerm(GlossaryTerm $targetTerm)
{
$this->targetTerm = $targetTerm;
}
/**
* @return GlossaryTerm
*/
public function getTargetTerm()
{
return $this->targetTerm;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GlossaryTermsPair::class, 'Google_Service_Translate_GlossaryTermsPair');

View File

@@ -0,0 +1,46 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class GlossaryTermsSet extends \Google\Collection
{
protected $collection_key = 'terms';
protected $termsType = GlossaryTerm::class;
protected $termsDataType = 'array';
/**
* Each term in the set represents a term that can be replaced by the other
* terms.
*
* @param GlossaryTerm[] $terms
*/
public function setTerms($terms)
{
$this->terms = $terms;
}
/**
* @return GlossaryTerm[]
*/
public function getTerms()
{
return $this->terms;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GlossaryTermsSet::class, 'Google_Service_Translate_GlossaryTermsSet');

View File

@@ -0,0 +1,62 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class ImportAdaptiveMtFileRequest extends \Google\Model
{
protected $fileInputSourceType = FileInputSource::class;
protected $fileInputSourceDataType = '';
protected $gcsInputSourceType = GcsInputSource::class;
protected $gcsInputSourceDataType = '';
/**
* Inline file source.
*
* @param FileInputSource $fileInputSource
*/
public function setFileInputSource(FileInputSource $fileInputSource)
{
$this->fileInputSource = $fileInputSource;
}
/**
* @return FileInputSource
*/
public function getFileInputSource()
{
return $this->fileInputSource;
}
/**
* Google Cloud Storage file source.
*
* @param GcsInputSource $gcsInputSource
*/
public function setGcsInputSource(GcsInputSource $gcsInputSource)
{
$this->gcsInputSource = $gcsInputSource;
}
/**
* @return GcsInputSource
*/
public function getGcsInputSource()
{
return $this->gcsInputSource;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ImportAdaptiveMtFileRequest::class, 'Google_Service_Translate_ImportAdaptiveMtFileRequest');

View File

@@ -0,0 +1,44 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class ImportAdaptiveMtFileResponse extends \Google\Model
{
protected $adaptiveMtFileType = AdaptiveMtFile::class;
protected $adaptiveMtFileDataType = '';
/**
* Output only. The Adaptive MT file that was imported.
*
* @param AdaptiveMtFile $adaptiveMtFile
*/
public function setAdaptiveMtFile(AdaptiveMtFile $adaptiveMtFile)
{
$this->adaptiveMtFile = $adaptiveMtFile;
}
/**
* @return AdaptiveMtFile
*/
public function getAdaptiveMtFile()
{
return $this->adaptiveMtFile;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ImportAdaptiveMtFileResponse::class, 'Google_Service_Translate_ImportAdaptiveMtFileResponse');

View File

@@ -0,0 +1,44 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class ImportDataRequest extends \Google\Model
{
protected $inputConfigType = DatasetInputConfig::class;
protected $inputConfigDataType = '';
/**
* Required. The config for the input content.
*
* @param DatasetInputConfig $inputConfig
*/
public function setInputConfig(DatasetInputConfig $inputConfig)
{
$this->inputConfig = $inputConfig;
}
/**
* @return DatasetInputConfig
*/
public function getInputConfig()
{
return $this->inputConfig;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ImportDataRequest::class, 'Google_Service_Translate_ImportDataRequest');

View File

@@ -0,0 +1,82 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class InputConfig extends \Google\Model
{
protected $gcsSourceType = GcsSource::class;
protected $gcsSourceDataType = '';
/**
* Optional. Can be "text/plain" or "text/html". For `.tsv`, "text/html" is
* used if mime_type is missing. For `.html`, this field must be "text/html"
* or empty. For `.txt`, this field must be "text/plain" or empty.
*
* @var string
*/
public $mimeType;
/**
* Required. Google Cloud Storage location for the source input. This can be a
* single file (for example, `gs://translation-test/input.tsv`) or a wildcard
* (for example, `gs://translation-test`). If a file extension is `.tsv`, it
* can contain either one or two columns. The first column (optional) is the
* id of the text request. If the first column is missing, we use the row
* number (0-based) from the input file as the ID in the output file. The
* second column is the actual text to be translated. We recommend each row be
* <= 10K Unicode codepoints, otherwise an error might be returned. Note that
* the input tsv must be RFC 4180 compliant. You could use
* https://github.com/Clever/csvlint to check potential formatting errors in
* your tsv file. csvlint --delimiter='\t' your_input_file.tsv The other
* supported file extensions are `.txt` or `.html`, which is treated as a
* single large chunk of text.
*
* @param GcsSource $gcsSource
*/
public function setGcsSource(GcsSource $gcsSource)
{
$this->gcsSource = $gcsSource;
}
/**
* @return GcsSource
*/
public function getGcsSource()
{
return $this->gcsSource;
}
/**
* Optional. Can be "text/plain" or "text/html". For `.tsv`, "text/html" is
* used if mime_type is missing. For `.html`, this field must be "text/html"
* or empty. For `.txt`, this field must be "text/plain" or empty.
*
* @param string $mimeType
*/
public function setMimeType($mimeType)
{
$this->mimeType = $mimeType;
}
/**
* @return string
*/
public function getMimeType()
{
return $this->mimeType;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(InputConfig::class, 'Google_Service_Translate_InputConfig');

View File

@@ -0,0 +1,68 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class InputFile extends \Google\Model
{
protected $gcsSourceType = GcsInputSource::class;
protected $gcsSourceDataType = '';
/**
* Optional. Usage of the file contents. Options are TRAIN|VALIDATION|TEST, or
* UNASSIGNED (by default) for auto split.
*
* @var string
*/
public $usage;
/**
* Google Cloud Storage file source.
*
* @param GcsInputSource $gcsSource
*/
public function setGcsSource(GcsInputSource $gcsSource)
{
$this->gcsSource = $gcsSource;
}
/**
* @return GcsInputSource
*/
public function getGcsSource()
{
return $this->gcsSource;
}
/**
* Optional. Usage of the file contents. Options are TRAIN|VALIDATION|TEST, or
* UNASSIGNED (by default) for auto split.
*
* @param string $usage
*/
public function setUsage($usage)
{
$this->usage = $usage;
}
/**
* @return string
*/
public function getUsage()
{
return $this->usage;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(InputFile::class, 'Google_Service_Translate_InputFile');

View File

@@ -0,0 +1,74 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class LanguageCodePair extends \Google\Model
{
/**
* Required. The ISO-639 language code of the input text, for example, "en-
* US". Expected to be an exact match for GlossaryTerm.language_code.
*
* @var string
*/
public $sourceLanguageCode;
/**
* Required. The ISO-639 language code for translation output, for example,
* "zh-CN". Expected to be an exact match for GlossaryTerm.language_code.
*
* @var string
*/
public $targetLanguageCode;
/**
* Required. The ISO-639 language code of the input text, for example, "en-
* US". Expected to be an exact match for GlossaryTerm.language_code.
*
* @param string $sourceLanguageCode
*/
public function setSourceLanguageCode($sourceLanguageCode)
{
$this->sourceLanguageCode = $sourceLanguageCode;
}
/**
* @return string
*/
public function getSourceLanguageCode()
{
return $this->sourceLanguageCode;
}
/**
* Required. The ISO-639 language code for translation output, for example,
* "zh-CN". Expected to be an exact match for GlossaryTerm.language_code.
*
* @param string $targetLanguageCode
*/
public function setTargetLanguageCode($targetLanguageCode)
{
$this->targetLanguageCode = $targetLanguageCode;
}
/**
* @return string
*/
public function getTargetLanguageCode()
{
return $this->targetLanguageCode;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(LanguageCodePair::class, 'Google_Service_Translate_LanguageCodePair');

View File

@@ -0,0 +1,53 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class LanguageCodesSet extends \Google\Collection
{
protected $collection_key = 'languageCodes';
/**
* The ISO-639 language code(s) for terms defined in the glossary. All entries
* are unique. The list contains at least two entries. Expected to be an exact
* match for GlossaryTerm.language_code.
*
* @var string[]
*/
public $languageCodes;
/**
* The ISO-639 language code(s) for terms defined in the glossary. All entries
* are unique. The list contains at least two entries. Expected to be an exact
* match for GlossaryTerm.language_code.
*
* @param string[] $languageCodes
*/
public function setLanguageCodes($languageCodes)
{
$this->languageCodes = $languageCodes;
}
/**
* @return string[]
*/
public function getLanguageCodes()
{
return $this->languageCodes;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(LanguageCodesSet::class, 'Google_Service_Translate_LanguageCodesSet');

View File

@@ -0,0 +1,71 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class ListAdaptiveMtDatasetsResponse extends \Google\Collection
{
protected $collection_key = 'adaptiveMtDatasets';
protected $adaptiveMtDatasetsType = AdaptiveMtDataset::class;
protected $adaptiveMtDatasetsDataType = 'array';
/**
* Optional. A token to retrieve a page of results. Pass this value in the
* [ListAdaptiveMtDatasetsRequest.page_token] field in the subsequent call to
* `ListAdaptiveMtDatasets` method to retrieve the next page of results.
*
* @var string
*/
public $nextPageToken;
/**
* Output only. A list of Adaptive MT datasets.
*
* @param AdaptiveMtDataset[] $adaptiveMtDatasets
*/
public function setAdaptiveMtDatasets($adaptiveMtDatasets)
{
$this->adaptiveMtDatasets = $adaptiveMtDatasets;
}
/**
* @return AdaptiveMtDataset[]
*/
public function getAdaptiveMtDatasets()
{
return $this->adaptiveMtDatasets;
}
/**
* Optional. A token to retrieve a page of results. Pass this value in the
* [ListAdaptiveMtDatasetsRequest.page_token] field in the subsequent call to
* `ListAdaptiveMtDatasets` method to retrieve the next page of results.
*
* @param string $nextPageToken
*/
public function setNextPageToken($nextPageToken)
{
$this->nextPageToken = $nextPageToken;
}
/**
* @return string
*/
public function getNextPageToken()
{
return $this->nextPageToken;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ListAdaptiveMtDatasetsResponse::class, 'Google_Service_Translate_ListAdaptiveMtDatasetsResponse');

View File

@@ -0,0 +1,71 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class ListAdaptiveMtFilesResponse extends \Google\Collection
{
protected $collection_key = 'adaptiveMtFiles';
protected $adaptiveMtFilesType = AdaptiveMtFile::class;
protected $adaptiveMtFilesDataType = 'array';
/**
* Optional. A token to retrieve a page of results. Pass this value in the
* ListAdaptiveMtFilesRequest.page_token field in the subsequent call to
* `ListAdaptiveMtFiles` method to retrieve the next page of results.
*
* @var string
*/
public $nextPageToken;
/**
* Output only. The Adaptive MT files.
*
* @param AdaptiveMtFile[] $adaptiveMtFiles
*/
public function setAdaptiveMtFiles($adaptiveMtFiles)
{
$this->adaptiveMtFiles = $adaptiveMtFiles;
}
/**
* @return AdaptiveMtFile[]
*/
public function getAdaptiveMtFiles()
{
return $this->adaptiveMtFiles;
}
/**
* Optional. A token to retrieve a page of results. Pass this value in the
* ListAdaptiveMtFilesRequest.page_token field in the subsequent call to
* `ListAdaptiveMtFiles` method to retrieve the next page of results.
*
* @param string $nextPageToken
*/
public function setNextPageToken($nextPageToken)
{
$this->nextPageToken = $nextPageToken;
}
/**
* @return string
*/
public function getNextPageToken()
{
return $this->nextPageToken;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ListAdaptiveMtFilesResponse::class, 'Google_Service_Translate_ListAdaptiveMtFilesResponse');

View File

@@ -0,0 +1,67 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class ListAdaptiveMtSentencesResponse extends \Google\Collection
{
protected $collection_key = 'adaptiveMtSentences';
protected $adaptiveMtSentencesType = AdaptiveMtSentence::class;
protected $adaptiveMtSentencesDataType = 'array';
/**
* Optional.
*
* @var string
*/
public $nextPageToken;
/**
* Output only. The list of AdaptiveMtSentences.
*
* @param AdaptiveMtSentence[] $adaptiveMtSentences
*/
public function setAdaptiveMtSentences($adaptiveMtSentences)
{
$this->adaptiveMtSentences = $adaptiveMtSentences;
}
/**
* @return AdaptiveMtSentence[]
*/
public function getAdaptiveMtSentences()
{
return $this->adaptiveMtSentences;
}
/**
* Optional.
*
* @param string $nextPageToken
*/
public function setNextPageToken($nextPageToken)
{
$this->nextPageToken = $nextPageToken;
}
/**
* @return string
*/
public function getNextPageToken()
{
return $this->nextPageToken;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ListAdaptiveMtSentencesResponse::class, 'Google_Service_Translate_ListAdaptiveMtSentencesResponse');

View File

@@ -0,0 +1,69 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class ListDatasetsResponse extends \Google\Collection
{
protected $collection_key = 'datasets';
protected $datasetsType = Dataset::class;
protected $datasetsDataType = 'array';
/**
* A token to retrieve next page of results. Pass this token to the page_token
* field in the ListDatasetsRequest to obtain the corresponding page.
*
* @var string
*/
public $nextPageToken;
/**
* The datasets read.
*
* @param Dataset[] $datasets
*/
public function setDatasets($datasets)
{
$this->datasets = $datasets;
}
/**
* @return Dataset[]
*/
public function getDatasets()
{
return $this->datasets;
}
/**
* A token to retrieve next page of results. Pass this token to the page_token
* field in the ListDatasetsRequest to obtain the corresponding page.
*
* @param string $nextPageToken
*/
public function setNextPageToken($nextPageToken)
{
$this->nextPageToken = $nextPageToken;
}
/**
* @return string
*/
public function getNextPageToken()
{
return $this->nextPageToken;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ListDatasetsResponse::class, 'Google_Service_Translate_ListDatasetsResponse');

View File

@@ -0,0 +1,69 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class ListExamplesResponse extends \Google\Collection
{
protected $collection_key = 'examples';
protected $examplesType = Example::class;
protected $examplesDataType = 'array';
/**
* A token to retrieve next page of results. Pass this token to the page_token
* field in the ListExamplesRequest to obtain the corresponding page.
*
* @var string
*/
public $nextPageToken;
/**
* The sentence pairs.
*
* @param Example[] $examples
*/
public function setExamples($examples)
{
$this->examples = $examples;
}
/**
* @return Example[]
*/
public function getExamples()
{
return $this->examples;
}
/**
* A token to retrieve next page of results. Pass this token to the page_token
* field in the ListExamplesRequest to obtain the corresponding page.
*
* @param string $nextPageToken
*/
public function setNextPageToken($nextPageToken)
{
$this->nextPageToken = $nextPageToken;
}
/**
* @return string
*/
public function getNextPageToken()
{
return $this->nextPageToken;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ListExamplesResponse::class, 'Google_Service_Translate_ListExamplesResponse');

View File

@@ -0,0 +1,71 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class ListGlossariesResponse extends \Google\Collection
{
protected $collection_key = 'glossaries';
protected $glossariesType = Glossary::class;
protected $glossariesDataType = 'array';
/**
* A token to retrieve a page of results. Pass this value in the
* [ListGlossariesRequest.page_token] field in the subsequent call to
* `ListGlossaries` method to retrieve the next page of results.
*
* @var string
*/
public $nextPageToken;
/**
* The list of glossaries for a project.
*
* @param Glossary[] $glossaries
*/
public function setGlossaries($glossaries)
{
$this->glossaries = $glossaries;
}
/**
* @return Glossary[]
*/
public function getGlossaries()
{
return $this->glossaries;
}
/**
* A token to retrieve a page of results. Pass this value in the
* [ListGlossariesRequest.page_token] field in the subsequent call to
* `ListGlossaries` method to retrieve the next page of results.
*
* @param string $nextPageToken
*/
public function setNextPageToken($nextPageToken)
{
$this->nextPageToken = $nextPageToken;
}
/**
* @return string
*/
public function getNextPageToken()
{
return $this->nextPageToken;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ListGlossariesResponse::class, 'Google_Service_Translate_ListGlossariesResponse');

View File

@@ -0,0 +1,69 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class ListGlossaryEntriesResponse extends \Google\Collection
{
protected $collection_key = 'glossaryEntries';
protected $glossaryEntriesType = GlossaryEntry::class;
protected $glossaryEntriesDataType = 'array';
/**
* Optional. A token to retrieve a page of results. Pass this value in the
* [ListGLossaryEntriesRequest.page_token] field in the subsequent calls.
*
* @var string
*/
public $nextPageToken;
/**
* Optional. The Glossary Entries
*
* @param GlossaryEntry[] $glossaryEntries
*/
public function setGlossaryEntries($glossaryEntries)
{
$this->glossaryEntries = $glossaryEntries;
}
/**
* @return GlossaryEntry[]
*/
public function getGlossaryEntries()
{
return $this->glossaryEntries;
}
/**
* Optional. A token to retrieve a page of results. Pass this value in the
* [ListGLossaryEntriesRequest.page_token] field in the subsequent calls.
*
* @param string $nextPageToken
*/
public function setNextPageToken($nextPageToken)
{
$this->nextPageToken = $nextPageToken;
}
/**
* @return string
*/
public function getNextPageToken()
{
return $this->nextPageToken;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ListGlossaryEntriesResponse::class, 'Google_Service_Translate_ListGlossaryEntriesResponse');

View File

@@ -0,0 +1,67 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class ListLocationsResponse extends \Google\Collection
{
protected $collection_key = 'locations';
protected $locationsType = Location::class;
protected $locationsDataType = 'array';
/**
* The standard List next-page token.
*
* @var string
*/
public $nextPageToken;
/**
* A list of locations that matches the specified filter in the request.
*
* @param Location[] $locations
*/
public function setLocations($locations)
{
$this->locations = $locations;
}
/**
* @return Location[]
*/
public function getLocations()
{
return $this->locations;
}
/**
* The standard List next-page token.
*
* @param string $nextPageToken
*/
public function setNextPageToken($nextPageToken)
{
$this->nextPageToken = $nextPageToken;
}
/**
* @return string
*/
public function getNextPageToken()
{
return $this->nextPageToken;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ListLocationsResponse::class, 'Google_Service_Translate_ListLocationsResponse');

View File

@@ -0,0 +1,69 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class ListModelsResponse extends \Google\Collection
{
protected $collection_key = 'models';
protected $modelsType = Model::class;
protected $modelsDataType = 'array';
/**
* A token to retrieve next page of results. Pass this token to the page_token
* field in the ListModelsRequest to obtain the corresponding page.
*
* @var string
*/
public $nextPageToken;
/**
* The models read.
*
* @param Model[] $models
*/
public function setModels($models)
{
$this->models = $models;
}
/**
* @return Model[]
*/
public function getModels()
{
return $this->models;
}
/**
* A token to retrieve next page of results. Pass this token to the page_token
* field in the ListModelsRequest to obtain the corresponding page.
*
* @param string $nextPageToken
*/
public function setNextPageToken($nextPageToken)
{
$this->nextPageToken = $nextPageToken;
}
/**
* @return string
*/
public function getNextPageToken()
{
return $this->nextPageToken;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ListModelsResponse::class, 'Google_Service_Translate_ListModelsResponse');

View File

@@ -0,0 +1,67 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class ListOperationsResponse extends \Google\Collection
{
protected $collection_key = 'operations';
/**
* The standard List next-page token.
*
* @var string
*/
public $nextPageToken;
protected $operationsType = Operation::class;
protected $operationsDataType = 'array';
/**
* The standard List next-page token.
*
* @param string $nextPageToken
*/
public function setNextPageToken($nextPageToken)
{
$this->nextPageToken = $nextPageToken;
}
/**
* @return string
*/
public function getNextPageToken()
{
return $this->nextPageToken;
}
/**
* A list of operations that matches the specified filter in the request.
*
* @param Operation[] $operations
*/
public function setOperations($operations)
{
$this->operations = $operations;
}
/**
* @return Operation[]
*/
public function getOperations()
{
return $this->operations;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ListOperationsResponse::class, 'Google_Service_Translate_ListOperationsResponse');

View File

@@ -0,0 +1,144 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class Location extends \Google\Model
{
/**
* The friendly name for this location, typically a nearby city name. For
* example, "Tokyo".
*
* @var string
*/
public $displayName;
/**
* Cross-service attributes for the location. For example
* {"cloud.googleapis.com/region": "us-east1"}
*
* @var string[]
*/
public $labels;
/**
* The canonical id for this location. For example: `"us-east1"`.
*
* @var string
*/
public $locationId;
/**
* Service-specific metadata. For example the available capacity at the given
* location.
*
* @var array[]
*/
public $metadata;
/**
* Resource name for the location, which may vary between implementations. For
* example: `"projects/example-project/locations/us-east1"`
*
* @var string
*/
public $name;
/**
* The friendly name for this location, typically a nearby city name. For
* example, "Tokyo".
*
* @param string $displayName
*/
public function setDisplayName($displayName)
{
$this->displayName = $displayName;
}
/**
* @return string
*/
public function getDisplayName()
{
return $this->displayName;
}
/**
* Cross-service attributes for the location. For example
* {"cloud.googleapis.com/region": "us-east1"}
*
* @param string[] $labels
*/
public function setLabels($labels)
{
$this->labels = $labels;
}
/**
* @return string[]
*/
public function getLabels()
{
return $this->labels;
}
/**
* The canonical id for this location. For example: `"us-east1"`.
*
* @param string $locationId
*/
public function setLocationId($locationId)
{
$this->locationId = $locationId;
}
/**
* @return string
*/
public function getLocationId()
{
return $this->locationId;
}
/**
* Service-specific metadata. For example the available capacity at the given
* location.
*
* @param array[] $metadata
*/
public function setMetadata($metadata)
{
$this->metadata = $metadata;
}
/**
* @return array[]
*/
public function getMetadata()
{
return $this->metadata;
}
/**
* Resource name for the location, which may vary between implementations. For
* example: `"projects/example-project/locations/us-east1"`
*
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Location::class, 'Google_Service_Translate_Location');

View File

@@ -0,0 +1,258 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class Model extends \Google\Model
{
/**
* Output only. Timestamp when the model resource was created, which is also
* when the training started.
*
* @var string
*/
public $createTime;
/**
* The dataset from which the model is trained, in form of `projects/{project-
* number-or-id}/locations/{location_id}/datasets/{dataset_id}`
*
* @var string
*/
public $dataset;
/**
* The name of the model to show in the interface. The name can be up to 32
* characters long and can consist only of ASCII Latin letters A-Z and a-z,
* underscores (_), and ASCII digits 0-9.
*
* @var string
*/
public $displayName;
/**
* The resource name of the model, in form of `projects/{project-number-or-
* id}/locations/{location_id}/models/{model_id}`
*
* @var string
*/
public $name;
/**
* Output only. The BCP-47 language code of the source language.
*
* @var string
*/
public $sourceLanguageCode;
/**
* Output only. The BCP-47 language code of the target language.
*
* @var string
*/
public $targetLanguageCode;
/**
* Output only. Number of examples (sentence pairs) used to test the model.
*
* @var int
*/
public $testExampleCount;
/**
* Output only. Number of examples (sentence pairs) used to train the model.
*
* @var int
*/
public $trainExampleCount;
/**
* Output only. Timestamp when this model was last updated.
*
* @var string
*/
public $updateTime;
/**
* Output only. Number of examples (sentence pairs) used to validate the
* model.
*
* @var int
*/
public $validateExampleCount;
/**
* Output only. Timestamp when the model resource was created, which is also
* when the training started.
*
* @param string $createTime
*/
public function setCreateTime($createTime)
{
$this->createTime = $createTime;
}
/**
* @return string
*/
public function getCreateTime()
{
return $this->createTime;
}
/**
* The dataset from which the model is trained, in form of `projects/{project-
* number-or-id}/locations/{location_id}/datasets/{dataset_id}`
*
* @param string $dataset
*/
public function setDataset($dataset)
{
$this->dataset = $dataset;
}
/**
* @return string
*/
public function getDataset()
{
return $this->dataset;
}
/**
* The name of the model to show in the interface. The name can be up to 32
* characters long and can consist only of ASCII Latin letters A-Z and a-z,
* underscores (_), and ASCII digits 0-9.
*
* @param string $displayName
*/
public function setDisplayName($displayName)
{
$this->displayName = $displayName;
}
/**
* @return string
*/
public function getDisplayName()
{
return $this->displayName;
}
/**
* The resource name of the model, in form of `projects/{project-number-or-
* id}/locations/{location_id}/models/{model_id}`
*
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Output only. The BCP-47 language code of the source language.
*
* @param string $sourceLanguageCode
*/
public function setSourceLanguageCode($sourceLanguageCode)
{
$this->sourceLanguageCode = $sourceLanguageCode;
}
/**
* @return string
*/
public function getSourceLanguageCode()
{
return $this->sourceLanguageCode;
}
/**
* Output only. The BCP-47 language code of the target language.
*
* @param string $targetLanguageCode
*/
public function setTargetLanguageCode($targetLanguageCode)
{
$this->targetLanguageCode = $targetLanguageCode;
}
/**
* @return string
*/
public function getTargetLanguageCode()
{
return $this->targetLanguageCode;
}
/**
* Output only. Number of examples (sentence pairs) used to test the model.
*
* @param int $testExampleCount
*/
public function setTestExampleCount($testExampleCount)
{
$this->testExampleCount = $testExampleCount;
}
/**
* @return int
*/
public function getTestExampleCount()
{
return $this->testExampleCount;
}
/**
* Output only. Number of examples (sentence pairs) used to train the model.
*
* @param int $trainExampleCount
*/
public function setTrainExampleCount($trainExampleCount)
{
$this->trainExampleCount = $trainExampleCount;
}
/**
* @return int
*/
public function getTrainExampleCount()
{
return $this->trainExampleCount;
}
/**
* Output only. Timestamp when this model was last updated.
*
* @param string $updateTime
*/
public function setUpdateTime($updateTime)
{
$this->updateTime = $updateTime;
}
/**
* @return string
*/
public function getUpdateTime()
{
return $this->updateTime;
}
/**
* Output only. Number of examples (sentence pairs) used to validate the
* model.
*
* @param int $validateExampleCount
*/
public function setValidateExampleCount($validateExampleCount)
{
$this->validateExampleCount = $validateExampleCount;
}
/**
* @return int
*/
public function getValidateExampleCount()
{
return $this->validateExampleCount;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Model::class, 'Google_Service_Translate_Model');

View File

@@ -0,0 +1,158 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class Operation extends \Google\Model
{
/**
* If the value is `false`, it means the operation is still in progress. If
* `true`, the operation is completed, and either `error` or `response` is
* available.
*
* @var bool
*/
public $done;
protected $errorType = Status::class;
protected $errorDataType = '';
/**
* Service-specific metadata associated with the operation. It typically
* contains progress information and common metadata such as create time. Some
* services might not provide such metadata. Any method that returns a long-
* running operation should document the metadata type, if any.
*
* @var array[]
*/
public $metadata;
/**
* The server-assigned name, which is only unique within the same service that
* originally returns it. If you use the default HTTP mapping, the `name`
* should be a resource name ending with `operations/{unique_id}`.
*
* @var string
*/
public $name;
/**
* The normal, successful response of the operation. If the original method
* returns no data on success, such as `Delete`, the response is
* `google.protobuf.Empty`. If the original method is standard
* `Get`/`Create`/`Update`, the response should be the resource. For other
* methods, the response should have the type `XxxResponse`, where `Xxx` is
* the original method name. For example, if the original method name is
* `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
*
* @var array[]
*/
public $response;
/**
* If the value is `false`, it means the operation is still in progress. If
* `true`, the operation is completed, and either `error` or `response` is
* available.
*
* @param bool $done
*/
public function setDone($done)
{
$this->done = $done;
}
/**
* @return bool
*/
public function getDone()
{
return $this->done;
}
/**
* The error result of the operation in case of failure or cancellation.
*
* @param Status $error
*/
public function setError(Status $error)
{
$this->error = $error;
}
/**
* @return Status
*/
public function getError()
{
return $this->error;
}
/**
* Service-specific metadata associated with the operation. It typically
* contains progress information and common metadata such as create time. Some
* services might not provide such metadata. Any method that returns a long-
* running operation should document the metadata type, if any.
*
* @param array[] $metadata
*/
public function setMetadata($metadata)
{
$this->metadata = $metadata;
}
/**
* @return array[]
*/
public function getMetadata()
{
return $this->metadata;
}
/**
* The server-assigned name, which is only unique within the same service that
* originally returns it. If you use the default HTTP mapping, the `name`
* should be a resource name ending with `operations/{unique_id}`.
*
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* The normal, successful response of the operation. If the original method
* returns no data on success, such as `Delete`, the response is
* `google.protobuf.Empty`. If the original method is standard
* `Get`/`Create`/`Update`, the response should be the resource. For other
* methods, the response should have the type `XxxResponse`, where `Xxx` is
* the original method name. For example, if the original method name is
* `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
*
* @param array[] $response
*/
public function setResponse($response)
{
$this->response = $response;
}
/**
* @return array[]
*/
public function getResponse()
{
return $this->response;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Operation::class, 'Google_Service_Translate_Operation');

View File

@@ -0,0 +1,90 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class OutputConfig extends \Google\Model
{
protected $gcsDestinationType = GcsDestination::class;
protected $gcsDestinationDataType = '';
/**
* Google Cloud Storage destination for output content. For every single input
* file (for example, gs://a/b/c.[extension]), we generate at most 2 * n
* output files. (n is the # of target_language_codes in the
* BatchTranslateTextRequest). Output files (tsv) generated are compliant with
* RFC 4180 except that record delimiters are '\n' instead of '\r\n'. We don't
* provide any way to change record delimiters. While the input files are
* being processed, we write/update an index file 'index.csv' under
* 'output_uri_prefix' (for example, gs://translation-test/index.csv) The
* index file is generated/updated as new files are being translated. The
* format is: input_file,target_language_code,translations_file,errors_file,
* glossary_translations_file,glossary_errors_file input_file is one file we
* matched using gcs_source.input_uri. target_language_code is provided in the
* request. translations_file contains the translations. (details provided
* below) errors_file contains the errors during processing of the file.
* (details below). Both translations_file and errors_file could be empty
* strings if we have no content to output. glossary_translations_file and
* glossary_errors_file are always empty strings if the input_file is tsv.
* They could also be empty if we have no content to output. Once a row is
* present in index.csv, the input/output matching never changes. Callers
* should also expect all the content in input_file are processed and ready to
* be consumed (that is, no partial output file is written). Since index.csv
* will be keeping updated during the process, please make sure there is no
* custom retention policy applied on the output bucket that may avoid file
* updating. (https://cloud.google.com/storage/docs/bucket-lock#retention-
* policy) The format of translations_file (for target language code 'trg')
* is: `gs://translation_test/a_b_c_'trg'_translations.[extension]` If the
* input file extension is tsv, the output has the following columns: Column
* 1: ID of the request provided in the input, if it's not provided in the
* input, then the input row number is used (0-based). Column 2: source
* sentence. Column 3: translation without applying a glossary. Empty string
* if there is an error. Column 4 (only present if a glossary is provided in
* the request): translation after applying the glossary. Empty string if
* there is an error applying the glossary. Could be same string as column 3
* if there is no glossary applied. If input file extension is a txt or html,
* the translation is directly written to the output file. If glossary is
* requested, a separate glossary_translations_file has format of
* `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` The
* format of errors file (for target language code 'trg') is:
* `gs://translation_test/a_b_c_'trg'_errors.[extension]` If the input file
* extension is tsv, errors_file contains the following: Column 1: ID of the
* request provided in the input, if it's not provided in the input, then the
* input row number is used (0-based). Column 2: source sentence. Column 3:
* Error detail for the translation. Could be empty. Column 4 (only present if
* a glossary is provided in the request): Error when applying the glossary.
* If the input file extension is txt or html, glossary_error_file will be
* generated that contains error details. glossary_error_file has format of
* `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]`
*
* @param GcsDestination $gcsDestination
*/
public function setGcsDestination(GcsDestination $gcsDestination)
{
$this->gcsDestination = $gcsDestination;
}
/**
* @return GcsDestination
*/
public function getGcsDestination()
{
return $this->gcsDestination;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(OutputConfig::class, 'Google_Service_Translate_OutputConfig');

View File

@@ -0,0 +1,92 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class ReferenceSentenceConfig extends \Google\Collection
{
protected $collection_key = 'referenceSentencePairLists';
protected $referenceSentencePairListsType = ReferenceSentencePairList::class;
protected $referenceSentencePairListsDataType = 'array';
/**
* Source language code.
*
* @var string
*/
public $sourceLanguageCode;
/**
* Target language code.
*
* @var string
*/
public $targetLanguageCode;
/**
* Reference sentences pair lists. Each list will be used as the references to
* translate the sentence under "content" field at the corresponding index.
* Length of the list is required to be equal to the length of "content"
* field.
*
* @param ReferenceSentencePairList[] $referenceSentencePairLists
*/
public function setReferenceSentencePairLists($referenceSentencePairLists)
{
$this->referenceSentencePairLists = $referenceSentencePairLists;
}
/**
* @return ReferenceSentencePairList[]
*/
public function getReferenceSentencePairLists()
{
return $this->referenceSentencePairLists;
}
/**
* Source language code.
*
* @param string $sourceLanguageCode
*/
public function setSourceLanguageCode($sourceLanguageCode)
{
$this->sourceLanguageCode = $sourceLanguageCode;
}
/**
* @return string
*/
public function getSourceLanguageCode()
{
return $this->sourceLanguageCode;
}
/**
* Target language code.
*
* @param string $targetLanguageCode
*/
public function setTargetLanguageCode($targetLanguageCode)
{
$this->targetLanguageCode = $targetLanguageCode;
}
/**
* @return string
*/
public function getTargetLanguageCode()
{
return $this->targetLanguageCode;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ReferenceSentenceConfig::class, 'Google_Service_Translate_ReferenceSentenceConfig');

View File

@@ -0,0 +1,70 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class ReferenceSentencePair extends \Google\Model
{
/**
* Source sentence in the sentence pair.
*
* @var string
*/
public $sourceSentence;
/**
* Target sentence in the sentence pair.
*
* @var string
*/
public $targetSentence;
/**
* Source sentence in the sentence pair.
*
* @param string $sourceSentence
*/
public function setSourceSentence($sourceSentence)
{
$this->sourceSentence = $sourceSentence;
}
/**
* @return string
*/
public function getSourceSentence()
{
return $this->sourceSentence;
}
/**
* Target sentence in the sentence pair.
*
* @param string $targetSentence
*/
public function setTargetSentence($targetSentence)
{
$this->targetSentence = $targetSentence;
}
/**
* @return string
*/
public function getTargetSentence()
{
return $this->targetSentence;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ReferenceSentencePair::class, 'Google_Service_Translate_ReferenceSentencePair');

View File

@@ -0,0 +1,45 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class ReferenceSentencePairList extends \Google\Collection
{
protected $collection_key = 'referenceSentencePairs';
protected $referenceSentencePairsType = ReferenceSentencePair::class;
protected $referenceSentencePairsDataType = 'array';
/**
* Reference sentence pairs.
*
* @param ReferenceSentencePair[] $referenceSentencePairs
*/
public function setReferenceSentencePairs($referenceSentencePairs)
{
$this->referenceSentencePairs = $referenceSentencePairs;
}
/**
* @return ReferenceSentencePair[]
*/
public function getReferenceSentencePairs()
{
return $this->referenceSentencePairs;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ReferenceSentencePairList::class, 'Google_Service_Translate_ReferenceSentencePairList');

View File

@@ -0,0 +1,136 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate\Resource;
use Google\Service\Translate\DetectLanguageRequest;
use Google\Service\Translate\DetectLanguageResponse;
use Google\Service\Translate\RomanizeTextRequest;
use Google\Service\Translate\RomanizeTextResponse;
use Google\Service\Translate\SupportedLanguages;
use Google\Service\Translate\TranslateTextRequest;
use Google\Service\Translate\TranslateTextResponse;
/**
* The "projects" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google\Service\Translate(...);
* $projects = $translateService->projects;
* </code>
*/
class Projects extends \Google\Service\Resource
{
/**
* Detects the language of text within a request. (projects.detectLanguage)
*
* @param string $parent Required. Project or location to make a call. Must
* refer to a caller's project. Format: `projects/{project-number-or-
* id}/locations/{location-id}` or `projects/{project-number-or-id}`. For global
* calls, use `projects/{project-number-or-id}/locations/global` or
* `projects/{project-number-or-id}`. Only models within the same region (has
* same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is
* returned.
* @param DetectLanguageRequest $postBody
* @param array $optParams Optional parameters.
* @return DetectLanguageResponse
* @throws \Google\Service\Exception
*/
public function detectLanguage($parent, DetectLanguageRequest $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('detectLanguage', [$params], DetectLanguageResponse::class);
}
/**
* Returns a list of supported languages for translation.
* (projects.getSupportedLanguages)
*
* @param string $parent Required. Project or location to make a call. Must
* refer to a caller's project. Format: `projects/{project-number-or-id}` or
* `projects/{project-number-or-id}/locations/{location-id}`. For global calls,
* use `projects/{project-number-or-id}/locations/global` or `projects/{project-
* number-or-id}`. Non-global location is required for AutoML models. Only
* models within the same region (have same location-id) can be used, otherwise
* an INVALID_ARGUMENT (400) error is returned.
* @param array $optParams Optional parameters.
*
* @opt_param string displayLanguageCode Optional. The language to use to return
* localized, human readable names of supported languages. If missing, then
* display names are not returned in a response.
* @opt_param string model Optional. Get supported languages of this model. The
* format depends on model type: - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` -
* General (built-in) models: `projects/{project-number-or-
* id}/locations/{location-id}/models/general/nmt`, Returns languages supported
* by the specified model. If missing, we get supported languages of Google
* general NMT model.
* @return SupportedLanguages
* @throws \Google\Service\Exception
*/
public function getSupportedLanguages($parent, $optParams = [])
{
$params = ['parent' => $parent];
$params = array_merge($params, $optParams);
return $this->call('getSupportedLanguages', [$params], SupportedLanguages::class);
}
/**
* Romanize input text written in non-Latin scripts to Latin text.
* (projects.romanizeText)
*
* @param string $parent Required. Project or location to make a call. Must
* refer to a caller's project. Format: `projects/{project-number-or-
* id}/locations/{location-id}` or `projects/{project-number-or-id}`. For global
* calls, use `projects/{project-number-or-id}/locations/global` or
* `projects/{project-number-or-id}`.
* @param RomanizeTextRequest $postBody
* @param array $optParams Optional parameters.
* @return RomanizeTextResponse
* @throws \Google\Service\Exception
*/
public function romanizeText($parent, RomanizeTextRequest $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('romanizeText', [$params], RomanizeTextResponse::class);
}
/**
* Translates input text and returns translated text. (projects.translateText)
*
* @param string $parent Required. Project or location to make a call. Must
* refer to a caller's project. Format: `projects/{project-number-or-id}` or
* `projects/{project-number-or-id}/locations/{location-id}`. For global calls,
* use `projects/{project-number-or-id}/locations/global` or `projects/{project-
* number-or-id}`. Non-global location is required for requests using AutoML
* models or custom glossaries. Models and glossaries must be within the same
* region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is
* returned.
* @param TranslateTextRequest $postBody
* @param array $optParams Optional parameters.
* @return TranslateTextResponse
* @throws \Google\Service\Exception
*/
public function translateText($parent, TranslateTextRequest $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('translateText', [$params], TranslateTextResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Projects::class, 'Google_Service_Translate_Resource_Projects');

View File

@@ -0,0 +1,272 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate\Resource;
use Google\Service\Translate\AdaptiveMtTranslateRequest;
use Google\Service\Translate\AdaptiveMtTranslateResponse;
use Google\Service\Translate\BatchTranslateDocumentRequest;
use Google\Service\Translate\BatchTranslateTextRequest;
use Google\Service\Translate\DetectLanguageRequest;
use Google\Service\Translate\DetectLanguageResponse;
use Google\Service\Translate\ListLocationsResponse;
use Google\Service\Translate\Location;
use Google\Service\Translate\Operation;
use Google\Service\Translate\RomanizeTextRequest;
use Google\Service\Translate\RomanizeTextResponse;
use Google\Service\Translate\SupportedLanguages;
use Google\Service\Translate\TranslateDocumentRequest;
use Google\Service\Translate\TranslateDocumentResponse;
use Google\Service\Translate\TranslateTextRequest;
use Google\Service\Translate\TranslateTextResponse;
/**
* The "locations" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google\Service\Translate(...);
* $locations = $translateService->projects_locations;
* </code>
*/
class ProjectsLocations extends \Google\Service\Resource
{
/**
* Translate text using Adaptive MT. (locations.adaptiveMtTranslate)
*
* @param string $parent Required. Location to make a regional call. Format:
* `projects/{project-number-or-id}/locations/{location-id}`.
* @param AdaptiveMtTranslateRequest $postBody
* @param array $optParams Optional parameters.
* @return AdaptiveMtTranslateResponse
* @throws \Google\Service\Exception
*/
public function adaptiveMtTranslate($parent, AdaptiveMtTranslateRequest $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('adaptiveMtTranslate', [$params], AdaptiveMtTranslateResponse::class);
}
/**
* Translates a large volume of document in asynchronous batch mode. This
* function provides real-time output as the inputs are being processed. If
* caller cancels a request, the partial results (for an input file, it's all or
* nothing) may still be available on the specified output location. This call
* returns immediately and you can use google.longrunning.Operation.name to poll
* the status of the call. (locations.batchTranslateDocument)
*
* @param string $parent Required. Location to make a regional call. Format:
* `projects/{project-number-or-id}/locations/{location-id}`. The `global`
* location is not supported for batch translation. Only AutoML Translation
* models or glossaries within the same region (have the same location-id) can
* be used, otherwise an INVALID_ARGUMENT (400) error is returned.
* @param BatchTranslateDocumentRequest $postBody
* @param array $optParams Optional parameters.
* @return Operation
* @throws \Google\Service\Exception
*/
public function batchTranslateDocument($parent, BatchTranslateDocumentRequest $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('batchTranslateDocument', [$params], Operation::class);
}
/**
* Translates a large volume of text in asynchronous batch mode. This function
* provides real-time output as the inputs are being processed. If caller
* cancels a request, the partial results (for an input file, it's all or
* nothing) may still be available on the specified output location. This call
* returns immediately and you can use google.longrunning.Operation.name to poll
* the status of the call. (locations.batchTranslateText)
*
* @param string $parent Required. Location to make a call. Must refer to a
* caller's project. Format: `projects/{project-number-or-
* id}/locations/{location-id}`. The `global` location is not supported for
* batch translation. Only AutoML Translation models or glossaries within the
* same region (have the same location-id) can be used, otherwise an
* INVALID_ARGUMENT (400) error is returned.
* @param BatchTranslateTextRequest $postBody
* @param array $optParams Optional parameters.
* @return Operation
* @throws \Google\Service\Exception
*/
public function batchTranslateText($parent, BatchTranslateTextRequest $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('batchTranslateText', [$params], Operation::class);
}
/**
* Detects the language of text within a request. (locations.detectLanguage)
*
* @param string $parent Required. Project or location to make a call. Must
* refer to a caller's project. Format: `projects/{project-number-or-
* id}/locations/{location-id}` or `projects/{project-number-or-id}`. For global
* calls, use `projects/{project-number-or-id}/locations/global` or
* `projects/{project-number-or-id}`. Only models within the same region (has
* same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is
* returned.
* @param DetectLanguageRequest $postBody
* @param array $optParams Optional parameters.
* @return DetectLanguageResponse
* @throws \Google\Service\Exception
*/
public function detectLanguage($parent, DetectLanguageRequest $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('detectLanguage', [$params], DetectLanguageResponse::class);
}
/**
* Gets information about a location. (locations.get)
*
* @param string $name Resource name for the location.
* @param array $optParams Optional parameters.
* @return Location
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], Location::class);
}
/**
* Returns a list of supported languages for translation.
* (locations.getSupportedLanguages)
*
* @param string $parent Required. Project or location to make a call. Must
* refer to a caller's project. Format: `projects/{project-number-or-id}` or
* `projects/{project-number-or-id}/locations/{location-id}`. For global calls,
* use `projects/{project-number-or-id}/locations/global` or `projects/{project-
* number-or-id}`. Non-global location is required for AutoML models. Only
* models within the same region (have same location-id) can be used, otherwise
* an INVALID_ARGUMENT (400) error is returned.
* @param array $optParams Optional parameters.
*
* @opt_param string displayLanguageCode Optional. The language to use to return
* localized, human readable names of supported languages. If missing, then
* display names are not returned in a response.
* @opt_param string model Optional. Get supported languages of this model. The
* format depends on model type: - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` -
* General (built-in) models: `projects/{project-number-or-
* id}/locations/{location-id}/models/general/nmt`, Returns languages supported
* by the specified model. If missing, we get supported languages of Google
* general NMT model.
* @return SupportedLanguages
* @throws \Google\Service\Exception
*/
public function getSupportedLanguages($parent, $optParams = [])
{
$params = ['parent' => $parent];
$params = array_merge($params, $optParams);
return $this->call('getSupportedLanguages', [$params], SupportedLanguages::class);
}
/**
* Lists information about the supported locations for this service.
* (locations.listProjectsLocations)
*
* @param string $name The resource that owns the locations collection, if
* applicable.
* @param array $optParams Optional parameters.
*
* @opt_param string extraLocationTypes Optional. A list of extra location types
* that should be used as conditions for controlling the visibility of the
* locations.
* @opt_param string filter A filter to narrow down results to a preferred
* subset. The filtering language accepts strings like `"displayName=tokyo"`,
* and is documented in more detail in [AIP-160](https://google.aip.dev/160).
* @opt_param int pageSize The maximum number of results to return. If not set,
* the service selects a default.
* @opt_param string pageToken A page token received from the `next_page_token`
* field in the response. Send that page token to receive the subsequent page.
* @return ListLocationsResponse
* @throws \Google\Service\Exception
*/
public function listProjectsLocations($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListLocationsResponse::class);
}
/**
* Romanize input text written in non-Latin scripts to Latin text.
* (locations.romanizeText)
*
* @param string $parent Required. Project or location to make a call. Must
* refer to a caller's project. Format: `projects/{project-number-or-
* id}/locations/{location-id}` or `projects/{project-number-or-id}`. For global
* calls, use `projects/{project-number-or-id}/locations/global` or
* `projects/{project-number-or-id}`.
* @param RomanizeTextRequest $postBody
* @param array $optParams Optional parameters.
* @return RomanizeTextResponse
* @throws \Google\Service\Exception
*/
public function romanizeText($parent, RomanizeTextRequest $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('romanizeText', [$params], RomanizeTextResponse::class);
}
/**
* Translates documents in synchronous mode. (locations.translateDocument)
*
* @param string $parent Required. Location to make a regional call. Format:
* `projects/{project-number-or-id}/locations/{location-id}`. For global calls,
* use `projects/{project-number-or-id}/locations/global` or `projects/{project-
* number-or-id}`. Non-global location is required for requests using AutoML
* models or custom glossaries. Models and glossaries must be within the same
* region (have the same location-id), otherwise an INVALID_ARGUMENT (400) error
* is returned.
* @param TranslateDocumentRequest $postBody
* @param array $optParams Optional parameters.
* @return TranslateDocumentResponse
* @throws \Google\Service\Exception
*/
public function translateDocument($parent, TranslateDocumentRequest $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('translateDocument', [$params], TranslateDocumentResponse::class);
}
/**
* Translates input text and returns translated text. (locations.translateText)
*
* @param string $parent Required. Project or location to make a call. Must
* refer to a caller's project. Format: `projects/{project-number-or-id}` or
* `projects/{project-number-or-id}/locations/{location-id}`. For global calls,
* use `projects/{project-number-or-id}/locations/global` or `projects/{project-
* number-or-id}`. Non-global location is required for requests using AutoML
* models or custom glossaries. Models and glossaries must be within the same
* region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is
* returned.
* @param TranslateTextRequest $postBody
* @param array $optParams Optional parameters.
* @return TranslateTextResponse
* @throws \Google\Service\Exception
*/
public function translateText($parent, TranslateTextRequest $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('translateText', [$params], TranslateTextResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsLocations::class, 'Google_Service_Translate_Resource_ProjectsLocations');

View File

@@ -0,0 +1,134 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate\Resource;
use Google\Service\Translate\AdaptiveMtDataset;
use Google\Service\Translate\ImportAdaptiveMtFileRequest;
use Google\Service\Translate\ImportAdaptiveMtFileResponse;
use Google\Service\Translate\ListAdaptiveMtDatasetsResponse;
use Google\Service\Translate\TranslateEmpty;
/**
* The "adaptiveMtDatasets" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google\Service\Translate(...);
* $adaptiveMtDatasets = $translateService->projects_locations_adaptiveMtDatasets;
* </code>
*/
class ProjectsLocationsAdaptiveMtDatasets extends \Google\Service\Resource
{
/**
* Creates an Adaptive MT dataset. (adaptiveMtDatasets.create)
*
* @param string $parent Required. Name of the parent project. In form of
* `projects/{project-number-or-id}/locations/{location-id}`
* @param AdaptiveMtDataset $postBody
* @param array $optParams Optional parameters.
* @return AdaptiveMtDataset
* @throws \Google\Service\Exception
*/
public function create($parent, AdaptiveMtDataset $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('create', [$params], AdaptiveMtDataset::class);
}
/**
* Deletes an Adaptive MT dataset, including all its entries and associated
* metadata. (adaptiveMtDatasets.delete)
*
* @param string $name Required. Name of the dataset. In the form of
* `projects/{project-number-or-id}/locations/{location-
* id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}`
* @param array $optParams Optional parameters.
* @return TranslateEmpty
* @throws \Google\Service\Exception
*/
public function delete($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params], TranslateEmpty::class);
}
/**
* Gets the Adaptive MT dataset. (adaptiveMtDatasets.get)
*
* @param string $name Required. Name of the dataset. In the form of
* `projects/{project-number-or-id}/locations/{location-
* id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}`
* @param array $optParams Optional parameters.
* @return AdaptiveMtDataset
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], AdaptiveMtDataset::class);
}
/**
* Imports an AdaptiveMtFile and adds all of its sentences into the
* AdaptiveMtDataset. (adaptiveMtDatasets.importAdaptiveMtFile)
*
* @param string $parent Required. The resource name of the file, in form of
* `projects/{project-number-or-
* id}/locations/{location_id}/adaptiveMtDatasets/{dataset}`
* @param ImportAdaptiveMtFileRequest $postBody
* @param array $optParams Optional parameters.
* @return ImportAdaptiveMtFileResponse
* @throws \Google\Service\Exception
*/
public function importAdaptiveMtFile($parent, ImportAdaptiveMtFileRequest $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('importAdaptiveMtFile', [$params], ImportAdaptiveMtFileResponse::class);
}
/**
* Lists all Adaptive MT datasets for which the caller has read permission.
* (adaptiveMtDatasets.listProjectsLocationsAdaptiveMtDatasets)
*
* @param string $parent Required. The resource name of the project from which
* to list the Adaptive MT datasets. `projects/{project-number-or-
* id}/locations/{location-id}`
* @param array $optParams Optional parameters.
*
* @opt_param string filter Optional. An expression for filtering the results of
* the request. Filter is not supported yet.
* @opt_param int pageSize Optional. Requested page size. The server may return
* fewer results than requested. If unspecified, the server picks an appropriate
* default.
* @opt_param string pageToken Optional. A token identifying a page of results
* the server should return. Typically, this is the value of
* ListAdaptiveMtDatasetsResponse.next_page_token returned from the previous
* call to `ListAdaptiveMtDatasets` method. The first page is returned if
* `page_token`is empty or missing.
* @return ListAdaptiveMtDatasetsResponse
* @throws \Google\Service\Exception
*/
public function listProjectsLocationsAdaptiveMtDatasets($parent, $optParams = [])
{
$params = ['parent' => $parent];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListAdaptiveMtDatasetsResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsLocationsAdaptiveMtDatasets::class, 'Google_Service_Translate_Resource_ProjectsLocationsAdaptiveMtDatasets');

View File

@@ -0,0 +1,93 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate\Resource;
use Google\Service\Translate\AdaptiveMtFile;
use Google\Service\Translate\ListAdaptiveMtFilesResponse;
use Google\Service\Translate\TranslateEmpty;
/**
* The "adaptiveMtFiles" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google\Service\Translate(...);
* $adaptiveMtFiles = $translateService->projects_locations_adaptiveMtDatasets_adaptiveMtFiles;
* </code>
*/
class ProjectsLocationsAdaptiveMtDatasetsAdaptiveMtFiles extends \Google\Service\Resource
{
/**
* Deletes an AdaptiveMtFile along with its sentences. (adaptiveMtFiles.delete)
*
* @param string $name Required. The resource name of the file to delete, in
* form of `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDa
* tasets/{dataset}/adaptiveMtFiles/{file}`
* @param array $optParams Optional parameters.
* @return TranslateEmpty
* @throws \Google\Service\Exception
*/
public function delete($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params], TranslateEmpty::class);
}
/**
* Gets and AdaptiveMtFile (adaptiveMtFiles.get)
*
* @param string $name Required. The resource name of the file, in form of
* `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{
* dataset}/adaptiveMtFiles/{file}`
* @param array $optParams Optional parameters.
* @return AdaptiveMtFile
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], AdaptiveMtFile::class);
}
/**
* Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset.
* (adaptiveMtFiles.listProjectsLocationsAdaptiveMtDatasetsAdaptiveMtFiles)
*
* @param string $parent Required. The resource name of the project from which
* to list the Adaptive MT files.
* `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}`
* @param array $optParams Optional parameters.
*
* @opt_param int pageSize Optional.
* @opt_param string pageToken Optional. A token identifying a page of results
* the server should return. Typically, this is the value of
* ListAdaptiveMtFilesResponse.next_page_token returned from the previous call
* to `ListAdaptiveMtFiles` method. The first page is returned if `page_token`is
* empty or missing.
* @return ListAdaptiveMtFilesResponse
* @throws \Google\Service\Exception
*/
public function listProjectsLocationsAdaptiveMtDatasetsAdaptiveMtFiles($parent, $optParams = [])
{
$params = ['parent' => $parent];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListAdaptiveMtFilesResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsLocationsAdaptiveMtDatasetsAdaptiveMtFiles::class, 'Google_Service_Translate_Resource_ProjectsLocationsAdaptiveMtDatasetsAdaptiveMtFiles');

View File

@@ -0,0 +1,62 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate\Resource;
use Google\Service\Translate\ListAdaptiveMtSentencesResponse;
/**
* The "adaptiveMtSentences" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google\Service\Translate(...);
* $adaptiveMtSentences = $translateService->projects_locations_adaptiveMtDatasets_adaptiveMtFiles_adaptiveMtSentences;
* </code>
*/
class ProjectsLocationsAdaptiveMtDatasetsAdaptiveMtFilesAdaptiveMtSentences extends \Google\Service\Resource
{
/**
* Lists all AdaptiveMtSentences under a given file/dataset. (adaptiveMtSentence
* s.listProjectsLocationsAdaptiveMtDatasetsAdaptiveMtFilesAdaptiveMtSentences)
*
* @param string $parent Required. The resource name of the project from which
* to list the Adaptive MT files. The following format lists all sentences under
* a file. `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}
* /adaptiveMtFiles/{file}` The following format lists all sentences within a
* dataset.
* `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}`
* @param array $optParams Optional parameters.
*
* @opt_param int pageSize
* @opt_param string pageToken A token identifying a page of results the server
* should return. Typically, this is the value of
* ListAdaptiveMtSentencesRequest.next_page_token returned from the previous
* call to `ListTranslationMemories` method. The first page is returned if
* `page_token` is empty or missing.
* @return ListAdaptiveMtSentencesResponse
* @throws \Google\Service\Exception
*/
public function listProjectsLocationsAdaptiveMtDatasetsAdaptiveMtFilesAdaptiveMtSentences($parent, $optParams = [])
{
$params = ['parent' => $parent];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListAdaptiveMtSentencesResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsLocationsAdaptiveMtDatasetsAdaptiveMtFilesAdaptiveMtSentences::class, 'Google_Service_Translate_Resource_ProjectsLocationsAdaptiveMtDatasetsAdaptiveMtFilesAdaptiveMtSentences');

View File

@@ -0,0 +1,62 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate\Resource;
use Google\Service\Translate\ListAdaptiveMtSentencesResponse;
/**
* The "adaptiveMtSentences" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google\Service\Translate(...);
* $adaptiveMtSentences = $translateService->projects_locations_adaptiveMtDatasets_adaptiveMtSentences;
* </code>
*/
class ProjectsLocationsAdaptiveMtDatasetsAdaptiveMtSentences extends \Google\Service\Resource
{
/**
* Lists all AdaptiveMtSentences under a given file/dataset. (adaptiveMtSentence
* s.listProjectsLocationsAdaptiveMtDatasetsAdaptiveMtSentences)
*
* @param string $parent Required. The resource name of the project from which
* to list the Adaptive MT files. The following format lists all sentences under
* a file. `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}
* /adaptiveMtFiles/{file}` The following format lists all sentences within a
* dataset.
* `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}`
* @param array $optParams Optional parameters.
*
* @opt_param int pageSize
* @opt_param string pageToken A token identifying a page of results the server
* should return. Typically, this is the value of
* ListAdaptiveMtSentencesRequest.next_page_token returned from the previous
* call to `ListTranslationMemories` method. The first page is returned if
* `page_token` is empty or missing.
* @return ListAdaptiveMtSentencesResponse
* @throws \Google\Service\Exception
*/
public function listProjectsLocationsAdaptiveMtDatasetsAdaptiveMtSentences($parent, $optParams = [])
{
$params = ['parent' => $parent];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListAdaptiveMtSentencesResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsLocationsAdaptiveMtDatasetsAdaptiveMtSentences::class, 'Google_Service_Translate_Resource_ProjectsLocationsAdaptiveMtDatasetsAdaptiveMtSentences');

View File

@@ -0,0 +1,137 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate\Resource;
use Google\Service\Translate\Dataset;
use Google\Service\Translate\ExportDataRequest;
use Google\Service\Translate\ImportDataRequest;
use Google\Service\Translate\ListDatasetsResponse;
use Google\Service\Translate\Operation;
/**
* The "datasets" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google\Service\Translate(...);
* $datasets = $translateService->projects_locations_datasets;
* </code>
*/
class ProjectsLocationsDatasets extends \Google\Service\Resource
{
/**
* Creates a Dataset. (datasets.create)
*
* @param string $parent Required. The project name.
* @param Dataset $postBody
* @param array $optParams Optional parameters.
* @return Operation
* @throws \Google\Service\Exception
*/
public function create($parent, Dataset $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('create', [$params], Operation::class);
}
/**
* Deletes a dataset and all of its contents. (datasets.delete)
*
* @param string $name Required. The name of the dataset to delete.
* @param array $optParams Optional parameters.
* @return Operation
* @throws \Google\Service\Exception
*/
public function delete($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params], Operation::class);
}
/**
* Exports dataset's data to the provided output location. (datasets.exportData)
*
* @param string $dataset Required. Name of the dataset. In form of
* `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-
* id}`
* @param ExportDataRequest $postBody
* @param array $optParams Optional parameters.
* @return Operation
* @throws \Google\Service\Exception
*/
public function exportData($dataset, ExportDataRequest $postBody, $optParams = [])
{
$params = ['dataset' => $dataset, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('exportData', [$params], Operation::class);
}
/**
* Gets a Dataset. (datasets.get)
*
* @param string $name Required. The resource name of the dataset to retrieve.
* @param array $optParams Optional parameters.
* @return Dataset
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], Dataset::class);
}
/**
* Import sentence pairs into translation Dataset. (datasets.importData)
*
* @param string $dataset Required. Name of the dataset. In form of
* `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-
* id}`
* @param ImportDataRequest $postBody
* @param array $optParams Optional parameters.
* @return Operation
* @throws \Google\Service\Exception
*/
public function importData($dataset, ImportDataRequest $postBody, $optParams = [])
{
$params = ['dataset' => $dataset, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('importData', [$params], Operation::class);
}
/**
* Lists datasets. (datasets.listProjectsLocationsDatasets)
*
* @param string $parent Required. Name of the parent project. In form of
* `projects/{project-number-or-id}/locations/{location-id}`
* @param array $optParams Optional parameters.
*
* @opt_param int pageSize Optional. Requested page size. The server can return
* fewer results than requested.
* @opt_param string pageToken Optional. A token identifying a page of results
* for the server to return. Typically obtained from next_page_token field in
* the response of a ListDatasets call.
* @return ListDatasetsResponse
* @throws \Google\Service\Exception
*/
public function listProjectsLocationsDatasets($parent, $optParams = [])
{
$params = ['parent' => $parent];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListDatasetsResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsLocationsDatasets::class, 'Google_Service_Translate_Resource_ProjectsLocationsDatasets');

View File

@@ -0,0 +1,60 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate\Resource;
use Google\Service\Translate\ListExamplesResponse;
/**
* The "examples" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google\Service\Translate(...);
* $examples = $translateService->projects_locations_datasets_examples;
* </code>
*/
class ProjectsLocationsDatasetsExamples extends \Google\Service\Resource
{
/**
* Lists sentence pairs in the dataset.
* (examples.listProjectsLocationsDatasetsExamples)
*
* @param string $parent Required. Name of the parent dataset. In form of
* `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-
* id}`
* @param array $optParams Optional parameters.
*
* @opt_param string filter Optional. An expression for filtering the examples
* that will be returned. Example filter: * `usage=TRAIN`
* @opt_param int pageSize Optional. Requested page size. The server can return
* fewer results than requested.
* @opt_param string pageToken Optional. A token identifying a page of results
* for the server to return. Typically obtained from next_page_token field in
* the response of a ListExamples call.
* @return ListExamplesResponse
* @throws \Google\Service\Exception
*/
public function listProjectsLocationsDatasetsExamples($parent, $optParams = [])
{
$params = ['parent' => $parent];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListExamplesResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsLocationsDatasetsExamples::class, 'Google_Service_Translate_Resource_ProjectsLocationsDatasetsExamples');

View File

@@ -0,0 +1,145 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate\Resource;
use Google\Service\Translate\Glossary;
use Google\Service\Translate\ListGlossariesResponse;
use Google\Service\Translate\Operation;
/**
* The "glossaries" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google\Service\Translate(...);
* $glossaries = $translateService->projects_locations_glossaries;
* </code>
*/
class ProjectsLocationsGlossaries extends \Google\Service\Resource
{
/**
* Creates a glossary and returns the long-running operation. Returns NOT_FOUND,
* if the project doesn't exist. (glossaries.create)
*
* @param string $parent Required. The project name.
* @param Glossary $postBody
* @param array $optParams Optional parameters.
* @return Operation
* @throws \Google\Service\Exception
*/
public function create($parent, Glossary $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('create', [$params], Operation::class);
}
/**
* Deletes a glossary, or cancels glossary construction if the glossary isn't
* created yet. Returns NOT_FOUND, if the glossary doesn't exist.
* (glossaries.delete)
*
* @param string $name Required. The name of the glossary to delete.
* @param array $optParams Optional parameters.
* @return Operation
* @throws \Google\Service\Exception
*/
public function delete($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params], Operation::class);
}
/**
* Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.
* (glossaries.get)
*
* @param string $name Required. The name of the glossary to retrieve.
* @param array $optParams Optional parameters.
* @return Glossary
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], Glossary::class);
}
/**
* Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't
* exist. (glossaries.listProjectsLocationsGlossaries)
*
* @param string $parent Required. The name of the project from which to list
* all of the glossaries.
* @param array $optParams Optional parameters.
*
* @opt_param string filter Optional. Filter specifying constraints of a list
* operation. Specify the constraint by the format of "key=value", where key
* must be "src" or "tgt", and the value must be a valid language code. For
* multiple restrictions, concatenate them by "AND" (uppercase only), such as:
* "src=en-US AND tgt=zh-CN". Notice that the exact match is used here, which
* means using 'en-US' and 'en' can lead to different results, which depends on
* the language code you used when you create the glossary. For the
* unidirectional glossaries, the "src" and "tgt" add restrictions on the source
* and target language code separately. For the equivalent term set glossaries,
* the "src" and/or "tgt" add restrictions on the term set. For example:
* "src=en-US AND tgt=zh-CN" will only pick the unidirectional glossaries which
* exactly match the source language code as "en-US" and the target language
* code "zh-CN", but all equivalent term set glossaries which contain "en-US"
* and "zh-CN" in their language set will be picked. If missing, no filtering is
* performed.
* @opt_param int pageSize Optional. Requested page size. The server may return
* fewer glossaries than requested. If unspecified, the server picks an
* appropriate default.
* @opt_param string pageToken Optional. A token identifying a page of results
* the server should return. Typically, this is the value of
* [ListGlossariesResponse.next_page_token] returned from the previous call to
* `ListGlossaries` method. The first page is returned if `page_token`is empty
* or missing.
* @return ListGlossariesResponse
* @throws \Google\Service\Exception
*/
public function listProjectsLocationsGlossaries($parent, $optParams = [])
{
$params = ['parent' => $parent];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListGlossariesResponse::class);
}
/**
* Updates a glossary. A LRO is used since the update can be async if the
* glossary's entry file is updated. (glossaries.patch)
*
* @param string $name Required. The resource name of the glossary. Glossary
* names have the form `projects/{project-number-or-id}/locations/{location-
* id}/glossaries/{glossary-id}`.
* @param Glossary $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string updateMask The list of fields to be updated. Currently only
* `display_name` and 'input_config'
* @return Operation
* @throws \Google\Service\Exception
*/
public function patch($name, Glossary $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('patch', [$params], Operation::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsLocationsGlossaries::class, 'Google_Service_Translate_Resource_ProjectsLocationsGlossaries');

View File

@@ -0,0 +1,122 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate\Resource;
use Google\Service\Translate\GlossaryEntry;
use Google\Service\Translate\ListGlossaryEntriesResponse;
use Google\Service\Translate\TranslateEmpty;
/**
* The "glossaryEntries" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google\Service\Translate(...);
* $glossaryEntries = $translateService->projects_locations_glossaries_glossaryEntries;
* </code>
*/
class ProjectsLocationsGlossariesGlossaryEntries extends \Google\Service\Resource
{
/**
* Creates a glossary entry. (glossaryEntries.create)
*
* @param string $parent Required. The resource name of the glossary to create
* the entry under.
* @param GlossaryEntry $postBody
* @param array $optParams Optional parameters.
* @return GlossaryEntry
* @throws \Google\Service\Exception
*/
public function create($parent, GlossaryEntry $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('create', [$params], GlossaryEntry::class);
}
/**
* Deletes a single entry from the glossary (glossaryEntries.delete)
*
* @param string $name Required. The resource name of the glossary entry to
* delete
* @param array $optParams Optional parameters.
* @return TranslateEmpty
* @throws \Google\Service\Exception
*/
public function delete($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params], TranslateEmpty::class);
}
/**
* Gets a single glossary entry by the given id. (glossaryEntries.get)
*
* @param string $name Required. The resource name of the glossary entry to get
* @param array $optParams Optional parameters.
* @return GlossaryEntry
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], GlossaryEntry::class);
}
/**
* List the entries for the glossary.
* (glossaryEntries.listProjectsLocationsGlossariesGlossaryEntries)
*
* @param string $parent Required. The parent glossary resource name for listing
* the glossary's entries.
* @param array $optParams Optional parameters.
*
* @opt_param int pageSize Optional. Requested page size. The server may return
* fewer glossary entries than requested. If unspecified, the server picks an
* appropriate default.
* @opt_param string pageToken Optional. A token identifying a page of results
* the server should return. Typically, this is the value of
* [ListGlossaryEntriesResponse.next_page_token] returned from the previous
* call. The first page is returned if `page_token`is empty or missing.
* @return ListGlossaryEntriesResponse
* @throws \Google\Service\Exception
*/
public function listProjectsLocationsGlossariesGlossaryEntries($parent, $optParams = [])
{
$params = ['parent' => $parent];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListGlossaryEntriesResponse::class);
}
/**
* Updates a glossary entry. (glossaryEntries.patch)
*
* @param string $name Identifier. The resource name of the entry. Format:
* `projects/locations/glossaries/glossaryEntries`
* @param GlossaryEntry $postBody
* @param array $optParams Optional parameters.
* @return GlossaryEntry
* @throws \Google\Service\Exception
*/
public function patch($name, GlossaryEntry $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('patch', [$params], GlossaryEntry::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsLocationsGlossariesGlossaryEntries::class, 'Google_Service_Translate_Resource_ProjectsLocationsGlossariesGlossaryEntries');

View File

@@ -0,0 +1,104 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate\Resource;
use Google\Service\Translate\ListModelsResponse;
use Google\Service\Translate\Model;
use Google\Service\Translate\Operation;
/**
* The "models" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google\Service\Translate(...);
* $models = $translateService->projects_locations_models;
* </code>
*/
class ProjectsLocationsModels extends \Google\Service\Resource
{
/**
* Creates a Model. (models.create)
*
* @param string $parent Required. The project name, in form of
* `projects/{project}/locations/{location}`
* @param Model $postBody
* @param array $optParams Optional parameters.
* @return Operation
* @throws \Google\Service\Exception
*/
public function create($parent, Model $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('create', [$params], Operation::class);
}
/**
* Deletes a model. (models.delete)
*
* @param string $name Required. The name of the model to delete.
* @param array $optParams Optional parameters.
* @return Operation
* @throws \Google\Service\Exception
*/
public function delete($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params], Operation::class);
}
/**
* Gets a model. (models.get)
*
* @param string $name Required. The resource name of the model to retrieve.
* @param array $optParams Optional parameters.
* @return Model
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], Model::class);
}
/**
* Lists models. (models.listProjectsLocationsModels)
*
* @param string $parent Required. Name of the parent project. In form of
* `projects/{project-number-or-id}/locations/{location-id}`
* @param array $optParams Optional parameters.
*
* @opt_param string filter Optional. An expression for filtering the models
* that will be returned. Supported filter: `dataset_id=${dataset_id}`
* @opt_param int pageSize Optional. Requested page size. The server can return
* fewer results than requested.
* @opt_param string pageToken Optional. A token identifying a page of results
* for the server to return. Typically obtained from next_page_token field in
* the response of a ListModels call.
* @return ListModelsResponse
* @throws \Google\Service\Exception
*/
public function listProjectsLocationsModels($parent, $optParams = [])
{
$params = ['parent' => $parent];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListModelsResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsLocationsModels::class, 'Google_Service_Translate_Resource_ProjectsLocationsModels');

View File

@@ -0,0 +1,138 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate\Resource;
use Google\Service\Translate\CancelOperationRequest;
use Google\Service\Translate\ListOperationsResponse;
use Google\Service\Translate\Operation;
use Google\Service\Translate\TranslateEmpty;
use Google\Service\Translate\WaitOperationRequest;
/**
* The "operations" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google\Service\Translate(...);
* $operations = $translateService->projects_locations_operations;
* </code>
*/
class ProjectsLocationsOperations extends \Google\Service\Resource
{
/**
* Starts asynchronous cancellation on a long-running operation. The server
* makes a best effort to cancel the operation, but success is not guaranteed.
* If the server doesn't support this method, it returns
* `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or
* other methods to check whether the cancellation succeeded or whether the
* operation completed despite cancellation. On successful cancellation, the
* operation is not deleted; instead, it becomes an operation with an
* Operation.error value with a google.rpc.Status.code of `1`, corresponding to
* `Code.CANCELLED`. (operations.cancel)
*
* @param string $name The name of the operation resource to be cancelled.
* @param CancelOperationRequest $postBody
* @param array $optParams Optional parameters.
* @return TranslateEmpty
* @throws \Google\Service\Exception
*/
public function cancel($name, CancelOperationRequest $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('cancel', [$params], TranslateEmpty::class);
}
/**
* Deletes a long-running operation. This method indicates that the client is no
* longer interested in the operation result. It does not cancel the operation.
* If the server doesn't support this method, it returns
* `google.rpc.Code.UNIMPLEMENTED`. (operations.delete)
*
* @param string $name The name of the operation resource to be deleted.
* @param array $optParams Optional parameters.
* @return TranslateEmpty
* @throws \Google\Service\Exception
*/
public function delete($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params], TranslateEmpty::class);
}
/**
* Gets the latest state of a long-running operation. Clients can use this
* method to poll the operation result at intervals as recommended by the API
* service. (operations.get)
*
* @param string $name The name of the operation resource.
* @param array $optParams Optional parameters.
* @return Operation
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], Operation::class);
}
/**
* Lists operations that match the specified filter in the request. If the
* server doesn't support this method, it returns `UNIMPLEMENTED`.
* (operations.listProjectsLocationsOperations)
*
* @param string $name The name of the operation's parent resource.
* @param array $optParams Optional parameters.
*
* @opt_param string filter The standard list filter.
* @opt_param int pageSize The standard list page size.
* @opt_param string pageToken The standard list page token.
* @return ListOperationsResponse
* @throws \Google\Service\Exception
*/
public function listProjectsLocationsOperations($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListOperationsResponse::class);
}
/**
* Waits until the specified long-running operation is done or reaches at most a
* specified timeout, returning the latest state. If the operation is already
* done, the latest state is immediately returned. If the timeout specified is
* greater than the default HTTP/RPC timeout, the HTTP/RPC timeout is used. If
* the server does not support this method, it returns
* `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort
* basis. It may return the latest state before the specified timeout (including
* immediately), meaning even an immediate response is no guarantee that the
* operation is done. (operations.wait)
*
* @param string $name The name of the operation resource to wait on.
* @param WaitOperationRequest $postBody
* @param array $optParams Optional parameters.
* @return Operation
* @throws \Google\Service\Exception
*/
public function wait($name, WaitOperationRequest $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('wait', [$params], Operation::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsLocationsOperations::class, 'Google_Service_Translate_Resource_ProjectsLocationsOperations');

View File

@@ -0,0 +1,78 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class Romanization extends \Google\Model
{
/**
* The ISO-639 language code of source text in the initial request, detected
* automatically, if no source language was passed within the initial request.
* If the source language was passed, auto-detection of the language does not
* occur and this field is empty.
*
* @var string
*/
public $detectedLanguageCode;
/**
* Romanized text. If an error occurs during romanization, this field might be
* excluded from the response.
*
* @var string
*/
public $romanizedText;
/**
* The ISO-639 language code of source text in the initial request, detected
* automatically, if no source language was passed within the initial request.
* If the source language was passed, auto-detection of the language does not
* occur and this field is empty.
*
* @param string $detectedLanguageCode
*/
public function setDetectedLanguageCode($detectedLanguageCode)
{
$this->detectedLanguageCode = $detectedLanguageCode;
}
/**
* @return string
*/
public function getDetectedLanguageCode()
{
return $this->detectedLanguageCode;
}
/**
* Romanized text. If an error occurs during romanization, this field might be
* excluded from the response.
*
* @param string $romanizedText
*/
public function setRomanizedText($romanizedText)
{
$this->romanizedText = $romanizedText;
}
/**
* @return string
*/
public function getRomanizedText()
{
return $this->romanizedText;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Romanization::class, 'Google_Service_Translate_Romanization');

View File

@@ -0,0 +1,77 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class RomanizeTextRequest extends \Google\Collection
{
protected $collection_key = 'contents';
/**
* Required. The content of the input in string format.
*
* @var string[]
*/
public $contents;
/**
* Optional. The ISO-639 language code of the input text if known, for
* example, "hi" or "zh". If the source language isn't specified, the API
* attempts to identify the source language automatically and returns the
* source language for each content in the response.
*
* @var string
*/
public $sourceLanguageCode;
/**
* Required. The content of the input in string format.
*
* @param string[] $contents
*/
public function setContents($contents)
{
$this->contents = $contents;
}
/**
* @return string[]
*/
public function getContents()
{
return $this->contents;
}
/**
* Optional. The ISO-639 language code of the input text if known, for
* example, "hi" or "zh". If the source language isn't specified, the API
* attempts to identify the source language automatically and returns the
* source language for each content in the response.
*
* @param string $sourceLanguageCode
*/
public function setSourceLanguageCode($sourceLanguageCode)
{
$this->sourceLanguageCode = $sourceLanguageCode;
}
/**
* @return string
*/
public function getSourceLanguageCode()
{
return $this->sourceLanguageCode;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(RomanizeTextRequest::class, 'Google_Service_Translate_RomanizeTextRequest');

View File

@@ -0,0 +1,45 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class RomanizeTextResponse extends \Google\Collection
{
protected $collection_key = 'romanizations';
protected $romanizationsType = Romanization::class;
protected $romanizationsDataType = 'array';
/**
* Text romanization responses. This field has the same length as `contents`.
*
* @param Romanization[] $romanizations
*/
public function setRomanizations($romanizations)
{
$this->romanizations = $romanizations;
}
/**
* @return Romanization[]
*/
public function getRomanizations()
{
return $this->romanizations;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(RomanizeTextResponse::class, 'Google_Service_Translate_RomanizeTextResponse');

View File

@@ -0,0 +1,99 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class Status extends \Google\Collection
{
protected $collection_key = 'details';
/**
* The status code, which should be an enum value of google.rpc.Code.
*
* @var int
*/
public $code;
/**
* A list of messages that carry the error details. There is a common set of
* message types for APIs to use.
*
* @var array[]
*/
public $details;
/**
* A developer-facing error message, which should be in English. Any user-
* facing error message should be localized and sent in the
* google.rpc.Status.details field, or localized by the client.
*
* @var string
*/
public $message;
/**
* The status code, which should be an enum value of google.rpc.Code.
*
* @param int $code
*/
public function setCode($code)
{
$this->code = $code;
}
/**
* @return int
*/
public function getCode()
{
return $this->code;
}
/**
* A list of messages that carry the error details. There is a common set of
* message types for APIs to use.
*
* @param array[] $details
*/
public function setDetails($details)
{
$this->details = $details;
}
/**
* @return array[]
*/
public function getDetails()
{
return $this->details;
}
/**
* A developer-facing error message, which should be in English. Any user-
* facing error message should be localized and sent in the
* google.rpc.Status.details field, or localized by the client.
*
* @param string $message
*/
public function setMessage($message)
{
$this->message = $message;
}
/**
* @return string
*/
public function getMessage()
{
return $this->message;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Status::class, 'Google_Service_Translate_Status');

View File

@@ -0,0 +1,120 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class SupportedLanguage extends \Google\Model
{
/**
* Human-readable name of the language localized in the display language
* specified in the request.
*
* @var string
*/
public $displayName;
/**
* Supported language code, generally consisting of its ISO 639-1 identifier,
* for example, 'en', 'ja'. In certain cases, ISO-639 codes including language
* and region identifiers are returned (for example, 'zh-TW' and 'zh-CN').
*
* @var string
*/
public $languageCode;
/**
* Can be used as a source language.
*
* @var bool
*/
public $supportSource;
/**
* Can be used as a target language.
*
* @var bool
*/
public $supportTarget;
/**
* Human-readable name of the language localized in the display language
* specified in the request.
*
* @param string $displayName
*/
public function setDisplayName($displayName)
{
$this->displayName = $displayName;
}
/**
* @return string
*/
public function getDisplayName()
{
return $this->displayName;
}
/**
* Supported language code, generally consisting of its ISO 639-1 identifier,
* for example, 'en', 'ja'. In certain cases, ISO-639 codes including language
* and region identifiers are returned (for example, 'zh-TW' and 'zh-CN').
*
* @param string $languageCode
*/
public function setLanguageCode($languageCode)
{
$this->languageCode = $languageCode;
}
/**
* @return string
*/
public function getLanguageCode()
{
return $this->languageCode;
}
/**
* Can be used as a source language.
*
* @param bool $supportSource
*/
public function setSupportSource($supportSource)
{
$this->supportSource = $supportSource;
}
/**
* @return bool
*/
public function getSupportSource()
{
return $this->supportSource;
}
/**
* Can be used as a target language.
*
* @param bool $supportTarget
*/
public function setSupportTarget($supportTarget)
{
$this->supportTarget = $supportTarget;
}
/**
* @return bool
*/
public function getSupportTarget()
{
return $this->supportTarget;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(SupportedLanguage::class, 'Google_Service_Translate_SupportedLanguage');

View File

@@ -0,0 +1,46 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class SupportedLanguages extends \Google\Collection
{
protected $collection_key = 'languages';
protected $languagesType = SupportedLanguage::class;
protected $languagesDataType = 'array';
/**
* A list of supported language responses. This list contains an entry for
* each language the Translation API supports.
*
* @param SupportedLanguage[] $languages
*/
public function setLanguages($languages)
{
$this->languages = $languages;
}
/**
* @return SupportedLanguage[]
*/
public function getLanguages()
{
return $this->languages;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(SupportedLanguages::class, 'Google_Service_Translate_SupportedLanguages');

View File

@@ -0,0 +1,311 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class TranslateDocumentRequest extends \Google\Model
{
/**
* Optional. This flag is to support user customized attribution. If not
* provided, the default is `Machine Translated by Google`. Customized
* attribution should follow rules in
* https://cloud.google.com/translate/attribution#attribution_and_logos
*
* @var string
*/
public $customizedAttribution;
protected $documentInputConfigType = DocumentInputConfig::class;
protected $documentInputConfigDataType = '';
protected $documentOutputConfigType = DocumentOutputConfig::class;
protected $documentOutputConfigDataType = '';
/**
* Optional. If true, enable auto rotation correction in DVS.
*
* @var bool
*/
public $enableRotationCorrection;
/**
* Optional. If true, use the text removal server to remove the shadow text on
* background image for native pdf translation. Shadow removal feature can
* only be enabled when is_translate_native_pdf_only: false &&
* pdf_native_only: false
*
* @var bool
*/
public $enableShadowRemovalNativePdf;
protected $glossaryConfigType = TranslateTextGlossaryConfig::class;
protected $glossaryConfigDataType = '';
/**
* Optional. is_translate_native_pdf_only field for external customers. If
* true, the page limit of online native pdf translation is 300 and only
* native pdf pages will be translated.
*
* @var bool
*/
public $isTranslateNativePdfOnly;
/**
* Optional. The labels with user-defined metadata for the request. Label keys
* and values can be no longer than 63 characters (Unicode codepoints), can
* only contain lowercase letters, numeric characters, underscores and dashes.
* International characters are allowed. Label values are optional. Label keys
* must start with a letter. See
* https://cloud.google.com/translate/docs/advanced/labels for more
* information.
*
* @var string[]
*/
public $labels;
/**
* Optional. The `model` type requested for this translation. The format
* depends on model type: - AutoML Translation models: `projects/{project-
* number-or-id}/locations/{location-id}/models/{model-id}` - General (built-
* in) models: `projects/{project-number-or-id}/locations/{location-
* id}/models/general/nmt`, If not provided, the default Google model (NMT)
* will be used for translation.
*
* @var string
*/
public $model;
/**
* Optional. The ISO-639 language code of the input document if known, for
* example, "en-US" or "sr-Latn". Supported language codes are listed in
* Language Support. If the source language isn't specified, the API attempts
* to identify the source language automatically and returns the source
* language within the response. Source language must be specified if the
* request contains a glossary or a custom model.
*
* @var string
*/
public $sourceLanguageCode;
/**
* Required. The ISO-639 language code to use for translation of the input
* document, set to one of the language codes listed in Language Support.
*
* @var string
*/
public $targetLanguageCode;
/**
* Optional. This flag is to support user customized attribution. If not
* provided, the default is `Machine Translated by Google`. Customized
* attribution should follow rules in
* https://cloud.google.com/translate/attribution#attribution_and_logos
*
* @param string $customizedAttribution
*/
public function setCustomizedAttribution($customizedAttribution)
{
$this->customizedAttribution = $customizedAttribution;
}
/**
* @return string
*/
public function getCustomizedAttribution()
{
return $this->customizedAttribution;
}
/**
* Required. Input configurations.
*
* @param DocumentInputConfig $documentInputConfig
*/
public function setDocumentInputConfig(DocumentInputConfig $documentInputConfig)
{
$this->documentInputConfig = $documentInputConfig;
}
/**
* @return DocumentInputConfig
*/
public function getDocumentInputConfig()
{
return $this->documentInputConfig;
}
/**
* Optional. Output configurations. Defines if the output file should be
* stored within Cloud Storage as well as the desired output format. If not
* provided the translated file will only be returned through a byte-stream
* and its output mime type will be the same as the input file's mime type.
*
* @param DocumentOutputConfig $documentOutputConfig
*/
public function setDocumentOutputConfig(DocumentOutputConfig $documentOutputConfig)
{
$this->documentOutputConfig = $documentOutputConfig;
}
/**
* @return DocumentOutputConfig
*/
public function getDocumentOutputConfig()
{
return $this->documentOutputConfig;
}
/**
* Optional. If true, enable auto rotation correction in DVS.
*
* @param bool $enableRotationCorrection
*/
public function setEnableRotationCorrection($enableRotationCorrection)
{
$this->enableRotationCorrection = $enableRotationCorrection;
}
/**
* @return bool
*/
public function getEnableRotationCorrection()
{
return $this->enableRotationCorrection;
}
/**
* Optional. If true, use the text removal server to remove the shadow text on
* background image for native pdf translation. Shadow removal feature can
* only be enabled when is_translate_native_pdf_only: false &&
* pdf_native_only: false
*
* @param bool $enableShadowRemovalNativePdf
*/
public function setEnableShadowRemovalNativePdf($enableShadowRemovalNativePdf)
{
$this->enableShadowRemovalNativePdf = $enableShadowRemovalNativePdf;
}
/**
* @return bool
*/
public function getEnableShadowRemovalNativePdf()
{
return $this->enableShadowRemovalNativePdf;
}
/**
* Optional. Glossary to be applied. The glossary must be within the same
* region (have the same location-id) as the model, otherwise an
* INVALID_ARGUMENT (400) error is returned.
*
* @param TranslateTextGlossaryConfig $glossaryConfig
*/
public function setGlossaryConfig(TranslateTextGlossaryConfig $glossaryConfig)
{
$this->glossaryConfig = $glossaryConfig;
}
/**
* @return TranslateTextGlossaryConfig
*/
public function getGlossaryConfig()
{
return $this->glossaryConfig;
}
/**
* Optional. is_translate_native_pdf_only field for external customers. If
* true, the page limit of online native pdf translation is 300 and only
* native pdf pages will be translated.
*
* @param bool $isTranslateNativePdfOnly
*/
public function setIsTranslateNativePdfOnly($isTranslateNativePdfOnly)
{
$this->isTranslateNativePdfOnly = $isTranslateNativePdfOnly;
}
/**
* @return bool
*/
public function getIsTranslateNativePdfOnly()
{
return $this->isTranslateNativePdfOnly;
}
/**
* Optional. The labels with user-defined metadata for the request. Label keys
* and values can be no longer than 63 characters (Unicode codepoints), can
* only contain lowercase letters, numeric characters, underscores and dashes.
* International characters are allowed. Label values are optional. Label keys
* must start with a letter. See
* https://cloud.google.com/translate/docs/advanced/labels for more
* information.
*
* @param string[] $labels
*/
public function setLabels($labels)
{
$this->labels = $labels;
}
/**
* @return string[]
*/
public function getLabels()
{
return $this->labels;
}
/**
* Optional. The `model` type requested for this translation. The format
* depends on model type: - AutoML Translation models: `projects/{project-
* number-or-id}/locations/{location-id}/models/{model-id}` - General (built-
* in) models: `projects/{project-number-or-id}/locations/{location-
* id}/models/general/nmt`, If not provided, the default Google model (NMT)
* will be used for translation.
*
* @param string $model
*/
public function setModel($model)
{
$this->model = $model;
}
/**
* @return string
*/
public function getModel()
{
return $this->model;
}
/**
* Optional. The ISO-639 language code of the input document if known, for
* example, "en-US" or "sr-Latn". Supported language codes are listed in
* Language Support. If the source language isn't specified, the API attempts
* to identify the source language automatically and returns the source
* language within the response. Source language must be specified if the
* request contains a glossary or a custom model.
*
* @param string $sourceLanguageCode
*/
public function setSourceLanguageCode($sourceLanguageCode)
{
$this->sourceLanguageCode = $sourceLanguageCode;
}
/**
* @return string
*/
public function getSourceLanguageCode()
{
return $this->sourceLanguageCode;
}
/**
* Required. The ISO-639 language code to use for translation of the input
* document, set to one of the language codes listed in Language Support.
*
* @param string $targetLanguageCode
*/
public function setTargetLanguageCode($targetLanguageCode)
{
$this->targetLanguageCode = $targetLanguageCode;
}
/**
* @return string
*/
public function getTargetLanguageCode()
{
return $this->targetLanguageCode;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(TranslateDocumentRequest::class, 'Google_Service_Translate_TranslateDocumentRequest');

View File

@@ -0,0 +1,112 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class TranslateDocumentResponse extends \Google\Model
{
protected $documentTranslationType = DocumentTranslation::class;
protected $documentTranslationDataType = '';
protected $glossaryConfigType = TranslateTextGlossaryConfig::class;
protected $glossaryConfigDataType = '';
protected $glossaryDocumentTranslationType = DocumentTranslation::class;
protected $glossaryDocumentTranslationDataType = '';
/**
* Only present when 'model' is present in the request. 'model' is normalized
* to have a project number. For example: If the 'model' field in
* TranslateDocumentRequest is: `projects/{project-id}/locations/{location-
* id}/models/general/nmt` then `model` here would be normalized to
* `projects/{project-number}/locations/{location-id}/models/general/nmt`.
*
* @var string
*/
public $model;
/**
* Translated document.
*
* @param DocumentTranslation $documentTranslation
*/
public function setDocumentTranslation(DocumentTranslation $documentTranslation)
{
$this->documentTranslation = $documentTranslation;
}
/**
* @return DocumentTranslation
*/
public function getDocumentTranslation()
{
return $this->documentTranslation;
}
/**
* The `glossary_config` used for this translation.
*
* @param TranslateTextGlossaryConfig $glossaryConfig
*/
public function setGlossaryConfig(TranslateTextGlossaryConfig $glossaryConfig)
{
$this->glossaryConfig = $glossaryConfig;
}
/**
* @return TranslateTextGlossaryConfig
*/
public function getGlossaryConfig()
{
return $this->glossaryConfig;
}
/**
* The document's translation output if a glossary is provided in the request.
* This can be the same as [TranslateDocumentResponse.document_translation] if
* no glossary terms apply.
*
* @param DocumentTranslation $glossaryDocumentTranslation
*/
public function setGlossaryDocumentTranslation(DocumentTranslation $glossaryDocumentTranslation)
{
$this->glossaryDocumentTranslation = $glossaryDocumentTranslation;
}
/**
* @return DocumentTranslation
*/
public function getGlossaryDocumentTranslation()
{
return $this->glossaryDocumentTranslation;
}
/**
* Only present when 'model' is present in the request. 'model' is normalized
* to have a project number. For example: If the 'model' field in
* TranslateDocumentRequest is: `projects/{project-id}/locations/{location-
* id}/models/general/nmt` then `model` here would be normalized to
* `projects/{project-number}/locations/{location-id}/models/general/nmt`.
*
* @param string $model
*/
public function setModel($model)
{
$this->model = $model;
}
/**
* @return string
*/
public function getModel()
{
return $this->model;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(TranslateDocumentResponse::class, 'Google_Service_Translate_TranslateDocumentResponse');

View File

@@ -0,0 +1,25 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class TranslateEmpty extends \Google\Model
{
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(TranslateEmpty::class, 'Google_Service_Translate_TranslateEmpty');

View File

@@ -0,0 +1,102 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class TranslateTextGlossaryConfig extends \Google\Model
{
/**
* Optional. If set to true, the glossary will be used for contextual
* translation.
*
* @var bool
*/
public $contextualTranslationEnabled;
/**
* Required. The `glossary` to be applied for this translation. The format
* depends on the glossary: - User-provided custom glossary:
* `projects/{project-number-or-id}/locations/{location-
* id}/glossaries/{glossary-id}`
*
* @var string
*/
public $glossary;
/**
* Optional. Indicates match is case insensitive. The default value is `false`
* if missing.
*
* @var bool
*/
public $ignoreCase;
/**
* Optional. If set to true, the glossary will be used for contextual
* translation.
*
* @param bool $contextualTranslationEnabled
*/
public function setContextualTranslationEnabled($contextualTranslationEnabled)
{
$this->contextualTranslationEnabled = $contextualTranslationEnabled;
}
/**
* @return bool
*/
public function getContextualTranslationEnabled()
{
return $this->contextualTranslationEnabled;
}
/**
* Required. The `glossary` to be applied for this translation. The format
* depends on the glossary: - User-provided custom glossary:
* `projects/{project-number-or-id}/locations/{location-
* id}/glossaries/{glossary-id}`
*
* @param string $glossary
*/
public function setGlossary($glossary)
{
$this->glossary = $glossary;
}
/**
* @return string
*/
public function getGlossary()
{
return $this->glossary;
}
/**
* Optional. Indicates match is case insensitive. The default value is `false`
* if missing.
*
* @param bool $ignoreCase
*/
public function setIgnoreCase($ignoreCase)
{
$this->ignoreCase = $ignoreCase;
}
/**
* @return bool
*/
public function getIgnoreCase()
{
return $this->ignoreCase;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(TranslateTextGlossaryConfig::class, 'Google_Service_Translate_TranslateTextGlossaryConfig');

View File

@@ -0,0 +1,243 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class TranslateTextRequest extends \Google\Collection
{
protected $collection_key = 'contents';
/**
* Required. The content of the input in string format. We recommend the total
* content be less than 30,000 codepoints. The max length of this field is
* 1024. Use BatchTranslateText for larger text.
*
* @var string[]
*/
public $contents;
protected $glossaryConfigType = TranslateTextGlossaryConfig::class;
protected $glossaryConfigDataType = '';
/**
* Optional. The labels with user-defined metadata for the request. Label keys
* and values can be no longer than 63 characters (Unicode codepoints), can
* only contain lowercase letters, numeric characters, underscores and dashes.
* International characters are allowed. Label values are optional. Label keys
* must start with a letter. See
* https://cloud.google.com/translate/docs/advanced/labels for more
* information.
*
* @var string[]
*/
public $labels;
/**
* Optional. The format of the source text, for example, "text/html",
* "text/plain". If left blank, the MIME type defaults to "text/html".
*
* @var string
*/
public $mimeType;
/**
* Optional. The `model` type requested for this translation. The format
* depends on model type: - AutoML Translation models: `projects/{project-
* number-or-id}/locations/{location-id}/models/{model-id}` - General (built-
* in) models: `projects/{project-number-or-id}/locations/{location-
* id}/models/general/nmt`, - Translation LLM models: `projects/{project-
* number-or-id}/locations/{location-id}/models/general/translation-llm`, For
* global (non-regionalized) requests, use `location-id` `global`. For
* example, `projects/{project-number-or-
* id}/locations/global/models/general/nmt`. If not provided, the default
* Google model (NMT) will be used
*
* @var string
*/
public $model;
/**
* Optional. The ISO-639 language code of the input text if known, for
* example, "en-US" or "sr-Latn". Supported language codes are listed in
* Language Support. If the source language isn't specified, the API attempts
* to identify the source language automatically and returns the source
* language within the response.
*
* @var string
*/
public $sourceLanguageCode;
/**
* Required. The ISO-639 language code to use for translation of the input
* text, set to one of the language codes listed in Language Support.
*
* @var string
*/
public $targetLanguageCode;
protected $transliterationConfigType = TransliterationConfig::class;
protected $transliterationConfigDataType = '';
/**
* Required. The content of the input in string format. We recommend the total
* content be less than 30,000 codepoints. The max length of this field is
* 1024. Use BatchTranslateText for larger text.
*
* @param string[] $contents
*/
public function setContents($contents)
{
$this->contents = $contents;
}
/**
* @return string[]
*/
public function getContents()
{
return $this->contents;
}
/**
* Optional. Glossary to be applied. The glossary must be within the same
* region (have the same location-id) as the model, otherwise an
* INVALID_ARGUMENT (400) error is returned.
*
* @param TranslateTextGlossaryConfig $glossaryConfig
*/
public function setGlossaryConfig(TranslateTextGlossaryConfig $glossaryConfig)
{
$this->glossaryConfig = $glossaryConfig;
}
/**
* @return TranslateTextGlossaryConfig
*/
public function getGlossaryConfig()
{
return $this->glossaryConfig;
}
/**
* Optional. The labels with user-defined metadata for the request. Label keys
* and values can be no longer than 63 characters (Unicode codepoints), can
* only contain lowercase letters, numeric characters, underscores and dashes.
* International characters are allowed. Label values are optional. Label keys
* must start with a letter. See
* https://cloud.google.com/translate/docs/advanced/labels for more
* information.
*
* @param string[] $labels
*/
public function setLabels($labels)
{
$this->labels = $labels;
}
/**
* @return string[]
*/
public function getLabels()
{
return $this->labels;
}
/**
* Optional. The format of the source text, for example, "text/html",
* "text/plain". If left blank, the MIME type defaults to "text/html".
*
* @param string $mimeType
*/
public function setMimeType($mimeType)
{
$this->mimeType = $mimeType;
}
/**
* @return string
*/
public function getMimeType()
{
return $this->mimeType;
}
/**
* Optional. The `model` type requested for this translation. The format
* depends on model type: - AutoML Translation models: `projects/{project-
* number-or-id}/locations/{location-id}/models/{model-id}` - General (built-
* in) models: `projects/{project-number-or-id}/locations/{location-
* id}/models/general/nmt`, - Translation LLM models: `projects/{project-
* number-or-id}/locations/{location-id}/models/general/translation-llm`, For
* global (non-regionalized) requests, use `location-id` `global`. For
* example, `projects/{project-number-or-
* id}/locations/global/models/general/nmt`. If not provided, the default
* Google model (NMT) will be used
*
* @param string $model
*/
public function setModel($model)
{
$this->model = $model;
}
/**
* @return string
*/
public function getModel()
{
return $this->model;
}
/**
* Optional. The ISO-639 language code of the input text if known, for
* example, "en-US" or "sr-Latn". Supported language codes are listed in
* Language Support. If the source language isn't specified, the API attempts
* to identify the source language automatically and returns the source
* language within the response.
*
* @param string $sourceLanguageCode
*/
public function setSourceLanguageCode($sourceLanguageCode)
{
$this->sourceLanguageCode = $sourceLanguageCode;
}
/**
* @return string
*/
public function getSourceLanguageCode()
{
return $this->sourceLanguageCode;
}
/**
* Required. The ISO-639 language code to use for translation of the input
* text, set to one of the language codes listed in Language Support.
*
* @param string $targetLanguageCode
*/
public function setTargetLanguageCode($targetLanguageCode)
{
$this->targetLanguageCode = $targetLanguageCode;
}
/**
* @return string
*/
public function getTargetLanguageCode()
{
return $this->targetLanguageCode;
}
/**
* Optional. Transliteration to be applied.
*
* @param TransliterationConfig $transliterationConfig
*/
public function setTransliterationConfig(TransliterationConfig $transliterationConfig)
{
$this->transliterationConfig = $transliterationConfig;
}
/**
* @return TransliterationConfig
*/
public function getTransliterationConfig()
{
return $this->transliterationConfig;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(TranslateTextRequest::class, 'Google_Service_Translate_TranslateTextRequest');

View File

@@ -0,0 +1,66 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class TranslateTextResponse extends \Google\Collection
{
protected $collection_key = 'translations';
protected $glossaryTranslationsType = Translation::class;
protected $glossaryTranslationsDataType = 'array';
protected $translationsType = Translation::class;
protected $translationsDataType = 'array';
/**
* Text translation responses if a glossary is provided in the request. This
* can be the same as `translations` if no terms apply. This field has the
* same length as `contents`.
*
* @param Translation[] $glossaryTranslations
*/
public function setGlossaryTranslations($glossaryTranslations)
{
$this->glossaryTranslations = $glossaryTranslations;
}
/**
* @return Translation[]
*/
public function getGlossaryTranslations()
{
return $this->glossaryTranslations;
}
/**
* Text translation responses with no glossary applied. This field has the
* same length as `contents`.
*
* @param Translation[] $translations
*/
public function setTranslations($translations)
{
$this->translations = $translations;
}
/**
* @return Translation[]
*/
public function getTranslations()
{
return $this->translations;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(TranslateTextResponse::class, 'Google_Service_Translate_TranslateTextResponse');

View File

@@ -0,0 +1,126 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class Translation extends \Google\Model
{
/**
* The ISO-639 language code of source text in the initial request, detected
* automatically, if no source language was passed within the initial request.
* If the source language was passed, auto-detection of the language does not
* occur and this field is empty.
*
* @var string
*/
public $detectedLanguageCode;
protected $glossaryConfigType = TranslateTextGlossaryConfig::class;
protected $glossaryConfigDataType = '';
/**
* Only present when `model` is present in the request. `model` here is
* normalized to have project number. For example: If the `model` requested in
* TranslationTextRequest is `projects/{project-id}/locations/{location-
* id}/models/general/nmt` then `model` here would be normalized to
* `projects/{project-number}/locations/{location-id}/models/general/nmt`.
*
* @var string
*/
public $model;
/**
* Text translated into the target language. If an error occurs during
* translation, this field might be excluded from the response.
*
* @var string
*/
public $translatedText;
/**
* The ISO-639 language code of source text in the initial request, detected
* automatically, if no source language was passed within the initial request.
* If the source language was passed, auto-detection of the language does not
* occur and this field is empty.
*
* @param string $detectedLanguageCode
*/
public function setDetectedLanguageCode($detectedLanguageCode)
{
$this->detectedLanguageCode = $detectedLanguageCode;
}
/**
* @return string
*/
public function getDetectedLanguageCode()
{
return $this->detectedLanguageCode;
}
/**
* The `glossary_config` used for this translation.
*
* @param TranslateTextGlossaryConfig $glossaryConfig
*/
public function setGlossaryConfig(TranslateTextGlossaryConfig $glossaryConfig)
{
$this->glossaryConfig = $glossaryConfig;
}
/**
* @return TranslateTextGlossaryConfig
*/
public function getGlossaryConfig()
{
return $this->glossaryConfig;
}
/**
* Only present when `model` is present in the request. `model` here is
* normalized to have project number. For example: If the `model` requested in
* TranslationTextRequest is `projects/{project-id}/locations/{location-
* id}/models/general/nmt` then `model` here would be normalized to
* `projects/{project-number}/locations/{location-id}/models/general/nmt`.
*
* @param string $model
*/
public function setModel($model)
{
$this->model = $model;
}
/**
* @return string
*/
public function getModel()
{
return $this->model;
}
/**
* Text translated into the target language. If an error occurs during
* translation, this field might be excluded from the response.
*
* @param string $translatedText
*/
public function setTranslatedText($translatedText)
{
$this->translatedText = $translatedText;
}
/**
* @return string
*/
public function getTranslatedText()
{
return $this->translatedText;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Translation::class, 'Google_Service_Translate_Translation');

View File

@@ -0,0 +1,50 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class TransliterationConfig extends \Google\Model
{
/**
* If true, source text in romanized form can be translated to the target
* language.
*
* @var bool
*/
public $enableTransliteration;
/**
* If true, source text in romanized form can be translated to the target
* language.
*
* @param bool $enableTransliteration
*/
public function setEnableTransliteration($enableTransliteration)
{
$this->enableTransliteration = $enableTransliteration;
}
/**
* @return bool
*/
public function getEnableTransliteration()
{
return $this->enableTransliteration;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(TransliterationConfig::class, 'Google_Service_Translate_TransliterationConfig');

View File

@@ -0,0 +1,52 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Translate;
class WaitOperationRequest extends \Google\Model
{
/**
* The maximum duration to wait before timing out. If left blank, the wait
* will be at most the time permitted by the underlying HTTP/RPC protocol. If
* RPC context deadline is also specified, the shorter one will be used.
*
* @var string
*/
public $timeout;
/**
* The maximum duration to wait before timing out. If left blank, the wait
* will be at most the time permitted by the underlying HTTP/RPC protocol. If
* RPC context deadline is also specified, the shorter one will be used.
*
* @param string $timeout
*/
public function setTimeout($timeout)
{
$this->timeout = $timeout;
}
/**
* @return string
*/
public function getTimeout()
{
return $this->timeout;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(WaitOperationRequest::class, 'Google_Service_Translate_WaitOperationRequest');