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