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