@google-cloud/discoveryengine 1.3.1 → 1.4.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 (119) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +51 -0
  3. package/build/protos/google/cloud/discoveryengine/v1/common.proto +54 -3
  4. package/build/protos/google/cloud/discoveryengine/v1/completion.proto +52 -0
  5. package/build/protos/google/cloud/discoveryengine/v1/completion_service.proto +51 -4
  6. package/build/protos/google/cloud/discoveryengine/v1/conversation.proto +3 -0
  7. package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +40 -1
  8. package/build/protos/google/cloud/discoveryengine/v1/data_store.proto +98 -0
  9. package/build/protos/google/cloud/discoveryengine/v1/data_store_service.proto +304 -0
  10. package/build/protos/google/cloud/discoveryengine/v1/document.proto +1 -1
  11. package/build/protos/google/cloud/discoveryengine/v1/engine.proto +215 -0
  12. package/build/protos/google/cloud/discoveryengine/v1/engine_service.proto +242 -0
  13. package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +64 -0
  14. package/build/protos/google/cloud/discoveryengine/v1/purge_config.proto +38 -0
  15. package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +137 -4
  16. package/build/protos/google/cloud/discoveryengine/v1/site_search_engine.proto +170 -0
  17. package/build/protos/google/cloud/discoveryengine/v1/site_search_engine_service.proto +691 -0
  18. package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +3 -3
  19. package/build/protos/google/cloud/discoveryengine/v1beta/common.proto +59 -8
  20. package/build/protos/google/cloud/discoveryengine/v1beta/completion.proto +52 -0
  21. package/build/protos/google/cloud/discoveryengine/v1beta/completion_service.proto +51 -4
  22. package/build/protos/google/cloud/discoveryengine/v1beta/conversation.proto +3 -0
  23. package/build/protos/google/cloud/discoveryengine/v1beta/conversational_search_service.proto +40 -1
  24. package/build/protos/google/cloud/discoveryengine/v1beta/data_store.proto +98 -0
  25. package/build/protos/google/cloud/discoveryengine/v1beta/data_store_service.proto +306 -0
  26. package/build/protos/google/cloud/discoveryengine/v1beta/document.proto +1 -1
  27. package/build/protos/google/cloud/discoveryengine/v1beta/engine.proto +220 -0
  28. package/build/protos/google/cloud/discoveryengine/v1beta/engine_service.proto +244 -0
  29. package/build/protos/google/cloud/discoveryengine/v1beta/import_config.proto +64 -0
  30. package/build/protos/google/cloud/discoveryengine/v1beta/purge_config.proto +38 -0
  31. package/build/protos/google/cloud/discoveryengine/v1beta/recommendation_service.proto +26 -3
  32. package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +150 -11
  33. package/build/protos/google/cloud/discoveryengine/v1beta/serving_config.proto +264 -0
  34. package/build/protos/google/cloud/discoveryengine/v1beta/serving_config_service.proto +147 -0
  35. package/build/protos/google/cloud/discoveryengine/v1beta/site_search_engine.proto +170 -0
  36. package/build/protos/google/cloud/discoveryengine/v1beta/site_search_engine_service.proto +695 -0
  37. package/build/protos/google/cloud/discoveryengine/v1beta/user_event.proto +4 -3
  38. package/build/protos/protos.d.ts +41157 -23655
  39. package/build/protos/protos.js +103188 -62466
  40. package/build/protos/protos.json +10400 -6075
  41. package/build/src/index.d.ts +10 -1
  42. package/build/src/index.js +10 -1
  43. package/build/src/v1/completion_service_client.d.ts +489 -7
  44. package/build/src/v1/completion_service_client.js +715 -11
  45. package/build/src/v1/completion_service_client_config.json +10 -0
  46. package/build/src/v1/conversational_search_service_client.d.ts +341 -3
  47. package/build/src/v1/conversational_search_service_client.js +466 -9
  48. package/build/src/v1/data_store_service_client.d.ts +1286 -0
  49. package/build/src/v1/data_store_service_client.js +1768 -0
  50. package/build/src/v1/data_store_service_client_config.json +46 -0
  51. package/build/src/v1/document_service_client.d.ts +347 -2
  52. package/build/src/v1/document_service_client.js +506 -9
  53. package/build/src/v1/engine_service_client.d.ts +1211 -0
  54. package/build/src/v1/engine_service_client.js +1731 -0
  55. package/build/src/v1/engine_service_client_config.json +46 -0
  56. package/build/src/v1/index.d.ts +3 -0
  57. package/build/src/v1/index.js +7 -1
  58. package/build/src/v1/schema_service_client.d.ts +272 -2
  59. package/build/src/v1/schema_service_client.js +402 -9
  60. package/build/src/v1/search_service_client.d.ts +515 -11
  61. package/build/src/v1/search_service_client.js +648 -15
  62. package/build/src/v1/site_search_engine_service_client.d.ts +1564 -0
  63. package/build/src/v1/site_search_engine_service_client.js +2075 -0
  64. package/build/src/v1/site_search_engine_service_client_config.json +74 -0
  65. package/build/src/v1/user_event_service_client.d.ts +272 -2
  66. package/build/src/v1/user_event_service_client.js +402 -9
  67. package/build/src/v1alpha/completion_service_client.d.ts +11 -2
  68. package/build/src/v1alpha/completion_service_client.js +37 -10
  69. package/build/src/v1alpha/conversational_search_service_client.d.ts +11 -2
  70. package/build/src/v1alpha/conversational_search_service_client.js +37 -10
  71. package/build/src/v1alpha/data_store_service_client.d.ts +11 -2
  72. package/build/src/v1alpha/data_store_service_client.js +37 -10
  73. package/build/src/v1alpha/document_service_client.d.ts +11 -2
  74. package/build/src/v1alpha/document_service_client.js +37 -10
  75. package/build/src/v1alpha/engine_service_client.d.ts +11 -2
  76. package/build/src/v1alpha/engine_service_client.js +37 -10
  77. package/build/src/v1alpha/index.js +1 -1
  78. package/build/src/v1alpha/recommendation_service_client.d.ts +11 -2
  79. package/build/src/v1alpha/recommendation_service_client.js +37 -10
  80. package/build/src/v1alpha/schema_service_client.d.ts +11 -2
  81. package/build/src/v1alpha/schema_service_client.js +37 -10
  82. package/build/src/v1alpha/search_service_client.d.ts +11 -2
  83. package/build/src/v1alpha/search_service_client.js +37 -10
  84. package/build/src/v1alpha/search_tuning_service_client.d.ts +11 -2
  85. package/build/src/v1alpha/search_tuning_service_client.js +37 -10
  86. package/build/src/v1alpha/site_search_engine_service_client.d.ts +11 -2
  87. package/build/src/v1alpha/site_search_engine_service_client.js +37 -10
  88. package/build/src/v1alpha/user_event_service_client.d.ts +11 -2
  89. package/build/src/v1alpha/user_event_service_client.js +37 -10
  90. package/build/src/v1beta/completion_service_client.d.ts +633 -7
  91. package/build/src/v1beta/completion_service_client.js +911 -11
  92. package/build/src/v1beta/completion_service_client_config.json +10 -0
  93. package/build/src/v1beta/conversational_search_service_client.d.ts +341 -3
  94. package/build/src/v1beta/conversational_search_service_client.js +466 -9
  95. package/build/src/v1beta/data_store_service_client.d.ts +1433 -0
  96. package/build/src/v1beta/data_store_service_client.js +1966 -0
  97. package/build/src/v1beta/data_store_service_client_config.json +46 -0
  98. package/build/src/v1beta/document_service_client.d.ts +491 -2
  99. package/build/src/v1beta/document_service_client.js +706 -11
  100. package/build/src/v1beta/engine_service_client.d.ts +1357 -0
  101. package/build/src/v1beta/engine_service_client.js +1928 -0
  102. package/build/src/v1beta/engine_service_client_config.json +46 -0
  103. package/build/src/v1beta/index.d.ts +4 -0
  104. package/build/src/v1beta/index.js +9 -1
  105. package/build/src/v1beta/recommendation_service_client.d.ts +420 -5
  106. package/build/src/v1beta/recommendation_service_client.js +570 -9
  107. package/build/src/v1beta/schema_service_client.d.ts +416 -2
  108. package/build/src/v1beta/schema_service_client.js +602 -11
  109. package/build/src/v1beta/search_service_client.d.ts +539 -29
  110. package/build/src/v1beta/search_service_client.js +664 -27
  111. package/build/src/v1beta/serving_config_service_client.d.ts +1102 -0
  112. package/build/src/v1beta/serving_config_service_client.js +1563 -0
  113. package/build/src/v1beta/serving_config_service_client_config.json +38 -0
  114. package/build/src/v1beta/site_search_engine_service_client.d.ts +1712 -0
  115. package/build/src/v1beta/site_search_engine_service_client.js +2271 -0
  116. package/build/src/v1beta/site_search_engine_service_client_config.json +74 -0
  117. package/build/src/v1beta/user_event_service_client.d.ts +416 -2
  118. package/build/src/v1beta/user_event_service_client.js +602 -11
  119. package/package.json +2 -2
@@ -16,6 +16,8 @@ export declare class ConversationalSearchServiceClient {
16
16
  private _gaxGrpc;
17
17
  private _protos;
18
18
  private _defaults;
19
+ private _universeDomain;
20
+ private _servicePath;
19
21
  auth: gax.GoogleAuth;
20
22
  descriptors: Descriptors;
21
23
  warn: (code: string, message: string, warnType?: string) => void;
@@ -85,15 +87,22 @@ export declare class ConversationalSearchServiceClient {
85
87
  }>;
86
88
  /**
87
89
  * The DNS address for this API service.
90
+ * @deprecated Use the apiEndpoint method of the client instance.
88
91
  * @returns {string} The DNS address for this service.
89
92
  */
90
93
  static get servicePath(): string;
91
94
  /**
92
- * The DNS address for this API service - same as servicePath(),
93
- * exists for compatibility reasons.
95
+ * The DNS address for this API service - same as servicePath.
96
+ * @deprecated Use the apiEndpoint method of the client instance.
94
97
  * @returns {string} The DNS address for this service.
95
98
  */
96
99
  static get apiEndpoint(): string;
100
+ /**
101
+ * The DNS address for this API service.
102
+ * @returns {string} The DNS address for this service.
103
+ */
104
+ get apiEndpoint(): string;
105
+ get universeDomain(): string;
97
106
  /**
98
107
  * The port for this API service.
99
108
  * @returns {number} The default port for this service.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2023 Google LLC
2
+ // Copyright 2024 Google LLC
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -72,7 +72,7 @@ class ConversationalSearchServiceClient {
72
72
  * ```
73
73
  */
74
74
  constructor(opts, gaxInstance) {
75
- var _a, _b;
75
+ var _a, _b, _c, _d;
76
76
  this._terminated = false;
77
77
  this.descriptors = {
78
78
  page: {},
@@ -83,16 +83,24 @@ class ConversationalSearchServiceClient {
83
83
  // Ensure that options include all the required fields.
84
84
  const staticMembers = this
85
85
  .constructor;
86
- const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath;
86
+ if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
87
+ (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
88
+ (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
89
+ throw new Error('Please set either universe_domain or universeDomain, but not both.');
90
+ }
91
+ this._universeDomain =
92
+ (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : 'googleapis.com';
93
+ this._servicePath = 'discoveryengine.' + this._universeDomain;
94
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
87
95
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
88
96
  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');
97
+ const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {};
98
+ const fallback = (_d = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _d !== void 0 ? _d : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
91
99
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
92
100
  // Request numeric enum values if REST transport is used.
93
101
  opts.numericEnums = true;
94
102
  // 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)) {
103
+ if (servicePath !== this._servicePath && !('scopes' in opts)) {
96
104
  opts['scopes'] = staticMembers.scopes;
97
105
  }
98
106
  // Load google-gax module synchronously if needed
@@ -110,9 +118,9 @@ class ConversationalSearchServiceClient {
110
118
  // Set useJWTAccessWithScope on the auth object.
111
119
  this.auth.useJWTAccessWithScope = true;
112
120
  // Set defaultServicePath on the auth object.
113
- this.auth.defaultServicePath = staticMembers.servicePath;
121
+ this.auth.defaultServicePath = this._servicePath;
114
122
  // Set the default scopes in auth client if needed.
115
- if (servicePath === staticMembers.servicePath) {
123
+ if (servicePath === this._servicePath) {
116
124
  this.auth.defaultScopes = staticMembers.scopes;
117
125
  }
118
126
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
@@ -223,19 +231,38 @@ class ConversationalSearchServiceClient {
223
231
  }
224
232
  /**
225
233
  * The DNS address for this API service.
234
+ * @deprecated Use the apiEndpoint method of the client instance.
226
235
  * @returns {string} The DNS address for this service.
227
236
  */
228
237
  static get servicePath() {
238
+ if (typeof process !== undefined &&
239
+ typeof process.emitWarning === 'function') {
240
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
241
+ }
229
242
  return 'discoveryengine.googleapis.com';
230
243
  }
231
244
  /**
232
- * The DNS address for this API service - same as servicePath(),
233
- * exists for compatibility reasons.
245
+ * The DNS address for this API service - same as servicePath.
246
+ * @deprecated Use the apiEndpoint method of the client instance.
234
247
  * @returns {string} The DNS address for this service.
235
248
  */
236
249
  static get apiEndpoint() {
250
+ if (typeof process !== undefined &&
251
+ typeof process.emitWarning === 'function') {
252
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
253
+ }
237
254
  return 'discoveryengine.googleapis.com';
238
255
  }
256
+ /**
257
+ * The DNS address for this API service.
258
+ * @returns {string} The DNS address for this service.
259
+ */
260
+ get apiEndpoint() {
261
+ return this._servicePath;
262
+ }
263
+ get universeDomain() {
264
+ return this._universeDomain;
265
+ }
239
266
  /**
240
267
  * The port for this API service.
241
268
  * @returns {number} The default port for this service.
@@ -17,6 +17,8 @@ export declare class DataStoreServiceClient {
17
17
  private _gaxGrpc;
18
18
  private _protos;
19
19
  private _defaults;
20
+ private _universeDomain;
21
+ private _servicePath;
20
22
  auth: gax.GoogleAuth;
21
23
  descriptors: Descriptors;
22
24
  warn: (code: string, message: string, warnType?: string) => void;
@@ -87,15 +89,22 @@ export declare class DataStoreServiceClient {
87
89
  }>;
88
90
  /**
89
91
  * The DNS address for this API service.
92
+ * @deprecated Use the apiEndpoint method of the client instance.
90
93
  * @returns {string} The DNS address for this service.
91
94
  */
92
95
  static get servicePath(): string;
93
96
  /**
94
- * The DNS address for this API service - same as servicePath(),
95
- * exists for compatibility reasons.
97
+ * The DNS address for this API service - same as servicePath.
98
+ * @deprecated Use the apiEndpoint method of the client instance.
96
99
  * @returns {string} The DNS address for this service.
97
100
  */
98
101
  static get apiEndpoint(): string;
102
+ /**
103
+ * The DNS address for this API service.
104
+ * @returns {string} The DNS address for this service.
105
+ */
106
+ get apiEndpoint(): string;
107
+ get universeDomain(): string;
99
108
  /**
100
109
  * The port for this API service.
101
110
  * @returns {number} The default port for this service.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2023 Google LLC
2
+ // Copyright 2024 Google LLC
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -73,7 +73,7 @@ class DataStoreServiceClient {
73
73
  * ```
74
74
  */
75
75
  constructor(opts, gaxInstance) {
76
- var _a, _b;
76
+ var _a, _b, _c, _d;
77
77
  this._terminated = false;
78
78
  this.descriptors = {
79
79
  page: {},
@@ -83,16 +83,24 @@ class DataStoreServiceClient {
83
83
  };
84
84
  // Ensure that options include all the required fields.
85
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;
86
+ if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
87
+ (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
88
+ (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
89
+ throw new Error('Please set either universe_domain or universeDomain, but not both.');
90
+ }
91
+ this._universeDomain =
92
+ (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : 'googleapis.com';
93
+ this._servicePath = 'discoveryengine.' + this._universeDomain;
94
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
87
95
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
88
96
  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');
97
+ const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {};
98
+ const fallback = (_d = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _d !== void 0 ? _d : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
91
99
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
92
100
  // Request numeric enum values if REST transport is used.
93
101
  opts.numericEnums = true;
94
102
  // 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)) {
103
+ if (servicePath !== this._servicePath && !('scopes' in opts)) {
96
104
  opts['scopes'] = staticMembers.scopes;
97
105
  }
98
106
  // Load google-gax module synchronously if needed
@@ -110,9 +118,9 @@ class DataStoreServiceClient {
110
118
  // Set useJWTAccessWithScope on the auth object.
111
119
  this.auth.useJWTAccessWithScope = true;
112
120
  // Set defaultServicePath on the auth object.
113
- this.auth.defaultServicePath = staticMembers.servicePath;
121
+ this.auth.defaultServicePath = this._servicePath;
114
122
  // Set the default scopes in auth client if needed.
115
- if (servicePath === staticMembers.servicePath) {
123
+ if (servicePath === this._servicePath) {
116
124
  this.auth.defaultScopes = staticMembers.scopes;
117
125
  }
118
126
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
@@ -328,19 +336,38 @@ class DataStoreServiceClient {
328
336
  }
329
337
  /**
330
338
  * The DNS address for this API service.
339
+ * @deprecated Use the apiEndpoint method of the client instance.
331
340
  * @returns {string} The DNS address for this service.
332
341
  */
333
342
  static get servicePath() {
343
+ if (typeof process !== undefined &&
344
+ typeof process.emitWarning === 'function') {
345
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
346
+ }
334
347
  return 'discoveryengine.googleapis.com';
335
348
  }
336
349
  /**
337
- * The DNS address for this API service - same as servicePath(),
338
- * exists for compatibility reasons.
350
+ * The DNS address for this API service - same as servicePath.
351
+ * @deprecated Use the apiEndpoint method of the client instance.
339
352
  * @returns {string} The DNS address for this service.
340
353
  */
341
354
  static get apiEndpoint() {
355
+ if (typeof process !== undefined &&
356
+ typeof process.emitWarning === 'function') {
357
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
358
+ }
342
359
  return 'discoveryengine.googleapis.com';
343
360
  }
361
+ /**
362
+ * The DNS address for this API service.
363
+ * @returns {string} The DNS address for this service.
364
+ */
365
+ get apiEndpoint() {
366
+ return this._servicePath;
367
+ }
368
+ get universeDomain() {
369
+ return this._universeDomain;
370
+ }
344
371
  /**
345
372
  * The port for this API service.
346
373
  * @returns {number} The default port for this service.
@@ -18,6 +18,8 @@ export declare class DocumentServiceClient {
18
18
  private _gaxGrpc;
19
19
  private _protos;
20
20
  private _defaults;
21
+ private _universeDomain;
22
+ private _servicePath;
21
23
  auth: gax.GoogleAuth;
22
24
  descriptors: Descriptors;
23
25
  warn: (code: string, message: string, warnType?: string) => void;
@@ -88,15 +90,22 @@ export declare class DocumentServiceClient {
88
90
  }>;
89
91
  /**
90
92
  * The DNS address for this API service.
93
+ * @deprecated Use the apiEndpoint method of the client instance.
91
94
  * @returns {string} The DNS address for this service.
92
95
  */
93
96
  static get servicePath(): string;
94
97
  /**
95
- * The DNS address for this API service - same as servicePath(),
96
- * exists for compatibility reasons.
98
+ * The DNS address for this API service - same as servicePath.
99
+ * @deprecated Use the apiEndpoint method of the client instance.
97
100
  * @returns {string} The DNS address for this service.
98
101
  */
99
102
  static get apiEndpoint(): string;
103
+ /**
104
+ * The DNS address for this API service.
105
+ * @returns {string} The DNS address for this service.
106
+ */
107
+ get apiEndpoint(): string;
108
+ get universeDomain(): string;
100
109
  /**
101
110
  * The port for this API service.
102
111
  * @returns {number} The default port for this service.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2023 Google LLC
2
+ // Copyright 2024 Google LLC
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -74,7 +74,7 @@ class DocumentServiceClient {
74
74
  * ```
75
75
  */
76
76
  constructor(opts, gaxInstance) {
77
- var _a, _b;
77
+ var _a, _b, _c, _d;
78
78
  this._terminated = false;
79
79
  this.descriptors = {
80
80
  page: {},
@@ -84,16 +84,24 @@ class DocumentServiceClient {
84
84
  };
85
85
  // Ensure that options include all the required fields.
86
86
  const staticMembers = this.constructor;
87
- const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath;
87
+ if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
88
+ (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
89
+ (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
90
+ throw new Error('Please set either universe_domain or universeDomain, but not both.');
91
+ }
92
+ this._universeDomain =
93
+ (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : 'googleapis.com';
94
+ this._servicePath = 'discoveryengine.' + this._universeDomain;
95
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
88
96
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
89
97
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
90
- const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {};
91
- 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');
98
+ const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {};
99
+ const fallback = (_d = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _d !== void 0 ? _d : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
92
100
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
93
101
  // Request numeric enum values if REST transport is used.
94
102
  opts.numericEnums = true;
95
103
  // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
96
- if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
104
+ if (servicePath !== this._servicePath && !('scopes' in opts)) {
97
105
  opts['scopes'] = staticMembers.scopes;
98
106
  }
99
107
  // Load google-gax module synchronously if needed
@@ -111,9 +119,9 @@ class DocumentServiceClient {
111
119
  // Set useJWTAccessWithScope on the auth object.
112
120
  this.auth.useJWTAccessWithScope = true;
113
121
  // Set defaultServicePath on the auth object.
114
- this.auth.defaultServicePath = staticMembers.servicePath;
122
+ this.auth.defaultServicePath = this._servicePath;
115
123
  // Set the default scopes in auth client if needed.
116
- if (servicePath === staticMembers.servicePath) {
124
+ if (servicePath === this._servicePath) {
117
125
  this.auth.defaultScopes = staticMembers.scopes;
118
126
  }
119
127
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
@@ -332,19 +340,38 @@ class DocumentServiceClient {
332
340
  }
333
341
  /**
334
342
  * The DNS address for this API service.
343
+ * @deprecated Use the apiEndpoint method of the client instance.
335
344
  * @returns {string} The DNS address for this service.
336
345
  */
337
346
  static get servicePath() {
347
+ if (typeof process !== undefined &&
348
+ typeof process.emitWarning === 'function') {
349
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
350
+ }
338
351
  return 'discoveryengine.googleapis.com';
339
352
  }
340
353
  /**
341
- * The DNS address for this API service - same as servicePath(),
342
- * exists for compatibility reasons.
354
+ * The DNS address for this API service - same as servicePath.
355
+ * @deprecated Use the apiEndpoint method of the client instance.
343
356
  * @returns {string} The DNS address for this service.
344
357
  */
345
358
  static get apiEndpoint() {
359
+ if (typeof process !== undefined &&
360
+ typeof process.emitWarning === 'function') {
361
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
362
+ }
346
363
  return 'discoveryengine.googleapis.com';
347
364
  }
365
+ /**
366
+ * The DNS address for this API service.
367
+ * @returns {string} The DNS address for this service.
368
+ */
369
+ get apiEndpoint() {
370
+ return this._servicePath;
371
+ }
372
+ get universeDomain() {
373
+ return this._universeDomain;
374
+ }
348
375
  /**
349
376
  * The port for this API service.
350
377
  * @returns {number} The default port for this service.
@@ -17,6 +17,8 @@ export declare class EngineServiceClient {
17
17
  private _gaxGrpc;
18
18
  private _protos;
19
19
  private _defaults;
20
+ private _universeDomain;
21
+ private _servicePath;
20
22
  auth: gax.GoogleAuth;
21
23
  descriptors: Descriptors;
22
24
  warn: (code: string, message: string, warnType?: string) => void;
@@ -87,15 +89,22 @@ export declare class EngineServiceClient {
87
89
  }>;
88
90
  /**
89
91
  * The DNS address for this API service.
92
+ * @deprecated Use the apiEndpoint method of the client instance.
90
93
  * @returns {string} The DNS address for this service.
91
94
  */
92
95
  static get servicePath(): string;
93
96
  /**
94
- * The DNS address for this API service - same as servicePath(),
95
- * exists for compatibility reasons.
97
+ * The DNS address for this API service - same as servicePath.
98
+ * @deprecated Use the apiEndpoint method of the client instance.
96
99
  * @returns {string} The DNS address for this service.
97
100
  */
98
101
  static get apiEndpoint(): string;
102
+ /**
103
+ * The DNS address for this API service.
104
+ * @returns {string} The DNS address for this service.
105
+ */
106
+ get apiEndpoint(): string;
107
+ get universeDomain(): string;
99
108
  /**
100
109
  * The port for this API service.
101
110
  * @returns {number} The default port for this service.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2023 Google LLC
2
+ // Copyright 2024 Google LLC
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -73,7 +73,7 @@ class EngineServiceClient {
73
73
  * ```
74
74
  */
75
75
  constructor(opts, gaxInstance) {
76
- var _a, _b;
76
+ var _a, _b, _c, _d;
77
77
  this._terminated = false;
78
78
  this.descriptors = {
79
79
  page: {},
@@ -83,16 +83,24 @@ class EngineServiceClient {
83
83
  };
84
84
  // Ensure that options include all the required fields.
85
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;
86
+ if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
87
+ (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
88
+ (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
89
+ throw new Error('Please set either universe_domain or universeDomain, but not both.');
90
+ }
91
+ this._universeDomain =
92
+ (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : 'googleapis.com';
93
+ this._servicePath = 'discoveryengine.' + this._universeDomain;
94
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
87
95
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
88
96
  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');
97
+ const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {};
98
+ const fallback = (_d = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _d !== void 0 ? _d : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
91
99
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
92
100
  // Request numeric enum values if REST transport is used.
93
101
  opts.numericEnums = true;
94
102
  // 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)) {
103
+ if (servicePath !== this._servicePath && !('scopes' in opts)) {
96
104
  opts['scopes'] = staticMembers.scopes;
97
105
  }
98
106
  // Load google-gax module synchronously if needed
@@ -110,9 +118,9 @@ class EngineServiceClient {
110
118
  // Set useJWTAccessWithScope on the auth object.
111
119
  this.auth.useJWTAccessWithScope = true;
112
120
  // Set defaultServicePath on the auth object.
113
- this.auth.defaultServicePath = staticMembers.servicePath;
121
+ this.auth.defaultServicePath = this._servicePath;
114
122
  // Set the default scopes in auth client if needed.
115
- if (servicePath === staticMembers.servicePath) {
123
+ if (servicePath === this._servicePath) {
116
124
  this.auth.defaultScopes = staticMembers.scopes;
117
125
  }
118
126
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
@@ -334,19 +342,38 @@ class EngineServiceClient {
334
342
  }
335
343
  /**
336
344
  * The DNS address for this API service.
345
+ * @deprecated Use the apiEndpoint method of the client instance.
337
346
  * @returns {string} The DNS address for this service.
338
347
  */
339
348
  static get servicePath() {
349
+ if (typeof process !== undefined &&
350
+ typeof process.emitWarning === 'function') {
351
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
352
+ }
340
353
  return 'discoveryengine.googleapis.com';
341
354
  }
342
355
  /**
343
- * The DNS address for this API service - same as servicePath(),
344
- * exists for compatibility reasons.
356
+ * The DNS address for this API service - same as servicePath.
357
+ * @deprecated Use the apiEndpoint method of the client instance.
345
358
  * @returns {string} The DNS address for this service.
346
359
  */
347
360
  static get apiEndpoint() {
361
+ if (typeof process !== undefined &&
362
+ typeof process.emitWarning === 'function') {
363
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
364
+ }
348
365
  return 'discoveryengine.googleapis.com';
349
366
  }
367
+ /**
368
+ * The DNS address for this API service.
369
+ * @returns {string} The DNS address for this service.
370
+ */
371
+ get apiEndpoint() {
372
+ return this._servicePath;
373
+ }
374
+ get universeDomain() {
375
+ return this._universeDomain;
376
+ }
350
377
  /**
351
378
  * The port for this API service.
352
379
  * @returns {number} The default port for this service.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2023 Google LLC
2
+ // Copyright 2024 Google LLC
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -14,6 +14,8 @@ export declare class RecommendationServiceClient {
14
14
  private _gaxGrpc;
15
15
  private _protos;
16
16
  private _defaults;
17
+ private _universeDomain;
18
+ private _servicePath;
17
19
  auth: gax.GoogleAuth;
18
20
  descriptors: Descriptors;
19
21
  warn: (code: string, message: string, warnType?: string) => void;
@@ -83,15 +85,22 @@ export declare class RecommendationServiceClient {
83
85
  }>;
84
86
  /**
85
87
  * The DNS address for this API service.
88
+ * @deprecated Use the apiEndpoint method of the client instance.
86
89
  * @returns {string} The DNS address for this service.
87
90
  */
88
91
  static get servicePath(): string;
89
92
  /**
90
- * The DNS address for this API service - same as servicePath(),
91
- * exists for compatibility reasons.
93
+ * The DNS address for this API service - same as servicePath.
94
+ * @deprecated Use the apiEndpoint method of the client instance.
92
95
  * @returns {string} The DNS address for this service.
93
96
  */
94
97
  static get apiEndpoint(): string;
98
+ /**
99
+ * The DNS address for this API service.
100
+ * @returns {string} The DNS address for this service.
101
+ */
102
+ get apiEndpoint(): string;
103
+ get universeDomain(): string;
95
104
  /**
96
105
  * The port for this API service.
97
106
  * @returns {number} The default port for this service.