"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createUser = createUser;
exports.getUser = getUser;
exports.updateUser = updateUser;
exports.deleteUser = deleteUser;
const authenticate_request_1 = require("./utils/authenticate-request");
const orval_newsletters_1 = require("./orval/api/orval-newsletters");
/**
 * create a user
 *
 * @param {ICreateUserParams} options
 * @return {Promise<IUser>}
 */
async function createUser(options) {
    options.token = await (0, authenticate_request_1.authenticateRequest)(options);
    return (0, orval_newsletters_1.createUser)(options.data, options);
}
/**
 * get a user
 *
 * @param {IGetUserParams} options
 * @return {Promise<IUser>}
 */
async function getUser(options) {
    options.token = await (0, authenticate_request_1.authenticateRequest)(options);
    return (0, orval_newsletters_1.getUser)(options.userId, options);
}
/**
 * update a user
 *
 * @param {IUpdateUserParams} options
 * @return {Promise<IUser>}
 */
async function updateUser(options) {
    options.token = await (0, authenticate_request_1.authenticateRequest)(options);
    return (0, orval_newsletters_1.updateUser)(options.userId, options.data, options);
}
/**
 * delete a user
 *
 * @param {IDeleteUserParams} options
 * @return {Promise<IUser>}
 */
async function deleteUser(options) {
    options.token = await (0, authenticate_request_1.authenticateRequest)(options);
    return (0, orval_newsletters_1.deleteUser)(options.userId, options);
}
//# sourceMappingURL=users.js.map