@@ -1963,6 +1963,71 @@ class Particle {
19631963 } ) ;
19641964 }
19651965
1966+ /**
1967+ * Query location for devices within a product
1968+ * @param {Object } options Options for this API call
1969+ * @param {String } options.product Locations for this product ID or slug
1970+ * @param {String } options.auth Access Token
1971+ * @param {String } options.dateRange Start and end date in ISO8601 format, separated by comma, to query
1972+ * @param {String } options.rectBl Bottom left of the rectangular bounding box to query. Latitude and longitude separated by comma
1973+ * @param {String } options.rectTr Top right of the rectangular bounding box to query. Latitude and longitude separated by comma
1974+ * @param {String } options.deviceId Device ID prefix to include in the query
1975+ * @param {String } options.deviceName Device name prefix to include in the query
1976+ * @param {String } options.groups Array of group names to include in the query
1977+ * @param {String } options.page Page of results to display. Defaults to 1
1978+ * @param {String } options.perPage Number of results per page. Defaults to 20. Maximum of 100
1979+ * @param {Object } [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
1980+ * @param {Object } [options.context] Request context
1981+ * @returns {Promise } A promise
1982+ */
1983+ getProductLocations ( { auth, product, dateRange, rectBl, rectTr, deviceId, deviceName, groups, page, perPage, headers, context } ) {
1984+ return this . get ( {
1985+ uri : `/v1/products/${ product } /locations` ,
1986+ query : {
1987+ date_range : dateRange ,
1988+ rect_bl : rectBl ,
1989+ rect_tr : rectTr ,
1990+ device_id : deviceId ,
1991+ device_name : deviceName ,
1992+ groups,
1993+ page,
1994+ per_page : perPage
1995+ } ,
1996+ auth,
1997+ headers,
1998+ context
1999+ } ) ;
2000+ }
2001+
2002+ /**
2003+ * Query location for one device within a product
2004+ * @param {Object } options Options for this API call
2005+ * @param {String } options.product Locations for this product ID or slug
2006+ * @param {String } options.auth Access Token
2007+ * @param {String } options.dateRange Start and end date in ISO8601 format, separated by comma, to query
2008+ * @param {String } options.rectBl Bottom left of the rectangular bounding box to query. Latitude and longitude separated by comma
2009+ * @param {String } options.rectTr Top right of the rectangular bounding box to query. Latitude and longitude separated by comma
2010+ * @param {String } options.deviceId Device ID to query
2011+ * @param {Object } [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
2012+ * @param {Object } [options.context] Request context
2013+ * @param {Object } [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
2014+ * @param {Object } [options.context] Request context
2015+ * @returns {Promise } A promise
2016+ */
2017+ getProductDeviceLocations ( { auth, product, dateRange, rectBl, rectTr, deviceId, headers, context } ) {
2018+ return this . get ( {
2019+ uri : `/v1/products/${ product } /locations/${ deviceId } ` ,
2020+ query : {
2021+ date_range : dateRange ,
2022+ rect_bl : rectBl ,
2023+ rect_tr : rectTr
2024+ } ,
2025+ auth,
2026+ headers,
2027+ context
2028+ } ) ;
2029+ }
2030+
19662031 /**
19672032 * API URI to access a device
19682033 * @param {Object } options Options for this API call
0 commit comments