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