Repository URL to install this package:
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Motif License Management Service API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0.0
* Contact: info@vipera.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable:no-unused-variable member-ordering */
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { CustomHttpUrlEncodingCodec } from '../encoder';
import { WC_API_BASE_PATH } from 'web-console-core';
import { Configuration } from '../configuration';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common/http";
import * as i2 from "web-console-core";
import * as i3 from "../configuration";
export class LicenseService {
/**
* @param {?} httpClient
* @param {?} basePath
* @param {?} configuration
*/
constructor(httpClient, basePath, configuration) {
this.httpClient = httpClient;
this.basePath = 'http://localhost:8080/rest/v2';
this.defaultHeaders = new HttpHeaders();
this.configuration = new Configuration();
if (configuration) {
this.configuration = configuration;
this.configuration.basePath = configuration.basePath || basePath || this.basePath;
}
else {
this.configuration.basePath = basePath || this.basePath;
}
}
/**
* @private
* @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 {?} productName
* @param {?} productVersion
* @param {?=} observe
* @param {?=} reportProgress
* @return {?}
*/
deleteLicense(productName, productVersion, observe = 'body', reportProgress = false) {
if (productName === null || productName === undefined) {
throw new Error('Required parameter productName was null or undefined when calling deleteLicense.');
}
if (productVersion === null || productVersion === undefined) {
throw new Error('Required parameter productVersion was null or undefined when calling deleteLicense.');
}
/** @type {?} */
let headers = this.defaultHeaders;
// authentication (vipera_basic) required
if (this.configuration.username || this.configuration.password) {
headers = headers.set('Authorization', 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password));
}
// authentication (vipera_cookie) required
// authentication (vipera_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);
}
// to determine the Accept header
/** @type {?} */
const httpHeaderAccepts = [
'application/json'
];
/** @type {?} */
const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
headers = headers.set('Accept', httpHeaderAcceptSelected);
}
// to determine the Content-Type header
/** @type {?} */
const consumes = [];
return this.httpClient.delete(`${this.configuration.basePath}/licenses/${encodeURIComponent(String(productName))}/${encodeURIComponent(String(productVersion))}`, {
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
});
}
/**
* @param {?=} observe
* @param {?=} reportProgress
* @return {?}
*/
listLicenses(observe = 'body', reportProgress = false) {
/** @type {?} */
let headers = this.defaultHeaders;
// authentication (vipera_basic) required
if (this.configuration.username || this.configuration.password) {
headers = headers.set('Authorization', 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password));
}
// authentication (vipera_cookie) required
// authentication (vipera_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);
}
// to determine the Accept header
/** @type {?} */
const httpHeaderAccepts = [
'application/json'
];
/** @type {?} */
const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
headers = headers.set('Accept', httpHeaderAcceptSelected);
}
// to determine the Content-Type header
/** @type {?} */
const consumes = [];
return this.httpClient.get(`${this.configuration.basePath}/licenses`, {
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
});
}
/**
* @param {?} file
* @param {?=} observe
* @param {?=} reportProgress
* @return {?}
*/
uploadLicense(file, observe = 'body', reportProgress = false) {
if (file === null || file === undefined) {
throw new Error('Required parameter file was null or undefined when calling uploadLicense.');
}
/** @type {?} */
let headers = this.defaultHeaders;
// authentication (vipera_basic) required
if (this.configuration.username || this.configuration.password) {
headers = headers.set('Authorization', 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password));
}
// authentication (vipera_cookie) required
// authentication (vipera_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);
}
// to determine the Accept header
/** @type {?} */
const httpHeaderAccepts = [
'application/json'
];
/** @type {?} */
const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
headers = headers.set('Accept', httpHeaderAcceptSelected);
}
// to determine the Content-Type header
/** @type {?} */
const consumes = [
'multipart/form-data'
];
/** @type {?} */
const canConsumeForm = this.canConsumeForm(consumes);
/** @type {?} */
let formParams;
/** @type {?} */
let useForm = false;
/** @type {?} */
let convertFormParamsToString = false;
// use FormData to transmit files using content-type "multipart/form-data"
// see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data
useForm = canConsumeForm;
if (useForm) {
formParams = new FormData();
}
else {
formParams = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() });
}
if (file !== undefined) {
formParams = (/** @type {?} */ (formParams.append('file', (/** @type {?} */ (file))))) || formParams;
}
return this.httpClient.put(`${this.configuration.basePath}/licenses`, convertFormParamsToString ? formParams.toString() : formParams, {
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
});
}
/**
* @param {?=} observe
* @param {?=} reportProgress
* @return {?}
*/
validateLicense(observe = 'body', reportProgress = false) {
/** @type {?} */
let headers = this.defaultHeaders;
// authentication (vipera_basic) required
if (this.configuration.username || this.configuration.password) {
headers = headers.set('Authorization', 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password));
}
// authentication (vipera_cookie) required
// authentication (vipera_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);
}
// to determine the Accept header
/** @type {?} */
const httpHeaderAccepts = [
'application/json'
];
/** @type {?} */
const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
headers = headers.set('Accept', httpHeaderAcceptSelected);
}
// to determine the Content-Type header
/** @type {?} */
const consumes = [];
return this.httpClient.get(`${this.configuration.basePath}/licenses/validate`, {
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
});
}
}
LicenseService.decorators = [
{ type: Injectable, args: [{
providedIn: 'root'
},] }
];
/** @nocollapse */
LicenseService.ctorParameters = () => [
{ type: HttpClient },
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [WC_API_BASE_PATH,] }] },
{ type: Configuration, decorators: [{ type: Optional }] }
];
/** @nocollapse */ LicenseService.ngInjectableDef = i0.defineInjectable({ factory: function LicenseService_Factory() { return new LicenseService(i0.inject(i1.HttpClient), i0.inject(i2.WC_API_BASE_PATH, 8), i0.inject(i3.Configuration, 8)); }, token: LicenseService, providedIn: "root" });
if (false) {
/**
* @type {?}
* @protected
*/
LicenseService.prototype.basePath;
/** @type {?} */
LicenseService.prototype.defaultHeaders;
/** @type {?} */
LicenseService.prototype.configuration;
/**
* @type {?}
* @protected
*/
LicenseService.prototype.httpClient;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGljZW5zZS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHdhLW1vdGlmLW9wZW4tYXBpL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