Skip to content

Commit db4f250

Browse files
committed
feat: datatypes v2 retrieval
1 parent da1af5b commit db4f250

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

lib/Services/cayenne.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
13
class Cayenne {
24
/**
35
* @param {String} url
@@ -295,6 +297,38 @@ class Cayenne {
295297
return this.auth.send(this.service, 'GET', url);
296298
}
297299

300+
/**
301+
* Gets V2 all things data types
302+
*/
303+
getThingDataTypesV2() {
304+
const url = `${this.url}/v2/things/datatypes`;
305+
return this.auth.send(this.service, 'GET', url);
306+
}
307+
308+
/**
309+
* Get V2 one things data type
310+
*/
311+
getThingDataTypeV2(id) {
312+
const url = `${this.url}/v2/things/datatypes/${id}`;
313+
return this.auth.send(this.service, 'GET', url);
314+
}
315+
316+
/**
317+
* Get V2 one things data type properties
318+
*/
319+
getThingDataTypePropertiesV2(id) {
320+
const url = `${this.url}/v2/things/datatypes/${id}/properties`;
321+
return this.auth.send(this.service, 'GET', url);
322+
}
323+
324+
/**
325+
* Get V2 one things data type property by it's id
326+
*/
327+
getThingDataTypePropertyV2(id, pid) {
328+
const url = `${this.url}/v2/things/datatypes/${id}/properties/${pid}`;
329+
return this.auth.send(this.service, 'GET', url);
330+
}
331+
298332
/**
299333
* Gets thing types by query
300334
* @param {Object} query

0 commit comments

Comments
 (0)