@google-cloud/discoveryengine 1.3.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -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 RecommendationServiceClient {
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 RecommendationServiceClient {
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 RecommendationServiceClient {
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);
@@ -210,19 +218,38 @@ class RecommendationServiceClient {
210
218
  }
211
219
  /**
212
220
  * The DNS address for this API service.
221
+ * @deprecated Use the apiEndpoint method of the client instance.
213
222
  * @returns {string} The DNS address for this service.
214
223
  */
215
224
  static get servicePath() {
225
+ if (typeof process !== undefined &&
226
+ typeof process.emitWarning === 'function') {
227
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
228
+ }
216
229
  return 'discoveryengine.googleapis.com';
217
230
  }
218
231
  /**
219
- * The DNS address for this API service - same as servicePath(),
220
- * exists for compatibility reasons.
232
+ * The DNS address for this API service - same as servicePath.
233
+ * @deprecated Use the apiEndpoint method of the client instance.
221
234
  * @returns {string} The DNS address for this service.
222
235
  */
223
236
  static get apiEndpoint() {
237
+ if (typeof process !== undefined &&
238
+ typeof process.emitWarning === 'function') {
239
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
240
+ }
224
241
  return 'discoveryengine.googleapis.com';
225
242
  }
243
+ /**
244
+ * The DNS address for this API service.
245
+ * @returns {string} The DNS address for this service.
246
+ */
247
+ get apiEndpoint() {
248
+ return this._servicePath;
249
+ }
250
+ get universeDomain() {
251
+ return this._universeDomain;
252
+ }
226
253
  /**
227
254
  * The port for this API service.
228
255
  * @returns {number} The default port for this service.
@@ -16,6 +16,8 @@ export declare class SchemaServiceClient {
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;
@@ -86,15 +88,22 @@ export declare class SchemaServiceClient {
86
88
  }>;
87
89
  /**
88
90
  * The DNS address for this API service.
91
+ * @deprecated Use the apiEndpoint method of the client instance.
89
92
  * @returns {string} The DNS address for this service.
90
93
  */
91
94
  static get servicePath(): string;
92
95
  /**
93
- * The DNS address for this API service - same as servicePath(),
94
- * exists for compatibility reasons.
96
+ * The DNS address for this API service - same as servicePath.
97
+ * @deprecated Use the apiEndpoint method of the client instance.
95
98
  * @returns {string} The DNS address for this service.
96
99
  */
97
100
  static get apiEndpoint(): string;
101
+ /**
102
+ * The DNS address for this API service.
103
+ * @returns {string} The DNS address for this service.
104
+ */
105
+ get apiEndpoint(): string;
106
+ get universeDomain(): string;
98
107
  /**
99
108
  * The port for this API service.
100
109
  * @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 SchemaServiceClient {
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: {},
@@ -82,16 +82,24 @@ class SchemaServiceClient {
82
82
  };
83
83
  // Ensure that options include all the required fields.
84
84
  const staticMembers = this.constructor;
85
- const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath;
85
+ if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
86
+ (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
87
+ (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
88
+ throw new Error('Please set either universe_domain or universeDomain, but not both.');
89
+ }
90
+ this._universeDomain =
91
+ (_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';
92
+ this._servicePath = 'discoveryengine.' + this._universeDomain;
93
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
86
94
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
87
95
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
88
- const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {};
89
- 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');
96
+ const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {};
97
+ 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');
90
98
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
91
99
  // Request numeric enum values if REST transport is used.
92
100
  opts.numericEnums = true;
93
101
  // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
94
- if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
102
+ if (servicePath !== this._servicePath && !('scopes' in opts)) {
95
103
  opts['scopes'] = staticMembers.scopes;
96
104
  }
97
105
  // Load google-gax module synchronously if needed
@@ -109,9 +117,9 @@ class SchemaServiceClient {
109
117
  // Set useJWTAccessWithScope on the auth object.
110
118
  this.auth.useJWTAccessWithScope = true;
111
119
  // Set defaultServicePath on the auth object.
112
- this.auth.defaultServicePath = staticMembers.servicePath;
120
+ this.auth.defaultServicePath = this._servicePath;
113
121
  // Set the default scopes in auth client if needed.
114
- if (servicePath === staticMembers.servicePath) {
122
+ if (servicePath === this._servicePath) {
115
123
  this.auth.defaultScopes = staticMembers.scopes;
116
124
  }
117
125
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
@@ -329,19 +337,38 @@ class SchemaServiceClient {
329
337
  }
330
338
  /**
331
339
  * The DNS address for this API service.
340
+ * @deprecated Use the apiEndpoint method of the client instance.
332
341
  * @returns {string} The DNS address for this service.
333
342
  */
334
343
  static get servicePath() {
344
+ if (typeof process !== undefined &&
345
+ typeof process.emitWarning === 'function') {
346
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
347
+ }
335
348
  return 'discoveryengine.googleapis.com';
336
349
  }
337
350
  /**
338
- * The DNS address for this API service - same as servicePath(),
339
- * exists for compatibility reasons.
351
+ * The DNS address for this API service - same as servicePath.
352
+ * @deprecated Use the apiEndpoint method of the client instance.
340
353
  * @returns {string} The DNS address for this service.
341
354
  */
342
355
  static get apiEndpoint() {
356
+ if (typeof process !== undefined &&
357
+ typeof process.emitWarning === 'function') {
358
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
359
+ }
343
360
  return 'discoveryengine.googleapis.com';
344
361
  }
362
+ /**
363
+ * The DNS address for this API service.
364
+ * @returns {string} The DNS address for this service.
365
+ */
366
+ get apiEndpoint() {
367
+ return this._servicePath;
368
+ }
369
+ get universeDomain() {
370
+ return this._universeDomain;
371
+ }
345
372
  /**
346
373
  * The port for this API service.
347
374
  * @returns {number} The default port for this service.
@@ -16,6 +16,8 @@ export declare class SearchServiceClient {
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 SearchServiceClient {
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 SearchServiceClient {
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: {},
@@ -82,16 +82,24 @@ class SearchServiceClient {
82
82
  };
83
83
  // Ensure that options include all the required fields.
84
84
  const staticMembers = this.constructor;
85
- const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath;
85
+ if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
86
+ (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
87
+ (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
88
+ throw new Error('Please set either universe_domain or universeDomain, but not both.');
89
+ }
90
+ this._universeDomain =
91
+ (_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';
92
+ this._servicePath = 'discoveryengine.' + this._universeDomain;
93
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
86
94
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
87
95
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
88
- const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {};
89
- 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');
96
+ const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {};
97
+ 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');
90
98
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
91
99
  // Request numeric enum values if REST transport is used.
92
100
  opts.numericEnums = true;
93
101
  // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
94
- if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
102
+ if (servicePath !== this._servicePath && !('scopes' in opts)) {
95
103
  opts['scopes'] = staticMembers.scopes;
96
104
  }
97
105
  // Load google-gax module synchronously if needed
@@ -109,9 +117,9 @@ class SearchServiceClient {
109
117
  // Set useJWTAccessWithScope on the auth object.
110
118
  this.auth.useJWTAccessWithScope = true;
111
119
  // Set defaultServicePath on the auth object.
112
- this.auth.defaultServicePath = staticMembers.servicePath;
120
+ this.auth.defaultServicePath = this._servicePath;
113
121
  // Set the default scopes in auth client if needed.
114
- if (servicePath === staticMembers.servicePath) {
122
+ if (servicePath === this._servicePath) {
115
123
  this.auth.defaultScopes = staticMembers.scopes;
116
124
  }
117
125
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
@@ -217,19 +225,38 @@ class SearchServiceClient {
217
225
  }
218
226
  /**
219
227
  * The DNS address for this API service.
228
+ * @deprecated Use the apiEndpoint method of the client instance.
220
229
  * @returns {string} The DNS address for this service.
221
230
  */
222
231
  static get servicePath() {
232
+ if (typeof process !== undefined &&
233
+ typeof process.emitWarning === 'function') {
234
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
235
+ }
223
236
  return 'discoveryengine.googleapis.com';
224
237
  }
225
238
  /**
226
- * The DNS address for this API service - same as servicePath(),
227
- * exists for compatibility reasons.
239
+ * The DNS address for this API service - same as servicePath.
240
+ * @deprecated Use the apiEndpoint method of the client instance.
228
241
  * @returns {string} The DNS address for this service.
229
242
  */
230
243
  static get apiEndpoint() {
244
+ if (typeof process !== undefined &&
245
+ typeof process.emitWarning === 'function') {
246
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
247
+ }
231
248
  return 'discoveryengine.googleapis.com';
232
249
  }
250
+ /**
251
+ * The DNS address for this API service.
252
+ * @returns {string} The DNS address for this service.
253
+ */
254
+ get apiEndpoint() {
255
+ return this._servicePath;
256
+ }
257
+ get universeDomain() {
258
+ return this._universeDomain;
259
+ }
233
260
  /**
234
261
  * The port for this API service.
235
262
  * @returns {number} The default port for this service.
@@ -14,6 +14,8 @@ export declare class SearchTuningServiceClient {
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;
@@ -84,15 +86,22 @@ export declare class SearchTuningServiceClient {
84
86
  }>;
85
87
  /**
86
88
  * The DNS address for this API service.
89
+ * @deprecated Use the apiEndpoint method of the client instance.
87
90
  * @returns {string} The DNS address for this service.
88
91
  */
89
92
  static get servicePath(): string;
90
93
  /**
91
- * The DNS address for this API service - same as servicePath(),
92
- * exists for compatibility reasons.
94
+ * The DNS address for this API service - same as servicePath.
95
+ * @deprecated Use the apiEndpoint method of the client instance.
93
96
  * @returns {string} The DNS address for this service.
94
97
  */
95
98
  static get apiEndpoint(): string;
99
+ /**
100
+ * The DNS address for this API service.
101
+ * @returns {string} The DNS address for this service.
102
+ */
103
+ get apiEndpoint(): string;
104
+ get universeDomain(): string;
96
105
  /**
97
106
  * The port for this API service.
98
107
  * @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 SearchTuningServiceClient {
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: {},
@@ -82,16 +82,24 @@ class SearchTuningServiceClient {
82
82
  };
83
83
  // Ensure that options include all the required fields.
84
84
  const staticMembers = this.constructor;
85
- const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath;
85
+ if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
86
+ (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
87
+ (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
88
+ throw new Error('Please set either universe_domain or universeDomain, but not both.');
89
+ }
90
+ this._universeDomain =
91
+ (_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';
92
+ this._servicePath = 'discoveryengine.' + this._universeDomain;
93
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
86
94
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
87
95
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
88
- const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {};
89
- 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');
96
+ const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {};
97
+ 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');
90
98
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
91
99
  // Request numeric enum values if REST transport is used.
92
100
  opts.numericEnums = true;
93
101
  // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
94
- if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
102
+ if (servicePath !== this._servicePath && !('scopes' in opts)) {
95
103
  opts['scopes'] = staticMembers.scopes;
96
104
  }
97
105
  // Load google-gax module synchronously if needed
@@ -109,9 +117,9 @@ class SearchTuningServiceClient {
109
117
  // Set useJWTAccessWithScope on the auth object.
110
118
  this.auth.useJWTAccessWithScope = true;
111
119
  // Set defaultServicePath on the auth object.
112
- this.auth.defaultServicePath = staticMembers.servicePath;
120
+ this.auth.defaultServicePath = this._servicePath;
113
121
  // Set the default scopes in auth client if needed.
114
- if (servicePath === staticMembers.servicePath) {
122
+ if (servicePath === this._servicePath) {
115
123
  this.auth.defaultScopes = staticMembers.scopes;
116
124
  }
117
125
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
@@ -309,19 +317,38 @@ class SearchTuningServiceClient {
309
317
  }
310
318
  /**
311
319
  * The DNS address for this API service.
320
+ * @deprecated Use the apiEndpoint method of the client instance.
312
321
  * @returns {string} The DNS address for this service.
313
322
  */
314
323
  static get servicePath() {
324
+ if (typeof process !== undefined &&
325
+ typeof process.emitWarning === 'function') {
326
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
327
+ }
315
328
  return 'discoveryengine.googleapis.com';
316
329
  }
317
330
  /**
318
- * The DNS address for this API service - same as servicePath(),
319
- * exists for compatibility reasons.
331
+ * The DNS address for this API service - same as servicePath.
332
+ * @deprecated Use the apiEndpoint method of the client instance.
320
333
  * @returns {string} The DNS address for this service.
321
334
  */
322
335
  static get apiEndpoint() {
336
+ if (typeof process !== undefined &&
337
+ typeof process.emitWarning === 'function') {
338
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
339
+ }
323
340
  return 'discoveryengine.googleapis.com';
324
341
  }
342
+ /**
343
+ * The DNS address for this API service.
344
+ * @returns {string} The DNS address for this service.
345
+ */
346
+ get apiEndpoint() {
347
+ return this._servicePath;
348
+ }
349
+ get universeDomain() {
350
+ return this._universeDomain;
351
+ }
325
352
  /**
326
353
  * The port for this API service.
327
354
  * @returns {number} The default port for this service.
@@ -16,6 +16,8 @@ export declare class SiteSearchEngineServiceClient {
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;
@@ -86,15 +88,22 @@ export declare class SiteSearchEngineServiceClient {
86
88
  }>;
87
89
  /**
88
90
  * The DNS address for this API service.
91
+ * @deprecated Use the apiEndpoint method of the client instance.
89
92
  * @returns {string} The DNS address for this service.
90
93
  */
91
94
  static get servicePath(): string;
92
95
  /**
93
- * The DNS address for this API service - same as servicePath(),
94
- * exists for compatibility reasons.
96
+ * The DNS address for this API service - same as servicePath.
97
+ * @deprecated Use the apiEndpoint method of the client instance.
95
98
  * @returns {string} The DNS address for this service.
96
99
  */
97
100
  static get apiEndpoint(): string;
101
+ /**
102
+ * The DNS address for this API service.
103
+ * @returns {string} The DNS address for this service.
104
+ */
105
+ get apiEndpoint(): string;
106
+ get universeDomain(): string;
98
107
  /**
99
108
  * The port for this API service.
100
109
  * @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 SiteSearchEngineServiceClient {
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 SiteSearchEngineServiceClient {
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 SiteSearchEngineServiceClient {
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);
@@ -353,19 +361,38 @@ class SiteSearchEngineServiceClient {
353
361
  }
354
362
  /**
355
363
  * The DNS address for this API service.
364
+ * @deprecated Use the apiEndpoint method of the client instance.
356
365
  * @returns {string} The DNS address for this service.
357
366
  */
358
367
  static get servicePath() {
368
+ if (typeof process !== undefined &&
369
+ typeof process.emitWarning === 'function') {
370
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
371
+ }
359
372
  return 'discoveryengine.googleapis.com';
360
373
  }
361
374
  /**
362
- * The DNS address for this API service - same as servicePath(),
363
- * exists for compatibility reasons.
375
+ * The DNS address for this API service - same as servicePath.
376
+ * @deprecated Use the apiEndpoint method of the client instance.
364
377
  * @returns {string} The DNS address for this service.
365
378
  */
366
379
  static get apiEndpoint() {
380
+ if (typeof process !== undefined &&
381
+ typeof process.emitWarning === 'function') {
382
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
383
+ }
367
384
  return 'discoveryengine.googleapis.com';
368
385
  }
386
+ /**
387
+ * The DNS address for this API service.
388
+ * @returns {string} The DNS address for this service.
389
+ */
390
+ get apiEndpoint() {
391
+ return this._servicePath;
392
+ }
393
+ get universeDomain() {
394
+ return this._universeDomain;
395
+ }
369
396
  /**
370
397
  * The port for this API service.
371
398
  * @returns {number} The default port for this service.