Repository URL to install this package:
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Motif Context 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 } 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 ValuesService {
/**
* @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 {?} domain
* @param {?} application
* @param {?} context
* @param {?=} valueCreate
* @param {?=} observe
* @param {?=} reportProgress
* @return {?}
*/
createValue(domain, application, context, valueCreate, observe = 'body', reportProgress = false) {
if (domain === null || domain === undefined) {
throw new Error('Required parameter domain was null or undefined when calling createValue.');
}
if (application === null || application === undefined) {
throw new Error('Required parameter application was null or undefined when calling createValue.');
}
if (context === null || context === undefined) {
throw new Error('Required parameter context was null or undefined when calling createValue.');
}
/** @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}/contextservice/domains/${encodeURIComponent(String(domain))}/applications/${encodeURIComponent(String(application))}/contexts/${encodeURIComponent(String(context))}/attributes`, valueCreate, {
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
});
}
/**
* @param {?} domain
* @param {?} application
* @param {?} context
* @param {?} attribute
* @param {?=} observe
* @param {?=} reportProgress
* @return {?}
*/
deleteValue(domain, application, context, attribute, observe = 'body', reportProgress = false) {
if (domain === null || domain === undefined) {
throw new Error('Required parameter domain was null or undefined when calling deleteValue.');
}
if (application === null || application === undefined) {
throw new Error('Required parameter application was null or undefined when calling deleteValue.');
}
if (context === null || context === undefined) {
throw new Error('Required parameter context was null or undefined when calling deleteValue.');
}
if (attribute === null || attribute === undefined) {
throw new Error('Required parameter attribute was null or undefined when calling deleteValue.');
}
/** @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}/contextservice/domains/${encodeURIComponent(String(domain))}/applications/${encodeURIComponent(String(application))}/contexts/${encodeURIComponent(String(context))}/attributes/${encodeURIComponent(String(attribute))}`, {
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
});
}
/**
* @param {?} domain
* @param {?} application
* @param {?} context
* @param {?} attribute
* @param {?=} observe
* @param {?=} reportProgress
* @return {?}
*/
getValue(domain, application, context, attribute, observe = 'body', reportProgress = false) {
if (domain === null || domain === undefined) {
throw new Error('Required parameter domain was null or undefined when calling getValue.');
}
if (application === null || application === undefined) {
throw new Error('Required parameter application was null or undefined when calling getValue.');
}
if (context === null || context === undefined) {
throw new Error('Required parameter context was null or undefined when calling getValue.');
}
if (attribute === null || attribute === undefined) {
throw new Error('Required parameter attribute was null or undefined when calling getValue.');
}
/** @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}/contextservice/domains/${encodeURIComponent(String(domain))}/applications/${encodeURIComponent(String(application))}/contexts/${encodeURIComponent(String(context))}/attributes/${encodeURIComponent(String(attribute))}`, {
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
});
}
/**
* @param {?} domain
* @param {?} application
* @param {?} context
* @param {?=} observe
* @param {?=} reportProgress
* @return {?}
*/
getValues(domain, application, context, observe = 'body', reportProgress = false) {
if (domain === null || domain === undefined) {
throw new Error('Required parameter domain was null or undefined when calling getValues.');
}
if (application === null || application === undefined) {
throw new Error('Required parameter application was null or undefined when calling getValues.');
}
if (context === null || context === undefined) {
throw new Error('Required parameter context was null or undefined when calling getValues.');
}
/** @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}/contextservice/domains/${encodeURIComponent(String(domain))}/applications/${encodeURIComponent(String(application))}/contexts/${encodeURIComponent(String(context))}/attributes`, {
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
});
}
/**
* @param {?} domain
* @param {?} application
* @param {?} context
* @param {?} attribute
* @param {?=} value
* @param {?=} observe
* @param {?=} reportProgress
* @return {?}
*/
updateValue(domain, application, context, attribute, value, observe = 'body', reportProgress = false) {
if (domain === null || domain === undefined) {
throw new Error('Required parameter domain was null or undefined when calling updateValue.');
}
if (application === null || application === undefined) {
throw new Error('Required parameter application was null or undefined when calling updateValue.');
}
if (context === null || context === undefined) {
throw new Error('Required parameter context was null or undefined when calling updateValue.');
}
if (attribute === null || attribute === undefined) {
throw new Error('Required parameter attribute was null or undefined when calling updateValue.');
}
/** @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}/contextservice/domains/${encodeURIComponent(String(domain))}/applications/${encodeURIComponent(String(application))}/contexts/${encodeURIComponent(String(context))}/attributes/${encodeURIComponent(String(attribute))}`, value, {
Loading ...