import { MediaTypeService } from '../../../../../core/backend-api/index.js';
import { tryExecute } from '../../../../../core/resources/index.js';
/**
 * Export Media Server Data Source
 * @export
 * @class UmbExportMediaTypeServerDataSource
 */
export class UmbExportMediaTypeServerDataSource {
    #host;
    /**
     * Creates an instance of UmbExportMediaTypeServerDataSource.
     * @param {UmbControllerHost} host
     * @memberof UmbExportMediaTypeServerDataSource
     */
    constructor(host) {
        this.#host = host;
    }
    /**
     * Export an item for the given id to the destination unique
     * @param {unique} unique
     * @returns {*}
     * @memberof UmbExportMediaTypeServerDataSource
     */
    async export(unique) {
        if (!unique)
            throw new Error('Unique is missing');
        return tryExecute(this.#host, MediaTypeService.getMediaTypeByIdExport({ path: { id: unique } }));
    }
}
