Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

vipera-npm-registry / @wa-motif-open-api/backend-controller-service   js

Repository URL to install this package:

Version: 0.6.0 

/ esm5 / lib / api / backendctrl.service.js

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import * as tslib_1 from "tslib";
/**
 * Motif Backend Controller 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 BackendctrlService = /** @class */ (function () {
    function BackendctrlService(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
     */
    BackendctrlService.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 {?} domain
     * @param {?} userId
     * @param {?=} observe
     * @param {?=} reportProgress
     * @return {?}
     */
    BackendctrlService.prototype.blockUser = /**
     * @param {?} domain
     * @param {?} userId
     * @param {?=} observe
     * @param {?=} reportProgress
     * @return {?}
     */
    function (domain, userId, observe, reportProgress) {
        if (observe === void 0) { observe = 'body'; }
        if (reportProgress === void 0) { reportProgress = false; }
        if (domain === null || domain === undefined) {
            throw new Error('Required parameter domain was null or undefined when calling blockUser.');
        }
        if (userId === null || userId === undefined) {
            throw new Error('Required parameter userId was null or undefined when calling blockUser.');
        }
        /** @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 = [];
        return this.httpClient.post(this.configuration.basePath + "/bectrl/domains/" + encodeURIComponent(String(domain)) + "/users/" + encodeURIComponent(String(userId)) + "/block", null, {
            withCredentials: this.configuration.withCredentials,
            headers: headers,
            observe: observe,
            reportProgress: reportProgress
        });
    };
    /**
     * @param {?} domain
     * @param {?=} userCreate
     * @param {?=} observe
     * @param {?=} reportProgress
     * @return {?}
     */
    BackendctrlService.prototype.createUser = /**
     * @param {?} domain
     * @param {?=} userCreate
     * @param {?=} observe
     * @param {?=} reportProgress
     * @return {?}
     */
    function (domain, userCreate, observe, reportProgress) {
        if (observe === void 0) { observe = 'body'; }
        if (reportProgress === void 0) { reportProgress = false; }
        if (domain === null || domain === undefined) {
            throw new Error('Required parameter domain was null or undefined when calling createUser.');
        }
        /** @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 + "/bectrl/domains/" + encodeURIComponent(String(domain)) + "/users", userCreate, {
            withCredentials: this.configuration.withCredentials,
            headers: headers,
            observe: observe,
            reportProgress: reportProgress
        });
    };
    /**
     * @param {?} domain
     * @param {?} userId
     * @param {?=} observe
     * @param {?=} reportProgress
     * @return {?}
     */
    BackendctrlService.prototype.reactivateUser = /**
     * @param {?} domain
     * @param {?} userId
     * @param {?=} observe
     * @param {?=} reportProgress
     * @return {?}
     */
    function (domain, userId, observe, reportProgress) {
        if (observe === void 0) { observe = 'body'; }
        if (reportProgress === void 0) { reportProgress = false; }
        if (domain === null || domain === undefined) {
            throw new Error('Required parameter domain was null or undefined when calling reactivateUser.');
        }
        if (userId === null || userId === undefined) {
            throw new Error('Required parameter userId was null or undefined when calling reactivateUser.');
        }
        /** @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 = [];
        return this.httpClient.post(this.configuration.basePath + "/bectrl/domains/" + encodeURIComponent(String(domain)) + "/users/" + encodeURIComponent(String(userId)) + "/reactivate", null, {
            withCredentials: this.configuration.withCredentials,
            headers: headers,
            observe: observe,
            reportProgress: reportProgress
        });
    };
    /**
     * @param {?} domain
     * @param {?} userId
     * @param {?=} userUpdate
     * @param {?=} observe
     * @param {?=} reportProgress
     * @return {?}
     */
    BackendctrlService.prototype.updateUser = /**
     * @param {?} domain
     * @param {?} userId
     * @param {?=} userUpdate
     * @param {?=} observe
     * @param {?=} reportProgress
     * @return {?}
     */
    function (domain, userId, userUpdate, observe, reportProgress) {
        if (observe === void 0) { observe = 'body'; }
        if (reportProgress === void 0) { reportProgress = false; }
        if (domain === null || domain === undefined) {
            throw new Error('Required parameter domain was null or undefined when calling updateUser.');
        }
        if (userId === null || userId === undefined) {
            throw new Error('Required parameter userId was null or undefined when calling updateUser.');
        }
        /** @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.put(this.configuration.basePath + "/bectrl/domains/" + encodeURIComponent(String(domain)) + "/users/" + encodeURIComponent(String(userId)), userUpdate, {
            withCredentials: this.configuration.withCredentials,
            headers: headers,
            observe: observe,
            reportProgress: reportProgress
        });
    };
    BackendctrlService.decorators = [
        { type: Injectable, args: [{
                    providedIn: 'root'
                },] }
    ];
    /** @nocollapse */
    BackendctrlService.ctorParameters = function () { return [
        { type: HttpClient },
        { type: String, decorators: [{ type: Optional }, { type: Inject, args: [WC_API_BASE_PATH,] }] },
        { type: Configuration, decorators: [{ type: Optional }] }
    ]; };
    /** @nocollapse */ BackendctrlService.ngInjectableDef = i0.defineInjectable({ factory: function BackendctrlService_Factory() { return new BackendctrlService(i0.inject(i1.HttpClient), i0.inject(i2.WC_API_BASE_PATH, 8), i0.inject(i3.Configuration, 8)); }, token: BackendctrlService, providedIn: "root" });
    return BackendctrlService;
}());
export { BackendctrlService };
if (false) {
    /**
     * @type {?}
     * @protected
     */
    BackendctrlService.prototype.basePath;
    /** @type {?} */
    BackendctrlService.prototype.defaultHeaders;
    /** @type {?} */
    BackendctrlService.prototype.configuration;
    /**
Loading ...