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\DiscoveryEngine\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\DiscoveryEngine\GoogleCloudDiscoveryengineV1CompleteQueryResponse;
|
---|
21 | use Google\Service\DiscoveryEngine\GoogleCloudDiscoveryengineV1DataStore;
|
---|
22 | use Google\Service\DiscoveryEngine\GoogleCloudDiscoveryengineV1ListDataStoresResponse;
|
---|
23 | use Google\Service\DiscoveryEngine\GoogleCloudDiscoveryengineV1SiteSearchEngine;
|
---|
24 | use Google\Service\DiscoveryEngine\GoogleLongrunningOperation;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "dataStores" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $discoveryengineService = new Google\Service\DiscoveryEngine(...);
|
---|
31 | * $dataStores = $discoveryengineService->projects_locations_dataStores;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class ProjectsLocationsDataStores extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Completes the specified user input with keyword suggestions.
|
---|
38 | * (dataStores.completeQuery)
|
---|
39 | *
|
---|
40 | * @param string $dataStore Required. The parent data store resource name for
|
---|
41 | * which the completion is performed, such as `projects/locations/global/collect
|
---|
42 | * ions/default_collection/dataStores/default_data_store`.
|
---|
43 | * @param array $optParams Optional parameters.
|
---|
44 | *
|
---|
45 | * @opt_param bool includeTailSuggestions Indicates if tail suggestions should
|
---|
46 | * be returned if there are no suggestions that match the full query. Even if
|
---|
47 | * set to true, if there are suggestions that match the full query, those are
|
---|
48 | * returned and no tail suggestions are returned.
|
---|
49 | * @opt_param string query Required. The typeahead input used to fetch
|
---|
50 | * suggestions. Maximum length is 128 characters.
|
---|
51 | * @opt_param string queryModel Specifies the autocomplete data model. This
|
---|
52 | * overrides any model specified in the Configuration > Autocomplete section of
|
---|
53 | * the Cloud console. Currently supported values: * `document` - Using
|
---|
54 | * suggestions generated from user-imported documents. * `search-history` -
|
---|
55 | * Using suggestions generated from the past history of SearchService.Search API
|
---|
56 | * calls. Do not use it when there is no traffic for Search API. * `user-event`
|
---|
57 | * - Using suggestions generated from user-imported search events. * `document-
|
---|
58 | * completable` - Using suggestions taken directly from user-imported document
|
---|
59 | * fields marked as completable. Default values: * `document` is the default
|
---|
60 | * model for regular dataStores. * `search-history` is the default model for
|
---|
61 | * site search dataStores.
|
---|
62 | * @opt_param string userPseudoId A unique identifier for tracking visitors. For
|
---|
63 | * example, this could be implemented with an HTTP cookie, which should be able
|
---|
64 | * to uniquely identify a visitor on a single device. This unique identifier
|
---|
65 | * should not change if the visitor logs in or out of the website. This field
|
---|
66 | * should NOT have a fixed value such as `unknown_visitor`. This should be the
|
---|
67 | * same identifier as UserEvent.user_pseudo_id and SearchRequest.user_pseudo_id.
|
---|
68 | * The field must be a UTF-8 encoded string with a length limit of 128
|
---|
69 | * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
|
---|
70 | * @return GoogleCloudDiscoveryengineV1CompleteQueryResponse
|
---|
71 | * @throws \Google\Service\Exception
|
---|
72 | */
|
---|
73 | public function completeQuery($dataStore, $optParams = [])
|
---|
74 | {
|
---|
75 | $params = ['dataStore' => $dataStore];
|
---|
76 | $params = array_merge($params, $optParams);
|
---|
77 | return $this->call('completeQuery', [$params], GoogleCloudDiscoveryengineV1CompleteQueryResponse::class);
|
---|
78 | }
|
---|
79 | /**
|
---|
80 | * Creates a DataStore. DataStore is for storing Documents. To serve these
|
---|
81 | * documents for Search, or Recommendation use case, an Engine needs to be
|
---|
82 | * created separately. (dataStores.create)
|
---|
83 | *
|
---|
84 | * @param string $parent Required. The parent resource name, such as
|
---|
85 | * `projects/{project}/locations/{location}/collections/{collection}`.
|
---|
86 | * @param GoogleCloudDiscoveryengineV1DataStore $postBody
|
---|
87 | * @param array $optParams Optional parameters.
|
---|
88 | *
|
---|
89 | * @opt_param string cmekConfigName Resource name of the CmekConfig to use for
|
---|
90 | * protecting this DataStore.
|
---|
91 | * @opt_param bool createAdvancedSiteSearch A boolean flag indicating whether
|
---|
92 | * user want to directly create an advanced data store for site search. If the
|
---|
93 | * data store is not configured as site search (GENERIC vertical and
|
---|
94 | * PUBLIC_WEBSITE content_config), this flag will be ignored.
|
---|
95 | * @opt_param string dataStoreId Required. The ID to use for the DataStore,
|
---|
96 | * which will become the final component of the DataStore's resource name. This
|
---|
97 | * field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
|
---|
98 | * standard with a length limit of 63 characters. Otherwise, an INVALID_ARGUMENT
|
---|
99 | * error is returned.
|
---|
100 | * @opt_param bool disableCmek DataStore without CMEK protections. If a default
|
---|
101 | * CmekConfig is set for the project, setting this field will override the
|
---|
102 | * default CmekConfig as well.
|
---|
103 | * @opt_param bool skipDefaultSchemaCreation A boolean flag indicating whether
|
---|
104 | * to skip the default schema creation for the data store. Only enable this flag
|
---|
105 | * if you are certain that the default schema is incompatible with your use
|
---|
106 | * case. If set to true, you must manually create a schema for the data store
|
---|
107 | * before any documents can be ingested. This flag cannot be specified if
|
---|
108 | * `data_store.starting_schema` is specified.
|
---|
109 | * @return GoogleLongrunningOperation
|
---|
110 | * @throws \Google\Service\Exception
|
---|
111 | */
|
---|
112 | public function create($parent, GoogleCloudDiscoveryengineV1DataStore $postBody, $optParams = [])
|
---|
113 | {
|
---|
114 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
115 | $params = array_merge($params, $optParams);
|
---|
116 | return $this->call('create', [$params], GoogleLongrunningOperation::class);
|
---|
117 | }
|
---|
118 | /**
|
---|
119 | * Deletes a DataStore. (dataStores.delete)
|
---|
120 | *
|
---|
121 | * @param string $name Required. Full resource name of DataStore, such as `proje
|
---|
122 | * cts/{project}/locations/{location}/collections/{collection_id}/dataStores/{da
|
---|
123 | * ta_store_id}`. If the caller does not have permission to delete the
|
---|
124 | * DataStore, regardless of whether or not it exists, a PERMISSION_DENIED error
|
---|
125 | * is returned. If the DataStore to delete does not exist, a NOT_FOUND error is
|
---|
126 | * returned.
|
---|
127 | * @param array $optParams Optional parameters.
|
---|
128 | * @return GoogleLongrunningOperation
|
---|
129 | * @throws \Google\Service\Exception
|
---|
130 | */
|
---|
131 | public function delete($name, $optParams = [])
|
---|
132 | {
|
---|
133 | $params = ['name' => $name];
|
---|
134 | $params = array_merge($params, $optParams);
|
---|
135 | return $this->call('delete', [$params], GoogleLongrunningOperation::class);
|
---|
136 | }
|
---|
137 | /**
|
---|
138 | * Gets a DataStore. (dataStores.get)
|
---|
139 | *
|
---|
140 | * @param string $name Required. Full resource name of DataStore, such as `proje
|
---|
141 | * cts/{project}/locations/{location}/collections/{collection_id}/dataStores/{da
|
---|
142 | * ta_store_id}`. If the caller does not have permission to access the
|
---|
143 | * DataStore, regardless of whether or not it exists, a PERMISSION_DENIED error
|
---|
144 | * is returned. If the requested DataStore does not exist, a NOT_FOUND error is
|
---|
145 | * returned.
|
---|
146 | * @param array $optParams Optional parameters.
|
---|
147 | * @return GoogleCloudDiscoveryengineV1DataStore
|
---|
148 | * @throws \Google\Service\Exception
|
---|
149 | */
|
---|
150 | public function get($name, $optParams = [])
|
---|
151 | {
|
---|
152 | $params = ['name' => $name];
|
---|
153 | $params = array_merge($params, $optParams);
|
---|
154 | return $this->call('get', [$params], GoogleCloudDiscoveryengineV1DataStore::class);
|
---|
155 | }
|
---|
156 | /**
|
---|
157 | * Gets the SiteSearchEngine. (dataStores.getSiteSearchEngine)
|
---|
158 | *
|
---|
159 | * @param string $name Required. Resource name of SiteSearchEngine, such as `pro
|
---|
160 | * jects/{project}/locations/{location}/collections/{collection}/dataStores/{dat
|
---|
161 | * a_store}/siteSearchEngine`. If the caller does not have permission to access
|
---|
162 | * the [SiteSearchEngine], regardless of whether or not it exists, a
|
---|
163 | * PERMISSION_DENIED error is returned.
|
---|
164 | * @param array $optParams Optional parameters.
|
---|
165 | * @return GoogleCloudDiscoveryengineV1SiteSearchEngine
|
---|
166 | * @throws \Google\Service\Exception
|
---|
167 | */
|
---|
168 | public function getSiteSearchEngine($name, $optParams = [])
|
---|
169 | {
|
---|
170 | $params = ['name' => $name];
|
---|
171 | $params = array_merge($params, $optParams);
|
---|
172 | return $this->call('getSiteSearchEngine', [$params], GoogleCloudDiscoveryengineV1SiteSearchEngine::class);
|
---|
173 | }
|
---|
174 | /**
|
---|
175 | * Lists all the DataStores associated with the project.
|
---|
176 | * (dataStores.listProjectsLocationsDataStores)
|
---|
177 | *
|
---|
178 | * @param string $parent Required. The parent branch resource name, such as
|
---|
179 | * `projects/{project}/locations/{location}/collections/{collection_id}`. If the
|
---|
180 | * caller does not have permission to list DataStores under this location,
|
---|
181 | * regardless of whether or not this data store exists, a PERMISSION_DENIED
|
---|
182 | * error is returned.
|
---|
183 | * @param array $optParams Optional parameters.
|
---|
184 | *
|
---|
185 | * @opt_param string filter Filter by solution type . For example: `filter =
|
---|
186 | * 'solution_type:SOLUTION_TYPE_SEARCH'`
|
---|
187 | * @opt_param int pageSize Maximum number of DataStores to return. If
|
---|
188 | * unspecified, defaults to 10. The maximum allowed value is 50. Values above 50
|
---|
189 | * will be coerced to 50. If this field is negative, an INVALID_ARGUMENT is
|
---|
190 | * returned.
|
---|
191 | * @opt_param string pageToken A page token
|
---|
192 | * ListDataStoresResponse.next_page_token, received from a previous
|
---|
193 | * DataStoreService.ListDataStores call. Provide this to retrieve the subsequent
|
---|
194 | * page. When paginating, all other parameters provided to
|
---|
195 | * DataStoreService.ListDataStores must match the call that provided the page
|
---|
196 | * token. Otherwise, an INVALID_ARGUMENT error is returned.
|
---|
197 | * @return GoogleCloudDiscoveryengineV1ListDataStoresResponse
|
---|
198 | * @throws \Google\Service\Exception
|
---|
199 | */
|
---|
200 | public function listProjectsLocationsDataStores($parent, $optParams = [])
|
---|
201 | {
|
---|
202 | $params = ['parent' => $parent];
|
---|
203 | $params = array_merge($params, $optParams);
|
---|
204 | return $this->call('list', [$params], GoogleCloudDiscoveryengineV1ListDataStoresResponse::class);
|
---|
205 | }
|
---|
206 | /**
|
---|
207 | * Updates a DataStore (dataStores.patch)
|
---|
208 | *
|
---|
209 | * @param string $name Immutable. The full resource name of the data store.
|
---|
210 | * Format: `projects/{project}/locations/{location}/collections/{collection_id}/
|
---|
211 | * dataStores/{data_store_id}`. This field must be a UTF-8 encoded string with a
|
---|
212 | * length limit of 1024 characters.
|
---|
213 | * @param GoogleCloudDiscoveryengineV1DataStore $postBody
|
---|
214 | * @param array $optParams Optional parameters.
|
---|
215 | *
|
---|
216 | * @opt_param string updateMask Indicates which fields in the provided DataStore
|
---|
217 | * to update. If an unsupported or unknown field is provided, an
|
---|
218 | * INVALID_ARGUMENT error is returned.
|
---|
219 | * @return GoogleCloudDiscoveryengineV1DataStore
|
---|
220 | * @throws \Google\Service\Exception
|
---|
221 | */
|
---|
222 | public function patch($name, GoogleCloudDiscoveryengineV1DataStore $postBody, $optParams = [])
|
---|
223 | {
|
---|
224 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
225 | $params = array_merge($params, $optParams);
|
---|
226 | return $this->call('patch', [$params], GoogleCloudDiscoveryengineV1DataStore::class);
|
---|
227 | }
|
---|
228 | }
|
---|
229 |
|
---|
230 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
231 | class_alias(ProjectsLocationsDataStores::class, 'Google_Service_DiscoveryEngine_Resource_ProjectsLocationsDataStores');
|
---|