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 

/ esm2015 / lib / api / applications.service.js

/**
 * @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 ApplicationsService {
    /**
     * @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 {?} property
     * @param {?=} observe
     * @param {?=} reportProgress
     * @return {?}
     */
    getApplicationProperty(domain, application, property, observe = 'body', 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 {?} */
        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/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 {?}
     */
    getServiceList(domain, application, observe = 'body', 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 {?} */
        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/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 = () => [
    { 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" });
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwbGljYXRpb25zLnNlcnZpY2UuanMiLCJzb3Vy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