/* tslint:disable */
/* eslint-disable */
/**
 * UCX Proxy
 * A single use API for the UCX Proxy.
 *
 * The version of the OpenAPI document: 0.0.12
 * Contact: customersuccess@equisoft.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
import * as runtime from '../runtime';
import { SourceSchemaFromJSON, } from '../models/index';
/**
 *
 */
export class SourceApi extends runtime.BaseAPI {
    /**
     * Creates request options for listSources without sending the request
     */
    listSourcesRequestOpts() {
        return __awaiter(this, void 0, void 0, function* () {
            const queryParameters = {};
            const headerParameters = {};
            if (this.configuration && this.configuration.accessToken) {
                // oauth required
                const token = this.configuration.accessToken;
                const tokenString = yield token("default", []);
                if (tokenString) {
                    headerParameters["Authorization"] = `Bearer ${tokenString}`;
                }
            }
            let urlPath = `/sources/available`;
            return {
                path: urlPath,
                method: 'GET',
                headers: headerParameters,
                query: queryParameters,
            };
        });
    }
    /**
     * Get all sources
     */
    listSourcesRaw(initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const requestOptions = yield this.listSourcesRequestOpts();
            const response = yield this.request(requestOptions, initOverrides);
            return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(SourceSchemaFromJSON));
        });
    }
    /**
     * Get all sources
     */
    listSources(initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const response = yield this.listSourcesRaw(initOverrides);
            return yield response.value();
        });
    }
}
