@google-cloud/discoveryengine 0.4.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +8 -0
  3. package/build/protos/google/cloud/discoveryengine/v1beta/common.proto +43 -10
  4. package/build/protos/google/cloud/discoveryengine/v1beta/completion_service.proto +116 -0
  5. package/build/protos/google/cloud/discoveryengine/v1beta/document.proto +45 -3
  6. package/build/protos/google/cloud/discoveryengine/v1beta/document_service.proto +46 -12
  7. package/build/protos/google/cloud/discoveryengine/v1beta/import_config.proto +26 -8
  8. package/build/protos/google/cloud/discoveryengine/v1beta/purge_config.proto +86 -0
  9. package/build/protos/google/cloud/discoveryengine/v1beta/recommendation_service.proto +15 -14
  10. package/build/protos/google/cloud/discoveryengine/v1beta/schema.proto +58 -0
  11. package/build/protos/google/cloud/discoveryengine/v1beta/schema_service.proto +259 -0
  12. package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +546 -0
  13. package/build/protos/google/cloud/discoveryengine/v1beta/user_event.proto +31 -25
  14. package/build/protos/protos.d.ts +5965 -1866
  15. package/build/protos/protos.js +39781 -1
  16. package/build/protos/protos.json +3963 -1
  17. package/build/src/index.d.ts +10 -1
  18. package/build/src/index.js +10 -1
  19. package/build/src/v1beta/completion_service_client.d.ts +455 -0
  20. package/build/src/v1beta/completion_service_client.js +659 -0
  21. package/build/src/v1beta/completion_service_client_config.json +43 -0
  22. package/build/src/v1beta/document_service_client.d.ts +174 -18
  23. package/build/src/v1beta/document_service_client.js +177 -6
  24. package/build/src/v1beta/document_service_client_config.json +5 -0
  25. package/build/src/v1beta/index.d.ts +3 -0
  26. package/build/src/v1beta/index.js +7 -1
  27. package/build/src/v1beta/recommendation_service_client.d.ts +108 -14
  28. package/build/src/v1beta/recommendation_service_client.js +128 -0
  29. package/build/src/v1beta/schema_service_client.d.ts +798 -0
  30. package/build/src/v1beta/schema_service_client.js +1122 -0
  31. package/build/src/v1beta/schema_service_client_config.json +63 -0
  32. package/build/src/v1beta/search_service_client.d.ts +851 -0
  33. package/build/src/v1beta/search_service_client.js +1070 -0
  34. package/build/src/v1beta/search_service_client_config.json +43 -0
  35. package/build/src/v1beta/user_event_service_client.d.ts +93 -0
  36. package/build/src/v1beta/user_event_service_client.js +128 -0
  37. package/package.json +8 -6
@@ -0,0 +1,1070 @@
1
+ "use strict";
2
+ // Copyright 2023 Google LLC
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // https://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+ // ** This file is automatically generated by gapic-generator-typescript. **
17
+ // ** https://github.com/googleapis/gapic-generator-typescript **
18
+ // ** All changes to this file may be overwritten. **
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.SearchServiceClient = void 0;
21
+ const jsonProtos = require("../../protos/protos.json");
22
+ /**
23
+ * Client JSON configuration object, loaded from
24
+ * `src/v1beta/search_service_client_config.json`.
25
+ * This file defines retry strategy and timeouts for all API methods in this library.
26
+ */
27
+ const gapicConfig = require("./search_service_client_config.json");
28
+ const version = require('../../../package.json').version;
29
+ /**
30
+ * Service for search.
31
+ * @class
32
+ * @memberof v1beta
33
+ */
34
+ class SearchServiceClient {
35
+ /**
36
+ * Construct an instance of SearchServiceClient.
37
+ *
38
+ * @param {object} [options] - The configuration object.
39
+ * The options accepted by the constructor are described in detail
40
+ * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
41
+ * The common options are:
42
+ * @param {object} [options.credentials] - Credentials object.
43
+ * @param {string} [options.credentials.client_email]
44
+ * @param {string} [options.credentials.private_key]
45
+ * @param {string} [options.email] - Account email address. Required when
46
+ * using a .pem or .p12 keyFilename.
47
+ * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
48
+ * .p12 key downloaded from the Google Developers Console. If you provide
49
+ * a path to a JSON file, the projectId option below is not necessary.
50
+ * NOTE: .pem and .p12 require you to specify options.email as well.
51
+ * @param {number} [options.port] - The port on which to connect to
52
+ * the remote host.
53
+ * @param {string} [options.projectId] - The project ID from the Google
54
+ * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
55
+ * the environment variable GCLOUD_PROJECT for your project ID. If your
56
+ * app is running in an environment which supports
57
+ * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
58
+ * your project ID will be detected automatically.
59
+ * @param {string} [options.apiEndpoint] - The domain name of the
60
+ * API remote host.
61
+ * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
62
+ * Follows the structure of {@link gapicConfig}.
63
+ * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
64
+ * Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
65
+ * For more information, please check the
66
+ * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
67
+ * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
68
+ * need to avoid loading the default gRPC version and want to use the fallback
69
+ * HTTP implementation. Load only fallback version and pass it to the constructor:
70
+ * ```
71
+ * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
72
+ * const client = new SearchServiceClient({fallback: 'rest'}, gax);
73
+ * ```
74
+ */
75
+ constructor(opts, gaxInstance) {
76
+ var _a, _b;
77
+ this._terminated = false;
78
+ this.descriptors = {
79
+ page: {},
80
+ stream: {},
81
+ longrunning: {},
82
+ batching: {},
83
+ };
84
+ // Ensure that options include all the required fields.
85
+ const staticMembers = this.constructor;
86
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath;
87
+ this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
88
+ const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
89
+ const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {};
90
+ const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
91
+ opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
92
+ // Request numeric enum values if REST transport is used.
93
+ opts.numericEnums = true;
94
+ // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
95
+ if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
96
+ opts['scopes'] = staticMembers.scopes;
97
+ }
98
+ // Load google-gax module synchronously if needed
99
+ if (!gaxInstance) {
100
+ gaxInstance = require('google-gax');
101
+ }
102
+ // Choose either gRPC or proto-over-HTTP implementation of google-gax.
103
+ this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;
104
+ // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
105
+ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
106
+ // Save options to use in initialize() method.
107
+ this._opts = opts;
108
+ // Save the auth object to the client, for use by other methods.
109
+ this.auth = this._gaxGrpc.auth;
110
+ // Set useJWTAccessWithScope on the auth object.
111
+ this.auth.useJWTAccessWithScope = true;
112
+ // Set defaultServicePath on the auth object.
113
+ this.auth.defaultServicePath = staticMembers.servicePath;
114
+ // Set the default scopes in auth client if needed.
115
+ if (servicePath === staticMembers.servicePath) {
116
+ this.auth.defaultScopes = staticMembers.scopes;
117
+ }
118
+ // Determine the client header string.
119
+ const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
120
+ if (typeof process !== 'undefined' && 'versions' in process) {
121
+ clientHeader.push(`gl-node/${process.versions.node}`);
122
+ }
123
+ else {
124
+ clientHeader.push(`gl-web/${this._gaxModule.version}`);
125
+ }
126
+ if (!opts.fallback) {
127
+ clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
128
+ }
129
+ else if (opts.fallback === 'rest') {
130
+ clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
131
+ }
132
+ if (opts.libName && opts.libVersion) {
133
+ clientHeader.push(`${opts.libName}/${opts.libVersion}`);
134
+ }
135
+ // Load the applicable protos.
136
+ this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos);
137
+ // This API contains "path templates"; forward-slash-separated
138
+ // identifiers to uniquely identify resources within the API.
139
+ // Create useful helper objects for these.
140
+ this.pathTemplates = {
141
+ projectLocationCollectionDataStoreBranchPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}'),
142
+ projectLocationCollectionDataStoreBranchDocumentPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}'),
143
+ projectLocationCollectionDataStoreSchemaPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}'),
144
+ projectLocationCollectionDataStoreServingConfigPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}'),
145
+ projectLocationDataStoreBranchPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}'),
146
+ projectLocationDataStoreBranchDocumentPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}'),
147
+ projectLocationDataStoreSchemaPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}'),
148
+ projectLocationDataStoreServingConfigPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}'),
149
+ };
150
+ // Some of the methods on this service return "paged" results,
151
+ // (e.g. 50 results at a time, with tokens to get subsequent
152
+ // pages). Denote the keys used for pagination and results.
153
+ this.descriptors.page = {
154
+ search: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'results'),
155
+ };
156
+ // Put together the default options sent with requests.
157
+ this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1beta.SearchService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
158
+ // Set up a dictionary of "inner API calls"; the core implementation
159
+ // of calling the API is handled in `google-gax`, with this code
160
+ // merely providing the destination and request information.
161
+ this.innerApiCalls = {};
162
+ // Add a warn function to the client constructor so it can be easily tested.
163
+ this.warn = this._gaxModule.warn;
164
+ }
165
+ /**
166
+ * Initialize the client.
167
+ * Performs asynchronous operations (such as authentication) and prepares the client.
168
+ * This function will be called automatically when any class method is called for the
169
+ * first time, but if you need to initialize it before calling an actual method,
170
+ * feel free to call initialize() directly.
171
+ *
172
+ * You can await on this method if you want to make sure the client is initialized.
173
+ *
174
+ * @returns {Promise} A promise that resolves to an authenticated service stub.
175
+ */
176
+ initialize() {
177
+ // If the client stub promise is already initialized, return immediately.
178
+ if (this.searchServiceStub) {
179
+ return this.searchServiceStub;
180
+ }
181
+ // Put together the "service stub" for
182
+ // google.cloud.discoveryengine.v1beta.SearchService.
183
+ this.searchServiceStub = this._gaxGrpc.createStub(this._opts.fallback
184
+ ? this._protos.lookupService('google.cloud.discoveryengine.v1beta.SearchService')
185
+ : // eslint-disable-next-line @typescript-eslint/no-explicit-any
186
+ this._protos.google.cloud.discoveryengine.v1beta
187
+ .SearchService, this._opts, this._providedCustomServicePath);
188
+ // Iterate over each of the methods that the service provides
189
+ // and create an API call method for each.
190
+ const searchServiceStubMethods = ['search'];
191
+ for (const methodName of searchServiceStubMethods) {
192
+ const callPromise = this.searchServiceStub.then(stub => (...args) => {
193
+ if (this._terminated) {
194
+ return Promise.reject('The client has already been closed.');
195
+ }
196
+ const func = stub[methodName];
197
+ return func.apply(stub, args);
198
+ }, (err) => () => {
199
+ throw err;
200
+ });
201
+ const descriptor = this.descriptors.page[methodName] || undefined;
202
+ const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
203
+ this.innerApiCalls[methodName] = apiCall;
204
+ }
205
+ return this.searchServiceStub;
206
+ }
207
+ /**
208
+ * The DNS address for this API service.
209
+ * @returns {string} The DNS address for this service.
210
+ */
211
+ static get servicePath() {
212
+ return 'discoveryengine.googleapis.com';
213
+ }
214
+ /**
215
+ * The DNS address for this API service - same as servicePath(),
216
+ * exists for compatibility reasons.
217
+ * @returns {string} The DNS address for this service.
218
+ */
219
+ static get apiEndpoint() {
220
+ return 'discoveryengine.googleapis.com';
221
+ }
222
+ /**
223
+ * The port for this API service.
224
+ * @returns {number} The default port for this service.
225
+ */
226
+ static get port() {
227
+ return 443;
228
+ }
229
+ /**
230
+ * The scopes needed to make gRPC calls for every method defined
231
+ * in this service.
232
+ * @returns {string[]} List of default scopes.
233
+ */
234
+ static get scopes() {
235
+ return ['https://www.googleapis.com/auth/cloud-platform'];
236
+ }
237
+ /**
238
+ * Return the project ID used by this class.
239
+ * @returns {Promise} A promise that resolves to string containing the project ID.
240
+ */
241
+ getProjectId(callback) {
242
+ if (callback) {
243
+ this.auth.getProjectId(callback);
244
+ return;
245
+ }
246
+ return this.auth.getProjectId();
247
+ }
248
+ search(request, optionsOrCallback, callback) {
249
+ var _a;
250
+ request = request || {};
251
+ let options;
252
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
253
+ callback = optionsOrCallback;
254
+ options = {};
255
+ }
256
+ else {
257
+ options = optionsOrCallback;
258
+ }
259
+ options = options || {};
260
+ options.otherArgs = options.otherArgs || {};
261
+ options.otherArgs.headers = options.otherArgs.headers || {};
262
+ options.otherArgs.headers['x-goog-request-params'] =
263
+ this._gaxModule.routingHeader.fromParams({
264
+ serving_config: (_a = request.servingConfig) !== null && _a !== void 0 ? _a : '',
265
+ });
266
+ this.initialize();
267
+ return this.innerApiCalls.search(request, options, callback);
268
+ }
269
+ /**
270
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
271
+ * @param {Object} request
272
+ * The request object that will be sent.
273
+ * @param {string} request.servingConfig
274
+ * Required. The resource name of the Search serving config, such as
275
+ * `projects/* /locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
276
+ * This field is used to identify the serving configuration name, set
277
+ * of models used to make the search.
278
+ * @param {string} request.branch
279
+ * The branch resource name, such as
280
+ * `projects/* /locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
281
+ *
282
+ * Use `default_branch` as the branch ID or leave this field empty, to search
283
+ * documents under the default branch.
284
+ * @param {string} request.query
285
+ * Raw search query.
286
+ * @param {number} request.pageSize
287
+ * Maximum number of {@link google.cloud.discoveryengine.v1beta.Document|Document}s
288
+ * to return. If unspecified, defaults to a reasonable value. The maximum
289
+ * allowed value is 100. Values above 100 will be coerced to 100.
290
+ *
291
+ * If this field is negative, an `INVALID_ARGUMENT` is returned.
292
+ * @param {string} request.pageToken
293
+ * A page token received from a previous
294
+ * {@link google.cloud.discoveryengine.v1beta.SearchService.Search|SearchService.Search}
295
+ * call. Provide this to retrieve the subsequent page.
296
+ *
297
+ * When paginating, all other parameters provided to
298
+ * {@link google.cloud.discoveryengine.v1beta.SearchService.Search|SearchService.Search}
299
+ * must match the call that provided the page token. Otherwise, an
300
+ * `INVALID_ARGUMENT` error is returned.
301
+ * @param {number} request.offset
302
+ * A 0-indexed integer that specifies the current offset (that is, starting
303
+ * result location, amongst the
304
+ * {@link google.cloud.discoveryengine.v1beta.Document|Document}s deemed by the API
305
+ * as relevant) in search results. This field is only considered if
306
+ * {@link google.cloud.discoveryengine.v1beta.SearchRequest.page_token|page_token}
307
+ * is unset.
308
+ *
309
+ * If this field is negative, an `INVALID_ARGUMENT` is returned.
310
+ * @param {string} request.filter
311
+ * The filter syntax consists of an expression language for constructing a
312
+ * predicate from one or more fields of the documents being filtered. Filter
313
+ * expression is case-sensitive.
314
+ *
315
+ * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
316
+ * @param {string} request.orderBy
317
+ * The order in which documents are returned. Document can be ordered by
318
+ * a field in an {@link google.cloud.discoveryengine.v1beta.Document|Document}
319
+ * object. Leave it unset if ordered by relevance. OrderBy expression is
320
+ * case-sensitive.
321
+ *
322
+ * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
323
+ * @param {number[]} request.facetSpecs
324
+ * Facet specifications for faceted search. If empty, no facets are returned.
325
+ *
326
+ * A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
327
+ * error is returned.
328
+ * @param {google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec} request.boostSpec
329
+ * Boost specification to boost certain documents.
330
+ * @param {number[]} request.params
331
+ * Additional search parameters.
332
+ *
333
+ * For
334
+ * {@link google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH|IndustryVertical.SITE_SEARCH}
335
+ * vertical, supported values are:
336
+ *
337
+ * * `user_country_code`: string. Default empty. If set to non-empty, results
338
+ * are restricted or boosted based on the location provided.
339
+ * * `search_type`: double. Default empty. Enables non-webpage searching
340
+ * depending on the value. The only valid non-default value is 1,
341
+ * which enables image searching.
342
+ * This field is ignored for other verticals.
343
+ * @param {google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec
344
+ * The query expansion specification that specifies the conditions under which
345
+ * query expansion will occur.
346
+ * @param {google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec} request.spellCorrectionSpec
347
+ * The spell correction specification that specifies the mode under
348
+ * which spell correction will take effect.
349
+ * @param {string} request.userPseudoId
350
+ * A unique identifier for tracking visitors. For example, this could be
351
+ * implemented with an HTTP cookie, which should be able to uniquely identify
352
+ * a visitor on a single device. This unique identifier should not change if
353
+ * the visitor logs in or out of the website.
354
+ *
355
+ * This field should NOT have a fixed value such as `unknown_visitor`.
356
+ *
357
+ * This should be the same identifier as
358
+ * {@link google.cloud.discoveryengine.v1beta.UserEvent.user_pseudo_id|UserEvent.user_pseudo_id}
359
+ * and
360
+ * {@link google.cloud.discoveryengine.v1beta.CompleteQueryRequest.user_pseudo_id|CompleteQueryRequest.user_pseudo_id}
361
+ *
362
+ * The field must be a UTF-8 encoded string with a length limit of 128
363
+ * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
364
+ * @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec} request.contentSearchSpec
365
+ * The content search spec that configs the desired behavior of content
366
+ * search.
367
+ * @param {object} [options]
368
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
369
+ * @returns {Stream}
370
+ * An object stream which emits an object representing {@link google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult | SearchResult} on 'data' event.
371
+ * The client library will perform auto-pagination by default: it will call the API as many
372
+ * times as needed. Note that it can affect your quota.
373
+ * We recommend using `searchAsync()`
374
+ * method described below for async iteration which you can stop as needed.
375
+ * Please see the
376
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
377
+ * for more details and examples.
378
+ */
379
+ searchStream(request, options) {
380
+ var _a;
381
+ request = request || {};
382
+ options = options || {};
383
+ options.otherArgs = options.otherArgs || {};
384
+ options.otherArgs.headers = options.otherArgs.headers || {};
385
+ options.otherArgs.headers['x-goog-request-params'] =
386
+ this._gaxModule.routingHeader.fromParams({
387
+ serving_config: (_a = request.servingConfig) !== null && _a !== void 0 ? _a : '',
388
+ });
389
+ const defaultCallSettings = this._defaults['search'];
390
+ const callSettings = defaultCallSettings.merge(options);
391
+ this.initialize();
392
+ return this.descriptors.page.search.createStream(this.innerApiCalls.search, request, callSettings);
393
+ }
394
+ /**
395
+ * Equivalent to `search`, but returns an iterable object.
396
+ *
397
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
398
+ * @param {Object} request
399
+ * The request object that will be sent.
400
+ * @param {string} request.servingConfig
401
+ * Required. The resource name of the Search serving config, such as
402
+ * `projects/* /locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
403
+ * This field is used to identify the serving configuration name, set
404
+ * of models used to make the search.
405
+ * @param {string} request.branch
406
+ * The branch resource name, such as
407
+ * `projects/* /locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
408
+ *
409
+ * Use `default_branch` as the branch ID or leave this field empty, to search
410
+ * documents under the default branch.
411
+ * @param {string} request.query
412
+ * Raw search query.
413
+ * @param {number} request.pageSize
414
+ * Maximum number of {@link google.cloud.discoveryengine.v1beta.Document|Document}s
415
+ * to return. If unspecified, defaults to a reasonable value. The maximum
416
+ * allowed value is 100. Values above 100 will be coerced to 100.
417
+ *
418
+ * If this field is negative, an `INVALID_ARGUMENT` is returned.
419
+ * @param {string} request.pageToken
420
+ * A page token received from a previous
421
+ * {@link google.cloud.discoveryengine.v1beta.SearchService.Search|SearchService.Search}
422
+ * call. Provide this to retrieve the subsequent page.
423
+ *
424
+ * When paginating, all other parameters provided to
425
+ * {@link google.cloud.discoveryengine.v1beta.SearchService.Search|SearchService.Search}
426
+ * must match the call that provided the page token. Otherwise, an
427
+ * `INVALID_ARGUMENT` error is returned.
428
+ * @param {number} request.offset
429
+ * A 0-indexed integer that specifies the current offset (that is, starting
430
+ * result location, amongst the
431
+ * {@link google.cloud.discoveryengine.v1beta.Document|Document}s deemed by the API
432
+ * as relevant) in search results. This field is only considered if
433
+ * {@link google.cloud.discoveryengine.v1beta.SearchRequest.page_token|page_token}
434
+ * is unset.
435
+ *
436
+ * If this field is negative, an `INVALID_ARGUMENT` is returned.
437
+ * @param {string} request.filter
438
+ * The filter syntax consists of an expression language for constructing a
439
+ * predicate from one or more fields of the documents being filtered. Filter
440
+ * expression is case-sensitive.
441
+ *
442
+ * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
443
+ * @param {string} request.orderBy
444
+ * The order in which documents are returned. Document can be ordered by
445
+ * a field in an {@link google.cloud.discoveryengine.v1beta.Document|Document}
446
+ * object. Leave it unset if ordered by relevance. OrderBy expression is
447
+ * case-sensitive.
448
+ *
449
+ * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
450
+ * @param {number[]} request.facetSpecs
451
+ * Facet specifications for faceted search. If empty, no facets are returned.
452
+ *
453
+ * A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
454
+ * error is returned.
455
+ * @param {google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec} request.boostSpec
456
+ * Boost specification to boost certain documents.
457
+ * @param {number[]} request.params
458
+ * Additional search parameters.
459
+ *
460
+ * For
461
+ * {@link google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH|IndustryVertical.SITE_SEARCH}
462
+ * vertical, supported values are:
463
+ *
464
+ * * `user_country_code`: string. Default empty. If set to non-empty, results
465
+ * are restricted or boosted based on the location provided.
466
+ * * `search_type`: double. Default empty. Enables non-webpage searching
467
+ * depending on the value. The only valid non-default value is 1,
468
+ * which enables image searching.
469
+ * This field is ignored for other verticals.
470
+ * @param {google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec
471
+ * The query expansion specification that specifies the conditions under which
472
+ * query expansion will occur.
473
+ * @param {google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec} request.spellCorrectionSpec
474
+ * The spell correction specification that specifies the mode under
475
+ * which spell correction will take effect.
476
+ * @param {string} request.userPseudoId
477
+ * A unique identifier for tracking visitors. For example, this could be
478
+ * implemented with an HTTP cookie, which should be able to uniquely identify
479
+ * a visitor on a single device. This unique identifier should not change if
480
+ * the visitor logs in or out of the website.
481
+ *
482
+ * This field should NOT have a fixed value such as `unknown_visitor`.
483
+ *
484
+ * This should be the same identifier as
485
+ * {@link google.cloud.discoveryengine.v1beta.UserEvent.user_pseudo_id|UserEvent.user_pseudo_id}
486
+ * and
487
+ * {@link google.cloud.discoveryengine.v1beta.CompleteQueryRequest.user_pseudo_id|CompleteQueryRequest.user_pseudo_id}
488
+ *
489
+ * The field must be a UTF-8 encoded string with a length limit of 128
490
+ * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
491
+ * @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec} request.contentSearchSpec
492
+ * The content search spec that configs the desired behavior of content
493
+ * search.
494
+ * @param {object} [options]
495
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
496
+ * @returns {Object}
497
+ * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
498
+ * When you iterate the returned iterable, each element will be an object representing
499
+ * {@link google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult | SearchResult}. The API will be called under the hood as needed, once per the page,
500
+ * so you can stop the iteration when you don't need more results.
501
+ * Please see the
502
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
503
+ * for more details and examples.
504
+ * @example <caption>include:samples/generated/v1beta/search_service.search.js</caption>
505
+ * region_tag:discoveryengine_v1beta_generated_SearchService_Search_async
506
+ */
507
+ searchAsync(request, options) {
508
+ var _a;
509
+ request = request || {};
510
+ options = options || {};
511
+ options.otherArgs = options.otherArgs || {};
512
+ options.otherArgs.headers = options.otherArgs.headers || {};
513
+ options.otherArgs.headers['x-goog-request-params'] =
514
+ this._gaxModule.routingHeader.fromParams({
515
+ serving_config: (_a = request.servingConfig) !== null && _a !== void 0 ? _a : '',
516
+ });
517
+ const defaultCallSettings = this._defaults['search'];
518
+ const callSettings = defaultCallSettings.merge(options);
519
+ this.initialize();
520
+ return this.descriptors.page.search.asyncIterate(this.innerApiCalls['search'], request, callSettings);
521
+ }
522
+ // --------------------
523
+ // -- Path templates --
524
+ // --------------------
525
+ /**
526
+ * Return a fully-qualified projectLocationCollectionDataStoreBranch resource name string.
527
+ *
528
+ * @param {string} project
529
+ * @param {string} location
530
+ * @param {string} collection
531
+ * @param {string} data_store
532
+ * @param {string} branch
533
+ * @returns {string} Resource name string.
534
+ */
535
+ projectLocationCollectionDataStoreBranchPath(project, location, collection, dataStore, branch) {
536
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.render({
537
+ project: project,
538
+ location: location,
539
+ collection: collection,
540
+ data_store: dataStore,
541
+ branch: branch,
542
+ });
543
+ }
544
+ /**
545
+ * Parse the project from ProjectLocationCollectionDataStoreBranch resource.
546
+ *
547
+ * @param {string} projectLocationCollectionDataStoreBranchName
548
+ * A fully-qualified path representing project_location_collection_data_store_branch resource.
549
+ * @returns {string} A string representing the project.
550
+ */
551
+ matchProjectFromProjectLocationCollectionDataStoreBranchName(projectLocationCollectionDataStoreBranchName) {
552
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match(projectLocationCollectionDataStoreBranchName).project;
553
+ }
554
+ /**
555
+ * Parse the location from ProjectLocationCollectionDataStoreBranch resource.
556
+ *
557
+ * @param {string} projectLocationCollectionDataStoreBranchName
558
+ * A fully-qualified path representing project_location_collection_data_store_branch resource.
559
+ * @returns {string} A string representing the location.
560
+ */
561
+ matchLocationFromProjectLocationCollectionDataStoreBranchName(projectLocationCollectionDataStoreBranchName) {
562
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match(projectLocationCollectionDataStoreBranchName).location;
563
+ }
564
+ /**
565
+ * Parse the collection from ProjectLocationCollectionDataStoreBranch resource.
566
+ *
567
+ * @param {string} projectLocationCollectionDataStoreBranchName
568
+ * A fully-qualified path representing project_location_collection_data_store_branch resource.
569
+ * @returns {string} A string representing the collection.
570
+ */
571
+ matchCollectionFromProjectLocationCollectionDataStoreBranchName(projectLocationCollectionDataStoreBranchName) {
572
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match(projectLocationCollectionDataStoreBranchName).collection;
573
+ }
574
+ /**
575
+ * Parse the data_store from ProjectLocationCollectionDataStoreBranch resource.
576
+ *
577
+ * @param {string} projectLocationCollectionDataStoreBranchName
578
+ * A fully-qualified path representing project_location_collection_data_store_branch resource.
579
+ * @returns {string} A string representing the data_store.
580
+ */
581
+ matchDataStoreFromProjectLocationCollectionDataStoreBranchName(projectLocationCollectionDataStoreBranchName) {
582
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match(projectLocationCollectionDataStoreBranchName).data_store;
583
+ }
584
+ /**
585
+ * Parse the branch from ProjectLocationCollectionDataStoreBranch resource.
586
+ *
587
+ * @param {string} projectLocationCollectionDataStoreBranchName
588
+ * A fully-qualified path representing project_location_collection_data_store_branch resource.
589
+ * @returns {string} A string representing the branch.
590
+ */
591
+ matchBranchFromProjectLocationCollectionDataStoreBranchName(projectLocationCollectionDataStoreBranchName) {
592
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match(projectLocationCollectionDataStoreBranchName).branch;
593
+ }
594
+ /**
595
+ * Return a fully-qualified projectLocationCollectionDataStoreBranchDocument resource name string.
596
+ *
597
+ * @param {string} project
598
+ * @param {string} location
599
+ * @param {string} collection
600
+ * @param {string} data_store
601
+ * @param {string} branch
602
+ * @param {string} document
603
+ * @returns {string} Resource name string.
604
+ */
605
+ projectLocationCollectionDataStoreBranchDocumentPath(project, location, collection, dataStore, branch, document) {
606
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.render({
607
+ project: project,
608
+ location: location,
609
+ collection: collection,
610
+ data_store: dataStore,
611
+ branch: branch,
612
+ document: document,
613
+ });
614
+ }
615
+ /**
616
+ * Parse the project from ProjectLocationCollectionDataStoreBranchDocument resource.
617
+ *
618
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
619
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
620
+ * @returns {string} A string representing the project.
621
+ */
622
+ matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
623
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).project;
624
+ }
625
+ /**
626
+ * Parse the location from ProjectLocationCollectionDataStoreBranchDocument resource.
627
+ *
628
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
629
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
630
+ * @returns {string} A string representing the location.
631
+ */
632
+ matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
633
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).location;
634
+ }
635
+ /**
636
+ * Parse the collection from ProjectLocationCollectionDataStoreBranchDocument resource.
637
+ *
638
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
639
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
640
+ * @returns {string} A string representing the collection.
641
+ */
642
+ matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
643
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).collection;
644
+ }
645
+ /**
646
+ * Parse the data_store from ProjectLocationCollectionDataStoreBranchDocument resource.
647
+ *
648
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
649
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
650
+ * @returns {string} A string representing the data_store.
651
+ */
652
+ matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
653
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).data_store;
654
+ }
655
+ /**
656
+ * Parse the branch from ProjectLocationCollectionDataStoreBranchDocument resource.
657
+ *
658
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
659
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
660
+ * @returns {string} A string representing the branch.
661
+ */
662
+ matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
663
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).branch;
664
+ }
665
+ /**
666
+ * Parse the document from ProjectLocationCollectionDataStoreBranchDocument resource.
667
+ *
668
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
669
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
670
+ * @returns {string} A string representing the document.
671
+ */
672
+ matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
673
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).document;
674
+ }
675
+ /**
676
+ * Return a fully-qualified projectLocationCollectionDataStoreSchema resource name string.
677
+ *
678
+ * @param {string} project
679
+ * @param {string} location
680
+ * @param {string} collection
681
+ * @param {string} data_store
682
+ * @param {string} schema
683
+ * @returns {string} Resource name string.
684
+ */
685
+ projectLocationCollectionDataStoreSchemaPath(project, location, collection, dataStore, schema) {
686
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.render({
687
+ project: project,
688
+ location: location,
689
+ collection: collection,
690
+ data_store: dataStore,
691
+ schema: schema,
692
+ });
693
+ }
694
+ /**
695
+ * Parse the project from ProjectLocationCollectionDataStoreSchema resource.
696
+ *
697
+ * @param {string} projectLocationCollectionDataStoreSchemaName
698
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
699
+ * @returns {string} A string representing the project.
700
+ */
701
+ matchProjectFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
702
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).project;
703
+ }
704
+ /**
705
+ * Parse the location from ProjectLocationCollectionDataStoreSchema resource.
706
+ *
707
+ * @param {string} projectLocationCollectionDataStoreSchemaName
708
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
709
+ * @returns {string} A string representing the location.
710
+ */
711
+ matchLocationFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
712
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).location;
713
+ }
714
+ /**
715
+ * Parse the collection from ProjectLocationCollectionDataStoreSchema resource.
716
+ *
717
+ * @param {string} projectLocationCollectionDataStoreSchemaName
718
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
719
+ * @returns {string} A string representing the collection.
720
+ */
721
+ matchCollectionFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
722
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).collection;
723
+ }
724
+ /**
725
+ * Parse the data_store from ProjectLocationCollectionDataStoreSchema resource.
726
+ *
727
+ * @param {string} projectLocationCollectionDataStoreSchemaName
728
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
729
+ * @returns {string} A string representing the data_store.
730
+ */
731
+ matchDataStoreFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
732
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).data_store;
733
+ }
734
+ /**
735
+ * Parse the schema from ProjectLocationCollectionDataStoreSchema resource.
736
+ *
737
+ * @param {string} projectLocationCollectionDataStoreSchemaName
738
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
739
+ * @returns {string} A string representing the schema.
740
+ */
741
+ matchSchemaFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
742
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).schema;
743
+ }
744
+ /**
745
+ * Return a fully-qualified projectLocationCollectionDataStoreServingConfig resource name string.
746
+ *
747
+ * @param {string} project
748
+ * @param {string} location
749
+ * @param {string} collection
750
+ * @param {string} data_store
751
+ * @param {string} serving_config
752
+ * @returns {string} Resource name string.
753
+ */
754
+ projectLocationCollectionDataStoreServingConfigPath(project, location, collection, dataStore, servingConfig) {
755
+ return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.render({
756
+ project: project,
757
+ location: location,
758
+ collection: collection,
759
+ data_store: dataStore,
760
+ serving_config: servingConfig,
761
+ });
762
+ }
763
+ /**
764
+ * Parse the project from ProjectLocationCollectionDataStoreServingConfig resource.
765
+ *
766
+ * @param {string} projectLocationCollectionDataStoreServingConfigName
767
+ * A fully-qualified path representing project_location_collection_data_store_serving_config resource.
768
+ * @returns {string} A string representing the project.
769
+ */
770
+ matchProjectFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName) {
771
+ return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match(projectLocationCollectionDataStoreServingConfigName).project;
772
+ }
773
+ /**
774
+ * Parse the location from ProjectLocationCollectionDataStoreServingConfig resource.
775
+ *
776
+ * @param {string} projectLocationCollectionDataStoreServingConfigName
777
+ * A fully-qualified path representing project_location_collection_data_store_serving_config resource.
778
+ * @returns {string} A string representing the location.
779
+ */
780
+ matchLocationFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName) {
781
+ return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match(projectLocationCollectionDataStoreServingConfigName).location;
782
+ }
783
+ /**
784
+ * Parse the collection from ProjectLocationCollectionDataStoreServingConfig resource.
785
+ *
786
+ * @param {string} projectLocationCollectionDataStoreServingConfigName
787
+ * A fully-qualified path representing project_location_collection_data_store_serving_config resource.
788
+ * @returns {string} A string representing the collection.
789
+ */
790
+ matchCollectionFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName) {
791
+ return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match(projectLocationCollectionDataStoreServingConfigName).collection;
792
+ }
793
+ /**
794
+ * Parse the data_store from ProjectLocationCollectionDataStoreServingConfig resource.
795
+ *
796
+ * @param {string} projectLocationCollectionDataStoreServingConfigName
797
+ * A fully-qualified path representing project_location_collection_data_store_serving_config resource.
798
+ * @returns {string} A string representing the data_store.
799
+ */
800
+ matchDataStoreFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName) {
801
+ return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match(projectLocationCollectionDataStoreServingConfigName).data_store;
802
+ }
803
+ /**
804
+ * Parse the serving_config from ProjectLocationCollectionDataStoreServingConfig resource.
805
+ *
806
+ * @param {string} projectLocationCollectionDataStoreServingConfigName
807
+ * A fully-qualified path representing project_location_collection_data_store_serving_config resource.
808
+ * @returns {string} A string representing the serving_config.
809
+ */
810
+ matchServingConfigFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName) {
811
+ return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match(projectLocationCollectionDataStoreServingConfigName).serving_config;
812
+ }
813
+ /**
814
+ * Return a fully-qualified projectLocationDataStoreBranch resource name string.
815
+ *
816
+ * @param {string} project
817
+ * @param {string} location
818
+ * @param {string} data_store
819
+ * @param {string} branch
820
+ * @returns {string} Resource name string.
821
+ */
822
+ projectLocationDataStoreBranchPath(project, location, dataStore, branch) {
823
+ return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.render({
824
+ project: project,
825
+ location: location,
826
+ data_store: dataStore,
827
+ branch: branch,
828
+ });
829
+ }
830
+ /**
831
+ * Parse the project from ProjectLocationDataStoreBranch resource.
832
+ *
833
+ * @param {string} projectLocationDataStoreBranchName
834
+ * A fully-qualified path representing project_location_data_store_branch resource.
835
+ * @returns {string} A string representing the project.
836
+ */
837
+ matchProjectFromProjectLocationDataStoreBranchName(projectLocationDataStoreBranchName) {
838
+ return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.match(projectLocationDataStoreBranchName).project;
839
+ }
840
+ /**
841
+ * Parse the location from ProjectLocationDataStoreBranch resource.
842
+ *
843
+ * @param {string} projectLocationDataStoreBranchName
844
+ * A fully-qualified path representing project_location_data_store_branch resource.
845
+ * @returns {string} A string representing the location.
846
+ */
847
+ matchLocationFromProjectLocationDataStoreBranchName(projectLocationDataStoreBranchName) {
848
+ return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.match(projectLocationDataStoreBranchName).location;
849
+ }
850
+ /**
851
+ * Parse the data_store from ProjectLocationDataStoreBranch resource.
852
+ *
853
+ * @param {string} projectLocationDataStoreBranchName
854
+ * A fully-qualified path representing project_location_data_store_branch resource.
855
+ * @returns {string} A string representing the data_store.
856
+ */
857
+ matchDataStoreFromProjectLocationDataStoreBranchName(projectLocationDataStoreBranchName) {
858
+ return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.match(projectLocationDataStoreBranchName).data_store;
859
+ }
860
+ /**
861
+ * Parse the branch from ProjectLocationDataStoreBranch resource.
862
+ *
863
+ * @param {string} projectLocationDataStoreBranchName
864
+ * A fully-qualified path representing project_location_data_store_branch resource.
865
+ * @returns {string} A string representing the branch.
866
+ */
867
+ matchBranchFromProjectLocationDataStoreBranchName(projectLocationDataStoreBranchName) {
868
+ return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.match(projectLocationDataStoreBranchName).branch;
869
+ }
870
+ /**
871
+ * Return a fully-qualified projectLocationDataStoreBranchDocument resource name string.
872
+ *
873
+ * @param {string} project
874
+ * @param {string} location
875
+ * @param {string} data_store
876
+ * @param {string} branch
877
+ * @param {string} document
878
+ * @returns {string} Resource name string.
879
+ */
880
+ projectLocationDataStoreBranchDocumentPath(project, location, dataStore, branch, document) {
881
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.render({
882
+ project: project,
883
+ location: location,
884
+ data_store: dataStore,
885
+ branch: branch,
886
+ document: document,
887
+ });
888
+ }
889
+ /**
890
+ * Parse the project from ProjectLocationDataStoreBranchDocument resource.
891
+ *
892
+ * @param {string} projectLocationDataStoreBranchDocumentName
893
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
894
+ * @returns {string} A string representing the project.
895
+ */
896
+ matchProjectFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
897
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).project;
898
+ }
899
+ /**
900
+ * Parse the location from ProjectLocationDataStoreBranchDocument resource.
901
+ *
902
+ * @param {string} projectLocationDataStoreBranchDocumentName
903
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
904
+ * @returns {string} A string representing the location.
905
+ */
906
+ matchLocationFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
907
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).location;
908
+ }
909
+ /**
910
+ * Parse the data_store from ProjectLocationDataStoreBranchDocument resource.
911
+ *
912
+ * @param {string} projectLocationDataStoreBranchDocumentName
913
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
914
+ * @returns {string} A string representing the data_store.
915
+ */
916
+ matchDataStoreFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
917
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).data_store;
918
+ }
919
+ /**
920
+ * Parse the branch from ProjectLocationDataStoreBranchDocument resource.
921
+ *
922
+ * @param {string} projectLocationDataStoreBranchDocumentName
923
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
924
+ * @returns {string} A string representing the branch.
925
+ */
926
+ matchBranchFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
927
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).branch;
928
+ }
929
+ /**
930
+ * Parse the document from ProjectLocationDataStoreBranchDocument resource.
931
+ *
932
+ * @param {string} projectLocationDataStoreBranchDocumentName
933
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
934
+ * @returns {string} A string representing the document.
935
+ */
936
+ matchDocumentFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
937
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).document;
938
+ }
939
+ /**
940
+ * Return a fully-qualified projectLocationDataStoreSchema resource name string.
941
+ *
942
+ * @param {string} project
943
+ * @param {string} location
944
+ * @param {string} data_store
945
+ * @param {string} schema
946
+ * @returns {string} Resource name string.
947
+ */
948
+ projectLocationDataStoreSchemaPath(project, location, dataStore, schema) {
949
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.render({
950
+ project: project,
951
+ location: location,
952
+ data_store: dataStore,
953
+ schema: schema,
954
+ });
955
+ }
956
+ /**
957
+ * Parse the project from ProjectLocationDataStoreSchema resource.
958
+ *
959
+ * @param {string} projectLocationDataStoreSchemaName
960
+ * A fully-qualified path representing project_location_data_store_schema resource.
961
+ * @returns {string} A string representing the project.
962
+ */
963
+ matchProjectFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
964
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).project;
965
+ }
966
+ /**
967
+ * Parse the location from ProjectLocationDataStoreSchema resource.
968
+ *
969
+ * @param {string} projectLocationDataStoreSchemaName
970
+ * A fully-qualified path representing project_location_data_store_schema resource.
971
+ * @returns {string} A string representing the location.
972
+ */
973
+ matchLocationFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
974
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).location;
975
+ }
976
+ /**
977
+ * Parse the data_store from ProjectLocationDataStoreSchema resource.
978
+ *
979
+ * @param {string} projectLocationDataStoreSchemaName
980
+ * A fully-qualified path representing project_location_data_store_schema resource.
981
+ * @returns {string} A string representing the data_store.
982
+ */
983
+ matchDataStoreFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
984
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).data_store;
985
+ }
986
+ /**
987
+ * Parse the schema from ProjectLocationDataStoreSchema resource.
988
+ *
989
+ * @param {string} projectLocationDataStoreSchemaName
990
+ * A fully-qualified path representing project_location_data_store_schema resource.
991
+ * @returns {string} A string representing the schema.
992
+ */
993
+ matchSchemaFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
994
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).schema;
995
+ }
996
+ /**
997
+ * Return a fully-qualified projectLocationDataStoreServingConfig resource name string.
998
+ *
999
+ * @param {string} project
1000
+ * @param {string} location
1001
+ * @param {string} data_store
1002
+ * @param {string} serving_config
1003
+ * @returns {string} Resource name string.
1004
+ */
1005
+ projectLocationDataStoreServingConfigPath(project, location, dataStore, servingConfig) {
1006
+ return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.render({
1007
+ project: project,
1008
+ location: location,
1009
+ data_store: dataStore,
1010
+ serving_config: servingConfig,
1011
+ });
1012
+ }
1013
+ /**
1014
+ * Parse the project from ProjectLocationDataStoreServingConfig resource.
1015
+ *
1016
+ * @param {string} projectLocationDataStoreServingConfigName
1017
+ * A fully-qualified path representing project_location_data_store_serving_config resource.
1018
+ * @returns {string} A string representing the project.
1019
+ */
1020
+ matchProjectFromProjectLocationDataStoreServingConfigName(projectLocationDataStoreServingConfigName) {
1021
+ return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.match(projectLocationDataStoreServingConfigName).project;
1022
+ }
1023
+ /**
1024
+ * Parse the location from ProjectLocationDataStoreServingConfig resource.
1025
+ *
1026
+ * @param {string} projectLocationDataStoreServingConfigName
1027
+ * A fully-qualified path representing project_location_data_store_serving_config resource.
1028
+ * @returns {string} A string representing the location.
1029
+ */
1030
+ matchLocationFromProjectLocationDataStoreServingConfigName(projectLocationDataStoreServingConfigName) {
1031
+ return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.match(projectLocationDataStoreServingConfigName).location;
1032
+ }
1033
+ /**
1034
+ * Parse the data_store from ProjectLocationDataStoreServingConfig resource.
1035
+ *
1036
+ * @param {string} projectLocationDataStoreServingConfigName
1037
+ * A fully-qualified path representing project_location_data_store_serving_config resource.
1038
+ * @returns {string} A string representing the data_store.
1039
+ */
1040
+ matchDataStoreFromProjectLocationDataStoreServingConfigName(projectLocationDataStoreServingConfigName) {
1041
+ return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.match(projectLocationDataStoreServingConfigName).data_store;
1042
+ }
1043
+ /**
1044
+ * Parse the serving_config from ProjectLocationDataStoreServingConfig resource.
1045
+ *
1046
+ * @param {string} projectLocationDataStoreServingConfigName
1047
+ * A fully-qualified path representing project_location_data_store_serving_config resource.
1048
+ * @returns {string} A string representing the serving_config.
1049
+ */
1050
+ matchServingConfigFromProjectLocationDataStoreServingConfigName(projectLocationDataStoreServingConfigName) {
1051
+ return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.match(projectLocationDataStoreServingConfigName).serving_config;
1052
+ }
1053
+ /**
1054
+ * Terminate the gRPC channel and close the client.
1055
+ *
1056
+ * The client will no longer be usable and all future behavior is undefined.
1057
+ * @returns {Promise} A promise that resolves when the client is closed.
1058
+ */
1059
+ close() {
1060
+ if (this.searchServiceStub && !this._terminated) {
1061
+ return this.searchServiceStub.then(stub => {
1062
+ this._terminated = true;
1063
+ stub.close();
1064
+ });
1065
+ }
1066
+ return Promise.resolve();
1067
+ }
1068
+ }
1069
+ exports.SearchServiceClient = SearchServiceClient;
1070
+ //# sourceMappingURL=search_service_client.js.map