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