@google-ai/generativelanguage
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -18,2 +18,4 @@ import type * as gax from 'google-gax'; | ||
private _defaults; | ||
private _universeDomain; | ||
private _servicePath; | ||
auth: gax.GoogleAuth; | ||
@@ -87,2 +89,3 @@ descriptors: Descriptors; | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -92,4 +95,4 @@ */ | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -99,2 +102,8 @@ */ | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint(): string; | ||
get universeDomain(): string; | ||
/** | ||
* The port for this API service. | ||
@@ -181,2 +190,5 @@ * @returns {number} The default port for this service. | ||
* `RETRIEVAL_DOCUMENT`. | ||
* | ||
* Note: Specifying a `title` for `RETRIEVAL_DOCUMENT` provides better quality | ||
* embeddings for retrieval. | ||
* @param {object} [options] | ||
@@ -183,0 +195,0 @@ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. |
@@ -77,3 +77,3 @@ "use strict"; | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
this._terminated = false; | ||
@@ -88,7 +88,15 @@ this.descriptors = { | ||
const staticMembers = this.constructor; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) { | ||
throw new Error('Please set either universe_domain or universeDomain, but not both.'); | ||
} | ||
this._universeDomain = | ||
(_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'; | ||
this._servicePath = 'generativelanguage.' + this._universeDomain; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath; | ||
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); | ||
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
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'); | ||
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {}; | ||
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'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
@@ -98,3 +106,3 @@ // Request numeric enum values if REST transport is used. | ||
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. | ||
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { | ||
if (servicePath !== this._servicePath && !('scopes' in opts)) { | ||
opts['scopes'] = staticMembers.scopes; | ||
@@ -117,5 +125,5 @@ } | ||
// Set defaultServicePath on the auth object. | ||
this.auth.defaultServicePath = staticMembers.servicePath; | ||
this.auth.defaultServicePath = this._servicePath; | ||
// Set the default scopes in auth client if needed. | ||
if (servicePath === staticMembers.servicePath) { | ||
if (servicePath === this._servicePath) { | ||
this.auth.defaultScopes = staticMembers.scopes; | ||
@@ -152,3 +160,3 @@ } | ||
streamGenerateContent: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, | ||
/* gaxStreamingRetries: */ true), | ||
/* gaxStreamingRetries: */ false), | ||
}; | ||
@@ -221,16 +229,35 @@ // Put together the default options sent with requests. | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get servicePath() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get apiEndpoint() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint() { | ||
return this._servicePath; | ||
} | ||
get universeDomain() { | ||
return this._universeDomain; | ||
} | ||
/** | ||
* The port for this API service. | ||
@@ -237,0 +264,0 @@ * @returns {number} The default port for this service. |
@@ -19,2 +19,4 @@ /// <reference types="node" /> | ||
private _defaults; | ||
private _universeDomain; | ||
private _servicePath; | ||
auth: gax.GoogleAuth; | ||
@@ -88,2 +90,3 @@ descriptors: Descriptors; | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -93,4 +96,4 @@ */ | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -100,2 +103,8 @@ */ | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint(): string; | ||
get universeDomain(): string; | ||
/** | ||
* The port for this API service. | ||
@@ -102,0 +111,0 @@ * @returns {number} The default port for this service. |
@@ -75,3 +75,3 @@ "use strict"; | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
this._terminated = false; | ||
@@ -86,7 +86,15 @@ this.descriptors = { | ||
const staticMembers = this.constructor; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) { | ||
throw new Error('Please set either universe_domain or universeDomain, but not both.'); | ||
} | ||
this._universeDomain = | ||
(_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'; | ||
this._servicePath = 'generativelanguage.' + this._universeDomain; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath; | ||
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); | ||
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
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'); | ||
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {}; | ||
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'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
@@ -96,3 +104,3 @@ // Request numeric enum values if REST transport is used. | ||
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. | ||
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { | ||
if (servicePath !== this._servicePath && !('scopes' in opts)) { | ||
opts['scopes'] = staticMembers.scopes; | ||
@@ -115,5 +123,5 @@ } | ||
// Set defaultServicePath on the auth object. | ||
this.auth.defaultServicePath = staticMembers.servicePath; | ||
this.auth.defaultServicePath = this._servicePath; | ||
// Set the default scopes in auth client if needed. | ||
if (servicePath === staticMembers.servicePath) { | ||
if (servicePath === this._servicePath) { | ||
this.auth.defaultScopes = staticMembers.scopes; | ||
@@ -204,16 +212,35 @@ } | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get servicePath() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get apiEndpoint() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint() { | ||
return this._servicePath; | ||
} | ||
get universeDomain() { | ||
return this._universeDomain; | ||
} | ||
/** | ||
* The port for this API service. | ||
@@ -220,0 +247,0 @@ * @returns {number} The default port for this service. |
@@ -20,2 +20,4 @@ import type * as gax from 'google-gax'; | ||
private _defaults; | ||
private _universeDomain; | ||
private _servicePath; | ||
auth: gax.GoogleAuth; | ||
@@ -89,2 +91,3 @@ descriptors: Descriptors; | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -94,4 +97,4 @@ */ | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -101,2 +104,8 @@ */ | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint(): string; | ||
get universeDomain(): string; | ||
/** | ||
* The port for this API service. | ||
@@ -103,0 +112,0 @@ * @returns {number} The default port for this service. |
@@ -78,3 +78,3 @@ "use strict"; | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
this._terminated = false; | ||
@@ -89,7 +89,15 @@ this.descriptors = { | ||
const staticMembers = this.constructor; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) { | ||
throw new Error('Please set either universe_domain or universeDomain, but not both.'); | ||
} | ||
this._universeDomain = | ||
(_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'; | ||
this._servicePath = 'generativelanguage.' + this._universeDomain; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath; | ||
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); | ||
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
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'); | ||
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {}; | ||
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'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
@@ -99,3 +107,3 @@ // Request numeric enum values if REST transport is used. | ||
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. | ||
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { | ||
if (servicePath !== this._servicePath && !('scopes' in opts)) { | ||
opts['scopes'] = staticMembers.scopes; | ||
@@ -118,5 +126,5 @@ } | ||
// Set defaultServicePath on the auth object. | ||
this.auth.defaultServicePath = staticMembers.servicePath; | ||
this.auth.defaultServicePath = this._servicePath; | ||
// Set the default scopes in auth client if needed. | ||
if (servicePath === staticMembers.servicePath) { | ||
if (servicePath === this._servicePath) { | ||
this.auth.defaultScopes = staticMembers.scopes; | ||
@@ -208,16 +216,35 @@ } | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get servicePath() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get apiEndpoint() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint() { | ||
return this._servicePath; | ||
} | ||
get universeDomain() { | ||
return this._universeDomain; | ||
} | ||
/** | ||
* The port for this API service. | ||
@@ -224,0 +251,0 @@ * @returns {number} The default port for this service. |
@@ -18,2 +18,4 @@ import type * as gax from 'google-gax'; | ||
private _defaults; | ||
private _universeDomain; | ||
private _servicePath; | ||
auth: gax.GoogleAuth; | ||
@@ -87,2 +89,3 @@ descriptors: Descriptors; | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -92,4 +95,4 @@ */ | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -99,2 +102,8 @@ */ | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint(): string; | ||
get universeDomain(): string; | ||
/** | ||
* The port for this API service. | ||
@@ -189,2 +198,4 @@ * @returns {number} The default port for this service. | ||
* the last `Content` in the list containing the question. | ||
* | ||
* Note: GenerateAnswer currently only supports queries in English. | ||
* @param {google.ai.generativelanguage.v1beta.GenerateAnswerRequest.AnswerStyle} request.answerStyle | ||
@@ -249,2 +260,5 @@ * Required. Style in which answers should be returned. | ||
* `RETRIEVAL_DOCUMENT`. | ||
* | ||
* Note: Specifying a `title` for `RETRIEVAL_DOCUMENT` provides better quality | ||
* embeddings for retrieval. | ||
* @param {object} [options] | ||
@@ -251,0 +265,0 @@ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. |
@@ -77,3 +77,3 @@ "use strict"; | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
this._terminated = false; | ||
@@ -88,7 +88,15 @@ this.descriptors = { | ||
const staticMembers = this.constructor; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) { | ||
throw new Error('Please set either universe_domain or universeDomain, but not both.'); | ||
} | ||
this._universeDomain = | ||
(_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'; | ||
this._servicePath = 'generativelanguage.' + this._universeDomain; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath; | ||
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); | ||
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
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'); | ||
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {}; | ||
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'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
@@ -98,3 +106,3 @@ // Request numeric enum values if REST transport is used. | ||
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. | ||
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { | ||
if (servicePath !== this._servicePath && !('scopes' in opts)) { | ||
opts['scopes'] = staticMembers.scopes; | ||
@@ -117,5 +125,5 @@ } | ||
// Set defaultServicePath on the auth object. | ||
this.auth.defaultServicePath = staticMembers.servicePath; | ||
this.auth.defaultServicePath = this._servicePath; | ||
// Set the default scopes in auth client if needed. | ||
if (servicePath === staticMembers.servicePath) { | ||
if (servicePath === this._servicePath) { | ||
this.auth.defaultScopes = staticMembers.scopes; | ||
@@ -158,3 +166,3 @@ } | ||
streamGenerateContent: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, | ||
/* gaxStreamingRetries: */ true), | ||
/* gaxStreamingRetries: */ false), | ||
}; | ||
@@ -228,16 +236,35 @@ // Put together the default options sent with requests. | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get servicePath() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get apiEndpoint() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint() { | ||
return this._servicePath; | ||
} | ||
get universeDomain() { | ||
return this._universeDomain; | ||
} | ||
/** | ||
* The port for this API service. | ||
@@ -244,0 +271,0 @@ * @returns {number} The default port for this service. |
@@ -19,2 +19,4 @@ /// <reference types="node" /> | ||
private _defaults; | ||
private _universeDomain; | ||
private _servicePath; | ||
auth: gax.GoogleAuth; | ||
@@ -89,2 +91,3 @@ descriptors: Descriptors; | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -94,4 +97,4 @@ */ | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -101,2 +104,8 @@ */ | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint(): string; | ||
get universeDomain(): string; | ||
/** | ||
* The port for this API service. | ||
@@ -103,0 +112,0 @@ * @returns {number} The default port for this service. |
@@ -75,3 +75,3 @@ "use strict"; | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
this._terminated = false; | ||
@@ -86,7 +86,15 @@ this.descriptors = { | ||
const staticMembers = this.constructor; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) { | ||
throw new Error('Please set either universe_domain or universeDomain, but not both.'); | ||
} | ||
this._universeDomain = | ||
(_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'; | ||
this._servicePath = 'generativelanguage.' + this._universeDomain; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath; | ||
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); | ||
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
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'); | ||
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {}; | ||
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'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
@@ -96,3 +104,3 @@ // Request numeric enum values if REST transport is used. | ||
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. | ||
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { | ||
if (servicePath !== this._servicePath && !('scopes' in opts)) { | ||
opts['scopes'] = staticMembers.scopes; | ||
@@ -115,5 +123,5 @@ } | ||
// Set defaultServicePath on the auth object. | ||
this.auth.defaultServicePath = staticMembers.servicePath; | ||
this.auth.defaultServicePath = this._servicePath; | ||
// Set the default scopes in auth client if needed. | ||
if (servicePath === staticMembers.servicePath) { | ||
if (servicePath === this._servicePath) { | ||
this.auth.defaultScopes = staticMembers.scopes; | ||
@@ -242,16 +250,35 @@ } | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get servicePath() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get apiEndpoint() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint() { | ||
return this._servicePath; | ||
} | ||
get universeDomain() { | ||
return this._universeDomain; | ||
} | ||
/** | ||
* The port for this API service. | ||
@@ -258,0 +285,0 @@ * @returns {number} The default port for this service. |
@@ -19,2 +19,4 @@ /// <reference types="node" /> | ||
private _defaults; | ||
private _universeDomain; | ||
private _servicePath; | ||
auth: gax.GoogleAuth; | ||
@@ -88,2 +90,3 @@ descriptors: Descriptors; | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -93,4 +96,4 @@ */ | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -100,2 +103,8 @@ */ | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint(): string; | ||
get universeDomain(): string; | ||
/** | ||
* The port for this API service. | ||
@@ -102,0 +111,0 @@ * @returns {number} The default port for this service. |
@@ -75,3 +75,3 @@ "use strict"; | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
this._terminated = false; | ||
@@ -86,7 +86,15 @@ this.descriptors = { | ||
const staticMembers = this.constructor; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) { | ||
throw new Error('Please set either universe_domain or universeDomain, but not both.'); | ||
} | ||
this._universeDomain = | ||
(_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'; | ||
this._servicePath = 'generativelanguage.' + this._universeDomain; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath; | ||
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); | ||
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
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'); | ||
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {}; | ||
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'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
@@ -96,3 +104,3 @@ // Request numeric enum values if REST transport is used. | ||
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. | ||
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { | ||
if (servicePath !== this._servicePath && !('scopes' in opts)) { | ||
opts['scopes'] = staticMembers.scopes; | ||
@@ -115,5 +123,5 @@ } | ||
// Set defaultServicePath on the auth object. | ||
this.auth.defaultServicePath = staticMembers.servicePath; | ||
this.auth.defaultServicePath = this._servicePath; | ||
// Set the default scopes in auth client if needed. | ||
if (servicePath === staticMembers.servicePath) { | ||
if (servicePath === this._servicePath) { | ||
this.auth.defaultScopes = staticMembers.scopes; | ||
@@ -218,16 +226,35 @@ } | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get servicePath() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get apiEndpoint() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint() { | ||
return this._servicePath; | ||
} | ||
get universeDomain() { | ||
return this._universeDomain; | ||
} | ||
/** | ||
* The port for this API service. | ||
@@ -234,0 +261,0 @@ * @returns {number} The default port for this service. |
@@ -75,3 +75,3 @@ "use strict"; | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
this._terminated = false; | ||
@@ -86,7 +86,15 @@ this.descriptors = { | ||
const staticMembers = this.constructor; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) { | ||
throw new Error('Please set either universe_domain or universeDomain, but not both.'); | ||
} | ||
this._universeDomain = | ||
(_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'; | ||
this._servicePath = 'generativelanguage.' + this._universeDomain; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath; | ||
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); | ||
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
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'); | ||
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {}; | ||
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'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
@@ -96,3 +104,3 @@ // Request numeric enum values if REST transport is used. | ||
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. | ||
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { | ||
if (servicePath !== this._servicePath && !('scopes' in opts)) { | ||
opts['scopes'] = staticMembers.scopes; | ||
@@ -115,5 +123,5 @@ } | ||
// Set defaultServicePath on the auth object. | ||
this.auth.defaultServicePath = staticMembers.servicePath; | ||
this.auth.defaultServicePath = this._servicePath; | ||
// Set the default scopes in auth client if needed. | ||
if (servicePath === staticMembers.servicePath) { | ||
if (servicePath === this._servicePath) { | ||
this.auth.defaultScopes = staticMembers.scopes; | ||
@@ -234,16 +242,35 @@ } | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get servicePath() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get apiEndpoint() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint() { | ||
return this._servicePath; | ||
} | ||
get universeDomain() { | ||
return this._universeDomain; | ||
} | ||
/** | ||
* The port for this API service. | ||
@@ -250,0 +277,0 @@ * @returns {number} The default port for this service. |
@@ -20,2 +20,4 @@ import type * as gax from 'google-gax'; | ||
private _defaults; | ||
private _universeDomain; | ||
private _servicePath; | ||
auth: gax.GoogleAuth; | ||
@@ -89,2 +91,3 @@ descriptors: Descriptors; | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -94,4 +97,4 @@ */ | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -101,2 +104,8 @@ */ | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint(): string; | ||
get universeDomain(): string; | ||
/** | ||
* The port for this API service. | ||
@@ -103,0 +112,0 @@ * @returns {number} The default port for this service. |
@@ -78,3 +78,3 @@ "use strict"; | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
this._terminated = false; | ||
@@ -89,7 +89,15 @@ this.descriptors = { | ||
const staticMembers = this.constructor; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) { | ||
throw new Error('Please set either universe_domain or universeDomain, but not both.'); | ||
} | ||
this._universeDomain = | ||
(_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'; | ||
this._servicePath = 'generativelanguage.' + this._universeDomain; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath; | ||
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); | ||
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
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'); | ||
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {}; | ||
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'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
@@ -99,3 +107,3 @@ // Request numeric enum values if REST transport is used. | ||
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. | ||
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { | ||
if (servicePath !== this._servicePath && !('scopes' in opts)) { | ||
opts['scopes'] = staticMembers.scopes; | ||
@@ -118,5 +126,5 @@ } | ||
// Set defaultServicePath on the auth object. | ||
this.auth.defaultServicePath = staticMembers.servicePath; | ||
this.auth.defaultServicePath = this._servicePath; | ||
// Set the default scopes in auth client if needed. | ||
if (servicePath === staticMembers.servicePath) { | ||
if (servicePath === this._servicePath) { | ||
this.auth.defaultScopes = staticMembers.scopes; | ||
@@ -212,16 +220,35 @@ } | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get servicePath() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get apiEndpoint() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint() { | ||
return this._servicePath; | ||
} | ||
get universeDomain() { | ||
return this._universeDomain; | ||
} | ||
/** | ||
* The port for this API service. | ||
@@ -228,0 +255,0 @@ * @returns {number} The default port for this service. |
@@ -20,2 +20,4 @@ import type * as gax from 'google-gax'; | ||
private _defaults; | ||
private _universeDomain; | ||
private _servicePath; | ||
auth: gax.GoogleAuth; | ||
@@ -89,2 +91,3 @@ descriptors: Descriptors; | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -94,4 +97,4 @@ */ | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -101,2 +104,8 @@ */ | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint(): string; | ||
get universeDomain(): string; | ||
/** | ||
* The port for this API service. | ||
@@ -103,0 +112,0 @@ * @returns {number} The default port for this service. |
@@ -78,3 +78,3 @@ "use strict"; | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
this._terminated = false; | ||
@@ -89,7 +89,15 @@ this.descriptors = { | ||
const staticMembers = this.constructor; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) { | ||
throw new Error('Please set either universe_domain or universeDomain, but not both.'); | ||
} | ||
this._universeDomain = | ||
(_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'; | ||
this._servicePath = 'generativelanguage.' + this._universeDomain; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath; | ||
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); | ||
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
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'); | ||
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {}; | ||
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'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
@@ -99,3 +107,3 @@ // Request numeric enum values if REST transport is used. | ||
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. | ||
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { | ||
if (servicePath !== this._servicePath && !('scopes' in opts)) { | ||
opts['scopes'] = staticMembers.scopes; | ||
@@ -118,5 +126,5 @@ } | ||
// Set defaultServicePath on the auth object. | ||
this.auth.defaultServicePath = staticMembers.servicePath; | ||
this.auth.defaultServicePath = this._servicePath; | ||
// Set the default scopes in auth client if needed. | ||
if (servicePath === staticMembers.servicePath) { | ||
if (servicePath === this._servicePath) { | ||
this.auth.defaultScopes = staticMembers.scopes; | ||
@@ -202,16 +210,35 @@ } | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get servicePath() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get apiEndpoint() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint() { | ||
return this._servicePath; | ||
} | ||
get universeDomain() { | ||
return this._universeDomain; | ||
} | ||
/** | ||
* The port for this API service. | ||
@@ -218,0 +245,0 @@ * @returns {number} The default port for this service. |
@@ -19,2 +19,4 @@ /// <reference types="node" /> | ||
private _defaults; | ||
private _universeDomain; | ||
private _servicePath; | ||
auth: gax.GoogleAuth; | ||
@@ -88,2 +90,3 @@ descriptors: Descriptors; | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -93,4 +96,4 @@ */ | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -100,2 +103,8 @@ */ | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint(): string; | ||
get universeDomain(): string; | ||
/** | ||
* The port for this API service. | ||
@@ -102,0 +111,0 @@ * @returns {number} The default port for this service. |
@@ -75,3 +75,3 @@ "use strict"; | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
this._terminated = false; | ||
@@ -86,7 +86,15 @@ this.descriptors = { | ||
const staticMembers = this.constructor; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) { | ||
throw new Error('Please set either universe_domain or universeDomain, but not both.'); | ||
} | ||
this._universeDomain = | ||
(_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'; | ||
this._servicePath = 'generativelanguage.' + this._universeDomain; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath; | ||
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); | ||
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
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'); | ||
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {}; | ||
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'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
@@ -96,3 +104,3 @@ // Request numeric enum values if REST transport is used. | ||
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. | ||
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { | ||
if (servicePath !== this._servicePath && !('scopes' in opts)) { | ||
opts['scopes'] = staticMembers.scopes; | ||
@@ -115,5 +123,5 @@ } | ||
// Set defaultServicePath on the auth object. | ||
this.auth.defaultServicePath = staticMembers.servicePath; | ||
this.auth.defaultServicePath = this._servicePath; | ||
// Set the default scopes in auth client if needed. | ||
if (servicePath === staticMembers.servicePath) { | ||
if (servicePath === this._servicePath) { | ||
this.auth.defaultScopes = staticMembers.scopes; | ||
@@ -205,16 +213,35 @@ } | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get servicePath() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get apiEndpoint() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint() { | ||
return this._servicePath; | ||
} | ||
get universeDomain() { | ||
return this._universeDomain; | ||
} | ||
/** | ||
* The port for this API service. | ||
@@ -221,0 +248,0 @@ * @returns {number} The default port for this service. |
@@ -20,2 +20,4 @@ import type * as gax from 'google-gax'; | ||
private _defaults; | ||
private _universeDomain; | ||
private _servicePath; | ||
auth: gax.GoogleAuth; | ||
@@ -89,2 +91,3 @@ descriptors: Descriptors; | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -94,4 +97,4 @@ */ | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -101,2 +104,8 @@ */ | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint(): string; | ||
get universeDomain(): string; | ||
/** | ||
* The port for this API service. | ||
@@ -103,0 +112,0 @@ * @returns {number} The default port for this service. |
@@ -78,3 +78,3 @@ "use strict"; | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
this._terminated = false; | ||
@@ -89,7 +89,15 @@ this.descriptors = { | ||
const staticMembers = this.constructor; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) { | ||
throw new Error('Please set either universe_domain or universeDomain, but not both.'); | ||
} | ||
this._universeDomain = | ||
(_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'; | ||
this._servicePath = 'generativelanguage.' + this._universeDomain; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath; | ||
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); | ||
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
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'); | ||
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {}; | ||
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'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
@@ -99,3 +107,3 @@ // Request numeric enum values if REST transport is used. | ||
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. | ||
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { | ||
if (servicePath !== this._servicePath && !('scopes' in opts)) { | ||
opts['scopes'] = staticMembers.scopes; | ||
@@ -118,5 +126,5 @@ } | ||
// Set defaultServicePath on the auth object. | ||
this.auth.defaultServicePath = staticMembers.servicePath; | ||
this.auth.defaultServicePath = this._servicePath; | ||
// Set the default scopes in auth client if needed. | ||
if (servicePath === staticMembers.servicePath) { | ||
if (servicePath === this._servicePath) { | ||
this.auth.defaultScopes = staticMembers.scopes; | ||
@@ -202,16 +210,35 @@ } | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get servicePath() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get apiEndpoint() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint() { | ||
return this._servicePath; | ||
} | ||
get universeDomain() { | ||
return this._universeDomain; | ||
} | ||
/** | ||
* The port for this API service. | ||
@@ -218,0 +245,0 @@ * @returns {number} The default port for this service. |
@@ -20,2 +20,4 @@ import type * as gax from 'google-gax'; | ||
private _defaults; | ||
private _universeDomain; | ||
private _servicePath; | ||
auth: gax.GoogleAuth; | ||
@@ -89,2 +91,3 @@ descriptors: Descriptors; | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -94,4 +97,4 @@ */ | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -101,2 +104,8 @@ */ | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint(): string; | ||
get universeDomain(): string; | ||
/** | ||
* The port for this API service. | ||
@@ -103,0 +112,0 @@ * @returns {number} The default port for this service. |
@@ -78,3 +78,3 @@ "use strict"; | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
this._terminated = false; | ||
@@ -89,7 +89,15 @@ this.descriptors = { | ||
const staticMembers = this.constructor; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) { | ||
throw new Error('Please set either universe_domain or universeDomain, but not both.'); | ||
} | ||
this._universeDomain = | ||
(_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'; | ||
this._servicePath = 'generativelanguage.' + this._universeDomain; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath; | ||
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); | ||
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
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'); | ||
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {}; | ||
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'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
@@ -99,3 +107,3 @@ // Request numeric enum values if REST transport is used. | ||
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. | ||
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { | ||
if (servicePath !== this._servicePath && !('scopes' in opts)) { | ||
opts['scopes'] = staticMembers.scopes; | ||
@@ -118,5 +126,5 @@ } | ||
// Set defaultServicePath on the auth object. | ||
this.auth.defaultServicePath = staticMembers.servicePath; | ||
this.auth.defaultServicePath = this._servicePath; | ||
// Set the default scopes in auth client if needed. | ||
if (servicePath === staticMembers.servicePath) { | ||
if (servicePath === this._servicePath) { | ||
this.auth.defaultScopes = staticMembers.scopes; | ||
@@ -204,16 +212,35 @@ } | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get servicePath() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get apiEndpoint() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint() { | ||
return this._servicePath; | ||
} | ||
get universeDomain() { | ||
return this._universeDomain; | ||
} | ||
/** | ||
* The port for this API service. | ||
@@ -220,0 +247,0 @@ * @returns {number} The default port for this service. |
@@ -19,2 +19,4 @@ /// <reference types="node" /> | ||
private _defaults; | ||
private _universeDomain; | ||
private _servicePath; | ||
auth: gax.GoogleAuth; | ||
@@ -89,2 +91,3 @@ descriptors: Descriptors; | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -94,4 +97,4 @@ */ | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -101,2 +104,8 @@ */ | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint(): string; | ||
get universeDomain(): string; | ||
/** | ||
* The port for this API service. | ||
@@ -103,0 +112,0 @@ * @returns {number} The default port for this service. |
@@ -75,3 +75,3 @@ "use strict"; | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
this._terminated = false; | ||
@@ -86,7 +86,15 @@ this.descriptors = { | ||
const staticMembers = this.constructor; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) { | ||
throw new Error('Please set either universe_domain or universeDomain, but not both.'); | ||
} | ||
this._universeDomain = | ||
(_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'; | ||
this._servicePath = 'generativelanguage.' + this._universeDomain; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath; | ||
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); | ||
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
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'); | ||
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {}; | ||
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'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
@@ -96,3 +104,3 @@ // Request numeric enum values if REST transport is used. | ||
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. | ||
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { | ||
if (servicePath !== this._servicePath && !('scopes' in opts)) { | ||
opts['scopes'] = staticMembers.scopes; | ||
@@ -115,5 +123,5 @@ } | ||
// Set defaultServicePath on the auth object. | ||
this.auth.defaultServicePath = staticMembers.servicePath; | ||
this.auth.defaultServicePath = this._servicePath; | ||
// Set the default scopes in auth client if needed. | ||
if (servicePath === staticMembers.servicePath) { | ||
if (servicePath === this._servicePath) { | ||
this.auth.defaultScopes = staticMembers.scopes; | ||
@@ -238,16 +246,35 @@ } | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get servicePath() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get apiEndpoint() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint() { | ||
return this._servicePath; | ||
} | ||
get universeDomain() { | ||
return this._universeDomain; | ||
} | ||
/** | ||
* The port for this API service. | ||
@@ -254,0 +281,0 @@ * @returns {number} The default port for this service. |
@@ -19,2 +19,4 @@ /// <reference types="node" /> | ||
private _defaults; | ||
private _universeDomain; | ||
private _servicePath; | ||
auth: gax.GoogleAuth; | ||
@@ -88,2 +90,3 @@ descriptors: Descriptors; | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -93,4 +96,4 @@ */ | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -100,2 +103,8 @@ */ | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint(): string; | ||
get universeDomain(): string; | ||
/** | ||
* The port for this API service. | ||
@@ -102,0 +111,0 @@ * @returns {number} The default port for this service. |
@@ -75,3 +75,3 @@ "use strict"; | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
this._terminated = false; | ||
@@ -86,7 +86,15 @@ this.descriptors = { | ||
const staticMembers = this.constructor; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) { | ||
throw new Error('Please set either universe_domain or universeDomain, but not both.'); | ||
} | ||
this._universeDomain = | ||
(_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'; | ||
this._servicePath = 'generativelanguage.' + this._universeDomain; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath; | ||
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); | ||
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
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'); | ||
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {}; | ||
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'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
@@ -96,3 +104,3 @@ // Request numeric enum values if REST transport is used. | ||
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. | ||
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { | ||
if (servicePath !== this._servicePath && !('scopes' in opts)) { | ||
opts['scopes'] = staticMembers.scopes; | ||
@@ -115,5 +123,5 @@ } | ||
// Set defaultServicePath on the auth object. | ||
this.auth.defaultServicePath = staticMembers.servicePath; | ||
this.auth.defaultServicePath = this._servicePath; | ||
// Set the default scopes in auth client if needed. | ||
if (servicePath === staticMembers.servicePath) { | ||
if (servicePath === this._servicePath) { | ||
this.auth.defaultScopes = staticMembers.scopes; | ||
@@ -214,16 +222,35 @@ } | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get servicePath() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get apiEndpoint() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint() { | ||
return this._servicePath; | ||
} | ||
get universeDomain() { | ||
return this._universeDomain; | ||
} | ||
/** | ||
* The port for this API service. | ||
@@ -230,0 +257,0 @@ * @returns {number} The default port for this service. |
@@ -20,2 +20,4 @@ import type * as gax from 'google-gax'; | ||
private _defaults; | ||
private _universeDomain; | ||
private _servicePath; | ||
auth: gax.GoogleAuth; | ||
@@ -89,2 +91,3 @@ descriptors: Descriptors; | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -94,4 +97,4 @@ */ | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -101,2 +104,8 @@ */ | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint(): string; | ||
get universeDomain(): string; | ||
/** | ||
* The port for this API service. | ||
@@ -103,0 +112,0 @@ * @returns {number} The default port for this service. |
@@ -78,3 +78,3 @@ "use strict"; | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
this._terminated = false; | ||
@@ -89,7 +89,15 @@ this.descriptors = { | ||
const staticMembers = this.constructor; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) { | ||
throw new Error('Please set either universe_domain or universeDomain, but not both.'); | ||
} | ||
this._universeDomain = | ||
(_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'; | ||
this._servicePath = 'generativelanguage.' + this._universeDomain; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath; | ||
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); | ||
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
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'); | ||
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {}; | ||
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'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
@@ -99,3 +107,3 @@ // Request numeric enum values if REST transport is used. | ||
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. | ||
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { | ||
if (servicePath !== this._servicePath && !('scopes' in opts)) { | ||
opts['scopes'] = staticMembers.scopes; | ||
@@ -118,5 +126,5 @@ } | ||
// Set defaultServicePath on the auth object. | ||
this.auth.defaultServicePath = staticMembers.servicePath; | ||
this.auth.defaultServicePath = this._servicePath; | ||
// Set the default scopes in auth client if needed. | ||
if (servicePath === staticMembers.servicePath) { | ||
if (servicePath === this._servicePath) { | ||
this.auth.defaultScopes = staticMembers.scopes; | ||
@@ -209,16 +217,35 @@ } | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get servicePath() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get apiEndpoint() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'generativelanguage.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint() { | ||
return this._servicePath; | ||
} | ||
get universeDomain() { | ||
return this._universeDomain; | ||
} | ||
/** | ||
* The port for this API service. | ||
@@ -225,0 +252,0 @@ * @returns {number} The default port for this service. |
# Changelog | ||
## [2.1.0](https://github.com/googleapis/google-cloud-node/compare/generativelanguage-v2.0.1...generativelanguage-v2.1.0) (2024-02-09) | ||
### Features | ||
* Trusted Private Cloud support, use the universeDomain parameter ([#5022](https://github.com/googleapis/google-cloud-node/issues/5022)) ([b6498d8](https://github.com/googleapis/google-cloud-node/commit/b6498d8580d056817981dedbaa0ea5d82e9dccc2)) | ||
## [2.0.1](https://github.com/googleapis/google-cloud-node/compare/generativelanguage-v2.0.0...generativelanguage-v2.0.1) (2024-01-23) | ||
@@ -4,0 +11,0 @@ |
{ | ||
"name": "@google-ai/generativelanguage", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "Generative Language API client for Node.js", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8462162
55038