"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getVersion = getVersion;
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
const getResourceNameFromVersionId_1 = require("./_internal/getResourceNameFromVersionId");
/**
 * Returns an IVersion object for the specified entity id and versionId
 * @param id
 * @param versionId
 * @param requestOptions
 * @returns
 */
async function getVersion(id, versionId, requestOptions) {
    return (0, arcgis_rest_portal_1.getItemResource)(id, Object.assign(Object.assign({}, requestOptions), { fileName: (0, getResourceNameFromVersionId_1.getResourceNameFromVersionId)(versionId), readAs: "json" }));
}
//# sourceMappingURL=getVersion.js.map