Repository URL to install this package:
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import * as tslib_1 from "tslib";
/**
* Motif Messaging 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";
var MsgService = /** @class */ (function () {
function MsgService(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;
}
}
/**
* @param consumes string[] mime-types
* @return true: consumes contains 'multipart/form-data', false: otherwise
*/
/**
* @private
* @param {?} consumes string[] mime-types
* @return {?} true: consumes contains 'multipart/form-data', false: otherwise
*/
MsgService.prototype.canConsumeForm = /**
* @private
* @param {?} consumes string[] mime-types
* @return {?} true: consumes contains 'multipart/form-data', false: otherwise
*/
function (consumes) {
var e_1, _a;
/** @type {?} */
var form = 'multipart/form-data';
try {
for (var consumes_1 = tslib_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;
};
/**
* @param {?=} sendData
* @param {?=} observe
* @param {?=} reportProgress
* @return {?}
*/
MsgService.prototype.send = /**
* @param {?=} sendData
* @param {?=} observe
* @param {?=} reportProgress
* @return {?}
*/
function (sendData, observe, reportProgress) {
if (observe === void 0) { observe = 'body'; }
if (reportProgress === void 0) { reportProgress = false; }
/** @type {?} */
var 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 {?} */
var accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken()
: this.configuration.accessToken;
headers = headers.set('Authorization', 'Bearer ' + accessToken);
}
// to determine the Accept header
/** @type {?} */
var httpHeaderAccepts = [
'application/json'
];
/** @type {?} */
var httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
headers = headers.set('Accept', httpHeaderAcceptSelected);
}
// to determine the Content-Type header
/** @type {?} */
var consumes = [
'application/json'
];
/** @type {?} */
var httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
headers = headers.set('Content-Type', httpContentTypeSelected);
}
return this.httpClient.post(this.configuration.basePath + "/msgs/send", sendData, {
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
});
};
MsgService.decorators = [
{ type: Injectable, args: [{
providedIn: 'root'
},] }
];
/** @nocollapse */
MsgService.ctorParameters = function () { return [
{ type: HttpClient },
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [WC_API_BASE_PATH,] }] },
{ type: Configuration, decorators: [{ type: Optional }] }
]; };
/** @nocollapse */ MsgService.ngInjectableDef = i0.defineInjectable({ factory: function MsgService_Factory() { return new MsgService(i0.inject(i1.HttpClient), i0.inject(i2.WC_API_BASE_PATH, 8), i0.inject(i3.Configuration, 8)); }, token: MsgService, providedIn: "root" });
return MsgService;
}());
export { MsgService };
if (false) {
/**
* @type {?}
* @protected
*/
MsgService.prototype.basePath;
/** @type {?} */
MsgService.prototype.defaultHeaders;
/** @type {?} */
MsgService.prototype.configuration;
/**
* @type {?}
* @protected
*/
MsgService.prototype.httpClient;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibXNnLnNlcnZpY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Ad2EtbW90aWYtb3Blbi1hcGkvbWVzc2FnaW5nLXNlcnZpY2UvIiwic291cmNlcyI6WyJsaWIvYXBpL21zZy5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBYUEsT0FBTyxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsUUFBUSxFQUFFLE1BQTJCLGVBQWUsQ0FBQztBQUNsRixPQUFPLEVBQUUsVUFBVSxFQUFFLFdBQVcsRUFDRSxNQUFnQyxzQkFBc0IsQ0FBQztBQVN6RixPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUNwRCxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQTBDLGtCQUFrQixDQUFDOzs7OztBQUlyRjtJQVNJLG9CQUFzQixVQUFzQixFQUF1QyxRQUFnQixFQUFjLGFBQTRCO1FBQXZILGVBQVUsR0FBVixVQUFVLENBQVk7UUFKbEMsYUFBUSxHQUFHLCtCQUErQixDQUFDO1FBQzlDLG1CQUFjLEdBQUcsSUFBSSxXQUFXLEVBQUUsQ0FBQztRQUNuQyxrQkFBYSxHQUFHLElBQUksYUFBYSxFQUFFLENBQUM7UUFJdkMsSUFBSSxhQUFhLEVBQUU7WUFDZixJQUFJLENBQUMsYUFBYSxHQUFHLGFBQWEsQ0FBQztZQUNuQyxJQ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ICAgICAgIGlmIChodHRwQ29udGVudFR5cGVTZWxlY3RlZCAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICBoZWFkZXJzID0gaGVhZGVycy5zZXQoJ0NvbnRlbnQtVHlwZScsIGh0dHBDb250ZW50VHlwZVNlbGVjdGVkKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0aGlzLmh0dHBDbGllbnQucG9zdDxTbXNDcmVhdGVkPihgJHt0aGlzLmNvbmZpZ3VyYXRpb24uYmFzZVBhdGh9L21zZ3Mvc2VuZGAsXG4gICAgICAgICAgICBzZW5kRGF0YSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB3aXRoQ3JlZGVudGlhbHM6IHRoaXMuY29uZmlndXJhdGlvbi53aXRoQ3JlZGVudGlhbHMsXG4gICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcbiAgICAgICAgICAgICAgICBvYnNlcnZlOiBvYnNlcnZlLFxuICAgICAgICAgICAgICAgIHJlcG9ydFByb2dyZXNzOiByZXBvcnRQcm9ncmVzc1xuICAgICAgICAgICAgfVxuICAgICAgICApO1xuICAgIH1cblxufVxuIl19