Initial commit

This commit is contained in:
Local Administrator
2025-04-18 10:32:42 +02:00
commit b83134aca3
29643 changed files with 3045897 additions and 0 deletions
@@ -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');
@@ -0,0 +1,269 @@
<?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 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');
@@ -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');
@@ -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');
@@ -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');
@@ -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');
@@ -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');
@@ -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');
@@ -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');
@@ -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');
@@ -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');
@@ -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');