[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\Contentwarehouse\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1ListSynonymSetsResponse;
|
---|
| 21 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1SynonymSet;
|
---|
| 22 | use Google\Service\Contentwarehouse\GoogleProtobufEmpty;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "synonymSets" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $contentwarehouseService = new Google\Service\Contentwarehouse(...);
|
---|
| 29 | * $synonymSets = $contentwarehouseService->projects_locations_synonymSets;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class ProjectsLocationsSynonymSets extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Creates a SynonymSet for a single context. Throws an ALREADY_EXISTS exception
|
---|
| 36 | * if a synonymset already exists for the context. (synonymSets.create)
|
---|
| 37 | *
|
---|
| 38 | * @param string $parent Required. The parent name. Format:
|
---|
| 39 | * projects/{project_number}/locations/{location}.
|
---|
| 40 | * @param GoogleCloudContentwarehouseV1SynonymSet $postBody
|
---|
| 41 | * @param array $optParams Optional parameters.
|
---|
| 42 | * @return GoogleCloudContentwarehouseV1SynonymSet
|
---|
| 43 | * @throws \Google\Service\Exception
|
---|
| 44 | */
|
---|
| 45 | public function create($parent, GoogleCloudContentwarehouseV1SynonymSet $postBody, $optParams = [])
|
---|
| 46 | {
|
---|
| 47 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 48 | $params = array_merge($params, $optParams);
|
---|
| 49 | return $this->call('create', [$params], GoogleCloudContentwarehouseV1SynonymSet::class);
|
---|
| 50 | }
|
---|
| 51 | /**
|
---|
| 52 | * Deletes a SynonymSet for a given context. Throws a NOT_FOUND exception if the
|
---|
| 53 | * SynonymSet is not found. (synonymSets.delete)
|
---|
| 54 | *
|
---|
| 55 | * @param string $name Required. The name of the synonymSet to delete Format:
|
---|
| 56 | * projects/{project_number}/locations/{location}/synonymSets/{context}.
|
---|
| 57 | * @param array $optParams Optional parameters.
|
---|
| 58 | * @return GoogleProtobufEmpty
|
---|
| 59 | * @throws \Google\Service\Exception
|
---|
| 60 | */
|
---|
| 61 | public function delete($name, $optParams = [])
|
---|
| 62 | {
|
---|
| 63 | $params = ['name' => $name];
|
---|
| 64 | $params = array_merge($params, $optParams);
|
---|
| 65 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
| 66 | }
|
---|
| 67 | /**
|
---|
| 68 | * Gets a SynonymSet for a particular context. Throws a NOT_FOUND exception if
|
---|
| 69 | * the Synonymset does not exist (synonymSets.get)
|
---|
| 70 | *
|
---|
| 71 | * @param string $name Required. The name of the synonymSet to retrieve Format:
|
---|
| 72 | * projects/{project_number}/locations/{location}/synonymSets/{context}.
|
---|
| 73 | * @param array $optParams Optional parameters.
|
---|
| 74 | * @return GoogleCloudContentwarehouseV1SynonymSet
|
---|
| 75 | * @throws \Google\Service\Exception
|
---|
| 76 | */
|
---|
| 77 | public function get($name, $optParams = [])
|
---|
| 78 | {
|
---|
| 79 | $params = ['name' => $name];
|
---|
| 80 | $params = array_merge($params, $optParams);
|
---|
| 81 | return $this->call('get', [$params], GoogleCloudContentwarehouseV1SynonymSet::class);
|
---|
| 82 | }
|
---|
| 83 | /**
|
---|
| 84 | * Returns all SynonymSets (for all contexts) for the specified location.
|
---|
| 85 | * (synonymSets.listProjectsLocationsSynonymSets)
|
---|
| 86 | *
|
---|
| 87 | * @param string $parent Required. The parent name. Format:
|
---|
| 88 | * projects/{project_number}/locations/{location}.
|
---|
| 89 | * @param array $optParams Optional parameters.
|
---|
| 90 | *
|
---|
| 91 | * @opt_param int pageSize The maximum number of synonymSets to return. The
|
---|
| 92 | * service may return fewer than this value. If unspecified, at most 50 rule
|
---|
| 93 | * sets will be returned. The maximum value is 1000; values above 1000 will be
|
---|
| 94 | * coerced to 1000.
|
---|
| 95 | * @opt_param string pageToken A page token, received from a previous
|
---|
| 96 | * `ListSynonymSets` call. Provide this to retrieve the subsequent page. When
|
---|
| 97 | * paginating, all other parameters provided to `ListSynonymSets` must match the
|
---|
| 98 | * call that provided the page token.
|
---|
| 99 | * @return GoogleCloudContentwarehouseV1ListSynonymSetsResponse
|
---|
| 100 | * @throws \Google\Service\Exception
|
---|
| 101 | */
|
---|
| 102 | public function listProjectsLocationsSynonymSets($parent, $optParams = [])
|
---|
| 103 | {
|
---|
| 104 | $params = ['parent' => $parent];
|
---|
| 105 | $params = array_merge($params, $optParams);
|
---|
| 106 | return $this->call('list', [$params], GoogleCloudContentwarehouseV1ListSynonymSetsResponse::class);
|
---|
| 107 | }
|
---|
| 108 | /**
|
---|
| 109 | * Remove the existing SynonymSet for the context and replaces it with a new
|
---|
| 110 | * one. Throws a NOT_FOUND exception if the SynonymSet is not found.
|
---|
| 111 | * (synonymSets.patch)
|
---|
| 112 | *
|
---|
| 113 | * @param string $name Required. The name of the synonymSet to update Format:
|
---|
| 114 | * projects/{project_number}/locations/{location}/synonymSets/{context}.
|
---|
| 115 | * @param GoogleCloudContentwarehouseV1SynonymSet $postBody
|
---|
| 116 | * @param array $optParams Optional parameters.
|
---|
| 117 | * @return GoogleCloudContentwarehouseV1SynonymSet
|
---|
| 118 | * @throws \Google\Service\Exception
|
---|
| 119 | */
|
---|
| 120 | public function patch($name, GoogleCloudContentwarehouseV1SynonymSet $postBody, $optParams = [])
|
---|
| 121 | {
|
---|
| 122 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 123 | $params = array_merge($params, $optParams);
|
---|
| 124 | return $this->call('patch', [$params], GoogleCloudContentwarehouseV1SynonymSet::class);
|
---|
| 125 | }
|
---|
| 126 | }
|
---|
| 127 |
|
---|
| 128 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 129 | class_alias(ProjectsLocationsSynonymSets::class, 'Google_Service_Contentwarehouse_Resource_ProjectsLocationsSynonymSets');
|
---|