source: vendor/google/apiclient-services/src/DiscoveryEngine/Resource/ProjectsLocationsCollectionsDataStores.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 12 days ago

Upload project files

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