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/catalog-service   js

Repository URL to install this package:

Version: 0.6.0 

/ esm5 / lib / api / applications.service.js

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import * as tslib_1 from "tslib";
/**
 * 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";
var ApplicationsService = /** @class */ (function () {
    function ApplicationsService(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
     */
    ApplicationsService.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 {?} application
     * @param {?} property
     * @param {?=} observe
     * @param {?=} reportProgress
     * @return {?}
     */
    ApplicationsService.prototype.getApplicationProperty = /**
     * @param {?} domain
     * @param {?} application
     * @param {?} property
     * @param {?=} observe
     * @param {?=} reportProgress
     * @return {?}
     */
    function (domain, application, property, 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 getApplicationProperty.');
        }
        if (application === null || application === undefined) {
            throw new Error('Required parameter application was null or undefined when calling getApplicationProperty.');
        }
        if (property === null || property === undefined) {
            throw new Error('Required parameter property was null or undefined when calling getApplicationProperty.');
        }
        /** @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.get(this.configuration.basePath + "/catalog/domains/" + encodeURIComponent(String(domain)) + "/applications/" + encodeURIComponent(String(application)) + "/properties/" + encodeURIComponent(String(property)), {
            withCredentials: this.configuration.withCredentials,
            headers: headers,
            observe: observe,
            reportProgress: reportProgress
        });
    };
    /**
     * @param {?} domain
     * @param {?} application
     * @param {?=} observe
     * @param {?=} reportProgress
     * @return {?}
     */
    ApplicationsService.prototype.getServiceList = /**
     * @param {?} domain
     * @param {?} application
     * @param {?=} observe
     * @param {?=} reportProgress
     * @return {?}
     */
    function (domain, application, 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 getServiceList.');
        }
        if (application === null || application === undefined) {
            throw new Error('Required parameter application was null or undefined when calling getServiceList.');
        }
        /** @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.get(this.configuration.basePath + "/catalog/domains/" + encodeURIComponent(String(domain)) + "/applications/" + encodeURIComponent(String(application)) + "/services", {
            withCredentials: this.configuration.withCredentials,
            headers: headers,
            observe: observe,
            reportProgress: reportProgress
        });
    };
    ApplicationsService.decorators = [
        { type: Injectable, args: [{
                    providedIn: 'root'
                },] }
    ];
    /** @nocollapse */
    ApplicationsService.ctorParameters = function () { return [
        { type: HttpClient },
        { type: String, decorators: [{ type: Optional }, { type: Inject, args: [WC_API_BASE_PATH,] }] },
        { type: Configuration, decorators: [{ type: Optional }] }
    ]; };
    /** @nocollapse */ ApplicationsService.ngInjectableDef = i0.defineInjectable({ factory: function ApplicationsService_Factory() { return new ApplicationsService(i0.inject(i1.HttpClient), i0.inject(i2.WC_API_BASE_PATH, 8), i0.inject(i3.Configuration, 8)); }, token: ApplicationsService, providedIn: "root" });
    return ApplicationsService;
}());
export { ApplicationsService };
if (false) {
    /**
     * @type {?}
     * @protected
     */
    ApplicationsService.prototype.basePath;
    /** @type {?} */
    ApplicationsService.prototype.defaultHeaders;
    /** @type {?} */
    ApplicationsService.prototype.configuration;
    /**
     * @type {?}
     * @protected
     */
    ApplicationsService.prototype.httpClient;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwbGljYXRpb25zLnNlcnZpY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Ad2EtbW90aWYtb3Blbi1hcGkvY2F0YWxvZy1zZXJ2aWNlLyIsInNvdXJjZXMiOlsibGliL2FwaS9hcHBsaWNhdGlvbnMuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7OztBQWFBLE9BQU8sRUFBRSxNQUFNLEVBQUUsVUFBVSxFQUFFLFFBQVEsRUFBRSxNQUEyQixlQUFlLENBQUM7QUFDbEYsT0FBTyxFQUFFLFVBQVUsRUFBRSxXQUFXLEVBQ0UsTUFBZ0Msc0JBQXNCLENBQUM7QUFTekYsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDcEQsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUEw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