This repository was archived by the owner on Jul 13, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,14 +56,18 @@ class LanguageServiceClient {
5656 * API remote host.
5757 */
5858 constructor ( opts ) {
59+ opts = opts || { } ;
5960 this . _descriptors = { } ;
6061
62+ const servicePath =
63+ opts . servicePath || opts . apiEndpoint || this . constructor . servicePath ;
64+
6165 // Ensure that options include the service address and port.
6266 opts = Object . assign (
6367 {
6468 clientConfig : { } ,
6569 port : this . constructor . port ,
66- servicePath : this . constructor . servicePath ,
70+ servicePath,
6771 } ,
6872 opts
6973 ) ;
@@ -149,6 +153,14 @@ class LanguageServiceClient {
149153 return 'language.googleapis.com' ;
150154 }
151155
156+ /**
157+ * The DNS address for this API service - same as servicePath(),
158+ * exists for compatibility reasons.
159+ */
160+ static get apiEndpoint ( ) {
161+ return 'language.googleapis.com' ;
162+ }
163+
152164 /**
153165 * The port for this API service.
154166 */
Original file line number Diff line number Diff line change @@ -56,14 +56,18 @@ class LanguageServiceClient {
5656 * API remote host.
5757 */
5858 constructor ( opts ) {
59+ opts = opts || { } ;
5960 this . _descriptors = { } ;
6061
62+ const servicePath =
63+ opts . servicePath || opts . apiEndpoint || this . constructor . servicePath ;
64+
6165 // Ensure that options include the service address and port.
6266 opts = Object . assign (
6367 {
6468 clientConfig : { } ,
6569 port : this . constructor . port ,
66- servicePath : this . constructor . servicePath ,
70+ servicePath,
6771 } ,
6872 opts
6973 ) ;
@@ -149,6 +153,14 @@ class LanguageServiceClient {
149153 return 'language.googleapis.com' ;
150154 }
151155
156+ /**
157+ * The DNS address for this API service - same as servicePath(),
158+ * exists for compatibility reasons.
159+ */
160+ static get apiEndpoint ( ) {
161+ return 'language.googleapis.com' ;
162+ }
163+
152164 /**
153165 * The port for this API service.
154166 */
Original file line number Diff line number Diff line change 11{
2- "updateTime": "2019-05-21T11:17:54.880717Z ",
2+ "updateTime": "2019-06-05T14:20:03.832982Z ",
33 "sources": [
44 {
55 "generator": {
66 "name": "artman",
7- "version": "0.20.0 ",
8- "dockerImage": "googleapis/artman@sha256:3246adac900f4bdbd62920e80de2e5877380e44036b3feae13667ec255ebf5ec "
7+ "version": "0.23.1 ",
8+ "dockerImage": "googleapis/artman@sha256:9d5cae1454da64ac3a87028f8ef486b04889e351c83bb95e83b8fab3959faed0 "
99 }
1010 },
1111 {
1212 "git": {
1313 "name": "googleapis",
1414 "remote": "https://github.com/googleapis/googleapis.git",
15- "sha": "32a10f69e2c9ce15bba13ab1ff928bacebb25160 ",
16- "internalRef": "249058354 "
15+ "sha": "47c142a7cecc6efc9f6f8af804b8be55392b795b ",
16+ "internalRef": "251635729 "
1717 }
1818 },
1919 {
Original file line number Diff line number Diff line change @@ -23,6 +23,27 @@ const error = new Error();
2323error . code = FAKE_STATUS_CODE ;
2424
2525describe ( 'LanguageServiceClient' , ( ) => {
26+ it ( 'has servicePath' , ( ) => {
27+ const servicePath = languageModule . v1 . LanguageServiceClient . servicePath ;
28+ assert ( servicePath ) ;
29+ } ) ;
30+
31+ it ( 'has apiEndpoint' , ( ) => {
32+ const apiEndpoint = languageModule . v1 . LanguageServiceClient . apiEndpoint ;
33+ assert ( apiEndpoint ) ;
34+ } ) ;
35+
36+ it ( 'has port' , ( ) => {
37+ const port = languageModule . v1 . LanguageServiceClient . port ;
38+ assert ( port ) ;
39+ assert ( typeof port === 'number' ) ;
40+ } ) ;
41+
42+ it ( 'should create a client with no options' , ( ) => {
43+ const client = new languageModule . v1 . LanguageServiceClient ( ) ;
44+ assert ( client ) ;
45+ } ) ;
46+
2647 describe ( 'analyzeSentiment' , ( ) => {
2748 it ( 'invokes analyzeSentiment without error' , done => {
2849 const client = new languageModule . v1 . LanguageServiceClient ( {
Original file line number Diff line number Diff line change @@ -23,6 +23,29 @@ const error = new Error();
2323error . code = FAKE_STATUS_CODE ;
2424
2525describe ( 'LanguageServiceClient' , ( ) => {
26+ it ( 'has servicePath' , ( ) => {
27+ const servicePath =
28+ languageModule . v1beta2 . LanguageServiceClient . servicePath ;
29+ assert ( servicePath ) ;
30+ } ) ;
31+
32+ it ( 'has apiEndpoint' , ( ) => {
33+ const apiEndpoint =
34+ languageModule . v1beta2 . LanguageServiceClient . apiEndpoint ;
35+ assert ( apiEndpoint ) ;
36+ } ) ;
37+
38+ it ( 'has port' , ( ) => {
39+ const port = languageModule . v1beta2 . LanguageServiceClient . port ;
40+ assert ( port ) ;
41+ assert ( typeof port === 'number' ) ;
42+ } ) ;
43+
44+ it ( 'should create a client with no options' , ( ) => {
45+ const client = new languageModule . v1beta2 . LanguageServiceClient ( ) ;
46+ assert ( client ) ;
47+ } ) ;
48+
2649 describe ( 'analyzeSentiment' , ( ) => {
2750 it ( 'invokes analyzeSentiment without error' , done => {
2851 const client = new languageModule . v1beta2 . LanguageServiceClient ( {
You can’t perform that action at this time.
0 commit comments