@google-cloud/discoveryengine 1.4.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +2 -0
  3. package/build/protos/google/cloud/discoveryengine/v1alpha/rank_service.proto +115 -0
  4. package/build/protos/protos.d.ts +384 -0
  5. package/build/protos/protos.js +906 -0
  6. package/build/protos/protos.json +90 -1
  7. package/build/src/v1/completion_service_client.js +10 -7
  8. package/build/src/v1/conversational_search_service_client.js +10 -7
  9. package/build/src/v1/data_store_service_client.js +10 -7
  10. package/build/src/v1/document_service_client.js +10 -7
  11. package/build/src/v1/engine_service_client.js +10 -7
  12. package/build/src/v1/schema_service_client.js +10 -7
  13. package/build/src/v1/search_service_client.js +10 -7
  14. package/build/src/v1/site_search_engine_service_client.js +10 -7
  15. package/build/src/v1/user_event_service_client.js +10 -7
  16. package/build/src/v1alpha/acl_config_service_client.js +10 -7
  17. package/build/src/v1alpha/chunk_service_client.js +10 -7
  18. package/build/src/v1alpha/completion_service_client.js +10 -7
  19. package/build/src/v1alpha/conversational_search_service_client.js +10 -7
  20. package/build/src/v1alpha/data_store_service_client.js +10 -7
  21. package/build/src/v1alpha/document_service_client.js +10 -7
  22. package/build/src/v1alpha/engine_service_client.js +10 -7
  23. package/build/src/v1alpha/estimate_billing_service_client.js +10 -7
  24. package/build/src/v1alpha/index.d.ts +1 -0
  25. package/build/src/v1alpha/index.js +3 -1
  26. package/build/src/v1alpha/rank_service_client.d.ts +1254 -0
  27. package/build/src/v1alpha/rank_service_client.js +1796 -0
  28. package/build/src/v1alpha/rank_service_client_config.json +30 -0
  29. package/build/src/v1alpha/recommendation_service_client.js +10 -7
  30. package/build/src/v1alpha/schema_service_client.js +10 -7
  31. package/build/src/v1alpha/search_service_client.js +10 -7
  32. package/build/src/v1alpha/search_tuning_service_client.js +10 -7
  33. package/build/src/v1alpha/serving_config_service_client.js +10 -7
  34. package/build/src/v1alpha/site_search_engine_service_client.js +10 -7
  35. package/build/src/v1alpha/user_event_service_client.js +10 -7
  36. package/build/src/v1beta/completion_service_client.js +10 -7
  37. package/build/src/v1beta/conversational_search_service_client.js +10 -7
  38. package/build/src/v1beta/data_store_service_client.js +10 -7
  39. package/build/src/v1beta/document_service_client.js +10 -7
  40. package/build/src/v1beta/engine_service_client.js +10 -7
  41. package/build/src/v1beta/recommendation_service_client.js +10 -7
  42. package/build/src/v1beta/schema_service_client.js +10 -7
  43. package/build/src/v1beta/search_service_client.js +10 -7
  44. package/build/src/v1beta/search_tuning_service_client.js +10 -7
  45. package/build/src/v1beta/serving_config_service_client.js +10 -7
  46. package/build/src/v1beta/site_search_engine_service_client.js +10 -7
  47. package/build/src/v1beta/user_event_service_client.js +10 -7
  48. package/package.json +1 -1
@@ -4533,7 +4533,7 @@
4533
4533
  "csharp_namespace": "Google.Cloud.DiscoveryEngine.V1Alpha",
4534
4534
  "go_package": "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb",
4535
4535
  "java_multiple_files": true,
4536
- "java_outer_classname": "UserEventServiceProto",
4536
+ "java_outer_classname": "RankServiceProto",
4537
4537
  "java_package": "com.google.cloud.discoveryengine.v1alpha",
4538
4538
  "objc_class_prefix": "DISCOVERYENGINE",
4539
4539
  "php_namespace": "Google\\Cloud\\DiscoveryEngine\\V1alpha",
@@ -10957,6 +10957,95 @@
10957
10957
  }
10958
10958
  }
10959
10959
  }
10960
+ },
10961
+ "RankService": {
10962
+ "options": {
10963
+ "(google.api.default_host)": "discoveryengine.googleapis.com",
10964
+ "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform"
10965
+ },
10966
+ "methods": {
10967
+ "Rank": {
10968
+ "requestType": "RankRequest",
10969
+ "responseType": "RankResponse",
10970
+ "options": {
10971
+ "(google.api.http).post": "/v1alpha/{ranking_config=projects/*/locations/*/rankingConfigs/*}:rank",
10972
+ "(google.api.http).body": "*"
10973
+ },
10974
+ "parsedOptions": [
10975
+ {
10976
+ "(google.api.http)": {
10977
+ "post": "/v1alpha/{ranking_config=projects/*/locations/*/rankingConfigs/*}:rank",
10978
+ "body": "*"
10979
+ }
10980
+ }
10981
+ ]
10982
+ }
10983
+ }
10984
+ },
10985
+ "RankingRecord": {
10986
+ "fields": {
10987
+ "id": {
10988
+ "type": "string",
10989
+ "id": 1
10990
+ },
10991
+ "title": {
10992
+ "type": "string",
10993
+ "id": 2
10994
+ },
10995
+ "content": {
10996
+ "type": "string",
10997
+ "id": 3
10998
+ },
10999
+ "score": {
11000
+ "type": "float",
11001
+ "id": 4
11002
+ }
11003
+ }
11004
+ },
11005
+ "RankRequest": {
11006
+ "fields": {
11007
+ "rankingConfig": {
11008
+ "type": "string",
11009
+ "id": 1,
11010
+ "options": {
11011
+ "(google.api.field_behavior)": "REQUIRED",
11012
+ "(google.api.resource_reference).type": "discoveryengine.googleapis.com/RankingConfig"
11013
+ }
11014
+ },
11015
+ "model": {
11016
+ "type": "string",
11017
+ "id": 2
11018
+ },
11019
+ "topN": {
11020
+ "type": "int32",
11021
+ "id": 3
11022
+ },
11023
+ "query": {
11024
+ "type": "string",
11025
+ "id": 4
11026
+ },
11027
+ "records": {
11028
+ "rule": "repeated",
11029
+ "type": "RankingRecord",
11030
+ "id": 5,
11031
+ "options": {
11032
+ "(google.api.field_behavior)": "REQUIRED"
11033
+ }
11034
+ },
11035
+ "ignoreRecordDetailsInResponse": {
11036
+ "type": "bool",
11037
+ "id": 6
11038
+ }
11039
+ }
11040
+ },
11041
+ "RankResponse": {
11042
+ "fields": {
11043
+ "records": {
11044
+ "rule": "repeated",
11045
+ "type": "RankingRecord",
11046
+ "id": 5
11047
+ }
11048
+ }
10960
11049
  }
10961
11050
  }
10962
11051
  },
@@ -72,7 +72,7 @@ class CompletionServiceClient {
72
72
  * ```
73
73
  */
74
74
  constructor(opts, gaxInstance) {
75
- var _a, _b, _c, _d;
75
+ var _a, _b, _c, _d, _e;
76
76
  this._terminated = false;
77
77
  this.descriptors = {
78
78
  page: {},
@@ -87,14 +87,17 @@ class CompletionServiceClient {
87
87
  (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
88
88
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
89
89
  }
90
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
91
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
92
+ : undefined;
90
93
  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';
94
+ (_c = (_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 : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
92
95
  this._servicePath = 'discoveryengine.' + this._universeDomain;
93
96
  const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
94
97
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
95
98
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
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');
99
+ const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
100
+ const fallback = (_e = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _e !== void 0 ? _e : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
98
101
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
99
102
  // Request numeric enum values if REST transport is used.
100
103
  opts.numericEnums = true;
@@ -125,7 +128,7 @@ class CompletionServiceClient {
125
128
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
126
129
  // Determine the client header string.
127
130
  const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
128
- if (typeof process !== 'undefined' && 'versions' in process) {
131
+ if (typeof process === 'object' && 'versions' in process) {
129
132
  clientHeader.push(`gl-node/${process.versions.node}`);
130
133
  }
131
134
  else {
@@ -330,7 +333,7 @@ class CompletionServiceClient {
330
333
  * @returns {string} The DNS address for this service.
331
334
  */
332
335
  static get servicePath() {
333
- if (typeof process !== undefined &&
336
+ if (typeof process === 'object' &&
334
337
  typeof process.emitWarning === 'function') {
335
338
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
336
339
  }
@@ -342,7 +345,7 @@ class CompletionServiceClient {
342
345
  * @returns {string} The DNS address for this service.
343
346
  */
344
347
  static get apiEndpoint() {
345
- if (typeof process !== undefined &&
348
+ if (typeof process === 'object' &&
346
349
  typeof process.emitWarning === 'function') {
347
350
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
348
351
  }
@@ -72,7 +72,7 @@ class ConversationalSearchServiceClient {
72
72
  * ```
73
73
  */
74
74
  constructor(opts, gaxInstance) {
75
- var _a, _b, _c, _d;
75
+ var _a, _b, _c, _d, _e;
76
76
  this._terminated = false;
77
77
  this.descriptors = {
78
78
  page: {},
@@ -88,14 +88,17 @@ class ConversationalSearchServiceClient {
88
88
  (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
89
89
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
90
90
  }
91
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
92
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
93
+ : undefined;
91
94
  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';
95
+ (_c = (_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 : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
93
96
  this._servicePath = 'discoveryengine.' + this._universeDomain;
94
97
  const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
95
98
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
96
99
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
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');
100
+ const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
101
+ const fallback = (_e = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _e !== void 0 ? _e : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
99
102
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
100
103
  // Request numeric enum values if REST transport is used.
101
104
  opts.numericEnums = true;
@@ -126,7 +129,7 @@ class ConversationalSearchServiceClient {
126
129
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
127
130
  // Determine the client header string.
128
131
  const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
129
- if (typeof process !== 'undefined' && 'versions' in process) {
132
+ if (typeof process === 'object' && 'versions' in process) {
130
133
  clientHeader.push(`gl-node/${process.versions.node}`);
131
134
  }
132
135
  else {
@@ -235,7 +238,7 @@ class ConversationalSearchServiceClient {
235
238
  * @returns {string} The DNS address for this service.
236
239
  */
237
240
  static get servicePath() {
238
- if (typeof process !== undefined &&
241
+ if (typeof process === 'object' &&
239
242
  typeof process.emitWarning === 'function') {
240
243
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
241
244
  }
@@ -247,7 +250,7 @@ class ConversationalSearchServiceClient {
247
250
  * @returns {string} The DNS address for this service.
248
251
  */
249
252
  static get apiEndpoint() {
250
- if (typeof process !== undefined &&
253
+ if (typeof process === 'object' &&
251
254
  typeof process.emitWarning === 'function') {
252
255
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
253
256
  }
@@ -73,7 +73,7 @@ class DataStoreServiceClient {
73
73
  * ```
74
74
  */
75
75
  constructor(opts, gaxInstance) {
76
- var _a, _b, _c, _d;
76
+ var _a, _b, _c, _d, _e;
77
77
  this._terminated = false;
78
78
  this.descriptors = {
79
79
  page: {},
@@ -88,14 +88,17 @@ class DataStoreServiceClient {
88
88
  (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
89
89
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
90
90
  }
91
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
92
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
93
+ : undefined;
91
94
  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';
95
+ (_c = (_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 : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
93
96
  this._servicePath = 'discoveryengine.' + this._universeDomain;
94
97
  const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
95
98
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
96
99
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
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');
100
+ const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
101
+ const fallback = (_e = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _e !== void 0 ? _e : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
99
102
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
100
103
  // Request numeric enum values if REST transport is used.
101
104
  opts.numericEnums = true;
@@ -126,7 +129,7 @@ class DataStoreServiceClient {
126
129
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
127
130
  // Determine the client header string.
128
131
  const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
129
- if (typeof process !== 'undefined' && 'versions' in process) {
132
+ if (typeof process === 'object' && 'versions' in process) {
130
133
  clientHeader.push(`gl-node/${process.versions.node}`);
131
134
  }
132
135
  else {
@@ -342,7 +345,7 @@ class DataStoreServiceClient {
342
345
  * @returns {string} The DNS address for this service.
343
346
  */
344
347
  static get servicePath() {
345
- if (typeof process !== undefined &&
348
+ if (typeof process === 'object' &&
346
349
  typeof process.emitWarning === 'function') {
347
350
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
348
351
  }
@@ -354,7 +357,7 @@ class DataStoreServiceClient {
354
357
  * @returns {string} The DNS address for this service.
355
358
  */
356
359
  static get apiEndpoint() {
357
- if (typeof process !== undefined &&
360
+ if (typeof process === 'object' &&
358
361
  typeof process.emitWarning === 'function') {
359
362
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
360
363
  }
@@ -73,7 +73,7 @@ class DocumentServiceClient {
73
73
  * ```
74
74
  */
75
75
  constructor(opts, gaxInstance) {
76
- var _a, _b, _c, _d;
76
+ var _a, _b, _c, _d, _e;
77
77
  this._terminated = false;
78
78
  this.descriptors = {
79
79
  page: {},
@@ -88,14 +88,17 @@ class DocumentServiceClient {
88
88
  (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
89
89
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
90
90
  }
91
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
92
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
93
+ : undefined;
91
94
  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';
95
+ (_c = (_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 : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
93
96
  this._servicePath = 'discoveryengine.' + this._universeDomain;
94
97
  const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
95
98
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
96
99
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
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');
100
+ const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
101
+ const fallback = (_e = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _e !== void 0 ? _e : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
99
102
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
100
103
  // Request numeric enum values if REST transport is used.
101
104
  opts.numericEnums = true;
@@ -126,7 +129,7 @@ class DocumentServiceClient {
126
129
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
127
130
  // Determine the client header string.
128
131
  const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
129
- if (typeof process !== 'undefined' && 'versions' in process) {
132
+ if (typeof process === 'object' && 'versions' in process) {
130
133
  clientHeader.push(`gl-node/${process.versions.node}`);
131
134
  }
132
135
  else {
@@ -344,7 +347,7 @@ class DocumentServiceClient {
344
347
  * @returns {string} The DNS address for this service.
345
348
  */
346
349
  static get servicePath() {
347
- if (typeof process !== undefined &&
350
+ if (typeof process === 'object' &&
348
351
  typeof process.emitWarning === 'function') {
349
352
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
350
353
  }
@@ -356,7 +359,7 @@ class DocumentServiceClient {
356
359
  * @returns {string} The DNS address for this service.
357
360
  */
358
361
  static get apiEndpoint() {
359
- if (typeof process !== undefined &&
362
+ if (typeof process === 'object' &&
360
363
  typeof process.emitWarning === 'function') {
361
364
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
362
365
  }
@@ -73,7 +73,7 @@ class EngineServiceClient {
73
73
  * ```
74
74
  */
75
75
  constructor(opts, gaxInstance) {
76
- var _a, _b, _c, _d;
76
+ var _a, _b, _c, _d, _e;
77
77
  this._terminated = false;
78
78
  this.descriptors = {
79
79
  page: {},
@@ -88,14 +88,17 @@ class EngineServiceClient {
88
88
  (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
89
89
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
90
90
  }
91
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
92
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
93
+ : undefined;
91
94
  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';
95
+ (_c = (_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 : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
93
96
  this._servicePath = 'discoveryengine.' + this._universeDomain;
94
97
  const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
95
98
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
96
99
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
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');
100
+ const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
101
+ const fallback = (_e = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _e !== void 0 ? _e : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
99
102
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
100
103
  // Request numeric enum values if REST transport is used.
101
104
  opts.numericEnums = true;
@@ -126,7 +129,7 @@ class EngineServiceClient {
126
129
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
127
130
  // Determine the client header string.
128
131
  const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
129
- if (typeof process !== 'undefined' && 'versions' in process) {
132
+ if (typeof process === 'object' && 'versions' in process) {
130
133
  clientHeader.push(`gl-node/${process.versions.node}`);
131
134
  }
132
135
  else {
@@ -341,7 +344,7 @@ class EngineServiceClient {
341
344
  * @returns {string} The DNS address for this service.
342
345
  */
343
346
  static get servicePath() {
344
- if (typeof process !== undefined &&
347
+ if (typeof process === 'object' &&
345
348
  typeof process.emitWarning === 'function') {
346
349
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
347
350
  }
@@ -353,7 +356,7 @@ class EngineServiceClient {
353
356
  * @returns {string} The DNS address for this service.
354
357
  */
355
358
  static get apiEndpoint() {
356
- if (typeof process !== undefined &&
359
+ if (typeof process === 'object' &&
357
360
  typeof process.emitWarning === 'function') {
358
361
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
359
362
  }
@@ -72,7 +72,7 @@ class SchemaServiceClient {
72
72
  * ```
73
73
  */
74
74
  constructor(opts, gaxInstance) {
75
- var _a, _b, _c, _d;
75
+ var _a, _b, _c, _d, _e;
76
76
  this._terminated = false;
77
77
  this.descriptors = {
78
78
  page: {},
@@ -87,14 +87,17 @@ class SchemaServiceClient {
87
87
  (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
88
88
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
89
89
  }
90
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
91
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
92
+ : undefined;
90
93
  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';
94
+ (_c = (_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 : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
92
95
  this._servicePath = 'discoveryengine.' + this._universeDomain;
93
96
  const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
94
97
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
95
98
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
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');
99
+ const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
100
+ const fallback = (_e = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _e !== void 0 ? _e : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
98
101
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
99
102
  // Request numeric enum values if REST transport is used.
100
103
  opts.numericEnums = true;
@@ -125,7 +128,7 @@ class SchemaServiceClient {
125
128
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
126
129
  // Determine the client header string.
127
130
  const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
128
- if (typeof process !== 'undefined' && 'versions' in process) {
131
+ if (typeof process === 'object' && 'versions' in process) {
129
132
  clientHeader.push(`gl-node/${process.versions.node}`);
130
133
  }
131
134
  else {
@@ -342,7 +345,7 @@ class SchemaServiceClient {
342
345
  * @returns {string} The DNS address for this service.
343
346
  */
344
347
  static get servicePath() {
345
- if (typeof process !== undefined &&
348
+ if (typeof process === 'object' &&
346
349
  typeof process.emitWarning === 'function') {
347
350
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
348
351
  }
@@ -354,7 +357,7 @@ class SchemaServiceClient {
354
357
  * @returns {string} The DNS address for this service.
355
358
  */
356
359
  static get apiEndpoint() {
357
- if (typeof process !== undefined &&
360
+ if (typeof process === 'object' &&
358
361
  typeof process.emitWarning === 'function') {
359
362
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
360
363
  }
@@ -72,7 +72,7 @@ class SearchServiceClient {
72
72
  * ```
73
73
  */
74
74
  constructor(opts, gaxInstance) {
75
- var _a, _b, _c, _d;
75
+ var _a, _b, _c, _d, _e;
76
76
  this._terminated = false;
77
77
  this.descriptors = {
78
78
  page: {},
@@ -87,14 +87,17 @@ class SearchServiceClient {
87
87
  (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
88
88
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
89
89
  }
90
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
91
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
92
+ : undefined;
90
93
  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';
94
+ (_c = (_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 : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
92
95
  this._servicePath = 'discoveryengine.' + this._universeDomain;
93
96
  const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
94
97
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
95
98
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
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');
99
+ const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
100
+ const fallback = (_e = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _e !== void 0 ? _e : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
98
101
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
99
102
  // Request numeric enum values if REST transport is used.
100
103
  opts.numericEnums = true;
@@ -125,7 +128,7 @@ class SearchServiceClient {
125
128
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
126
129
  // Determine the client header string.
127
130
  const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
128
- if (typeof process !== 'undefined' && 'versions' in process) {
131
+ if (typeof process === 'object' && 'versions' in process) {
129
132
  clientHeader.push(`gl-node/${process.versions.node}`);
130
133
  }
131
134
  else {
@@ -228,7 +231,7 @@ class SearchServiceClient {
228
231
  * @returns {string} The DNS address for this service.
229
232
  */
230
233
  static get servicePath() {
231
- if (typeof process !== undefined &&
234
+ if (typeof process === 'object' &&
232
235
  typeof process.emitWarning === 'function') {
233
236
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
234
237
  }
@@ -240,7 +243,7 @@ class SearchServiceClient {
240
243
  * @returns {string} The DNS address for this service.
241
244
  */
242
245
  static get apiEndpoint() {
243
- if (typeof process !== undefined &&
246
+ if (typeof process === 'object' &&
244
247
  typeof process.emitWarning === 'function') {
245
248
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
246
249
  }
@@ -72,7 +72,7 @@ class SiteSearchEngineServiceClient {
72
72
  * ```
73
73
  */
74
74
  constructor(opts, gaxInstance) {
75
- var _a, _b, _c, _d;
75
+ var _a, _b, _c, _d, _e;
76
76
  this._terminated = false;
77
77
  this.descriptors = {
78
78
  page: {},
@@ -88,14 +88,17 @@ class SiteSearchEngineServiceClient {
88
88
  (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
89
89
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
90
90
  }
91
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
92
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
93
+ : undefined;
91
94
  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';
95
+ (_c = (_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 : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
93
96
  this._servicePath = 'discoveryengine.' + this._universeDomain;
94
97
  const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
95
98
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
96
99
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
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');
100
+ const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
101
+ const fallback = (_e = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _e !== void 0 ? _e : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
99
102
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
100
103
  // Request numeric enum values if REST transport is used.
101
104
  opts.numericEnums = true;
@@ -126,7 +129,7 @@ class SiteSearchEngineServiceClient {
126
129
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
127
130
  // Determine the client header string.
128
131
  const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
129
- if (typeof process !== 'undefined' && 'versions' in process) {
132
+ if (typeof process === 'object' && 'versions' in process) {
130
133
  clientHeader.push(`gl-node/${process.versions.node}`);
131
134
  }
132
135
  else {
@@ -367,7 +370,7 @@ class SiteSearchEngineServiceClient {
367
370
  * @returns {string} The DNS address for this service.
368
371
  */
369
372
  static get servicePath() {
370
- if (typeof process !== undefined &&
373
+ if (typeof process === 'object' &&
371
374
  typeof process.emitWarning === 'function') {
372
375
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
373
376
  }
@@ -379,7 +382,7 @@ class SiteSearchEngineServiceClient {
379
382
  * @returns {string} The DNS address for this service.
380
383
  */
381
384
  static get apiEndpoint() {
382
- if (typeof process !== undefined &&
385
+ if (typeof process === 'object' &&
383
386
  typeof process.emitWarning === 'function') {
384
387
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
385
388
  }
@@ -72,7 +72,7 @@ class UserEventServiceClient {
72
72
  * ```
73
73
  */
74
74
  constructor(opts, gaxInstance) {
75
- var _a, _b, _c, _d;
75
+ var _a, _b, _c, _d, _e;
76
76
  this._terminated = false;
77
77
  this.descriptors = {
78
78
  page: {},
@@ -87,14 +87,17 @@ class UserEventServiceClient {
87
87
  (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
88
88
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
89
89
  }
90
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
91
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
92
+ : undefined;
90
93
  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';
94
+ (_c = (_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 : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
92
95
  this._servicePath = 'discoveryengine.' + this._universeDomain;
93
96
  const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
94
97
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
95
98
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
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');
99
+ const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
100
+ const fallback = (_e = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _e !== void 0 ? _e : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
98
101
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
99
102
  // Request numeric enum values if REST transport is used.
100
103
  opts.numericEnums = true;
@@ -125,7 +128,7 @@ class UserEventServiceClient {
125
128
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
126
129
  // Determine the client header string.
127
130
  const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
128
- if (typeof process !== 'undefined' && 'versions' in process) {
131
+ if (typeof process === 'object' && 'versions' in process) {
129
132
  clientHeader.push(`gl-node/${process.versions.node}`);
130
133
  }
131
134
  else {
@@ -327,7 +330,7 @@ class UserEventServiceClient {
327
330
  * @returns {string} The DNS address for this service.
328
331
  */
329
332
  static get servicePath() {
330
- if (typeof process !== undefined &&
333
+ if (typeof process === 'object' &&
331
334
  typeof process.emitWarning === 'function') {
332
335
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
333
336
  }
@@ -339,7 +342,7 @@ class UserEventServiceClient {
339
342
  * @returns {string} The DNS address for this service.
340
343
  */
341
344
  static get apiEndpoint() {
342
- if (typeof process !== undefined &&
345
+ if (typeof process === 'object' &&
343
346
  typeof process.emitWarning === 'function') {
344
347
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
345
348
  }