UNPKG

@xompass/sdk-cloud-api

Version:

Xompass Client for cloud-api

145 lines (140 loc) 4.69 kB
import { SDKModels } from './SDKModels'; import { XompassBaseApi, XompassAuth } from '../core'; import { XompassClient } from '../../XompassClient'; import { LoopBackFilter } from '../../models'; import { EventSummaryForAsset } from '../../models'; import { Asset, EventSummary, EventSummaryForProject, Log } from '../../models'; /** * Api services for the `EventSummaryForAsset` model. */ export abstract class EventSummaryForAssetApi extends XompassBaseApi { public static model = SDKModels.get('EventSummaryForAsset'); public static findByIdEventSummaries(id: any, fk: any, retry = false): Promise<any> { const _method = 'GET'; const _url = [ XompassClient.getPath() + '/' + XompassClient.getApiVersion(), '/EventSummaryForAssets/:id/eventSummaries/: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(), '/EventSummaryForAssets/:id/trackingLogs/:fk' ].join(''); const _routeParams = { id, fk }; const _postBody = {}; const _urlParams: any = {}; return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry); } public static getEventSummaries(id: any, filter: LoopBackFilter = {}, retry = false): Promise<any> { const _method = 'GET'; const _url = [ XompassClient.getPath() + '/' + XompassClient.getApiVersion(), '/EventSummaryForAssets/:id/eventSummaries' ].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 countEventSummaries(id: any, where: any = {}, retry = false): Promise<any> { const _method = 'GET'; const _url = [ XompassClient.getPath() + '/' + XompassClient.getApiVersion(), '/EventSummaryForAssets/:id/eventSummaries/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(), '/EventSummaryForAssets/: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(), '/EventSummaryForAssets/: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 generateSummary( id: any, force: any = {}, minimalResponse: any = {}, retry = false ): Promise<any> { const _method = 'POST'; const _url = [ XompassClient.getPath() + '/' + XompassClient.getApiVersion(), '/EventSummaryForAssets/:id/generate' ].join(''); const _routeParams = { id }; const _postBody = {}; const _urlParams: any = {}; if (typeof force !== 'undefined' && force !== null) { _urlParams['force'] = force; } if (typeof minimalResponse !== 'undefined' && minimalResponse !== null) { _urlParams['minimal_response'] = minimalResponse; } return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry); } /** * The name of the model represented by this $resource, * i.e. `EventSummaryForAsset`. */ public static getModelName(): string { return 'EventSummaryForAsset'; } }