import { UserService } from '../../../../core/backend-api/index.js';
import { tryExecute } from '../../../../core/resources/index.js';
export class UmbUserAvatarServerDataSource {
    #host;
    constructor(host) {
        this.#host = host;
    }
    /**
     * Creates an avatar for the user with the given id based on a temporary uploaded file
     * @param {string} unique
     * @param {string} fileUnique
     * @returns {*}  {Promise<UmbDataSourceErrorResponse>}
     * @memberof UmbUserServerDataSource
     */
    createAvatar(unique, fileUnique) {
        const body = {
            file: {
                id: fileUnique,
            },
        };
        return tryExecute(this.#host, UserService.postUserAvatarById({ path: { id: unique }, body }));
    }
    /**
     * Deletes the avatar for the user with the given id
     * @param {string} unique
     * @returns {*}  {Promise<UmbDataSourceErrorResponse>}
     * @memberof UmbUserServerDataSource
     */
    deleteAvatar(unique) {
        return tryExecute(this.#host, UserService.deleteUserAvatarById({ path: { id: unique } }));
    }
}
