"use strict";
/* 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());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfiguredSourceApi = void 0;
const runtime = require("../runtime");
const index_1 = require("../models/index");
/**
 *
 */
class ConfiguredSourceApi extends runtime.BaseAPI {
    /**
     * Creates request options for listConfiguredSources without sending the request
     */
    listConfiguredSourcesRequestOpts(requestParameters) {
        return __awaiter(this, void 0, void 0, function* () {
            const queryParameters = {};
            if (requestParameters['organizationId'] != null) {
                queryParameters['organizationId'] = requestParameters['organizationId'];
            }
            if (requestParameters['includeInactive'] != null) {
                queryParameters['includeInactive'] = requestParameters['includeInactive'];
            }
            const headerParameters = {};
            if (this.configuration && this.configuration.accessToken) {
                // oauth required
                const token = this.configuration.accessToken;
                const tokenString = yield token("default", ["ucx:read"]);
                if (tokenString) {
                    headerParameters["Authorization"] = `Bearer ${tokenString}`;
                }
            }
            let urlPath = `/sources`;
            return {
                path: urlPath,
                method: 'GET',
                headers: headerParameters,
                query: queryParameters,
            };
        });
    }
    /**
     * Get all active (and inactive) sources for the current user / organization
     */
    listConfiguredSourcesRaw(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const requestOptions = yield this.listConfiguredSourcesRequestOpts(requestParameters);
            const response = yield this.request(requestOptions, initOverrides);
            return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.ConfiguredSourceSchemaFromJSON));
        });
    }
    /**
     * Get all active (and inactive) sources for the current user / organization
     */
    listConfiguredSources() {
        return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
            const response = yield this.listConfiguredSourcesRaw(requestParameters, initOverrides);
            return yield response.value();
        });
    }
}
exports.ConfiguredSourceApi = ConfiguredSourceApi;
