import { computeItemProps } from "../../core/_internal/computeItemProps";
import { applyDiscussionMigrations } from "./applyDiscussionMigrations";
import { getItemThumbnailUrl } from "../../resources/get-item-thumbnail-url";
/**
 * Given a model and a Discussion, set various computed properties that can't be directly mapped
 * @private
 * @param model
 * @param discussion
 * @param requestOptions
 * @returns an IHubDiscussion
 */
export function computeProps(model, discussion, requestOptions) {
    let token;
    if (requestOptions.authentication) {
        const session = requestOptions.authentication;
        token = session.token;
    }
    // compute base properties on discussion
    discussion = computeItemProps(model.item, discussion);
    // thumbnail url
    discussion.thumbnailUrl = getItemThumbnailUrl(model.item, requestOptions, token);
    // Apply migrations
    discussion = applyDiscussionMigrations(discussion);
    // cast b/c this takes a partial but returns a full object
    return discussion;
}
//# sourceMappingURL=computeProps.js.map