Skip to content

Commit

Permalink
feat: add support for apiEndpoint option (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and JustinBeckwith committed Jun 5, 2019
1 parent 33f9efe commit 53013ac
Show file tree
Hide file tree
Showing 17 changed files with 487 additions and 19 deletions.
14 changes: 13 additions & 1 deletion packages/google-cloud-dialogflow/src/v2/agents_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,18 @@ class AgentsClient {
* API remote host.
*/
constructor(opts) {
opts = opts || {};
this._descriptors = {};

const servicePath =
opts.servicePath || opts.apiEndpoint || this.constructor.servicePath;

// Ensure that options include the service address and port.
opts = Object.assign(
{
clientConfig: {},
port: this.constructor.port,
servicePath: this.constructor.servicePath,
servicePath,
},
opts
);
Expand Down Expand Up @@ -250,6 +254,14 @@ class AgentsClient {
return 'dialogflow.googleapis.com';
}

/**
* The DNS address for this API service - same as servicePath(),
* exists for compatibility reasons.
*/
static get apiEndpoint() {
return 'dialogflow.googleapis.com';
}

/**
* The port for this API service.
*/
Expand Down
14 changes: 13 additions & 1 deletion packages/google-cloud-dialogflow/src/v2/contexts_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,18 @@ class ContextsClient {
* API remote host.
*/
constructor(opts) {
opts = opts || {};
this._descriptors = {};

const servicePath =
opts.servicePath || opts.apiEndpoint || this.constructor.servicePath;

// Ensure that options include the service address and port.
opts = Object.assign(
{
clientConfig: {},
port: this.constructor.port,
servicePath: this.constructor.servicePath,
servicePath,
},
opts
);
Expand Down Expand Up @@ -188,6 +192,14 @@ class ContextsClient {
return 'dialogflow.googleapis.com';
}

/**
* The DNS address for this API service - same as servicePath(),
* exists for compatibility reasons.
*/
static get apiEndpoint() {
return 'dialogflow.googleapis.com';
}

/**
* The port for this API service.
*/
Expand Down
14 changes: 13 additions & 1 deletion packages/google-cloud-dialogflow/src/v2/entity_types_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,18 @@ class EntityTypesClient {
* API remote host.
*/
constructor(opts) {
opts = opts || {};
this._descriptors = {};

const servicePath =
opts.servicePath || opts.apiEndpoint || this.constructor.servicePath;

// Ensure that options include the service address and port.
opts = Object.assign(
{
clientConfig: {},
port: this.constructor.port,
servicePath: this.constructor.servicePath,
servicePath,
},
opts
);
Expand Down Expand Up @@ -290,6 +294,14 @@ class EntityTypesClient {
return 'dialogflow.googleapis.com';
}

/**
* The DNS address for this API service - same as servicePath(),
* exists for compatibility reasons.
*/
static get apiEndpoint() {
return 'dialogflow.googleapis.com';
}

/**
* The port for this API service.
*/
Expand Down
14 changes: 13 additions & 1 deletion packages/google-cloud-dialogflow/src/v2/intents_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,18 @@ class IntentsClient {
* API remote host.
*/
constructor(opts) {
opts = opts || {};
this._descriptors = {};

const servicePath =
opts.servicePath || opts.apiEndpoint || this.constructor.servicePath;

// Ensure that options include the service address and port.
opts = Object.assign(
{
clientConfig: {},
port: this.constructor.port,
servicePath: this.constructor.servicePath,
servicePath,
},
opts
);
Expand Down Expand Up @@ -253,6 +257,14 @@ class IntentsClient {
return 'dialogflow.googleapis.com';
}

/**
* The DNS address for this API service - same as servicePath(),
* exists for compatibility reasons.
*/
static get apiEndpoint() {
return 'dialogflow.googleapis.com';
}

/**
* The port for this API service.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,18 @@ class SessionEntityTypesClient {
* API remote host.
*/
constructor(opts) {
opts = opts || {};
this._descriptors = {};

const servicePath =
opts.servicePath || opts.apiEndpoint || this.constructor.servicePath;

// Ensure that options include the service address and port.
opts = Object.assign(
{
clientConfig: {},
port: this.constructor.port,
servicePath: this.constructor.servicePath,
servicePath,
},
opts
);
Expand Down Expand Up @@ -182,6 +186,14 @@ class SessionEntityTypesClient {
return 'dialogflow.googleapis.com';
}

/**
* The DNS address for this API service - same as servicePath(),
* exists for compatibility reasons.
*/
static get apiEndpoint() {
return 'dialogflow.googleapis.com';
}

/**
* The port for this API service.
*/
Expand Down
14 changes: 13 additions & 1 deletion packages/google-cloud-dialogflow/src/v2/sessions_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,18 @@ class SessionsClient {
* API remote host.
*/
constructor(opts) {
opts = opts || {};
this._descriptors = {};

const servicePath =
opts.servicePath || opts.apiEndpoint || this.constructor.servicePath;

// Ensure that options include the service address and port.
opts = Object.assign(
{
clientConfig: {},
port: this.constructor.port,
servicePath: this.constructor.servicePath,
servicePath,
},
opts
);
Expand Down Expand Up @@ -161,6 +165,14 @@ class SessionsClient {
return 'dialogflow.googleapis.com';
}

/**
* The DNS address for this API service - same as servicePath(),
* exists for compatibility reasons.
*/
static get apiEndpoint() {
return 'dialogflow.googleapis.com';
}

/**
* The port for this API service.
*/
Expand Down
14 changes: 13 additions & 1 deletion packages/google-cloud-dialogflow/src/v2beta1/agents_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,18 @@ class AgentsClient {
* API remote host.
*/
constructor(opts) {
opts = opts || {};
this._descriptors = {};

const servicePath =
opts.servicePath || opts.apiEndpoint || this.constructor.servicePath;

// Ensure that options include the service address and port.
opts = Object.assign(
{
clientConfig: {},
port: this.constructor.port,
servicePath: this.constructor.servicePath,
servicePath,
},
opts
);
Expand Down Expand Up @@ -250,6 +254,14 @@ class AgentsClient {
return 'dialogflow.googleapis.com';
}

/**
* The DNS address for this API service - same as servicePath(),
* exists for compatibility reasons.
*/
static get apiEndpoint() {
return 'dialogflow.googleapis.com';
}

/**
* The port for this API service.
*/
Expand Down
14 changes: 13 additions & 1 deletion packages/google-cloud-dialogflow/src/v2beta1/contexts_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,18 @@ class ContextsClient {
* API remote host.
*/
constructor(opts) {
opts = opts || {};
this._descriptors = {};

const servicePath =
opts.servicePath || opts.apiEndpoint || this.constructor.servicePath;

// Ensure that options include the service address and port.
opts = Object.assign(
{
clientConfig: {},
port: this.constructor.port,
servicePath: this.constructor.servicePath,
servicePath,
},
opts
);
Expand Down Expand Up @@ -194,6 +198,14 @@ class ContextsClient {
return 'dialogflow.googleapis.com';
}

/**
* The DNS address for this API service - same as servicePath(),
* exists for compatibility reasons.
*/
static get apiEndpoint() {
return 'dialogflow.googleapis.com';
}

/**
* The port for this API service.
*/
Expand Down
14 changes: 13 additions & 1 deletion packages/google-cloud-dialogflow/src/v2beta1/documents_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,18 @@ class DocumentsClient {
* API remote host.
*/
constructor(opts) {
opts = opts || {};
this._descriptors = {};

const servicePath =
opts.servicePath || opts.apiEndpoint || this.constructor.servicePath;

// Ensure that options include the service address and port.
opts = Object.assign(
{
clientConfig: {},
port: this.constructor.port,
servicePath: this.constructor.servicePath,
servicePath,
},
opts
);
Expand Down Expand Up @@ -229,6 +233,14 @@ class DocumentsClient {
return 'dialogflow.googleapis.com';
}

/**
* The DNS address for this API service - same as servicePath(),
* exists for compatibility reasons.
*/
static get apiEndpoint() {
return 'dialogflow.googleapis.com';
}

/**
* The port for this API service.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,18 @@ class EntityTypesClient {
* API remote host.
*/
constructor(opts) {
opts = opts || {};
this._descriptors = {};

const servicePath =
opts.servicePath || opts.apiEndpoint || this.constructor.servicePath;

// Ensure that options include the service address and port.
opts = Object.assign(
{
clientConfig: {},
port: this.constructor.port,
servicePath: this.constructor.servicePath,
servicePath,
},
opts
);
Expand Down Expand Up @@ -290,6 +294,14 @@ class EntityTypesClient {
return 'dialogflow.googleapis.com';
}

/**
* The DNS address for this API service - same as servicePath(),
* exists for compatibility reasons.
*/
static get apiEndpoint() {
return 'dialogflow.googleapis.com';
}

/**
* The port for this API service.
*/
Expand Down
14 changes: 13 additions & 1 deletion packages/google-cloud-dialogflow/src/v2beta1/intents_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,18 @@ class IntentsClient {
* API remote host.
*/
constructor(opts) {
opts = opts || {};
this._descriptors = {};

const servicePath =
opts.servicePath || opts.apiEndpoint || this.constructor.servicePath;

// Ensure that options include the service address and port.
opts = Object.assign(
{
clientConfig: {},
port: this.constructor.port,
servicePath: this.constructor.servicePath,
servicePath,
},
opts
);
Expand Down Expand Up @@ -250,6 +254,14 @@ class IntentsClient {
return 'dialogflow.googleapis.com';
}

/**
* The DNS address for this API service - same as servicePath(),
* exists for compatibility reasons.
*/
static get apiEndpoint() {
return 'dialogflow.googleapis.com';
}

/**
* The port for this API service.
*/
Expand Down
Loading

0 comments on commit 53013ac

Please sign in to comment.