UNPKG

@finbourne/lusid-sdk-angular6

Version:

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

1,249 lines (1,241 loc) 2.51 MB
import { HttpUrlEncodingCodec, HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { InjectionToken, Inject, Injectable, Optional, NgModule, SkipSelf } from '@angular/core'; /** * @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 */ class CustomHttpUrlEncodingCodec extends HttpUrlEncodingCodec { /** * @param {?} k * @return {?} */ encodeKey(k) { k = super.encodeKey(k); return k.replace(/\+/gi, '%2B'); } /** * @param {?} v * @return {?} */ encodeValue(v) { v = super.encodeValue(v); return v.replace(/\+/gi, '%2B'); } } /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc */ /** @type {?} */ const BASE_PATH = new InjectionToken('basePath'); /** @type {?} */ const COLLECTION_FORMATS = { 'csv': ',', 'tsv': ' ', 'ssv': ' ', 'pipes': '|' }; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc */ class Configuration { /** * @param {?=} configurationParameters */ constructor(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. */ selectHeaderContentType(contentTypes) { if (contentTypes.length == 0) { return undefined; } /** @type {?} */ let type = contentTypes.find(x => 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. */ selectHeaderAccept(accepts) { if (accepts.length == 0) { return undefined; } /** @type {?} */ let type = accepts.find(x => 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. */ isJsonMime(mime) { /** @type {?} */ const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } } /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc */ class AggregationService { /** * @param {?} httpClient * @param {?} basePath * @param {?} configuration */ constructor(httpClient, basePath, configuration) { this.httpClient = httpClient; this.basePath = 'https://localhost'; this.defaultHeaders = new 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 */ canConsumeForm(consumes) { /** @type {?} */ const form = 'multipart/form-data'; for (const consume of consumes) { if (form === consume) { return true; } } return false; } /** * @param {?} scope * @param {?} code * @param {?=} request * @param {?=} sortBy * @param {?=} start * @param {?=} limit * @param {?=} observe * @param {?=} reportProgress * @return {?} */ getAggregationByGroup(scope, code, request, sortBy, start, limit, observe = 'body', 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 {?} */ let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (sortBy) { sortBy.forEach((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 {?} */ let headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ let httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } /** @type {?} */ const consumes = [ 'application/json-patch+json', 'application/json', 'text/json', 'application/_*+json' ]; /** @type {?} */ const 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 {?} */ getAggregationByPortfolio(scope, code, request, sortBy, start, limit, observe = 'body', 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 {?} */ let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (sortBy) { sortBy.forEach((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 {?} */ let headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ let httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } /** @type {?} */ const consumes = [ 'application/json-patch+json', 'application/json', 'text/json', 'application/_*+json' ]; /** @type {?} */ const 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 {?} */ getAggregationByResultSet(scope, resultsKey, request, sortBy, start, limit, observe = 'body', 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 {?} */ let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (sortBy) { sortBy.forEach((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 {?} */ let headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ let httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } /** @type {?} */ const consumes = [ 'application/json-patch+json', 'application/json', 'text/json', 'application/_*+json' ]; /** @type {?} */ const 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 {?} */ getNestedAggregationByGroup(scope, code, request, observe = 'body', 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 {?} */ let headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ let httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } /** @type {?} */ const consumes = [ 'application/json-patch+json', 'application/json', 'text/json', 'application/_*+json' ]; /** @type {?} */ const 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: Injectable } ]; /** @nocollapse */ AggregationService.ctorParameters = () => [ { type: HttpClient }, { type: String, decorators: [{ type: Optional }, { type: Inject, args: [BASE_PATH,] }] }, { type: Configuration, decorators: [{ type: Optional }] } ]; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc */ class AnalyticsStoresService { /** * @param {?} httpClient * @param {?} basePath * @param {?} configuration */ constructor(httpClient, basePath, configuration) { this.httpClient = httpClient; this.basePath = 'https://localhost'; this.defaultHeaders = new 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 */ canConsumeForm(consumes) { /** @type {?} */ const form = 'multipart/form-data'; for (const consume of consumes) { if (form === consume) { return true; } } return false; } /** * @param {?=} request * @param {?=} observe * @param {?=} reportProgress * @return {?} */ createAnalyticStore(request, observe = 'body', reportProgress = false) { /** @type {?} */ let headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ let httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } /** @type {?} */ const consumes = [ 'application/json-patch+json', 'application/json', 'text/json', 'application/_*+json' ]; /** @type {?} */ const 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 {?} */ deleteAnalyticStore(scope, year, month, day, observe = 'body', 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 {?} */ let headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ let httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ const 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 {?} */ getAnalyticStore(scope, year, month, day, asAt, observe = 'body', 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 {?} */ let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (asAt !== undefined && asAt !== null) { queryParameters = queryParameters.set('asAt', /** @type {?} */ (asAt.toISOString())); } /** @type {?} */ let headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ let httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ const 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 {?} */ listAnalyticStores(asAt, sortBy, start, limit, filter, observe = 'body', reportProgress = false) { /** @type {?} */ let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (asAt !== undefined && asAt !== null) { queryParameters = queryParameters.set('asAt', /** @type {?} */ (asAt.toISOString())); } if (sortBy) { sortBy.forEach((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 {?} */ let headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ let httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ const 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 {?} */ setAnalytics(scope, year, month, day, data, observe = 'body', 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 {?} */ let headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ let httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } /** @type {?} */ const consumes = [ 'application/json-patch+json', 'application/json', 'text/json', 'application/_*+json' ]; /** @type {?} */ const 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: Injectable } ]; /** @nocollapse */ AnalyticsStoresService.ctorParameters = () => [ { type: HttpClient }, { type: String, decorators: [{ type: Optional }, { type: Inject, args: [BASE_PATH,] }] }, { type: Configuration, decorators: [{ type: Optional }] } ]; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc */ class ApplicationMetadataService { /** * @param {?} httpClient * @param {?} basePath * @param {?} configuration */ constructor(httpClient, basePath, configuration) { this.httpClient = httpClient; this.basePath = 'https://localhost'; this.defaultHeaders = new 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 */ canConsumeForm(consumes) { /** @type {?} */ const form = 'multipart/form-data'; for (const consume of consumes) { if (form === consume) { return true; } } return false; } /** * @param {?=} version * @param {?=} observe * @param {?=} reportProgress * @return {?} */ getExcelAddin(version, observe = 'body', reportProgress = false) { /** @type {?} */ let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (version !== undefined && version !== null) { queryParameters = queryParameters.set('version', /** @type {?} */ (version)); } /** @type {?} */ let headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ let httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.get(`${this.basePath}/api/metadata/downloads/exceladdin`, { params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); } /** * @param {?=} version * @param {?=} observe * @param {?=} reportProgress * @return {?} */ getExcelDownloadUrl(version, observe = 'body', reportProgress = false) { /** @type {?} */ let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (version !== undefined && version !== null) { queryParameters = queryParameters.set('version', /** @type {?} */ (version)); } /** @type {?} */ let headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ let httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.get(`${this.basePath}/api/metadata/downloads/excel`, { params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); } /** * @param {?=} observe * @param {?=} reportProgress * @return {?} */ getLusidVersions(observe = 'body', reportProgress = false) { /** @type {?} */ let headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ let httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.get(`${this.basePath}/api/metadata/versions`, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); } } ApplicationMetadataService.decorators = [ { type: Injectable } ]; /** @nocollapse */ ApplicationMetadataService.ctorParameters = () => [ { type: HttpClient }, { type: String, decorators: [{ type: Optional }, { type: Inject, args: [BASE_PATH,] }] }, { type: Configuration, decorators: [{ type: Optional }] } ]; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc */ class CorporateActionsService { /** * @param {?} httpClient * @param {?} basePath * @param {?} configuration */ constructor(httpClient, basePath, configuration) { this.httpClient = httpClient; this.basePath = 'https://localhost'; this.defaultHeaders = new 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 */ canConsumeForm(consumes) { /** @type {?} */ const form = 'multipart/form-data'; for (const consume of consumes) { if (form === consume) { return true; } } return false; } /** * @param {?} scope * @param {?} code * @param {?=} actions * @param {?=} observe * @param {?=} reportProgress * @return {?} */ batchUpsertCorporateActions(scope, code, actions, observe = 'body', reportProgress = false) { if (scope === null || scope === undefined) { throw new Error('Required parameter scope was null or undefined when calling batchUpsertCorporateActions.'); } if (code === null || code === undefined) { throw new Error('Required parameter code was null or undefined when calling batchUpsertCorporateActions.'); } /** @type {?} */ let headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ let httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } /** @type {?} */ const consumes = [ 'application/json-patch+json', 'application/json', 'text/json', 'application/_*+json' ]; /** @type {?} */ const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected != undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } return this.httpClient.post(`${this.basePath}/api/corporateactions/${encodeURIComponent(String(scope))}/${encodeURIComponent(String(code))}`, actions, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); } /** * @param {?} scope * @param {?} code * @param {?=} effectiveAt * @param {?=} asAt * @param {?=} sortBy * @param {?=} start * @param {?=} limit * @param {?=} filter * @param {?=} observe * @param {?=} reportProgress * @return {?} */ getCorporateActions(scope, code, effectiveAt, asAt, sortBy, start, limit, filter, observe = 'body', reportProgress = false) { if (scope === null || scope === undefined) { throw new Error('Required parameter scope was null or undefined when calling getCorporateActions.'); } if (code === null || code === undefined) { throw new Error('Required parameter code was null or undefined when calling getCorporateActions.'); } /** @type {?} */ let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (effectiveAt !== undefined && effectiveAt !== null) { queryParameters = queryParameters.set('effectiveAt', /** @type {?} */ (effectiveAt.toISOString())); } if (asAt !== undefined && asAt !== null) { queryParameters = queryParameters.set('asAt', /** @type {?} */ (asAt.toISOString())); } if (sortBy) { sortBy.forEach((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 {?} */ let headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ let httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.get(`${this.basePath}/api/corporateactions/${encodeURIComponent(String(scope))}/${encodeURIComponent(String(code))}`, { params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); } } CorporateActionsService.decorators = [ { type: Injectable } ]; /** @nocollapse */ CorporateActionsService.ctorParameters = () => [ { type: HttpClient }, { type: String, decorators: [{ type: Optional }, { type: Inject, args: [BASE_PATH,] }] }, { type: Configuration, decorators: [{ type: Optional }] } ]; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc */ class DataTypesService { /** * @param {?} httpClient * @param {?} basePath * @param {?} configuration */ constructor(httpClient, basePath, configuration) { this.httpClient = httpClient; this.basePath = 'https://localhost'; this.defaultHeaders = new 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 */ canConsumeForm(consumes) { /** @type {?} */ const form = 'multipart/form-data'; for (const consume of consumes) { if (form === consume) { return true; } } return false; } /** * @param {?=} request * @param {?=} observe * @param {?=} reportProgress * @return {?} */ createDataType(request, observe = 'body', reportProgress = false) { /** @type {?} */ let headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ let httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } /** @type {?} */ const consumes = [ 'application/json-patch+json', 'application/json', 'text/json', 'application/_*+json' ]; /** @type {?} */ const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected != undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } return this.httpClient.post(`${this.basePath}/api/datatypes`, request, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); } /** * @param {?} scope * @param {?} code * @param {?=} observe * @param {?=} reportProgress * @return {?} */ getDataType(scope, code, observe = 'body', reportProgress = false) { if (scope === null || scope === undefined) { throw new Error('Required parameter scope was null or undefined when calling getDataType.'); } if (code === null || code === undefined) { throw new Error('Required parameter code was null or undefined when calling getDataType.'); } /** @type {?} */ let headers = this.defaultHeaders; // authentication (oauth2) required if (this.configuration.accessToken) { /** @type {?} */ const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } /** @type {?} */ let httpHeaderAccepts = [ 'text/plain', 'application/json', 'text/json' ]; /** @type {?} */ const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.get(`${this.basePath}/api/datatypes/${encodeURIComponent(String(scope))}/${encodeURIComponent(String(code))}`, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); } /** * @param {?} scope * @param {?} code * @param {?=} units * @param {?=} filter * @param {?=} observe * @param {?=} reportProgress * @return {?} */ getUnitsFromDataType(scope, code, units, filter, observe = 'body', reportProgress = false) { if (scope === null || scope === undefined) { throw new Error('Required parameter scope was null or undefined when calling getUnitsFromDataType.'); } if (code === null || code === undefined) { throw new Error('Required parameter code was null or undefined when calling getUnitsFromDataType.'); } /** @type {?} */ let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (units) { units.forEach((element) => { queryParameters = queryParameters.append('units', /** @type {?} */ (element)); }); } if (filter !== undefined && filter !== null) { queryParameters = queryParameters.set('filter', /** @type {?} */ (filter)); } /** @type {?} */ let headers = this