@xompass/sdk-cloud-api
Version:
Xompass Client for cloud-api
799 lines (794 loc) • 23.6 kB
text/typescript
import { SDKModels } from './SDKModels';
import { XompassBaseApi, XompassAuth } from '../core';
import { XompassClient } from '../../XompassClient';
import { LoopBackFilter } from '../../models';
import { Var } from '../../models';
import {
Log,
Admin,
Customer,
Country,
ToolkitTemplate,
Toolkit
} from '../../models';
/**
* Api services for the `Var` model.
*/
export abstract class VarApi extends XompassBaseApi {
public static model = SDKModels.get('Var');
public static findByIdTrackingLogs(id: any, fk: any, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/trackingLogs/:fk'
].join('');
const _routeParams = {
id,
fk
};
const _postBody = {};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static findByIdAdmins(id: any, fk: any, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/admins/:fk'
].join('');
const _routeParams = {
id,
fk
};
const _postBody = {};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static updateByIdCustomers(
id: any,
fk: any,
data: any = {},
retry = false
): Promise<any> {
const _method = 'PUT';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/customers/:fk'
].join('');
const _routeParams = {
id,
fk
};
const _postBody = {
data
};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static getCountry(id: any, refresh: any = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/country'
].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 linkToolkitTemplates(id: any, fk: any, retry = false): Promise<any> {
const _method = 'PUT';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkitTemplates/rel/:fk'
].join('');
const _routeParams = {
id,
fk
};
const _postBody = {};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static unlinkToolkitTemplates(id: any, fk: any, retry = false): Promise<any> {
const _method = 'DELETE';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkitTemplates/rel/:fk'
].join('');
const _routeParams = {
id,
fk
};
const _postBody = {};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static updateByIdToolkits(
id: any,
fk: any,
data: any = {},
retry = false
): Promise<any> {
const _method = 'PUT';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkits/:fk'
].join('');
const _routeParams = {
id,
fk
};
const _postBody = {
data
};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static getContainer(id: any, refresh: any = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/container'
].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 createContainer(id: any, data: any = {}, retry = false): Promise<any> {
const _method = 'POST';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/container'
].join('');
const _routeParams = {
id
};
const _postBody = {
data
};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static updateContainer(id: any, data: any = {}, retry = false): Promise<any> {
const _method = 'PUT';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/container'
].join('');
const _routeParams = {
id
};
const _postBody = {
data
};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static destroyContainer(id: any, retry = false): Promise<any> {
const _method = 'DELETE';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/container'
].join('');
const _routeParams = {
id
};
const _postBody = {};
const _urlParams: any = {};
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(),
'/Vars/: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(),
'/Vars/: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 getAdmins(id: any, filter: LoopBackFilter = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/admins'
].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 createAdmins(id: any, data: any = {}, retry = false): Promise<any> {
const _method = 'POST';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/admins'
].join('');
const _routeParams = {
id
};
const _postBody = {
data
};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static countAdmins(id: any, where: any = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/admins/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 getCustomers(id: any, filter: LoopBackFilter = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/customers'
].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 createCustomers(id: any, data: any = {}, retry = false): Promise<any> {
const _method = 'POST';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/customers'
].join('');
const _routeParams = {
id
};
const _postBody = {
data
};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static countCustomers(id: any, where: any = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/customers/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 getToolkitTemplates(id: any, filter: LoopBackFilter = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkitTemplates'
].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 countToolkitTemplates(id: any, where: any = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkitTemplates/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 getToolkits(id: any, filter: LoopBackFilter = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkits'
].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 countToolkits(id: any, where: any = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkits/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 instantiateToolkitTemplates(
id: any,
fk: any,
data: Toolkit = new Toolkit(),
retry = false
): Promise<any> {
const _method = 'POST';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkitTemplates/:fk/instantiate'
].join('');
const _routeParams = {
id,
fk
};
const _postBody = {
data
};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static getAdminTools(id: any, filter: LoopBackFilter = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/adminTools'
].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 getTools(id: any, filter: LoopBackFilter = {}, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/tools'
].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 getToolkitTemplatesAssetTypes(
id: any,
fk: any,
filter: LoopBackFilter = {},
retry = false
): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkitTemplates/:fk/assetTypes'
].join('');
const _routeParams = {
id,
fk
};
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 getToolkitsAssetTypes(
id: any,
fk: any,
filter: LoopBackFilter = {},
retry = false
): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkits/:fk/assetTypes'
].join('');
const _routeParams = {
id,
fk
};
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 getContainerInfo(id: any, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/container/info'
].join('');
const _routeParams = {
id
};
const _postBody = {};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static getFiles(id: any, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/container/files'
].join('');
const _routeParams = {
id
};
const _postBody = {};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static getFile(id: any, file: any, retry = false): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/container/files/:file'
].join('');
const _routeParams = {
id,
file
};
const _postBody = {};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static removeFile(
id: any,
property: any,
file: any,
retry = false
): Promise<any> {
const _method = 'DELETE';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/container/files/:file'
].join('');
const _routeParams = {
id,
file
};
const _postBody = {};
const _urlParams: any = {};
if (typeof property !== 'undefined' && property !== null) {
_urlParams['property'] = property;
}
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static upload(id: any, property: any, retry = false): Promise<any> {
const _method = 'POST';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/container/upload'
].join('');
const _routeParams = {
id
};
const _postBody = {};
const _urlParams: any = {};
if (typeof property !== 'undefined' && property !== null) {
_urlParams['property'] = property;
}
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static download(
id: any,
property: any,
file: any,
retry = false
): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/container/download/:file'
].join('');
const _routeParams = {
id,
file
};
const _postBody = {};
const _urlParams: any = {};
if (typeof property !== 'undefined' && property !== null) {
_urlParams['property'] = property;
}
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static findByIdToolkitsAdminTools(
id: any,
nk: any,
fk: any,
retry = false
): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkits/:nk/adminTools/:fk'
].join('');
const _routeParams = {
id,
nk,
fk
};
const _postBody = {};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static linkToolkitsAdminTools(
id: any,
nk: any,
fk: any,
retry = false
): Promise<any> {
const _method = 'PUT';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkits/:nk/adminTools/rel/:fk'
].join('');
const _routeParams = {
id,
nk,
fk
};
const _postBody = {};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static unlinkToolkitsAdminTools(
id: any,
nk: any,
fk: any,
retry = false
): Promise<any> {
const _method = 'DELETE';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkits/:nk/adminTools/rel/:fk'
].join('');
const _routeParams = {
id,
nk,
fk
};
const _postBody = {};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static findByIdToolkitsTools(
id: any,
nk: any,
fk: any,
retry = false
): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkits/:nk/tools/:fk'
].join('');
const _routeParams = {
id,
nk,
fk
};
const _postBody = {};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static linkToolkitsTools(
id: any,
nk: any,
fk: any,
retry = false
): Promise<any> {
const _method = 'PUT';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkits/:nk/tools/rel/:fk'
].join('');
const _routeParams = {
id,
nk,
fk
};
const _postBody = {};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static unlinkToolkitsTools(
id: any,
nk: any,
fk: any,
retry = false
): Promise<any> {
const _method = 'DELETE';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkits/:nk/tools/rel/:fk'
].join('');
const _routeParams = {
id,
nk,
fk
};
const _postBody = {};
const _urlParams: any = {};
return super.request(_method, _url, _routeParams, _urlParams, _postBody, retry);
}
public static getToolkitsAdminTools(
id: any,
nk: any,
filter: LoopBackFilter = {},
retry = false
): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkits/:nk/adminTools'
].join('');
const _routeParams = {
id,
nk
};
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 countToolkitsAdminTools(
id: any,
nk: any,
where: any = {},
retry = false
): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkits/:nk/adminTools/count'
].join('');
const _routeParams = {
id,
nk
};
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 getToolkitsTools(
id: any,
nk: any,
filter: LoopBackFilter = {},
retry = false
): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkits/:nk/tools'
].join('');
const _routeParams = {
id,
nk
};
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 countToolkitsTools(
id: any,
nk: any,
where: any = {},
retry = false
): Promise<any> {
const _method = 'GET';
const _url = [
XompassClient.getPath() + '/' + XompassClient.getApiVersion(),
'/Vars/:id/toolkits/:nk/tools/count'
].join('');
const _routeParams = {
id,
nk
};
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. `Var`.
*/
public static getModelName(): string {
return 'Var';
}
}