@google-cloud/discoveryengine 1.0.0 → 1.2.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 (94) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +33 -1
  3. package/build/protos/google/cloud/discoveryengine/v1/common.proto +30 -2
  4. package/build/protos/google/cloud/discoveryengine/v1/completion_service.proto +15 -2
  5. package/build/protos/google/cloud/discoveryengine/v1/conversation.proto +114 -0
  6. package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +303 -0
  7. package/build/protos/google/cloud/discoveryengine/v1/document.proto +8 -5
  8. package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +4 -3
  9. package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +27 -23
  10. package/build/protos/google/cloud/discoveryengine/v1/schema.proto +1 -1
  11. package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +428 -20
  12. package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +48 -39
  13. package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +2 -2
  14. package/build/protos/google/cloud/discoveryengine/v1alpha/common.proto +155 -0
  15. package/build/protos/google/cloud/discoveryengine/v1alpha/completion_service.proto +134 -0
  16. package/build/protos/google/cloud/discoveryengine/v1alpha/conversation.proto +138 -0
  17. package/build/protos/google/cloud/discoveryengine/v1alpha/conversational_search_service.proto +306 -0
  18. package/build/protos/google/cloud/discoveryengine/v1alpha/document.proto +121 -0
  19. package/build/protos/google/cloud/discoveryengine/v1alpha/document_service.proto +318 -0
  20. package/build/protos/google/cloud/discoveryengine/v1alpha/import_config.proto +343 -0
  21. package/build/protos/google/cloud/discoveryengine/v1alpha/purge_config.proto +159 -0
  22. package/build/protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto +221 -0
  23. package/build/protos/google/cloud/discoveryengine/v1alpha/schema.proto +312 -0
  24. package/build/protos/google/cloud/discoveryengine/v1alpha/schema_service.proto +260 -0
  25. package/build/protos/google/cloud/discoveryengine/v1alpha/search_service.proto +851 -0
  26. package/build/protos/google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto +152 -0
  27. package/build/protos/google/cloud/discoveryengine/v1alpha/user_event.proto +475 -0
  28. package/build/protos/google/cloud/discoveryengine/v1alpha/user_event_service.proto +154 -0
  29. package/build/protos/google/cloud/discoveryengine/v1beta/common.proto +6 -0
  30. package/build/protos/google/cloud/discoveryengine/v1beta/conversation.proto +9 -2
  31. package/build/protos/google/cloud/discoveryengine/v1beta/conversational_search_service.proto +25 -0
  32. package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +115 -3
  33. package/build/protos/google/cloud/discoveryengine/v1beta/user_event.proto +4 -0
  34. package/build/protos/protos.d.ts +22864 -6680
  35. package/build/protos/protos.js +57205 -16191
  36. package/build/protos/protos.json +5548 -1224
  37. package/build/src/index.d.ts +6 -1
  38. package/build/src/index.js +7 -1
  39. package/build/src/v1/completion_service_client.d.ts +156 -6
  40. package/build/src/v1/completion_service_client.js +188 -4
  41. package/build/src/v1/conversational_search_service_client.d.ts +947 -0
  42. package/build/src/v1/conversational_search_service_client.js +1205 -0
  43. package/build/src/v1/conversational_search_service_client_config.json +68 -0
  44. package/build/src/v1/document_service_client.d.ts +165 -18
  45. package/build/src/v1/document_service_client.js +215 -11
  46. package/build/src/v1/index.d.ts +1 -0
  47. package/build/src/v1/index.js +3 -1
  48. package/build/src/v1/schema_service_client.d.ts +148 -4
  49. package/build/src/v1/schema_service_client.js +207 -5
  50. package/build/src/v1/search_service_client.d.ts +238 -28
  51. package/build/src/v1/search_service_client.js +248 -20
  52. package/build/src/v1/user_event_service_client.d.ts +153 -9
  53. package/build/src/v1/user_event_service_client.js +207 -5
  54. package/build/src/v1alpha/completion_service_client.d.ts +603 -0
  55. package/build/src/v1alpha/completion_service_client.js +843 -0
  56. package/build/src/v1alpha/completion_service_client_config.json +43 -0
  57. package/build/src/v1alpha/conversational_search_service_client.d.ts +998 -0
  58. package/build/src/v1alpha/conversational_search_service_client.js +1275 -0
  59. package/build/src/v1alpha/conversational_search_service_client_config.json +68 -0
  60. package/build/src/v1alpha/document_service_client.d.ts +1140 -0
  61. package/build/src/v1alpha/document_service_client.js +1393 -0
  62. package/build/src/v1alpha/document_service_client_config.json +82 -0
  63. package/build/src/v1alpha/index.d.ts +8 -0
  64. package/build/src/v1alpha/index.js +37 -0
  65. package/build/src/v1alpha/recommendation_service_client.d.ts +735 -0
  66. package/build/src/v1alpha/recommendation_service_client.js +938 -0
  67. package/build/src/v1alpha/recommendation_service_client_config.json +43 -0
  68. package/build/src/v1alpha/schema_service_client.d.ts +935 -0
  69. package/build/src/v1alpha/schema_service_client.js +1327 -0
  70. package/build/src/v1alpha/schema_service_client_config.json +63 -0
  71. package/build/src/v1alpha/search_service_client.d.ts +1208 -0
  72. package/build/src/v1alpha/search_service_client.js +1432 -0
  73. package/build/src/v1alpha/search_service_client_config.json +43 -0
  74. package/build/src/v1alpha/site_search_engine_service_client.d.ts +704 -0
  75. package/build/src/v1alpha/site_search_engine_service_client.js +1087 -0
  76. package/build/src/v1alpha/site_search_engine_service_client_config.json +30 -0
  77. package/build/src/v1alpha/user_event_service_client.d.ts +853 -0
  78. package/build/src/v1alpha/user_event_service_client.js +1174 -0
  79. package/build/src/v1alpha/user_event_service_client_config.json +67 -0
  80. package/build/src/v1beta/completion_service_client.d.ts +55 -4
  81. package/build/src/v1beta/completion_service_client.js +60 -4
  82. package/build/src/v1beta/conversational_search_service_client.d.ts +75 -4
  83. package/build/src/v1beta/conversational_search_service_client.js +60 -4
  84. package/build/src/v1beta/document_service_client.d.ts +55 -4
  85. package/build/src/v1beta/document_service_client.js +61 -5
  86. package/build/src/v1beta/recommendation_service_client.d.ts +55 -4
  87. package/build/src/v1beta/recommendation_service_client.js +60 -4
  88. package/build/src/v1beta/schema_service_client.d.ts +55 -4
  89. package/build/src/v1beta/schema_service_client.js +61 -5
  90. package/build/src/v1beta/search_service_client.d.ts +142 -4
  91. package/build/src/v1beta/search_service_client.js +118 -4
  92. package/build/src/v1beta/user_event_service_client.d.ts +55 -4
  93. package/build/src/v1beta/user_event_service_client.js +61 -5
  94. package/package.json +5 -5
@@ -60,8 +60,7 @@ class SearchServiceClient {
60
60
  * API remote host.
61
61
  * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
62
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.
63
+ * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
65
64
  * For more information, please check the
66
65
  * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
67
66
  * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
@@ -69,7 +68,7 @@ class SearchServiceClient {
69
68
  * HTTP implementation. Load only fallback version and pass it to the constructor:
70
69
  * ```
71
70
  * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
72
- * const client = new SearchServiceClient({fallback: 'rest'}, gax);
71
+ * const client = new SearchServiceClient({fallback: true}, gax);
73
72
  * ```
74
73
  */
75
74
  constructor(opts, gaxInstance) {
@@ -115,6 +114,7 @@ class SearchServiceClient {
115
114
  if (servicePath === staticMembers.servicePath) {
116
115
  this.auth.defaultScopes = staticMembers.scopes;
117
116
  }
117
+ this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
118
118
  // Determine the client header string.
119
119
  const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
120
120
  if (typeof process !== 'undefined' && 'versions' in process) {
@@ -126,7 +126,7 @@ class SearchServiceClient {
126
126
  if (!opts.fallback) {
127
127
  clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
128
128
  }
129
- else if (opts.fallback === 'rest') {
129
+ else {
130
130
  clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
131
131
  }
132
132
  if (opts.libName && opts.libVersion) {
@@ -140,10 +140,12 @@ class SearchServiceClient {
140
140
  this.pathTemplates = {
141
141
  projectLocationCollectionDataStoreBranchPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}'),
142
142
  projectLocationCollectionDataStoreBranchDocumentPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}'),
143
+ projectLocationCollectionDataStoreConversationPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}'),
143
144
  projectLocationCollectionDataStoreSchemaPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}'),
144
145
  projectLocationCollectionDataStoreServingConfigPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}'),
145
146
  projectLocationDataStoreBranchPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}'),
146
147
  projectLocationDataStoreBranchDocumentPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}'),
148
+ projectLocationDataStoreConversationPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}'),
147
149
  projectLocationDataStoreSchemaPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}'),
148
150
  projectLocationDataStoreServingConfigPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}'),
149
151
  };
@@ -282,10 +284,12 @@ class SearchServiceClient {
282
284
  * documents under the default branch.
283
285
  * @param {string} request.query
284
286
  * Raw search query.
287
+ * @param {google.cloud.discoveryengine.v1.SearchRequest.ImageQuery} request.imageQuery
288
+ * Raw image query.
285
289
  * @param {number} request.pageSize
286
290
  * Maximum number of {@link protos.google.cloud.discoveryengine.v1.Document|Document}s to
287
291
  * return. If unspecified, defaults to a reasonable value. The maximum allowed
288
- * value is 100. Values above 100 will be coerced to 100.
292
+ * value is 100. Values above 100 are coerced to 100.
289
293
  *
290
294
  * If this field is negative, an `INVALID_ARGUMENT` is returned.
291
295
  * @param {string} request.pageToken
@@ -306,10 +310,31 @@ class SearchServiceClient {
306
310
  * unset.
307
311
  *
308
312
  * If this field is negative, an `INVALID_ARGUMENT` is returned.
313
+ * @param {string} request.filter
314
+ * The filter syntax consists of an expression language for constructing a
315
+ * predicate from one or more fields of the documents being filtered. Filter
316
+ * expression is case-sensitive.
317
+ *
318
+ * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
319
+ * @param {string} request.orderBy
320
+ * The order in which documents are returned. Documents can be ordered by
321
+ * a field in an {@link protos.google.cloud.discoveryengine.v1.Document|Document} object.
322
+ * Leave it unset if ordered by relevance. `order_by` expression is
323
+ * case-sensitive.
324
+ *
325
+ * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
309
326
  * @param {google.cloud.discoveryengine.v1.UserInfo} request.userInfo
310
327
  * Information about the end user.
311
- * Highly recommended for analytics. The user_agent string in UserInfo will
312
- * be used to deduce device_type for analytics.
328
+ * Highly recommended for analytics.
329
+ * {@link protos.google.cloud.discoveryengine.v1.UserInfo.user_agent|UserInfo.user_agent}
330
+ * is used to deduce `device_type` for analytics.
331
+ * @param {number[]} request.facetSpecs
332
+ * Facet specifications for faceted search. If empty, no facets are returned.
333
+ *
334
+ * A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
335
+ * error is returned.
336
+ * @param {google.cloud.discoveryengine.v1.SearchRequest.BoostSpec} request.boostSpec
337
+ * Boost specification to boost certain documents.
313
338
  * @param {number[]} request.params
314
339
  * Additional search parameters.
315
340
  *
@@ -322,10 +347,10 @@ class SearchServiceClient {
322
347
  * which enables image searching.
323
348
  * @param {google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec
324
349
  * The query expansion specification that specifies the conditions under which
325
- * query expansion will occur.
350
+ * query expansion occurs.
326
351
  * @param {google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec} request.spellCorrectionSpec
327
352
  * The spell correction specification that specifies the mode under
328
- * which spell correction will take effect.
353
+ * which spell correction takes effect.
329
354
  * @param {string} request.userPseudoId
330
355
  * A unique identifier for tracking visitors. For example, this could be
331
356
  * implemented with an HTTP cookie, which should be able to uniquely identify
@@ -342,11 +367,10 @@ class SearchServiceClient {
342
367
  * The field must be a UTF-8 encoded string with a length limit of 128
343
368
  * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
344
369
  * @param {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec} request.contentSearchSpec
345
- * The content search spec that configs the desired behavior of content
346
- * search.
370
+ * A specification for configuring the behavior of content search.
347
371
  * @param {boolean} request.safeSearch
348
372
  * Whether to turn on safe search. This is only supported for
349
- * {@link protos.|ContentConfig.PUBLIC_WEBSITE}.
373
+ * website search.
350
374
  * @param {number[]} request.userLabels
351
375
  * The user labels applied to a resource must meet the following requirements:
352
376
  *
@@ -410,10 +434,12 @@ class SearchServiceClient {
410
434
  * documents under the default branch.
411
435
  * @param {string} request.query
412
436
  * Raw search query.
437
+ * @param {google.cloud.discoveryengine.v1.SearchRequest.ImageQuery} request.imageQuery
438
+ * Raw image query.
413
439
  * @param {number} request.pageSize
414
440
  * Maximum number of {@link protos.google.cloud.discoveryengine.v1.Document|Document}s to
415
441
  * return. If unspecified, defaults to a reasonable value. The maximum allowed
416
- * value is 100. Values above 100 will be coerced to 100.
442
+ * value is 100. Values above 100 are coerced to 100.
417
443
  *
418
444
  * If this field is negative, an `INVALID_ARGUMENT` is returned.
419
445
  * @param {string} request.pageToken
@@ -434,10 +460,31 @@ class SearchServiceClient {
434
460
  * unset.
435
461
  *
436
462
  * If this field is negative, an `INVALID_ARGUMENT` is returned.
463
+ * @param {string} request.filter
464
+ * The filter syntax consists of an expression language for constructing a
465
+ * predicate from one or more fields of the documents being filtered. Filter
466
+ * expression is case-sensitive.
467
+ *
468
+ * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
469
+ * @param {string} request.orderBy
470
+ * The order in which documents are returned. Documents can be ordered by
471
+ * a field in an {@link protos.google.cloud.discoveryengine.v1.Document|Document} object.
472
+ * Leave it unset if ordered by relevance. `order_by` expression is
473
+ * case-sensitive.
474
+ *
475
+ * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
437
476
  * @param {google.cloud.discoveryengine.v1.UserInfo} request.userInfo
438
477
  * Information about the end user.
439
- * Highly recommended for analytics. The user_agent string in UserInfo will
440
- * be used to deduce device_type for analytics.
478
+ * Highly recommended for analytics.
479
+ * {@link protos.google.cloud.discoveryengine.v1.UserInfo.user_agent|UserInfo.user_agent}
480
+ * is used to deduce `device_type` for analytics.
481
+ * @param {number[]} request.facetSpecs
482
+ * Facet specifications for faceted search. If empty, no facets are returned.
483
+ *
484
+ * A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
485
+ * error is returned.
486
+ * @param {google.cloud.discoveryengine.v1.SearchRequest.BoostSpec} request.boostSpec
487
+ * Boost specification to boost certain documents.
441
488
  * @param {number[]} request.params
442
489
  * Additional search parameters.
443
490
  *
@@ -450,10 +497,10 @@ class SearchServiceClient {
450
497
  * which enables image searching.
451
498
  * @param {google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec
452
499
  * The query expansion specification that specifies the conditions under which
453
- * query expansion will occur.
500
+ * query expansion occurs.
454
501
  * @param {google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec} request.spellCorrectionSpec
455
502
  * The spell correction specification that specifies the mode under
456
- * which spell correction will take effect.
503
+ * which spell correction takes effect.
457
504
  * @param {string} request.userPseudoId
458
505
  * A unique identifier for tracking visitors. For example, this could be
459
506
  * implemented with an HTTP cookie, which should be able to uniquely identify
@@ -470,11 +517,10 @@ class SearchServiceClient {
470
517
  * The field must be a UTF-8 encoded string with a length limit of 128
471
518
  * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
472
519
  * @param {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec} request.contentSearchSpec
473
- * The content search spec that configs the desired behavior of content
474
- * search.
520
+ * A specification for configuring the behavior of content search.
475
521
  * @param {boolean} request.safeSearch
476
522
  * Whether to turn on safe search. This is only supported for
477
- * {@link protos.|ContentConfig.PUBLIC_WEBSITE}.
523
+ * website search.
478
524
  * @param {number[]} request.userLabels
479
525
  * The user labels applied to a resource must meet the following requirements:
480
526
  *
@@ -520,6 +566,61 @@ class SearchServiceClient {
520
566
  this.initialize();
521
567
  return this.descriptors.page.search.asyncIterate(this.innerApiCalls['search'], request, callSettings);
522
568
  }
569
+ /**
570
+ * Gets information about a location.
571
+ *
572
+ * @param {Object} request
573
+ * The request object that will be sent.
574
+ * @param {string} request.name
575
+ * Resource name for the location.
576
+ * @param {object} [options]
577
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
578
+ * @returns {Promise} - The promise which resolves to an array.
579
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
580
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
581
+ * for more details and examples.
582
+ * @example
583
+ * ```
584
+ * const [response] = await client.getLocation(request);
585
+ * ```
586
+ */
587
+ getLocation(request, options, callback) {
588
+ return this.locationsClient.getLocation(request, options, callback);
589
+ }
590
+ /**
591
+ * Lists information about the supported locations for this service. Returns an iterable object.
592
+ *
593
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
594
+ * @param {Object} request
595
+ * The request object that will be sent.
596
+ * @param {string} request.name
597
+ * The resource that owns the locations collection, if applicable.
598
+ * @param {string} request.filter
599
+ * The standard list filter.
600
+ * @param {number} request.pageSize
601
+ * The standard list page size.
602
+ * @param {string} request.pageToken
603
+ * The standard list page token.
604
+ * @param {object} [options]
605
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
606
+ * @returns {Object}
607
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
608
+ * When you iterate the returned iterable, each element will be an object representing
609
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
610
+ * so you can stop the iteration when you don't need more results.
611
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
612
+ * for more details and examples.
613
+ * @example
614
+ * ```
615
+ * const iterable = client.listLocationsAsync(request);
616
+ * for await (const response of iterable) {
617
+ * // process response
618
+ * }
619
+ * ```
620
+ */
621
+ listLocationsAsync(request, options) {
622
+ return this.locationsClient.listLocationsAsync(request, options);
623
+ }
523
624
  // --------------------
524
625
  // -- Path templates --
525
626
  // --------------------
@@ -673,6 +774,75 @@ class SearchServiceClient {
673
774
  matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
674
775
  return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).document;
675
776
  }
777
+ /**
778
+ * Return a fully-qualified projectLocationCollectionDataStoreConversation resource name string.
779
+ *
780
+ * @param {string} project
781
+ * @param {string} location
782
+ * @param {string} collection
783
+ * @param {string} data_store
784
+ * @param {string} conversation
785
+ * @returns {string} Resource name string.
786
+ */
787
+ projectLocationCollectionDataStoreConversationPath(project, location, collection, dataStore, conversation) {
788
+ return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.render({
789
+ project: project,
790
+ location: location,
791
+ collection: collection,
792
+ data_store: dataStore,
793
+ conversation: conversation,
794
+ });
795
+ }
796
+ /**
797
+ * Parse the project from ProjectLocationCollectionDataStoreConversation resource.
798
+ *
799
+ * @param {string} projectLocationCollectionDataStoreConversationName
800
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
801
+ * @returns {string} A string representing the project.
802
+ */
803
+ matchProjectFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
804
+ return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).project;
805
+ }
806
+ /**
807
+ * Parse the location from ProjectLocationCollectionDataStoreConversation resource.
808
+ *
809
+ * @param {string} projectLocationCollectionDataStoreConversationName
810
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
811
+ * @returns {string} A string representing the location.
812
+ */
813
+ matchLocationFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
814
+ return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).location;
815
+ }
816
+ /**
817
+ * Parse the collection from ProjectLocationCollectionDataStoreConversation resource.
818
+ *
819
+ * @param {string} projectLocationCollectionDataStoreConversationName
820
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
821
+ * @returns {string} A string representing the collection.
822
+ */
823
+ matchCollectionFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
824
+ return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).collection;
825
+ }
826
+ /**
827
+ * Parse the data_store from ProjectLocationCollectionDataStoreConversation resource.
828
+ *
829
+ * @param {string} projectLocationCollectionDataStoreConversationName
830
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
831
+ * @returns {string} A string representing the data_store.
832
+ */
833
+ matchDataStoreFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
834
+ return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).data_store;
835
+ }
836
+ /**
837
+ * Parse the conversation from ProjectLocationCollectionDataStoreConversation resource.
838
+ *
839
+ * @param {string} projectLocationCollectionDataStoreConversationName
840
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
841
+ * @returns {string} A string representing the conversation.
842
+ */
843
+ matchConversationFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
844
+ return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).conversation;
845
+ }
676
846
  /**
677
847
  * Return a fully-qualified projectLocationCollectionDataStoreSchema resource name string.
678
848
  *
@@ -937,6 +1107,63 @@ class SearchServiceClient {
937
1107
  matchDocumentFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
938
1108
  return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).document;
939
1109
  }
1110
+ /**
1111
+ * Return a fully-qualified projectLocationDataStoreConversation resource name string.
1112
+ *
1113
+ * @param {string} project
1114
+ * @param {string} location
1115
+ * @param {string} data_store
1116
+ * @param {string} conversation
1117
+ * @returns {string} Resource name string.
1118
+ */
1119
+ projectLocationDataStoreConversationPath(project, location, dataStore, conversation) {
1120
+ return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.render({
1121
+ project: project,
1122
+ location: location,
1123
+ data_store: dataStore,
1124
+ conversation: conversation,
1125
+ });
1126
+ }
1127
+ /**
1128
+ * Parse the project from ProjectLocationDataStoreConversation resource.
1129
+ *
1130
+ * @param {string} projectLocationDataStoreConversationName
1131
+ * A fully-qualified path representing project_location_data_store_conversation resource.
1132
+ * @returns {string} A string representing the project.
1133
+ */
1134
+ matchProjectFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName) {
1135
+ return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match(projectLocationDataStoreConversationName).project;
1136
+ }
1137
+ /**
1138
+ * Parse the location from ProjectLocationDataStoreConversation resource.
1139
+ *
1140
+ * @param {string} projectLocationDataStoreConversationName
1141
+ * A fully-qualified path representing project_location_data_store_conversation resource.
1142
+ * @returns {string} A string representing the location.
1143
+ */
1144
+ matchLocationFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName) {
1145
+ return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match(projectLocationDataStoreConversationName).location;
1146
+ }
1147
+ /**
1148
+ * Parse the data_store from ProjectLocationDataStoreConversation resource.
1149
+ *
1150
+ * @param {string} projectLocationDataStoreConversationName
1151
+ * A fully-qualified path representing project_location_data_store_conversation resource.
1152
+ * @returns {string} A string representing the data_store.
1153
+ */
1154
+ matchDataStoreFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName) {
1155
+ return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match(projectLocationDataStoreConversationName).data_store;
1156
+ }
1157
+ /**
1158
+ * Parse the conversation from ProjectLocationDataStoreConversation resource.
1159
+ *
1160
+ * @param {string} projectLocationDataStoreConversationName
1161
+ * A fully-qualified path representing project_location_data_store_conversation resource.
1162
+ * @returns {string} A string representing the conversation.
1163
+ */
1164
+ matchConversationFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName) {
1165
+ return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match(projectLocationDataStoreConversationName).conversation;
1166
+ }
940
1167
  /**
941
1168
  * Return a fully-qualified projectLocationDataStoreSchema resource name string.
942
1169
  *
@@ -1062,6 +1289,7 @@ class SearchServiceClient {
1062
1289
  return this.searchServiceStub.then(stub => {
1063
1290
  this._terminated = true;
1064
1291
  stub.close();
1292
+ this.locationsClient.close();
1065
1293
  });
1066
1294
  }
1067
1295
  return Promise.resolve();
@@ -1,5 +1,5 @@
1
1
  import type * as gax from 'google-gax';
2
- import type { Callback, CallOptions, Descriptors, ClientOptions, LROperation } from 'google-gax';
2
+ import type { Callback, CallOptions, Descriptors, ClientOptions, LROperation, LocationsClient, LocationProtos } from 'google-gax';
3
3
  import * as protos from '../../protos/protos';
4
4
  /**
5
5
  * Service for ingesting end user actions on a website to Discovery Engine API.
@@ -20,6 +20,7 @@ export declare class UserEventServiceClient {
20
20
  innerApiCalls: {
21
21
  [name: string]: Function;
22
22
  };
23
+ locationsClient: LocationsClient;
23
24
  pathTemplates: {
24
25
  [name: string]: gax.PathTemplate;
25
26
  };
@@ -55,8 +56,7 @@ export declare class UserEventServiceClient {
55
56
  * API remote host.
56
57
  * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
57
58
  * Follows the structure of {@link gapicConfig}.
58
- * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
59
- * Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
59
+ * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
60
60
  * For more information, please check the
61
61
  * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
62
62
  * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
@@ -64,7 +64,7 @@ export declare class UserEventServiceClient {
64
64
  * HTTP implementation. Load only fallback version and pass it to the constructor:
65
65
  * ```
66
66
  * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
67
- * const client = new UserEventServiceClient({fallback: 'rest'}, gax);
67
+ * const client = new UserEventServiceClient({fallback: true}, gax);
68
68
  * ```
69
69
  */
70
70
  constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
@@ -134,7 +134,7 @@ export declare class UserEventServiceClient {
134
134
  writeUserEvent(request: protos.google.cloud.discoveryengine.v1.IWriteUserEventRequest, callback: Callback<protos.google.cloud.discoveryengine.v1.IUserEvent, protos.google.cloud.discoveryengine.v1.IWriteUserEventRequest | null | undefined, {} | null | undefined>): void;
135
135
  /**
136
136
  * Writes a single user event from the browser. This uses a GET request to
137
- * due to browser restriction of POST-ing to a 3rd party domain.
137
+ * due to browser restriction of POST-ing to a third-party domain.
138
138
  *
139
139
  * This method is used only by the Discovery Engine API JavaScript pixel and
140
140
  * Google Tag Manager. Users should not call this method directly.
@@ -150,7 +150,7 @@ export declare class UserEventServiceClient {
150
150
  * @param {string} request.uri
151
151
  * The URL including cgi-parameters but excluding the hash fragment with a
152
152
  * length limit of 5,000 characters. This is often more useful than the
153
- * referer URL, because many browsers only send the domain for 3rd party
153
+ * referer URL, because many browsers only send the domain for third-party
154
154
  * requests.
155
155
  * @param {number} request.ets
156
156
  * The event timestamp in milliseconds. This prevents browser caching of
@@ -184,11 +184,11 @@ export declare class UserEventServiceClient {
184
184
  * @param {Object} request
185
185
  * The request object that will be sent.
186
186
  * @param {google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource} request.inlineSource
187
- * Required. The Inline source for the input content for UserEvents.
187
+ * The Inline source for the input content for UserEvents.
188
188
  * @param {google.cloud.discoveryengine.v1.GcsSource} request.gcsSource
189
- * Required. Cloud Storage location for the input content.
189
+ * Cloud Storage location for the input content.
190
190
  * @param {google.cloud.discoveryengine.v1.BigQuerySource} request.bigquerySource
191
- * Required. BigQuery input source.
191
+ * BigQuery input source.
192
192
  * @param {string} request.parent
193
193
  * Required. Parent DataStore resource name, of the form
194
194
  * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
@@ -225,6 +225,57 @@ export declare class UserEventServiceClient {
225
225
  * region_tag:discoveryengine_v1_generated_UserEventService_ImportUserEvents_async
226
226
  */
227
227
  checkImportUserEventsProgress(name: string): Promise<LROperation<protos.google.cloud.discoveryengine.v1.ImportUserEventsResponse, protos.google.cloud.discoveryengine.v1.ImportUserEventsMetadata>>;
228
+ /**
229
+ * Gets information about a location.
230
+ *
231
+ * @param {Object} request
232
+ * The request object that will be sent.
233
+ * @param {string} request.name
234
+ * Resource name for the location.
235
+ * @param {object} [options]
236
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
237
+ * @returns {Promise} - The promise which resolves to an array.
238
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
239
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
240
+ * for more details and examples.
241
+ * @example
242
+ * ```
243
+ * const [response] = await client.getLocation(request);
244
+ * ```
245
+ */
246
+ getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;
247
+ /**
248
+ * Lists information about the supported locations for this service. Returns an iterable object.
249
+ *
250
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
251
+ * @param {Object} request
252
+ * The request object that will be sent.
253
+ * @param {string} request.name
254
+ * The resource that owns the locations collection, if applicable.
255
+ * @param {string} request.filter
256
+ * The standard list filter.
257
+ * @param {number} request.pageSize
258
+ * The standard list page size.
259
+ * @param {string} request.pageToken
260
+ * The standard list page token.
261
+ * @param {object} [options]
262
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
263
+ * @returns {Object}
264
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
265
+ * When you iterate the returned iterable, each element will be an object representing
266
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
267
+ * so you can stop the iteration when you don't need more results.
268
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
269
+ * for more details and examples.
270
+ * @example
271
+ * ```
272
+ * const iterable = client.listLocationsAsync(request);
273
+ * for await (const response of iterable) {
274
+ * // process response
275
+ * }
276
+ * ```
277
+ */
278
+ listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
228
279
  /**
229
280
  * Gets the latest state of a long-running operation. Clients can use this
230
281
  * method to poll the operation result at intervals as recommended by the API
@@ -447,6 +498,57 @@ export declare class UserEventServiceClient {
447
498
  * @returns {string} A string representing the document.
448
499
  */
449
500
  matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName: string): string | number;
501
+ /**
502
+ * Return a fully-qualified projectLocationCollectionDataStoreConversation resource name string.
503
+ *
504
+ * @param {string} project
505
+ * @param {string} location
506
+ * @param {string} collection
507
+ * @param {string} data_store
508
+ * @param {string} conversation
509
+ * @returns {string} Resource name string.
510
+ */
511
+ projectLocationCollectionDataStoreConversationPath(project: string, location: string, collection: string, dataStore: string, conversation: string): string;
512
+ /**
513
+ * Parse the project from ProjectLocationCollectionDataStoreConversation resource.
514
+ *
515
+ * @param {string} projectLocationCollectionDataStoreConversationName
516
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
517
+ * @returns {string} A string representing the project.
518
+ */
519
+ matchProjectFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName: string): string | number;
520
+ /**
521
+ * Parse the location from ProjectLocationCollectionDataStoreConversation resource.
522
+ *
523
+ * @param {string} projectLocationCollectionDataStoreConversationName
524
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
525
+ * @returns {string} A string representing the location.
526
+ */
527
+ matchLocationFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName: string): string | number;
528
+ /**
529
+ * Parse the collection from ProjectLocationCollectionDataStoreConversation resource.
530
+ *
531
+ * @param {string} projectLocationCollectionDataStoreConversationName
532
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
533
+ * @returns {string} A string representing the collection.
534
+ */
535
+ matchCollectionFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName: string): string | number;
536
+ /**
537
+ * Parse the data_store from ProjectLocationCollectionDataStoreConversation resource.
538
+ *
539
+ * @param {string} projectLocationCollectionDataStoreConversationName
540
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
541
+ * @returns {string} A string representing the data_store.
542
+ */
543
+ matchDataStoreFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName: string): string | number;
544
+ /**
545
+ * Parse the conversation from ProjectLocationCollectionDataStoreConversation resource.
546
+ *
547
+ * @param {string} projectLocationCollectionDataStoreConversationName
548
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
549
+ * @returns {string} A string representing the conversation.
550
+ */
551
+ matchConversationFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName: string): string | number;
450
552
  /**
451
553
  * Return a fully-qualified projectLocationCollectionDataStoreSchema resource name string.
452
554
  *
@@ -582,6 +684,48 @@ export declare class UserEventServiceClient {
582
684
  * @returns {string} A string representing the document.
583
685
  */
584
686
  matchDocumentFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName: string): string | number;
687
+ /**
688
+ * Return a fully-qualified projectLocationDataStoreConversation resource name string.
689
+ *
690
+ * @param {string} project
691
+ * @param {string} location
692
+ * @param {string} data_store
693
+ * @param {string} conversation
694
+ * @returns {string} Resource name string.
695
+ */
696
+ projectLocationDataStoreConversationPath(project: string, location: string, dataStore: string, conversation: string): string;
697
+ /**
698
+ * Parse the project from ProjectLocationDataStoreConversation resource.
699
+ *
700
+ * @param {string} projectLocationDataStoreConversationName
701
+ * A fully-qualified path representing project_location_data_store_conversation resource.
702
+ * @returns {string} A string representing the project.
703
+ */
704
+ matchProjectFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName: string): string | number;
705
+ /**
706
+ * Parse the location from ProjectLocationDataStoreConversation resource.
707
+ *
708
+ * @param {string} projectLocationDataStoreConversationName
709
+ * A fully-qualified path representing project_location_data_store_conversation resource.
710
+ * @returns {string} A string representing the location.
711
+ */
712
+ matchLocationFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName: string): string | number;
713
+ /**
714
+ * Parse the data_store from ProjectLocationDataStoreConversation resource.
715
+ *
716
+ * @param {string} projectLocationDataStoreConversationName
717
+ * A fully-qualified path representing project_location_data_store_conversation resource.
718
+ * @returns {string} A string representing the data_store.
719
+ */
720
+ matchDataStoreFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName: string): string | number;
721
+ /**
722
+ * Parse the conversation from ProjectLocationDataStoreConversation resource.
723
+ *
724
+ * @param {string} projectLocationDataStoreConversationName
725
+ * A fully-qualified path representing project_location_data_store_conversation resource.
726
+ * @returns {string} A string representing the conversation.
727
+ */
728
+ matchConversationFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName: string): string | number;
585
729
  /**
586
730
  * Return a fully-qualified projectLocationDataStoreSchema resource name string.
587
731
  *