UNPKG

@finbourne/lusid-sdk-angular6

Version:

An angular (6+) SDK for secure access to the LUSID® by FINBOURNE web API

1,098 lines (1,089 loc) 2.49 MB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common/http'), require('@angular/core')) : typeof define === 'function' && define.amd ? define('@finbourne/lusid-sdk-angular6', ['exports', '@angular/common/http', '@angular/core'], factory) : (factory((global.finbourne = global.finbourne || {}, global.finbourne['lusid-sdk-angular6'] = {}),global.ng.common.http,global.ng.core)); }(this, (function (exports,http,core) { 'use strict'; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ /* global Reflect, Promise */ var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } function __values(o) { var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; if (m) return m.call(o); return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; } /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc */ /** * CustomHttpUrlEncodingCodec * Fix plus sign (+) not encoding, so sent as blank space * See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 */ var /** * CustomHttpUrlEncodingCodec * Fix plus sign (+) not encoding, so sent as blank space * See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 */ CustomHttpUrlEncodingCodec = (function (_super) { __extends(CustomHttpUrlEncodingCodec, _super); function CustomHttpUrlEncodingCodec() { return _super !== null && _super.apply(this, arguments) || this; } /** * @param {?} k * @return {?} */ CustomHttpUrlEncodingCodec.prototype.encodeKey = /** * @param {?} k * @return {?} */ function (k) { k = _super.prototype.encodeKey.call(this, k); return k.replace(/\+/gi, '%2B'); }; /** * @param {?} v * @return {?} */ CustomHttpUrlEncodingCodec.prototype.encodeValue = /** * @param {?} v * @return {?} */ function (v) { v = _super.prototype.encodeValue.call(this, v); return v.replace(/\+/gi, '%2B'); }; return CustomHttpUrlEncodingCodec; }(http.HttpUrlEncodingCodec)); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc */ /** @type {?} */ var BASE_PATH = new core.InjectionToken('basePath'); /** @type {?} */ var COLLECTION_FORMATS = { 'csv': ',', 'tsv': ' ', 'ssv': ' ', 'pipes': '|' }; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc */ var Configuration = (function () { function Configuration(configurationParameters) { if (configurationParameters === void 0) { configurationParameters = {}; } this.apiKeys = configurationParameters.apiKeys; this.username = configurationParameters.username; this.password = configurationParameters.password; this.accessToken = configurationParameters.accessToken; this.basePath = configurationParameters.basePath; this.withCredentials = configurationParameters.withCredentials; } /** * Select the correct content-type to use for a request. * Uses {\@link Configuration#isJsonMime} to determine the correct content-type. * If no content type is found return the first found type if the contentTypes is not empty * @param {?} contentTypes - the array of content types that are available for selection * @return {?} the selected content-type or <code>undefined</code> if no selection could be made. */ Configuration.prototype.selectHeaderContentType = /** * Select the correct content-type to use for a request. * Uses {\@link Configuration#isJsonMime} to determine the correct content-type. * If no content type is found return the first found type if the contentTypes is not empty * @param {?} contentTypes - the array of content types that are available for selection * @return {?} the selected content-type or <code>undefined</code> if no selection could be made. */ function (contentTypes) { var _this = this; if (contentTypes.length == 0) { return undefined; } /** @type {?} */ var type = contentTypes.find(function (x) { return _this.isJsonMime(x); }); if (type === undefined) { return contentTypes[0]; } return type; }; /** * Select the correct accept content-type to use for a request. * Uses {\@link Configuration#isJsonMime} to determine the correct accept content-type. * If no content type is found return the first found type if the contentTypes is not empty * @param {?} accepts - the array of content types that are available for selection. * @return {?} the selected content-type or <code>undefined</code> if no selection could be made. */ Configuration.prototype.selectHeaderAccept = /** * Select the correct accept content-type to use for a request. * Uses {\@link Configuration#isJsonMime} to determine the correct accept content-type. * If no content type is found return the first found type if the contentTypes is not empty * @param {?} accepts - the array of content types that are available for selection. * @return {?} the selected content-type or <code>undefined</code> if no selection could be made. */ function (accepts) { var _this = this; if (accepts.length == 0) { return undefined; } /** @type {?} */ var type = accepts.find(function (x) { return _this.isJsonMime(x); }); if (type === undefined) { return accepts[0]; } return type; }; /** * Check if the given MIME is a JSON MIME. * JSON MIME examples: * application/json * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json * @param {?} mime - MIME (Multipurpose Internet Mail Extensions) * @return {?} True if the given MIME is JSON, false otherwise. */ Configuration.prototype.isJsonMime = /** * Check if the given MIME is a JSON MIME. * JSON MIME examples: * application/json * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json * @param {?} mime - MIME (Multipurpose Internet Mail Extensions) * @return {?} True if the given MIME is JSON, false otherwise. */ function (mime) { /** @type {?} */ var jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); }; return Configuration; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc */ var AggregationService = (function () { function AggregationService(httpClient, basePath, configuration) { this.httpClient = httpClient; this.basePath = 'https://localhost'; this.defaultHeaders = new http.HttpHeaders(); this.configuration = new Configuration(); if (basePath) { this.basePath = basePath; } if (configuration) { this.configuration = configuration; this.basePath = basePath || configuration.basePath || this.basePath; } } /** * @param {?} consumes string[] mime-types * @return {?} true: consumes contains 'multipart/form-data', false: otherwise */ AggregationService.prototype.canConsumeForm = /** * @param {?} consumes string[] mime-types * @return {?} true: consumes contains 'multipart/form-data', false: otherwise */ function (consumes) { /** @type {?} */ var form = 'multipart/form-data'; try { for (var consumes_1 = __values(consumes), consumes_1_1 = consumes_1.next(); !consumes_1_1.done; consumes_1_1 = consumes_1.next()) { var consume = consumes_1_1.value; if (form === consume) { return true; } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (consumes_1_1 && !consumes_1_1.done && (_a = consumes_1.return)) _a.call(consumes_1); } finally { if (e_1) throw e_1.error; } } return false; var e_1, _a; }; /** * @param {?} scope * @param {?} code * @param {?=} request * @param {?=} sortBy * @param {?=} start * @param {?=} limit * @param {?=} observe * @param {?=} reportProgress * @return {?} */ AggregationService.prototype.getAggregationByGroup = /** * @param {?} scope * @param {?} code * @param {?=} request * @param {?=} sortBy * @param {?=} start * @param {?=} limit * @param {?=} observe * @param {?=} reportProgress * @return {?} */ function (scope, code, request, sortBy, start, limit, observe, reportProgress) { if (observe === void 0) { observe = 'body'; } if (reportProgress === void 0) { reportProgress = false; } if (scope === null || scope === undefined) { throw new Error('Required parameter scope was null or undefined when calling getAggregationByGroup.'); } if (code === null || code === undefined) { throw new Error('Required parameter code was null or undefined when calling getAggregationByGroup.'); } /** @type {?} */ var queryParameters = new http.HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (sortBy) { sortBy.forEach(function (element) { queryParameters = queryParameters.append('sortBy', /** @type {?} */ (element)); }); } if (start !== undefined && start !== null) { queryParameters = queryParameters.set('start', /** @type {?} */ (start)); } if (limit !== undefined && limit !== null) { queryParameters = queryParameters.set('limit', /** @type {?} */ (limit)); } /** @type {?} */ var headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ var accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ var httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ var httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } /** @type {?} */ var consumes = [ 'application/json-patch+json', 'application/json', 'text/json', 'application/_*+json' ]; /** @type {?} */ var httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected != undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } return this.httpClient.post(this.basePath + "/api/portfoliogroups/" + encodeURIComponent(String(scope)) + "/" + encodeURIComponent(String(code)) + "/$aggregate", request, { params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); }; /** * @param {?} scope * @param {?} code * @param {?=} request * @param {?=} sortBy * @param {?=} start * @param {?=} limit * @param {?=} observe * @param {?=} reportProgress * @return {?} */ AggregationService.prototype.getAggregationByPortfolio = /** * @param {?} scope * @param {?} code * @param {?=} request * @param {?=} sortBy * @param {?=} start * @param {?=} limit * @param {?=} observe * @param {?=} reportProgress * @return {?} */ function (scope, code, request, sortBy, start, limit, observe, reportProgress) { if (observe === void 0) { observe = 'body'; } if (reportProgress === void 0) { reportProgress = false; } if (scope === null || scope === undefined) { throw new Error('Required parameter scope was null or undefined when calling getAggregationByPortfolio.'); } if (code === null || code === undefined) { throw new Error('Required parameter code was null or undefined when calling getAggregationByPortfolio.'); } /** @type {?} */ var queryParameters = new http.HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (sortBy) { sortBy.forEach(function (element) { queryParameters = queryParameters.append('sortBy', /** @type {?} */ (element)); }); } if (start !== undefined && start !== null) { queryParameters = queryParameters.set('start', /** @type {?} */ (start)); } if (limit !== undefined && limit !== null) { queryParameters = queryParameters.set('limit', /** @type {?} */ (limit)); } /** @type {?} */ var headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ var accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ var httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ var httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } /** @type {?} */ var consumes = [ 'application/json-patch+json', 'application/json', 'text/json', 'application/_*+json' ]; /** @type {?} */ var httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected != undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } return this.httpClient.post(this.basePath + "/api/portfolios/" + encodeURIComponent(String(scope)) + "/" + encodeURIComponent(String(code)) + "/$aggregate", request, { params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); }; /** * @param {?} scope * @param {?} resultsKey * @param {?=} request * @param {?=} sortBy * @param {?=} start * @param {?=} limit * @param {?=} observe * @param {?=} reportProgress * @return {?} */ AggregationService.prototype.getAggregationByResultSet = /** * @param {?} scope * @param {?} resultsKey * @param {?=} request * @param {?=} sortBy * @param {?=} start * @param {?=} limit * @param {?=} observe * @param {?=} reportProgress * @return {?} */ function (scope, resultsKey, request, sortBy, start, limit, observe, reportProgress) { if (observe === void 0) { observe = 'body'; } if (reportProgress === void 0) { reportProgress = false; } if (scope === null || scope === undefined) { throw new Error('Required parameter scope was null or undefined when calling getAggregationByResultSet.'); } if (resultsKey === null || resultsKey === undefined) { throw new Error('Required parameter resultsKey was null or undefined when calling getAggregationByResultSet.'); } /** @type {?} */ var queryParameters = new http.HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (sortBy) { sortBy.forEach(function (element) { queryParameters = queryParameters.append('sortBy', /** @type {?} */ (element)); }); } if (start !== undefined && start !== null) { queryParameters = queryParameters.set('start', /** @type {?} */ (start)); } if (limit !== undefined && limit !== null) { queryParameters = queryParameters.set('limit', /** @type {?} */ (limit)); } /** @type {?} */ var headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ var accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ var httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ var httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } /** @type {?} */ var consumes = [ 'application/json-patch+json', 'application/json', 'text/json', 'application/_*+json' ]; /** @type {?} */ var httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected != undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } return this.httpClient.post(this.basePath + "/api/results/" + encodeURIComponent(String(scope)) + "/" + encodeURIComponent(String(resultsKey)) + "/$aggregate", request, { params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); }; /** * @param {?} scope * @param {?} code * @param {?=} request * @param {?=} observe * @param {?=} reportProgress * @return {?} */ AggregationService.prototype.getNestedAggregationByGroup = /** * @param {?} scope * @param {?} code * @param {?=} request * @param {?=} observe * @param {?=} reportProgress * @return {?} */ function (scope, code, request, observe, reportProgress) { if (observe === void 0) { observe = 'body'; } if (reportProgress === void 0) { reportProgress = false; } if (scope === null || scope === undefined) { throw new Error('Required parameter scope was null or undefined when calling getNestedAggregationByGroup.'); } if (code === null || code === undefined) { throw new Error('Required parameter code was null or undefined when calling getNestedAggregationByGroup.'); } /** @type {?} */ var headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ var accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ var httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ var httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } /** @type {?} */ var consumes = [ 'application/json-patch+json', 'application/json', 'text/json', 'application/_*+json' ]; /** @type {?} */ var httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected != undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } return this.httpClient.post(this.basePath + "/api/portfoliogroups/" + encodeURIComponent(String(scope)) + "/" + encodeURIComponent(String(code)) + "/$aggregatenested", request, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); }; AggregationService.decorators = [ { type: core.Injectable } ]; /** @nocollapse */ AggregationService.ctorParameters = function () { return [ { type: http.HttpClient }, { type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [BASE_PATH,] }] }, { type: Configuration, decorators: [{ type: core.Optional }] } ]; }; return AggregationService; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc */ var AnalyticsStoresService = (function () { function AnalyticsStoresService(httpClient, basePath, configuration) { this.httpClient = httpClient; this.basePath = 'https://localhost'; this.defaultHeaders = new http.HttpHeaders(); this.configuration = new Configuration(); if (basePath) { this.basePath = basePath; } if (configuration) { this.configuration = configuration; this.basePath = basePath || configuration.basePath || this.basePath; } } /** * @param {?} consumes string[] mime-types * @return {?} true: consumes contains 'multipart/form-data', false: otherwise */ AnalyticsStoresService.prototype.canConsumeForm = /** * @param {?} consumes string[] mime-types * @return {?} true: consumes contains 'multipart/form-data', false: otherwise */ function (consumes) { /** @type {?} */ var form = 'multipart/form-data'; try { for (var consumes_1 = __values(consumes), consumes_1_1 = consumes_1.next(); !consumes_1_1.done; consumes_1_1 = consumes_1.next()) { var consume = consumes_1_1.value; if (form === consume) { return true; } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (consumes_1_1 && !consumes_1_1.done && (_a = consumes_1.return)) _a.call(consumes_1); } finally { if (e_1) throw e_1.error; } } return false; var e_1, _a; }; /** * @param {?=} request * @param {?=} observe * @param {?=} reportProgress * @return {?} */ AnalyticsStoresService.prototype.createAnalyticStore = /** * @param {?=} request * @param {?=} observe * @param {?=} reportProgress * @return {?} */ function (request, observe, reportProgress) { if (observe === void 0) { observe = 'body'; } if (reportProgress === void 0) { reportProgress = false; } /** @type {?} */ var headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ var accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ var httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ var httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } /** @type {?} */ var consumes = [ 'application/json-patch+json', 'application/json', 'text/json', 'application/_*+json' ]; /** @type {?} */ var httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected != undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } return this.httpClient.post(this.basePath + "/api/analytics", request, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); }; /** * @param {?} scope * @param {?} year * @param {?} month * @param {?} day * @param {?=} observe * @param {?=} reportProgress * @return {?} */ AnalyticsStoresService.prototype.deleteAnalyticStore = /** * @param {?} scope * @param {?} year * @param {?} month * @param {?} day * @param {?=} observe * @param {?=} reportProgress * @return {?} */ function (scope, year, month, day, observe, reportProgress) { if (observe === void 0) { observe = 'body'; } if (reportProgress === void 0) { reportProgress = false; } if (scope === null || scope === undefined) { throw new Error('Required parameter scope was null or undefined when calling deleteAnalyticStore.'); } if (year === null || year === undefined) { throw new Error('Required parameter year was null or undefined when calling deleteAnalyticStore.'); } if (month === null || month === undefined) { throw new Error('Required parameter month was null or undefined when calling deleteAnalyticStore.'); } if (day === null || day === undefined) { throw new Error('Required parameter day was null or undefined when calling deleteAnalyticStore.'); } /** @type {?} */ var headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ var accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ var httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ var httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.delete(this.basePath + "/api/analytics/" + encodeURIComponent(String(scope)) + "/" + encodeURIComponent(String(year)) + "/" + encodeURIComponent(String(month)) + "/" + encodeURIComponent(String(day)), { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); }; /** * @param {?} scope * @param {?} year * @param {?} month * @param {?} day * @param {?=} asAt * @param {?=} observe * @param {?=} reportProgress * @return {?} */ AnalyticsStoresService.prototype.getAnalyticStore = /** * @param {?} scope * @param {?} year * @param {?} month * @param {?} day * @param {?=} asAt * @param {?=} observe * @param {?=} reportProgress * @return {?} */ function (scope, year, month, day, asAt, observe, reportProgress) { if (observe === void 0) { observe = 'body'; } if (reportProgress === void 0) { reportProgress = false; } if (scope === null || scope === undefined) { throw new Error('Required parameter scope was null or undefined when calling getAnalyticStore.'); } if (year === null || year === undefined) { throw new Error('Required parameter year was null or undefined when calling getAnalyticStore.'); } if (month === null || month === undefined) { throw new Error('Required parameter month was null or undefined when calling getAnalyticStore.'); } if (day === null || day === undefined) { throw new Error('Required parameter day was null or undefined when calling getAnalyticStore.'); } /** @type {?} */ var queryParameters = new http.HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (asAt !== undefined && asAt !== null) { queryParameters = queryParameters.set('asAt', /** @type {?} */ (asAt.toISOString())); } /** @type {?} */ var headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ var accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ var httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ var httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.get(this.basePath + "/api/analytics/" + encodeURIComponent(String(scope)) + "/" + encodeURIComponent(String(year)) + "/" + encodeURIComponent(String(month)) + "/" + encodeURIComponent(String(day)), { params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); }; /** * @param {?=} asAt * @param {?=} sortBy * @param {?=} start * @param {?=} limit * @param {?=} filter * @param {?=} observe * @param {?=} reportProgress * @return {?} */ AnalyticsStoresService.prototype.listAnalyticStores = /** * @param {?=} asAt * @param {?=} sortBy * @param {?=} start * @param {?=} limit * @param {?=} filter * @param {?=} observe * @param {?=} reportProgress * @return {?} */ function (asAt, sortBy, start, limit, filter, observe, reportProgress) { if (observe === void 0) { observe = 'body'; } if (reportProgress === void 0) { reportProgress = false; } /** @type {?} */ var queryParameters = new http.HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (asAt !== undefined && asAt !== null) { queryParameters = queryParameters.set('asAt', /** @type {?} */ (asAt.toISOString())); } if (sortBy) { sortBy.forEach(function (element) { queryParameters = queryParameters.append('sortBy', /** @type {?} */ (element)); }); } if (start !== undefined && start !== null) { queryParameters = queryParameters.set('start', /** @type {?} */ (start)); } if (limit !== undefined && limit !== null) { queryParameters = queryParameters.set('limit', /** @type {?} */ (limit)); } if (filter !== undefined && filter !== null) { queryParameters = queryParameters.set('filter', /** @type {?} */ (filter)); } /** @type {?} */ var headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ var accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ var httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ var httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.get(this.basePath + "/api/analytics", { params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); }; /** * @param {?} scope * @param {?} year * @param {?} month * @param {?} day * @param {?=} data * @param {?=} observe * @param {?=} reportProgress * @return {?} */ AnalyticsStoresService.prototype.setAnalytics = /** * @param {?} scope * @param {?} year * @param {?} month * @param {?} day * @param {?=} data * @param {?=} observe * @param {?=} reportProgress * @return {?} */ function (scope, year, month, day, data, observe, reportProgress) { if (observe === void 0) { observe = 'body'; } if (reportProgress === void 0) { reportProgress = false; } if (scope === null || scope === undefined) { throw new Error('Required parameter scope was null or undefined when calling setAnalytics.'); } if (year === null || year === undefined) { throw new Error('Required parameter year was null or undefined when calling setAnalytics.'); } if (month === null || month === undefined) { throw new Error('Required parameter month was null or undefined when calling setAnalytics.'); } if (day === null || day === undefined) { throw new Error('Required parameter day was null or undefined when calling setAnalytics.'); } /** @type {?} */ var headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ var accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ var httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ var httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } /** @type {?} */ var consumes = [ 'application/json-patch+json', 'application/json', 'text/json', 'application/_*+json' ]; /** @type {?} */ var httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected != undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } return this.httpClient.put(this.basePath + "/api/analytics/" + encodeURIComponent(String(scope)) + "/" + encodeURIComponent(String(year)) + "/" + encodeURIComponent(String(month)) + "/" + encodeURIComponent(String(day)) + "/prices", data, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); }; AnalyticsStoresService.decorators = [ { type: core.Injectable } ]; /** @nocollapse */ AnalyticsStoresService.ctorParameters = function () { return [ { type: http.HttpClient }, { type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [BASE_PATH,] }] }, { type: Configuration, decorators: [{ type: core.Optional }] } ]; }; return AnalyticsStoresService; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc */ var ApplicationMetadataService = (function () { function ApplicationMetadataService(httpClient, basePath, configuration) { this.httpClient = httpClient; this.basePath = 'https://localhost'; this.defaultHeaders = new http.HttpHeaders(); this.configuration = new Configuration(); if (basePath) { this.basePath = basePath; } if (configuration) { this.configuration = configuration; this.basePath = basePath || configuration.basePath || this.basePath; } } /** * @param {?} consumes string[] mime-types * @return {?} true: consumes contains 'multipart/form-data', false: otherwise */ ApplicationMetadataService.prototype.canConsumeForm = /** * @param {?} consumes string[] mime-types * @return {?} true: consumes contains 'multipart/form-data', false: otherwise */ function (consumes) { /** @type {?} */ var form = 'multipart/form-data'; try { for (var consumes_1 = __values(consumes), consumes_1_1 = consumes_1.next(); !consumes_1_1.done; consumes_1_1 = consumes_1.next()) { var consume = consumes_1_1.value; if (form === consume) { return true; } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (consumes_1_1 && !consumes_1_1.done && (_a = consumes_1.return)) _a.call(consumes_1); } finally { if (e_1) throw e_1.error; } } return false; var e_1, _a; }; /** * @param {?=} version * @param {?=} observe * @param {?=} reportProgress * @return {?} */ ApplicationMetadataService.prototype.getExcelAddin = /** * @param {?=} version * @param {?=} observe * @param {?=} reportProgress * @return {?} */ function (version, observe, reportProgress) { if (observe === void 0) { observe = 'body'; } if (reportProgress === void 0) { reportProgress = false; } /** @type {?} */ var queryParameters = new http.HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (