[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\ListModelsResponse;
|
---|
| 21 | use Google\Service\Translate\Model;
|
---|
| 22 | use Google\Service\Translate\Operation;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "models" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $translateService = new Google\Service\Translate(...);
|
---|
| 29 | * $models = $translateService->projects_locations_models;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class ProjectsLocationsModels extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Creates a Model. (models.create)
|
---|
| 36 | *
|
---|
| 37 | * @param string $parent Required. The project name, in form of
|
---|
| 38 | * `projects/{project}/locations/{location}`
|
---|
| 39 | * @param Model $postBody
|
---|
| 40 | * @param array $optParams Optional parameters.
|
---|
| 41 | * @return Operation
|
---|
| 42 | * @throws \Google\Service\Exception
|
---|
| 43 | */
|
---|
| 44 | public function create($parent, Model $postBody, $optParams = [])
|
---|
| 45 | {
|
---|
| 46 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 47 | $params = array_merge($params, $optParams);
|
---|
| 48 | return $this->call('create', [$params], Operation::class);
|
---|
| 49 | }
|
---|
| 50 | /**
|
---|
| 51 | * Deletes a model. (models.delete)
|
---|
| 52 | *
|
---|
| 53 | * @param string $name Required. The name of the model to delete.
|
---|
| 54 | * @param array $optParams Optional parameters.
|
---|
| 55 | * @return Operation
|
---|
| 56 | * @throws \Google\Service\Exception
|
---|
| 57 | */
|
---|
| 58 | public function delete($name, $optParams = [])
|
---|
| 59 | {
|
---|
| 60 | $params = ['name' => $name];
|
---|
| 61 | $params = array_merge($params, $optParams);
|
---|
| 62 | return $this->call('delete', [$params], Operation::class);
|
---|
| 63 | }
|
---|
| 64 | /**
|
---|
| 65 | * Gets a model. (models.get)
|
---|
| 66 | *
|
---|
| 67 | * @param string $name Required. The resource name of the model to retrieve.
|
---|
| 68 | * @param array $optParams Optional parameters.
|
---|
| 69 | * @return Model
|
---|
| 70 | * @throws \Google\Service\Exception
|
---|
| 71 | */
|
---|
| 72 | public function get($name, $optParams = [])
|
---|
| 73 | {
|
---|
| 74 | $params = ['name' => $name];
|
---|
| 75 | $params = array_merge($params, $optParams);
|
---|
| 76 | return $this->call('get', [$params], Model::class);
|
---|
| 77 | }
|
---|
| 78 | /**
|
---|
| 79 | * Lists models. (models.listProjectsLocationsModels)
|
---|
| 80 | *
|
---|
| 81 | * @param string $parent Required. Name of the parent project. In form of
|
---|
| 82 | * `projects/{project-number-or-id}/locations/{location-id}`
|
---|
| 83 | * @param array $optParams Optional parameters.
|
---|
| 84 | *
|
---|
| 85 | * @opt_param string filter Optional. An expression for filtering the models
|
---|
| 86 | * that will be returned. Supported filter: `dataset_id=${dataset_id}`
|
---|
| 87 | * @opt_param int pageSize Optional. Requested page size. The server can return
|
---|
| 88 | * fewer results than requested.
|
---|
| 89 | * @opt_param string pageToken Optional. A token identifying a page of results
|
---|
| 90 | * for the server to return. Typically obtained from next_page_token field in
|
---|
| 91 | * the response of a ListModels call.
|
---|
| 92 | * @return ListModelsResponse
|
---|
| 93 | * @throws \Google\Service\Exception
|
---|
| 94 | */
|
---|
| 95 | public function listProjectsLocationsModels($parent, $optParams = [])
|
---|
| 96 | {
|
---|
| 97 | $params = ['parent' => $parent];
|
---|
| 98 | $params = array_merge($params, $optParams);
|
---|
| 99 | return $this->call('list', [$params], ListModelsResponse::class);
|
---|
| 100 | }
|
---|
| 101 | }
|
---|
| 102 |
|
---|
| 103 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 104 | class_alias(ProjectsLocationsModels::class, 'Google_Service_Translate_Resource_ProjectsLocationsModels');
|
---|