Repository URL to install this package:
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Motif Service Catalog 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 } from '@angular/common/http';
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 ServicesService {
/**
* @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 {?} channel
* @param {?} domain
* @param {?} application
* @param {?=} serviceCreate
* @param {?=} observe
* @param {?=} reportProgress
* @return {?}
*/
createService(channel, domain, application, serviceCreate, observe = 'body', reportProgress = false) {
if (channel === null || channel === undefined) {
throw new Error('Required parameter channel was null or undefined when calling createService.');
}
if (domain === null || domain === undefined) {
throw new Error('Required parameter domain was null or undefined when calling createService.');
}
if (application === null || application === undefined) {
throw new Error('Required parameter application was null or undefined when calling createService.');
}
/** @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 = [
'application/json'
];
/** @type {?} */
const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
headers = headers.set('Content-Type', httpContentTypeSelected);
}
return this.httpClient.post(`${this.configuration.basePath}/catalog/channels/${encodeURIComponent(String(channel))}/domains/${encodeURIComponent(String(domain))}/applications/${encodeURIComponent(String(application))}/services`, serviceCreate, {
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
});
}
/**
* @param {?} channel
* @param {?} domain
* @param {?} application
* @param {?} service
* @param {?=} observe
* @param {?=} reportProgress
* @return {?}
*/
deleteService(channel, domain, application, service, observe = 'body', reportProgress = false) {
if (channel === null || channel === undefined) {
throw new Error('Required parameter channel was null or undefined when calling deleteService.');
}
if (domain === null || domain === undefined) {
throw new Error('Required parameter domain was null or undefined when calling deleteService.');
}
if (application === null || application === undefined) {
throw new Error('Required parameter application was null or undefined when calling deleteService.');
}
if (service === null || service === undefined) {
throw new Error('Required parameter service was null or undefined when calling deleteService.');
}
/** @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}/catalog/channels/${encodeURIComponent(String(channel))}/domains/${encodeURIComponent(String(domain))}/applications/${encodeURIComponent(String(application))}/services/${encodeURIComponent(String(service))}`, {
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
});
}
/**
* @param {?} channel
* @param {?} domain
* @param {?} application
* @param {?} service
* @param {?=} observe
* @param {?=} reportProgress
* @return {?}
*/
getService(channel, domain, application, service, observe = 'body', reportProgress = false) {
if (channel === null || channel === undefined) {
throw new Error('Required parameter channel was null or undefined when calling getService.');
}
if (domain === null || domain === undefined) {
throw new Error('Required parameter domain was null or undefined when calling getService.');
}
if (application === null || application === undefined) {
throw new Error('Required parameter application was null or undefined when calling getService.');
}
if (service === null || service === undefined) {
throw new Error('Required parameter service was null or undefined when calling getService.');
}
/** @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}/catalog/channels/${encodeURIComponent(String(channel))}/domains/${encodeURIComponent(String(domain))}/applications/${encodeURIComponent(String(application))}/services/${encodeURIComponent(String(service))}`, {
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
});
}
/**
* @param {?} channel
* @param {?} domain
* @param {?} application
* @param {?} service
* @param {?=} serviceUpdate
* @param {?=} observe
* @param {?=} reportProgress
* @return {?}
*/
updateService(channel, domain, application, service, serviceUpdate, observe = 'body', reportProgress = false) {
if (channel === null || channel === undefined) {
throw new Error('Required parameter channel was null or undefined when calling updateService.');
}
if (domain === null || domain === undefined) {
throw new Error('Required parameter domain was null or undefined when calling updateService.');
}
if (application === null || application === undefined) {
throw new Error('Required parameter application was null or undefined when calling updateService.');
}
if (service === null || service === undefined) {
throw new Error('Required parameter service was null or undefined when calling updateService.');
}
/** @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 = [
'application/json'
];
/** @type {?} */
const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
headers = headers.set('Content-Type', httpContentTypeSelected);
}
return this.httpClient.put(`${this.configuration.basePath}/catalog/channels/${encodeURIComponent(String(channel))}/domains/${encodeURIComponent(String(domain))}/applications/${encodeURIComponent(String(application))}/services/${encodeURIComponent(String(service))}`, serviceUpdate, {
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
});
}
}
ServicesService.decorators = [
{ type: Injectable, args: [{
providedIn: 'root'
},] }
];
/** @nocollapse */
ServicesService.ctorParameters = () => [
{ type: HttpClient },
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [WC_API_BASE_PATH,] }] },
{ type: Configuration, decorators: [{ type: Optional }] }
];
/** @nocollapse */ ServicesService.ngInjectableDef = i0.defineInjectable({ factory: function ServicesService_Factory() { return new ServicesService(i0.inject(i1.HttpClient), i0.inject(i2.WC_API_BASE_PATH, 8), i0.inject(i3.Configuration, 8)); }, token: ServicesService, providedIn: "root" });
if (false) {
/**
* @type {?}
* @protected
*/
ServicesService.prototype.basePath;
/** @type {?} */
ServicesService.prototype.defaultHeaders;
/** @type {?} */
ServicesService.prototype.configuration;
/**
* @type {?}
* @protected
*/
ServicesService.prototype.httpClient;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmljZXMuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B3YS1tb3RpZi1vcGVuLWFwaS9jYXRhbG9nLXNlcnZpY2UvIiwic291cmNlcyI6WyJsaWIvYXBpL3NlcnZpY2VzLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQWFBLE9BQU8sRUFBRSxNQUFNLEVBQUUsVUFBVSxFQUFFLFFBQVEsRUFBRSxNQUEyQixlQUFlLENBQUM7QUFDbEYsT0FBTyxFQUFFLFVBQVUsRU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