File tree 7 files changed +107
-8
lines changed
packages/google-cloud-tasks
7 files changed +107
-8
lines changed Original file line number Diff line number Diff line change @@ -56,14 +56,18 @@ class CloudTasksClient {
56
56
* API remote host.
57
57
*/
58
58
constructor ( opts ) {
59
+ opts = opts || { } ;
59
60
this . _descriptors = { } ;
60
61
62
+ const servicePath =
63
+ opts . servicePath || opts . apiEndpoint || this . constructor . servicePath ;
64
+
61
65
// Ensure that options include the service address and port.
62
66
opts = Object . assign (
63
67
{
64
68
clientConfig : { } ,
65
69
port : this . constructor . port ,
66
- servicePath : this . constructor . servicePath ,
70
+ servicePath,
67
71
} ,
68
72
opts
69
73
) ;
@@ -187,6 +191,14 @@ class CloudTasksClient {
187
191
return 'cloudtasks.googleapis.com' ;
188
192
}
189
193
194
+ /**
195
+ * The DNS address for this API service - same as servicePath(),
196
+ * exists for compatibility reasons.
197
+ */
198
+ static get apiEndpoint ( ) {
199
+ return 'cloudtasks.googleapis.com' ;
200
+ }
201
+
190
202
/**
191
203
* The port for this API service.
192
204
*/
Original file line number Diff line number Diff line change @@ -56,14 +56,18 @@ class CloudTasksClient {
56
56
* API remote host.
57
57
*/
58
58
constructor ( opts ) {
59
+ opts = opts || { } ;
59
60
this . _descriptors = { } ;
60
61
62
+ const servicePath =
63
+ opts . servicePath || opts . apiEndpoint || this . constructor . servicePath ;
64
+
61
65
// Ensure that options include the service address and port.
62
66
opts = Object . assign (
63
67
{
64
68
clientConfig : { } ,
65
69
port : this . constructor . port ,
66
- servicePath : this . constructor . servicePath ,
70
+ servicePath,
67
71
} ,
68
72
opts
69
73
) ;
@@ -191,6 +195,14 @@ class CloudTasksClient {
191
195
return 'cloudtasks.googleapis.com' ;
192
196
}
193
197
198
+ /**
199
+ * The DNS address for this API service - same as servicePath(),
200
+ * exists for compatibility reasons.
201
+ */
202
+ static get apiEndpoint ( ) {
203
+ return 'cloudtasks.googleapis.com' ;
204
+ }
205
+
194
206
/**
195
207
* The port for this API service.
196
208
*/
Original file line number Diff line number Diff line change @@ -56,14 +56,18 @@ class CloudTasksClient {
56
56
* API remote host.
57
57
*/
58
58
constructor ( opts ) {
59
+ opts = opts || { } ;
59
60
this . _descriptors = { } ;
60
61
62
+ const servicePath =
63
+ opts . servicePath || opts . apiEndpoint || this . constructor . servicePath ;
64
+
61
65
// Ensure that options include the service address and port.
62
66
opts = Object . assign (
63
67
{
64
68
clientConfig : { } ,
65
69
port : this . constructor . port ,
66
- servicePath : this . constructor . servicePath ,
70
+ servicePath,
67
71
} ,
68
72
opts
69
73
) ;
@@ -187,6 +191,14 @@ class CloudTasksClient {
187
191
return 'cloudtasks.googleapis.com' ;
188
192
}
189
193
194
+ /**
195
+ * The DNS address for this API service - same as servicePath(),
196
+ * exists for compatibility reasons.
197
+ */
198
+ static get apiEndpoint ( ) {
199
+ return 'cloudtasks.googleapis.com' ;
200
+ }
201
+
190
202
/**
191
203
* The port for this API service.
192
204
*/
Original file line number Diff line number Diff line change 1
1
{
2
- "updateTime": "2019-05-21T11:26:46.540067Z ",
2
+ "updateTime": "2019-06-05T14:27:56.003459Z ",
3
3
"sources": [
4
4
{
5
5
"generator": {
6
6
"name": "artman",
7
- "version": "0.20.0 ",
8
- "dockerImage": "googleapis/artman@sha256:3246adac900f4bdbd62920e80de2e5877380e44036b3feae13667ec255ebf5ec "
7
+ "version": "0.23.1 ",
8
+ "dockerImage": "googleapis/artman@sha256:9d5cae1454da64ac3a87028f8ef486b04889e351c83bb95e83b8fab3959faed0 "
9
9
}
10
10
},
11
11
{
12
12
"git": {
13
13
"name": "googleapis",
14
14
"remote": "https://github.com/googleapis/googleapis.git",
15
- "sha": "32a10f69e2c9ce15bba13ab1ff928bacebb25160 ",
16
- "internalRef": "249058354 "
15
+ "sha": "47c142a7cecc6efc9f6f8af804b8be55392b795b ",
16
+ "internalRef": "251635729 "
17
17
}
18
18
},
19
19
{
Original file line number Diff line number Diff line change @@ -23,6 +23,27 @@ const error = new Error();
23
23
error . code = FAKE_STATUS_CODE ;
24
24
25
25
describe ( 'CloudTasksClient' , ( ) => {
26
+ it ( 'has servicePath' , ( ) => {
27
+ const servicePath = tasksModule . v2 . CloudTasksClient . servicePath ;
28
+ assert ( servicePath ) ;
29
+ } ) ;
30
+
31
+ it ( 'has apiEndpoint' , ( ) => {
32
+ const apiEndpoint = tasksModule . v2 . CloudTasksClient . apiEndpoint ;
33
+ assert ( apiEndpoint ) ;
34
+ } ) ;
35
+
36
+ it ( 'has port' , ( ) => {
37
+ const port = tasksModule . v2 . CloudTasksClient . port ;
38
+ assert ( port ) ;
39
+ assert ( typeof port === 'number' ) ;
40
+ } ) ;
41
+
42
+ it ( 'should create a client with no options' , ( ) => {
43
+ const client = new tasksModule . v2 . CloudTasksClient ( ) ;
44
+ assert ( client ) ;
45
+ } ) ;
46
+
26
47
describe ( 'listQueues' , ( ) => {
27
48
it ( 'invokes listQueues without error' , done => {
28
49
const client = new tasksModule . v2 . CloudTasksClient ( {
Original file line number Diff line number Diff line change @@ -23,6 +23,27 @@ const error = new Error();
23
23
error . code = FAKE_STATUS_CODE ;
24
24
25
25
describe ( 'CloudTasksClient' , ( ) => {
26
+ it ( 'has servicePath' , ( ) => {
27
+ const servicePath = tasksModule . v2beta2 . CloudTasksClient . servicePath ;
28
+ assert ( servicePath ) ;
29
+ } ) ;
30
+
31
+ it ( 'has apiEndpoint' , ( ) => {
32
+ const apiEndpoint = tasksModule . v2beta2 . CloudTasksClient . apiEndpoint ;
33
+ assert ( apiEndpoint ) ;
34
+ } ) ;
35
+
36
+ it ( 'has port' , ( ) => {
37
+ const port = tasksModule . v2beta2 . CloudTasksClient . port ;
38
+ assert ( port ) ;
39
+ assert ( typeof port === 'number' ) ;
40
+ } ) ;
41
+
42
+ it ( 'should create a client with no options' , ( ) => {
43
+ const client = new tasksModule . v2beta2 . CloudTasksClient ( ) ;
44
+ assert ( client ) ;
45
+ } ) ;
46
+
26
47
describe ( 'listQueues' , ( ) => {
27
48
it ( 'invokes listQueues without error' , done => {
28
49
const client = new tasksModule . v2beta2 . CloudTasksClient ( {
Original file line number Diff line number Diff line change @@ -23,6 +23,27 @@ const error = new Error();
23
23
error . code = FAKE_STATUS_CODE ;
24
24
25
25
describe ( 'CloudTasksClient' , ( ) => {
26
+ it ( 'has servicePath' , ( ) => {
27
+ const servicePath = tasksModule . v2beta3 . CloudTasksClient . servicePath ;
28
+ assert ( servicePath ) ;
29
+ } ) ;
30
+
31
+ it ( 'has apiEndpoint' , ( ) => {
32
+ const apiEndpoint = tasksModule . v2beta3 . CloudTasksClient . apiEndpoint ;
33
+ assert ( apiEndpoint ) ;
34
+ } ) ;
35
+
36
+ it ( 'has port' , ( ) => {
37
+ const port = tasksModule . v2beta3 . CloudTasksClient . port ;
38
+ assert ( port ) ;
39
+ assert ( typeof port === 'number' ) ;
40
+ } ) ;
41
+
42
+ it ( 'should create a client with no options' , ( ) => {
43
+ const client = new tasksModule . v2beta3 . CloudTasksClient ( ) ;
44
+ assert ( client ) ;
45
+ } ) ;
46
+
26
47
describe ( 'listQueues' , ( ) => {
27
48
it ( 'invokes listQueues without error' , done => {
28
49
const client = new tasksModule . v2beta3 . CloudTasksClient ( {
You can’t perform that action at this time.
0 commit comments