"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getApi = getApi;
const shouldUseOgcApi_1 = require("./shouldUseOgcApi");
const shouldUseDiscussionsApi_1 = require("./shouldUseDiscussionsApi");
const shouldUseEventsApi_1 = require("./shouldUseEventsApi");
/**
 * @private
 * Determines Which API should be hit for the given search parameters.
 * Defaults to the Portal API unless parameters indicate that a Hub API should be used.
 * @param targetEntity target entity of the query
 * @param options search options
 * @returns the target API, either 'portal' or 'hub'
 */
function getApi(targetEntity, options) {
    let result = "portal";
    if ((0, shouldUseDiscussionsApi_1.shouldUseDiscussionsApi)(targetEntity, options) ||
        (0, shouldUseEventsApi_1.shouldUseEventsApi)(targetEntity, options) ||
        (0, shouldUseOgcApi_1.shouldUseOgcApi)(targetEntity, options)) {
        result = "hub";
    }
    return result;
}
//# sourceMappingURL=getApi.js.map