yaas-api-document-v1
Version:
TypeScript API client-lib for YAAS 'document' based on (fixed) version on Hybris SAP published API RAML, see https://devportal.yaas.io/services/document/v1/ [Auto-generated using raml-typescript-generator]
819 lines • 64.7 kB
JavaScript
/// <reference types="@types/es6-shim" />
//========================================================================
// RAML-defined Typed REST Client for 'YaasApiDocumentV1'
//========================================================================
"use strict";
exports.__esModule = true;
var popsicle = require("popsicle");
var extend = require("deep-extend");
var rxjs_1 = require("@reactivex/rxjs");
//========================================================================
// Actions
//========================================================================
var TEMPLATE_REGEXP = /{([^{}]+)}/g;
function template(string, interpolate) {
return string.replace(TEMPLATE_REGEXP, function (match, key) {
if (interpolate[key] != null) {
return encodeURIComponent(interpolate[key]);
}
return '';
});
}
var YaasApiDocumentV1 = (function () {
function YaasApiDocumentV1(options) {
this._path = '';
this._options = extend({
baseUri: 'https://api.eu.yaas.io/hybris/document/v1',
baseUriParameters: {}
}, options);
//function client (method, path, options) {
// return this.request(client, method, path, options)
//}
// Initialize RAML resourcs without parameters
this.all = new Resources.All(this, '/all');
this._client = this;
this._form = popsicle.form;
this._version = 'v0.1';
this._Security = {};
// RAML resources with parameters
}
YaasApiDocumentV1.prototype.request = function (client, method, path, opts) {
var options = extend({}, client._options, opts);
var baseUri = template(options.baseUri, options.baseUriParameters);
var reqOpts = {
url: baseUri.replace(/\/$/, '') + template(path, options.uriParameters),
method: method,
headers: extend(options.headers, options.getHeaders ? options.getHeaders() : {}),
body: options.body,
query: options.query,
options: options.options
};
if (options.user && typeof options.user.sign === 'function') {
reqOpts = options.user.sign(reqOpts);
}
return popsicle.request(reqOpts);
};
// createProtoResources - Resource: Client
YaasApiDocumentV1.prototype.tenant = function (tenant) { return new Resources.Tenant(this._client, this._path + template('/{tenant}', extend({}, { tenant: tenant }))); };
return YaasApiDocumentV1;
}());
exports.YaasApiDocumentV1 = YaasApiDocumentV1;
var Resources;
(function (Resources) {
// createResource - All
var All = (function () {
function All(client, path) {
this._client = client;
this._path = path;
this.statistics = new All.AllStatistics(this._client, this._path + '/statistics');
}
/**
* GET on All
*/
All.prototype.GET = function (opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
_this._client.request(_this._client, 'get', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
return All;
}());
Resources.All = All;
(function (All) {
// createResource - AllStatistics
var AllStatistics = (function () {
function AllStatistics(client, path) {
this._client = client;
this._path = path;
this.total = new All.AllStatistics.AllStatisticsTotal(this._client, this._path + '/total');
}
/**
* GET on AllStatistics
*/
AllStatistics.prototype.GET = function (opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
_this._client.request(_this._client, 'get', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
return AllStatistics;
}());
All.AllStatistics = AllStatistics;
(function (AllStatistics) {
// createResource - AllStatisticsTotal
var AllStatisticsTotal = (function () {
function AllStatisticsTotal(client, path) {
this._client = client;
this._path = path;
}
/**
* GET on AllStatisticsTotal
*/
AllStatisticsTotal.prototype.GET = function (opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
_this._client.request(_this._client, 'get', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
return AllStatisticsTotal;
}());
AllStatistics.AllStatisticsTotal = AllStatisticsTotal;
})(AllStatistics = All.AllStatistics || (All.AllStatistics = {}));
})(All = Resources.All || (Resources.All = {}));
// createResource - Tenant
var Tenant = (function () {
function Tenant(client, path) {
this._client = client;
this._path = path;
}
// createProtoResources - Resource: Tenant
Tenant.prototype.client = function (client) { return new Tenant.TenantClient(this._client, this._path + template('/{client}', extend({}, { client: client }))); };
/**
* GET on Tenant
*/
Tenant.prototype.GET = function (opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
_this._client.request(_this._client, 'get', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* HEAD on Tenant
*/
Tenant.prototype.HEAD = function (opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
_this._client.request(_this._client, 'head', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* DELETE on Tenant
*/
Tenant.prototype.DELETE = function (opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
_this._client.request(_this._client, 'delete', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
return Tenant;
}());
Resources.Tenant = Tenant;
(function (Tenant) {
// createResource - TenantClient
var TenantClient = (function () {
function TenantClient(client, path) {
this._client = client;
this._path = path;
this.data = new Tenant.TenantClient.TenantClientData(this._client, this._path + '/data');
this.aggr = new Tenant.TenantClient.TenantClientAggr(this._client, this._path + '/aggr');
this.indexes = new Tenant.TenantClient.TenantClientIndexes(this._client, this._path + '/indexes');
this.tags = new Tenant.TenantClient.TenantClientTags(this._client, this._path + '/tags');
}
/**
* GET on TenantClient
*/
TenantClient.prototype.GET = function (opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
_this._client.request(_this._client, 'get', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* HEAD on TenantClient
*/
TenantClient.prototype.HEAD = function (opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
_this._client.request(_this._client, 'head', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* DELETE on TenantClient
*/
TenantClient.prototype.DELETE = function (opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
_this._client.request(_this._client, 'delete', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
return TenantClient;
}());
Tenant.TenantClient = TenantClient;
(function (TenantClient) {
// createResource - TenantClientData
var TenantClientData = (function () {
function TenantClientData(client, path) {
this._client = client;
this._path = path;
}
// createProtoResources - Resource: TenantClientData
TenantClientData.prototype.type = function (type) { return new Tenant.TenantClient.TenantClientData.TenantClientDataType(this._client, this._path + template('/{type}', extend({}, { type: type }))); };
return TenantClientData;
}());
TenantClient.TenantClientData = TenantClientData;
(function (TenantClientData) {
// createResource - TenantClientDataType
var TenantClientDataType = (function () {
function TenantClientDataType(client, path) {
this._client = client;
this._path = path;
}
// createProtoResources - Resource: TenantClientDataType
TenantClientDataType.prototype.dataId = function (dataId) { return new Tenant.TenantClient.TenantClientData.TenantClientDataType.TenantClientDataTypeDataId(this._client, this._path + template('/{dataId}', extend({}, { dataId: dataId }))); };
/**
* HEAD on TenantClientDataType
*/
TenantClientDataType.prototype.HEAD = function (q, opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
if (q !== undefined && q !== null)
options.query['q'] = q;
_this._client.request(_this._client, 'head', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* GET on TenantClientDataType
*/
TenantClientDataType.prototype.GET = function (text, scoreField, language, caseSensitive, diacriticSensitive, fetchAll, fields, totalCount, pageNumber, pageSize, sort, q, opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
if (text !== undefined && text !== null)
options.query['text'] = text;
if (scoreField !== undefined && scoreField !== null)
options.query['scoreField'] = scoreField;
if (language !== undefined && language !== null)
options.query['language'] = language;
if (caseSensitive !== undefined && caseSensitive !== null)
options.query['caseSensitive'] = caseSensitive;
if (diacriticSensitive !== undefined && diacriticSensitive !== null)
options.query['diacriticSensitive'] = diacriticSensitive;
if (fetchAll !== undefined && fetchAll !== null)
options.query['fetchAll'] = fetchAll;
if (fields !== undefined && fields !== null)
options.query['fields'] = fields;
if (totalCount !== undefined && totalCount !== null)
options.query['totalCount'] = totalCount;
if (pageNumber !== undefined && pageNumber < 1) {
observer.error('Parameter \'pageNumber\' outside specified range!');
return;
}
if (pageNumber !== undefined && pageNumber !== null)
options.query['pageNumber'] = pageNumber;
if (pageSize !== undefined && pageSize < 1) {
observer.error('Parameter \'pageSize\' outside specified range!');
return;
}
if (pageSize !== undefined && pageSize !== null)
options.query['pageSize'] = pageSize;
if (sort !== undefined && sort !== null)
options.query['sort'] = sort;
if (q !== undefined && q !== null)
options.query['q'] = q;
_this._client.request(_this._client, 'get', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* POST on TenantClientDataType
*/
TenantClientDataType.prototype.POST = function (body /* Implicitly defined schemas not yet supported */, rawwrite, opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
if (rawwrite !== undefined && rawwrite !== null)
options.query['rawwrite'] = rawwrite;
options.body = body;
_this._client.request(_this._client, 'post', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* DELETE on TenantClientDataType
*/
TenantClientDataType.prototype.DELETE = function (q, drop, opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
if (q !== undefined && q !== null)
options.query['q'] = q;
if (drop !== undefined && drop !== null)
options.query['drop'] = drop;
_this._client.request(_this._client, 'delete', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* PUT on TenantClientDataType
*/
TenantClientDataType.prototype.PUT = function (body /* Implicitly defined schemas not yet supported */, q, opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
if (q !== undefined && q !== null)
options.query['q'] = q;
options.body = body;
_this._client.request(_this._client, 'put', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
return TenantClientDataType;
}());
TenantClientData.TenantClientDataType = TenantClientDataType;
(function (TenantClientDataType) {
// createResource - TenantClientDataTypeDataId
var TenantClientDataTypeDataId = (function () {
function TenantClientDataTypeDataId(client, path) {
this._client = client;
this._path = path;
}
// createProtoResources - Resource: TenantClientDataTypeDataId
TenantClientDataTypeDataId.prototype.attributeName = function (attributeName) { return new Tenant.TenantClient.TenantClientData.TenantClientDataType.TenantClientDataTypeDataId.TenantClientDataTypeDataIdAttributeName(this._client, this._path + template('/{attributeName}', extend({}, { attributeName: attributeName }))); };
/**
* GET on TenantClientDataTypeDataId
*/
TenantClientDataTypeDataId.prototype.GET = function (fields, opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
if (fields !== undefined && fields !== null)
options.query['fields'] = fields;
_this._client.request(_this._client, 'get', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* HEAD on TenantClientDataTypeDataId
*/
TenantClientDataTypeDataId.prototype.HEAD = function (fields, opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
if (fields !== undefined && fields !== null)
options.query['fields'] = fields;
_this._client.request(_this._client, 'head', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* POST on TenantClientDataTypeDataId
*/
TenantClientDataTypeDataId.prototype.POST = function (body /* Implicitly defined schemas not yet supported */, opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
options.body = body;
_this._client.request(_this._client, 'post', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* PUT on TenantClientDataTypeDataId
*/
TenantClientDataTypeDataId.prototype.PUT = function (body /* Implicitly defined schemas not yet supported */, upsert, patch, partial, version, opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
if (upsert !== undefined && upsert !== null)
options.query['upsert'] = upsert;
if (patch !== undefined && patch !== null)
options.query['patch'] = patch;
if (partial !== undefined && partial !== null)
options.query['partial'] = partial;
if (version !== undefined && version !== null)
options.query['version'] = version;
options.body = body;
_this._client.request(_this._client, 'put', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* DELETE on TenantClientDataTypeDataId
*/
TenantClientDataTypeDataId.prototype.DELETE = function (version, opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
if (version !== undefined && version !== null)
options.query['version'] = version;
_this._client.request(_this._client, 'delete', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
return TenantClientDataTypeDataId;
}());
TenantClientDataType.TenantClientDataTypeDataId = TenantClientDataTypeDataId;
(function (TenantClientDataTypeDataId) {
// createResource - TenantClientDataTypeDataIdAttributeName
var TenantClientDataTypeDataIdAttributeName = (function () {
function TenantClientDataTypeDataIdAttributeName(client, path) {
this._client = client;
this._path = path;
}
// createProtoResources - Resource: TenantClientDataTypeDataIdAttributeName
TenantClientDataTypeDataIdAttributeName.prototype.index = function (index) { return new Tenant.TenantClient.TenantClientData.TenantClientDataType.TenantClientDataTypeDataId.TenantClientDataTypeDataIdAttributeName.TenantClientDataTypeDataIdAttributeNameIndex(this._client, this._path + template('/{index}', extend({}, { index: index }))); };
/**
* POST on TenantClientDataTypeDataIdAttributeName
*/
TenantClientDataTypeDataIdAttributeName.prototype.POST = function (body, version, opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
if (version !== undefined && version !== null)
options.query['version'] = version;
options.body = body;
_this._client.request(_this._client, 'post', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* DELETE on TenantClientDataTypeDataIdAttributeName
*/
TenantClientDataTypeDataIdAttributeName.prototype.DELETE = function (version, opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
if (version !== undefined && version !== null)
options.query['version'] = version;
_this._client.request(_this._client, 'delete', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
return TenantClientDataTypeDataIdAttributeName;
}());
TenantClientDataTypeDataId.TenantClientDataTypeDataIdAttributeName = TenantClientDataTypeDataIdAttributeName;
(function (TenantClientDataTypeDataIdAttributeName) {
// createResource - TenantClientDataTypeDataIdAttributeNameIndex
var TenantClientDataTypeDataIdAttributeNameIndex = (function () {
function TenantClientDataTypeDataIdAttributeNameIndex(client, path) {
this._client = client;
this._path = path;
}
/**
* GET on TenantClientDataTypeDataIdAttributeNameIndex
*/
TenantClientDataTypeDataIdAttributeNameIndex.prototype.GET = function (opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
_this._client.request(_this._client, 'get', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* HEAD on TenantClientDataTypeDataIdAttributeNameIndex
*/
TenantClientDataTypeDataIdAttributeNameIndex.prototype.HEAD = function (opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
_this._client.request(_this._client, 'head', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* PUT on TenantClientDataTypeDataIdAttributeNameIndex
*/
TenantClientDataTypeDataIdAttributeNameIndex.prototype.PUT = function (body, compact, version, opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
if (compact !== undefined && compact !== null)
options.query['compact'] = compact;
if (version !== undefined && version !== null)
options.query['version'] = version;
options.body = body;
_this._client.request(_this._client, 'put', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* DELETE on TenantClientDataTypeDataIdAttributeNameIndex
*/
TenantClientDataTypeDataIdAttributeNameIndex.prototype.DELETE = function (compact, version, opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
if (compact !== undefined && compact !== null)
options.query['compact'] = compact;
if (version !== undefined && version !== null)
options.query['version'] = version;
_this._client.request(_this._client, 'delete', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
return TenantClientDataTypeDataIdAttributeNameIndex;
}());
TenantClientDataTypeDataIdAttributeName.TenantClientDataTypeDataIdAttributeNameIndex = TenantClientDataTypeDataIdAttributeNameIndex;
})(TenantClientDataTypeDataIdAttributeName = TenantClientDataTypeDataId.TenantClientDataTypeDataIdAttributeName || (TenantClientDataTypeDataId.TenantClientDataTypeDataIdAttributeName = {}));
})(TenantClientDataTypeDataId = TenantClientDataType.TenantClientDataTypeDataId || (TenantClientDataType.TenantClientDataTypeDataId = {}));
})(TenantClientDataType = TenantClientData.TenantClientDataType || (TenantClientData.TenantClientDataType = {}));
})(TenantClientData = TenantClient.TenantClientData || (TenantClient.TenantClientData = {}));
// createResource - TenantClientAggr
var TenantClientAggr = (function () {
function TenantClientAggr(client, path) {
this._client = client;
this._path = path;
}
// createProtoResources - Resource: TenantClientAggr
TenantClientAggr.prototype.type = function (type) { return new Tenant.TenantClient.TenantClientAggr.TenantClientAggrType(this._client, this._path + template('/{type}', extend({}, { type: type }))); };
return TenantClientAggr;
}());
TenantClient.TenantClientAggr = TenantClientAggr;
(function (TenantClientAggr) {
// createResource - TenantClientAggrType
var TenantClientAggrType = (function () {
function TenantClientAggrType(client, path) {
this._client = client;
this._path = path;
}
/**
* HEAD on TenantClientAggrType
*/
TenantClientAggrType.prototype.HEAD = function (opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
_this._client.request(_this._client, 'head', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* GET on TenantClientAggrType
*/
TenantClientAggrType.prototype.GET = function (sum, avg, count, opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
if (sum !== undefined && sum !== null)
options.query['sum'] = sum;
if (avg !== undefined && avg !== null)
options.query['avg'] = avg;
if (count !== undefined && count !== null)
options.query['count'] = count;
_this._client.request(_this._client, 'get', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
return TenantClientAggrType;
}());
TenantClientAggr.TenantClientAggrType = TenantClientAggrType;
})(TenantClientAggr = TenantClient.TenantClientAggr || (TenantClient.TenantClientAggr = {}));
// createResource - TenantClientIndexes
var TenantClientIndexes = (function () {
function TenantClientIndexes(client, path) {
this._client = client;
this._path = path;
}
// createProtoResources - Resource: TenantClientIndexes
TenantClientIndexes.prototype.type = function (type) { return new Tenant.TenantClient.TenantClientIndexes.TenantClientIndexesType(this._client, this._path + template('/{type}', extend({}, { type: type }))); };
return TenantClientIndexes;
}());
TenantClient.TenantClientIndexes = TenantClientIndexes;
(function (TenantClientIndexes) {
// createResource - TenantClientIndexesType
var TenantClientIndexesType = (function () {
function TenantClientIndexesType(client, path) {
this._client = client;
this._path = path;
}
// createProtoResources - Resource: TenantClientIndexesType
TenantClientIndexesType.prototype.name = function (name) { return new Tenant.TenantClient.TenantClientIndexes.TenantClientIndexesType.TenantClientIndexesTypeName(this._client, this._path + template('/{name}', extend({}, { name: name }))); };
/**
* GET on TenantClientIndexesType
*/
TenantClientIndexesType.prototype.GET = function (opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
_this._client.request(_this._client, 'get', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* HEAD on TenantClientIndexesType
*/
TenantClientIndexesType.prototype.HEAD = function (opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
_this._client.request(_this._client, 'head', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* POST on TenantClientIndexesType
*/
TenantClientIndexesType.prototype.POST = function (body /* Implicitly defined schemas not yet supported */, opts) {
var _this = this;
return rxjs_1.Observable.create(function (observer) {
var options = extend({ query: {}, headers: {} }, opts);
options.body = body;
_this._client.request(_this._client, 'post', _this._path, options)
.use(popsicle.plugins.parse('json'))
.then(function (response) {
var r = { headers: response.headers, responseCode: response.status, bodyRaw: response.body };
r["_" + response.status] = response.body;
observer.next(r);
observer.complete();
});
});
};
/**
* DELETE on TenantClientIndexesType
*/
TenantClientIndexesType.prototype.DE