"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fetchHubChannel = fetchHubChannel;
const channels_1 = require("../discussions/api/channels/channels");
const channelRelation_1 = require("../discussions/api/enums/channelRelation");
const transformChannelToEntity_1 = require("./_internal/transformChannelToEntity");
/**
 * Fetches a Channel for the given channelId
 * @param channelId The ID of the channel to fetch
 * @param context ArcGIS context
 * @returns a promise that resolves an IHubChannel for the given channelId
 */
async function fetchHubChannel(channelId, context) {
    const channel = await (0, channels_1.fetchChannelV2)(Object.assign({ channelId, data: { relations: [channelRelation_1.ChannelRelation.CHANNEL_ACL] } }, context.hubRequestOptions));
    return (0, transformChannelToEntity_1.transformChannelToEntity)(channel, context.currentUser);
}
//# sourceMappingURL=fetch.js.map