UNPKG

@xompass/sdk-cloud-api

Version:

Xompass Client for cloud-api

263 lines (258 loc) 8.58 kB
import { SDKModels } from './SDKModels'; import { XompassBaseApi, XompassAuth } from '../core'; import { XompassClient } from '../../XompassClient'; import { LoopBackFilter } from '../../models'; import { EventTriggerAssetState } from '../../models'; import { AssetState, EmergencyContact, EventTrigger, EventTriggerAssetStateTemplate, Log } from '../../models'; /** * Api services for the `EventTriggerAssetState` model. */ export abstract class EventTriggerAssetStateApi extends XompassBaseApi { public static model = SDKModels.get('EventTriggerAssetState'); public static getAssetState(id: any, refresh: any = {}, retry = false): Promise<any> { const _method = 'GET'; const _url = [ XompassClient.getPath() + '/' + XompassClient.getApiVersion(), '/EventTriggerAssetStates/:id/assetState' ].join(''); const _routeParams = { id }; const _postBody = {}; const _urlParams: any = {}; if (typeof refresh !== 'undefined' && refresh !== null) { _urlParams['refresh'] = refresh; } return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry); } public static findByIdEmergencyContacts(id: any, fk: any, retry = false): Promise<any> { const _method = 'GET'; const _url = [ XompassClient.getPath() + '/' + XompassClient.getApiVersion(), '/EventTriggerAssetStates/:id/emergencyContacts/:fk' ].join(''); const _routeParams = { id, fk }; const _postBody = {}; const _urlParams: any = {}; return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry); } public static linkEmergencyContacts( id: any, fk: any, data: any = {}, retry = false ): Promise<any> { const _method = 'PUT'; const _url = [ XompassClient.getPath() + '/' + XompassClient.getApiVersion(), '/EventTriggerAssetStates/:id/emergencyContacts/rel/:fk' ].join(''); const _routeParams = { id, fk }; const _postBody = data; const _urlParams: any = {}; return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry); } public static unlinkEmergencyContacts(id: any, fk: any, retry = false): Promise<any> { const _method = 'DELETE'; const _url = [ XompassClient.getPath() + '/' + XompassClient.getApiVersion(), '/EventTriggerAssetStates/:id/emergencyContacts/rel/:fk' ].join(''); const _routeParams = { id, fk }; const _postBody = {}; const _urlParams: any = {}; return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry); } public static findByIdRules(id: any, fk: any, retry = false): Promise<any> { const _method = 'GET'; const _url = [ XompassClient.getPath() + '/' + XompassClient.getApiVersion(), '/EventTriggerAssetStates/:id/rules/:fk' ].join(''); const _routeParams = { id, fk }; const _postBody = {}; const _urlParams: any = {}; return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry); } public static destroyByIdRules(id: any, fk: any, retry = false): Promise<any> { const _method = 'DELETE'; const _url = [ XompassClient.getPath() + '/' + XompassClient.getApiVersion(), '/EventTriggerAssetStates/:id/rules/:fk' ].join(''); const _routeParams = { id, fk }; const _postBody = {}; const _urlParams: any = {}; return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry); } public static updateByIdRules( id: any, fk: any, data: any = {}, retry = false ): Promise<any> { const _method = 'PUT'; const _url = [ XompassClient.getPath() + '/' + XompassClient.getApiVersion(), '/EventTriggerAssetStates/:id/rules/:fk' ].join(''); const _routeParams = { id, fk }; const _postBody = data; 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(), '/EventTriggerAssetStates/:id/trackingLogs/:fk' ].join(''); const _routeParams = { id, fk }; const _postBody = {}; const _urlParams: any = {}; return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry); } public static getEmergencyContacts(id: any, filter: LoopBackFilter = {}, retry = false): Promise<any> { const _method = 'GET'; const _url = [ XompassClient.getPath() + '/' + XompassClient.getApiVersion(), '/EventTriggerAssetStates/:id/emergencyContacts' ].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 countEmergencyContacts(id: any, where: any = {}, retry = false): Promise<any> { const _method = 'GET'; const _url = [ XompassClient.getPath() + '/' + XompassClient.getApiVersion(), '/EventTriggerAssetStates/:id/emergencyContacts/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 getRules(id: any, filter: LoopBackFilter = {}, retry = false): Promise<any> { const _method = 'GET'; const _url = [ XompassClient.getPath() + '/' + XompassClient.getApiVersion(), '/EventTriggerAssetStates/:id/rules' ].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 createRules(id: any, data: any = {}, retry = false): Promise<any> { const _method = 'POST'; const _url = [ XompassClient.getPath() + '/' + XompassClient.getApiVersion(), '/EventTriggerAssetStates/:id/rules' ].join(''); const _routeParams = { id }; const _postBody = data; const _urlParams: any = {}; return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry); } public static countRules(id: any, where: any = {}, retry = false): Promise<any> { const _method = 'GET'; const _url = [ XompassClient.getPath() + '/' + XompassClient.getApiVersion(), '/EventTriggerAssetStates/:id/rules/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(), '/EventTriggerAssetStates/: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(), '/EventTriggerAssetStates/: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); } /** * The name of the model represented by this $resource, * i.e. `EventTriggerAssetState`. */ public static getModelName(): string { return 'EventTriggerAssetState'; } }