@xompass/sdk-cloud-api
Version:
Xompass Client for cloud-api
231 lines (226 loc) • 7.49 kB
text/typescript
import { SDKModels } from './SDKModels';
import { XompassBaseApi, XompassAuth } from '../core';
import { XompassClient } from '../../XompassClient';
import { LoopBackFilter } from '../../models';
import { AssetState } from '../../models';
import {
Asset,
Alert,
AlertHistory,
AssetStateTemplate,
EventTriggerAssetState,
Log,
SensorAssetState,
Sensor
} from '../../models';
/**
* Api services for the `AssetState` model.
*/
export abstract class AssetStateApi extends XompassBaseApi {
public static model = SDKModels.get('AssetState');
public static findByIdEventTriggerAssetStates(id: any, fk: any, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/AssetStates/:id/eventTriggerAssetStates/:fk'
].join('');
const _routeParams = {
id,
fk
};
const _postBody = {};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static findByIdTrackingLogs(id: any, fk: any, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/AssetStates/:id/trackingLogs/:fk'
].join('');
const _routeParams = {
id,
fk
};
const _postBody = {};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static findByIdSensors(id: any, fk: any, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/AssetStates/:id/sensors/:fk'
].join('');
const _routeParams = {
id,
fk
};
const _postBody = {};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static existsSensors(id: any, fk: any, retry = false): Promise<any> {
const _method = 'HEAD';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/AssetStates/:id/sensors/rel/:fk'
].join('');
const _routeParams = {
id,
fk
};
const _postBody = {};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static findByIdStates(id: any, fk: any, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/AssetStates/:id/states/:fk'
].join('');
const _routeParams = {
id,
fk
};
const _postBody = {};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static getEventTriggerAssetStates(id: any, filter: LoopBackFilter = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/AssetStates/:id/eventTriggerAssetStates'
].join('');
const _routeParams = {
id
};
const _postBody = {};
const _urlParams: any = {};
if (typeof filter !== 'undefined' && filter !== null) {
_urlParams['filter'] = filter;
}
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static countEventTriggerAssetStates(id: any, where: any = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/AssetStates/:id/eventTriggerAssetStates/count'
].join('');
const _routeParams = {
id
};
const _postBody = {};
const _urlParams: any = {};
if (typeof where !== 'undefined' && where !== null) {
_urlParams['where'] = where;
}
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static getTrackingLogs(id: any, filter: LoopBackFilter = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/AssetStates/:id/trackingLogs'
].join('');
const _routeParams = {
id
};
const _postBody = {};
const _urlParams: any = {};
if (typeof filter !== 'undefined' && filter !== null) {
_urlParams['filter'] = filter;
}
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static countTrackingLogs(id: any, where: any = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/AssetStates/:id/trackingLogs/count'
].join('');
const _routeParams = {
id
};
const _postBody = {};
const _urlParams: any = {};
if (typeof where !== 'undefined' && where !== null) {
_urlParams['where'] = where;
}
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static getSensors(id: any, filter: LoopBackFilter = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/AssetStates/:id/sensors'
].join('');
const _routeParams = {
id
};
const _postBody = {};
const _urlParams: any = {};
if (typeof filter !== 'undefined' && filter !== null) {
_urlParams['filter'] = filter;
}
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static countSensors(id: any, where: any = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/AssetStates/:id/sensors/count'
].join('');
const _routeParams = {
id
};
const _postBody = {};
const _urlParams: any = {};
if (typeof where !== 'undefined' && where !== null) {
_urlParams['where'] = where;
}
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static getStates(id: any, filter: LoopBackFilter = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/AssetStates/:id/states'
].join('');
const _routeParams = {
id
};
const _postBody = {};
const _urlParams: any = {};
if (typeof filter !== 'undefined' && filter !== null) {
_urlParams['filter'] = filter;
}
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static countStates(id: any, where: any = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/AssetStates/:id/states/count'
].join('');
const _routeParams = {
id
};
const _postBody = {};
const _urlParams: any = {};
if (typeof where !== 'undefined' && where !== null) {
_urlParams['where'] = where;
}
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
/**
* The name of the model represented by this $resource,
* i.e. `AssetState`.
*/
public static getModelName(): string {
return 'AssetState';
}
}