"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FeedCommand = void 0;
const extra_utils_1 = require("../../extra-utils");
const shared_1 = require("../shared");
class FeedCommand extends shared_1.AbstractCommand {
    getXML(options) {
        const { feed, format, ignoreCache } = options;
        const path = '/feeds/' + feed + '.xml';
        const query = {};
        if (ignoreCache)
            query.v = (0, extra_utils_1.buildUUID)();
        if (format)
            query.format = format;
        return this.getRequestText(Object.assign(Object.assign({}, options), { path,
            query, accept: 'application/xml', implicitToken: false, defaultExpectedStatus: 200 }));
    }
    getJSON(options) {
        const { feed, query = {}, ignoreCache } = options;
        const path = '/feeds/' + feed + '.json';
        const cacheQuery = ignoreCache
            ? { v: (0, extra_utils_1.buildUUID)() }
            : {};
        return this.getRequestText(Object.assign(Object.assign({}, options), { path, query: Object.assign(Object.assign({}, query), cacheQuery), accept: 'application/json', implicitToken: false, defaultExpectedStatus: 200 }));
    }
}
exports.FeedCommand = FeedCommand;
//# sourceMappingURL=feeds-command.js.map