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

Repository URL to install this package:

Version: 0.6.0 

/ esm2015 / lib / api / datarecords.service.js

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/**
 * Motif Datarecords 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, HttpParams } from '@angular/common/http';
import { CustomHttpUrlEncodingCodec } from '../encoder';
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 DatarecordsService {
    /**
     * @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 {?} type
     * @param {?=} hashedSession
     * @param {?=} usersId
     * @param {?=} operations
     * @param {?=} fromDate
     * @param {?=} toDate
     * @param {?=} resultCode
     * @param {?=} anyError
     * @param {?=} singleCsv
     * @param {?=} observe
     * @param {?=} reportProgress
     * @return {?}
     */
    exportDatarecords(type, hashedSession, usersId, operations, fromDate, toDate, resultCode, anyError, singleCsv, observe = 'body', reportProgress = false) {
        if (type === null || type === undefined) {
            throw new Error('Required parameter type was null or undefined when calling exportDatarecords.');
        }
        /** @type {?} */
        let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() });
        if (hashedSession !== undefined && hashedSession !== null) {
            queryParameters = queryParameters.set('hashedSession', (/** @type {?} */ (hashedSession)));
        }
        if (usersId !== undefined && usersId !== null) {
            queryParameters = queryParameters.set('usersId', (/** @type {?} */ (usersId)));
        }
        if (operations) {
            operations.forEach((/**
             * @param {?} element
             * @return {?}
             */
            (element) => {
                queryParameters = queryParameters.append('operations', (/** @type {?} */ (element)));
            }));
        }
        if (fromDate !== undefined && fromDate !== null) {
            queryParameters = queryParameters.set('fromDate', (/** @type {?} */ (fromDate.toISOString())));
        }
        if (toDate !== undefined && toDate !== null) {
            queryParameters = queryParameters.set('toDate', (/** @type {?} */ (toDate.toISOString())));
        }
        if (resultCode !== undefined && resultCode !== null) {
            queryParameters = queryParameters.set('resultCode', (/** @type {?} */ (resultCode)));
        }
        if (anyError !== undefined && anyError !== null) {
            queryParameters = queryParameters.set('anyError', (/** @type {?} */ (anyError)));
        }
        if (singleCsv !== undefined && singleCsv !== null) {
            queryParameters = queryParameters.set('singleCsv', (/** @type {?} */ (singleCsv)));
        }
        /** @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/zip',
            '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}/datarecords/types/${encodeURIComponent(String(type))}/export`, {
            params: queryParameters,
            responseType: "blob",
            withCredentials: this.configuration.withCredentials,
            headers: headers,
            observe: observe,
            reportProgress: reportProgress
        });
    }
    /**
     * @param {?} type
     * @param {?=} fromDate
     * @param {?=} toDate
     * @param {?=} page
     * @param {?=} pageSize
     * @param {?=} sort
     * @param {?=} observe
     * @param {?=} reportProgress
     * @return {?}
     */
    getDatarecords(type, fromDate, toDate, page, pageSize, sort, observe = 'body', reportProgress = false) {
        if (type === null || type === undefined) {
            throw new Error('Required parameter type was null or undefined when calling getDatarecords.');
        }
        /** @type {?} */
        let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() });
        if (fromDate !== undefined && fromDate !== null) {
            queryParameters = queryParameters.set('fromDate', (/** @type {?} */ (fromDate.toISOString())));
        }
        if (toDate !== undefined && toDate !== null) {
            queryParameters = queryParameters.set('toDate', (/** @type {?} */ (toDate.toISOString())));
        }
        if (page !== undefined && page !== null) {
            queryParameters = queryParameters.set('page', (/** @type {?} */ (page)));
        }
        if (pageSize !== undefined && pageSize !== null) {
            queryParameters = queryParameters.set('page_size', (/** @type {?} */ (pageSize)));
        }
        if (sort !== undefined && sort !== null) {
            queryParameters = queryParameters.set('sort', (/** @type {?} */ (sort)));
        }
        /** @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}/datarecords/types/${encodeURIComponent(String(type))}`, {
            params: queryParameters,
            withCredentials: this.configuration.withCredentials,
            headers: headers,
            observe: observe,
            reportProgress: reportProgress
        });
    }
    /**
     * @param {?=} observe
     * @param {?=} reportProgress
     * @return {?}
     */
    getDatarecordsTypes(observe = 'body', reportProgress = false) {
        /** @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}/datarecords/types`, {
            withCredentials: this.configuration.withCredentials,
            headers: headers,
            observe: observe,
            reportProgress: reportProgress
        });
    }
    /**
     * @param {?} type
     * @param {?=} hashedSession
     * @param {?=} usersId
     * @param {?=} operations
     * @param {?=} fromDate
     * @param {?=} toDate
     * @param {?=} resultCode
     * @param {?=} anyError
     * @param {?=} singleCsv
     * @param {?=} observe
     * @param {?=} reportProgress
     * @return {?}
     */
    verifyDatarecordsExport(type, hashedSession, usersId, operations, fromDate, toDate, resultCode, anyError, singleCsv, observe = 'body', reportProgress = false) {
        if (type === null || type === undefined) {
            throw new Error('Required parameter type was null or undefined when calling verifyDatarecordsExport.');
        }
        /** @type {?} */
        let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() });
        if (hashedSession !== undefined && hashedSession !== null) {
            queryParameters = queryParameters.set('hashedSession', (/** @type {?} */ (hashedSession)));
        }
        if (usersId !== undefined && usersId !== null) {
            queryParameters = queryParameters.set('usersId', (/** @type {?} */ (usersId)));
        }
        if (operations) {
            operations.forEach((/**
             * @param {?} element
             * @return {?}
             */
            (element) => {
                queryParameters = queryParameters.append('operations', (/** @type {?} */ (element)));
            }));
        }
        if (fromDate !== undefined && fromDate !== null) {
            queryParameters = queryParameters.set('fromDate', (/** @type {?} */ (fromDate.toISOString())));
        }
        if (toDate !== undefined && toDate !== null) {
            queryParameters = queryParameters.set('toDate', (/** @type {?} */ (toDate.toISOString())));
        }
        if (resultCode !== undefined && resultCode !== null) {
            queryParameters = queryParameters.set('resultCode', (/** @type {?} */ (resultCode)));
        }
        if (anyError !== undefined && anyError !== null) {
            queryParameters = queryParameters.set('anyError', (/** @type {?} */ (anyError)));
        }
        if (singleCsv !== undefined && singleCsv !== null) {
            queryParameters = queryParameters.set('singleCsv', (/** @type {?} */ (singleCsv)));
        }
        /** @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}/datarecords/types/${encodeURIComponent(String(type))}/export/verify`, {
            params: queryParameters,
            withCredentials: this.configuration.withCredentials,
            headers: headers,
            observe: observe,
            reportProgress: reportProgress
        });
    }
}
DatarecordsService.decorators = [
    { type: Injectable, args: [{
Loading ...