[e3d4e0a] | 1 | <?php
|
---|
| 2 | /*
|
---|
| 3 | * Copyright 2014 Google Inc.
|
---|
| 4 | *
|
---|
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
---|
| 6 | * use this file except in compliance with the License. You may obtain a copy of
|
---|
| 7 | * the License at
|
---|
| 8 | *
|
---|
| 9 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
| 10 | *
|
---|
| 11 | * Unless required by applicable law or agreed to in writing, software
|
---|
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
---|
| 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
---|
| 14 | * License for the specific language governing permissions and limitations under
|
---|
| 15 | * the License.
|
---|
| 16 | */
|
---|
| 17 |
|
---|
| 18 | namespace Google\Service\Translate\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Translate\AdaptiveMtDataset;
|
---|
| 21 | use Google\Service\Translate\ImportAdaptiveMtFileRequest;
|
---|
| 22 | use Google\Service\Translate\ImportAdaptiveMtFileResponse;
|
---|
| 23 | use Google\Service\Translate\ListAdaptiveMtDatasetsResponse;
|
---|
| 24 | use Google\Service\Translate\TranslateEmpty;
|
---|
| 25 |
|
---|
| 26 | /**
|
---|
| 27 | * The "adaptiveMtDatasets" collection of methods.
|
---|
| 28 | * Typical usage is:
|
---|
| 29 | * <code>
|
---|
| 30 | * $translateService = new Google\Service\Translate(...);
|
---|
| 31 | * $adaptiveMtDatasets = $translateService->projects_locations_adaptiveMtDatasets;
|
---|
| 32 | * </code>
|
---|
| 33 | */
|
---|
| 34 | class ProjectsLocationsAdaptiveMtDatasets extends \Google\Service\Resource
|
---|
| 35 | {
|
---|
| 36 | /**
|
---|
| 37 | * Creates an Adaptive MT dataset. (adaptiveMtDatasets.create)
|
---|
| 38 | *
|
---|
| 39 | * @param string $parent Required. Name of the parent project. In form of
|
---|
| 40 | * `projects/{project-number-or-id}/locations/{location-id}`
|
---|
| 41 | * @param AdaptiveMtDataset $postBody
|
---|
| 42 | * @param array $optParams Optional parameters.
|
---|
| 43 | * @return AdaptiveMtDataset
|
---|
| 44 | * @throws \Google\Service\Exception
|
---|
| 45 | */
|
---|
| 46 | public function create($parent, AdaptiveMtDataset $postBody, $optParams = [])
|
---|
| 47 | {
|
---|
| 48 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 49 | $params = array_merge($params, $optParams);
|
---|
| 50 | return $this->call('create', [$params], AdaptiveMtDataset::class);
|
---|
| 51 | }
|
---|
| 52 | /**
|
---|
| 53 | * Deletes an Adaptive MT dataset, including all its entries and associated
|
---|
| 54 | * metadata. (adaptiveMtDatasets.delete)
|
---|
| 55 | *
|
---|
| 56 | * @param string $name Required. Name of the dataset. In the form of
|
---|
| 57 | * `projects/{project-number-or-id}/locations/{location-
|
---|
| 58 | * id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}`
|
---|
| 59 | * @param array $optParams Optional parameters.
|
---|
| 60 | * @return TranslateEmpty
|
---|
| 61 | * @throws \Google\Service\Exception
|
---|
| 62 | */
|
---|
| 63 | public function delete($name, $optParams = [])
|
---|
| 64 | {
|
---|
| 65 | $params = ['name' => $name];
|
---|
| 66 | $params = array_merge($params, $optParams);
|
---|
| 67 | return $this->call('delete', [$params], TranslateEmpty::class);
|
---|
| 68 | }
|
---|
| 69 | /**
|
---|
| 70 | * Gets the Adaptive MT dataset. (adaptiveMtDatasets.get)
|
---|
| 71 | *
|
---|
| 72 | * @param string $name Required. Name of the dataset. In the form of
|
---|
| 73 | * `projects/{project-number-or-id}/locations/{location-
|
---|
| 74 | * id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}`
|
---|
| 75 | * @param array $optParams Optional parameters.
|
---|
| 76 | * @return AdaptiveMtDataset
|
---|
| 77 | * @throws \Google\Service\Exception
|
---|
| 78 | */
|
---|
| 79 | public function get($name, $optParams = [])
|
---|
| 80 | {
|
---|
| 81 | $params = ['name' => $name];
|
---|
| 82 | $params = array_merge($params, $optParams);
|
---|
| 83 | return $this->call('get', [$params], AdaptiveMtDataset::class);
|
---|
| 84 | }
|
---|
| 85 | /**
|
---|
| 86 | * Imports an AdaptiveMtFile and adds all of its sentences into the
|
---|
| 87 | * AdaptiveMtDataset. (adaptiveMtDatasets.importAdaptiveMtFile)
|
---|
| 88 | *
|
---|
| 89 | * @param string $parent Required. The resource name of the file, in form of
|
---|
| 90 | * `projects/{project-number-or-
|
---|
| 91 | * id}/locations/{location_id}/adaptiveMtDatasets/{dataset}`
|
---|
| 92 | * @param ImportAdaptiveMtFileRequest $postBody
|
---|
| 93 | * @param array $optParams Optional parameters.
|
---|
| 94 | * @return ImportAdaptiveMtFileResponse
|
---|
| 95 | * @throws \Google\Service\Exception
|
---|
| 96 | */
|
---|
| 97 | public function importAdaptiveMtFile($parent, ImportAdaptiveMtFileRequest $postBody, $optParams = [])
|
---|
| 98 | {
|
---|
| 99 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 100 | $params = array_merge($params, $optParams);
|
---|
| 101 | return $this->call('importAdaptiveMtFile', [$params], ImportAdaptiveMtFileResponse::class);
|
---|
| 102 | }
|
---|
| 103 | /**
|
---|
| 104 | * Lists all Adaptive MT datasets for which the caller has read permission.
|
---|
| 105 | * (adaptiveMtDatasets.listProjectsLocationsAdaptiveMtDatasets)
|
---|
| 106 | *
|
---|
| 107 | * @param string $parent Required. The resource name of the project from which
|
---|
| 108 | * to list the Adaptive MT datasets. `projects/{project-number-or-
|
---|
| 109 | * id}/locations/{location-id}`
|
---|
| 110 | * @param array $optParams Optional parameters.
|
---|
| 111 | *
|
---|
| 112 | * @opt_param string filter Optional. An expression for filtering the results of
|
---|
| 113 | * the request. Filter is not supported yet.
|
---|
| 114 | * @opt_param int pageSize Optional. Requested page size. The server may return
|
---|
| 115 | * fewer results than requested. If unspecified, the server picks an appropriate
|
---|
| 116 | * default.
|
---|
| 117 | * @opt_param string pageToken Optional. A token identifying a page of results
|
---|
| 118 | * the server should return. Typically, this is the value of
|
---|
| 119 | * ListAdaptiveMtDatasetsResponse.next_page_token returned from the previous
|
---|
| 120 | * call to `ListAdaptiveMtDatasets` method. The first page is returned if
|
---|
| 121 | * `page_token`is empty or missing.
|
---|
| 122 | * @return ListAdaptiveMtDatasetsResponse
|
---|
| 123 | * @throws \Google\Service\Exception
|
---|
| 124 | */
|
---|
| 125 | public function listProjectsLocationsAdaptiveMtDatasets($parent, $optParams = [])
|
---|
| 126 | {
|
---|
| 127 | $params = ['parent' => $parent];
|
---|
| 128 | $params = array_merge($params, $optParams);
|
---|
| 129 | return $this->call('list', [$params], ListAdaptiveMtDatasetsResponse::class);
|
---|
| 130 | }
|
---|
| 131 | }
|
---|
| 132 |
|
---|
| 133 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 134 | class_alias(ProjectsLocationsAdaptiveMtDatasets::class, 'Google_Service_Translate_Resource_ProjectsLocationsAdaptiveMtDatasets');
|
---|