/* eslint-disable no-unused-vars */ const Service = require('./Service'); class UserService { /** * Create user * This can only be done by the logged in user. * * body User Created user object * no response value expected for this operation **/ static createUser({ body }) { return new Promise( async (resolve) => { try { resolve(Service.successResponse('')); } catch (e) { resolve(Service.rejectResponse( e.message || 'Invalid input', e.status || 405, )); } }, ); } /** * Creates list of users with given input array * * body List List of user object * no response value expected for this operation **/ static createUsersWithArrayInput({ body }) { return new Promise( async (resolve) => { try { resolve(Service.successResponse('')); } catch (e) { resolve(Service.rejectResponse( e.message || 'Invalid input', e.status || 405, )); } }, ); } /** * Creates list of users with given input array * * body List List of user object * no response value expected for this operation **/ static createUsersWithListInput({ body }) { return new Promise( async (resolve) => { try { resolve(Service.successResponse('')); } catch (e) { resolve(Service.rejectResponse( e.message || 'Invalid input', e.status || 405, )); } }, ); } /** * Delete user * This can only be done by the logged in user. * * username String The name that needs to be deleted * no response value expected for this operation **/ static deleteUser({ username }) { return new Promise( async (resolve) => { try { resolve(Service.successResponse('')); } catch (e) { resolve(Service.rejectResponse( e.message || 'Invalid input', e.status || 405, )); } }, ); } /** * Get user by user name * * username String The name that needs to be fetched. Use user1 for testing. * returns User **/ static getUserByName({ username }) { return new Promise( async (resolve) => { try { resolve(Service.successResponse('')); } catch (e) { resolve(Service.rejectResponse( e.message || 'Invalid input', e.status || 405, )); } }, ); } /** * Logs user into the system * * username String The user name for login * password String The password for login in clear text * returns String **/ static loginUser({ username, password }) { return new Promise( async (resolve) => { try { resolve(Service.successResponse('')); } catch (e) { resolve(Service.rejectResponse( e.message || 'Invalid input', e.status || 405, )); } }, ); } /** * Logs out current logged in user session * * no response value expected for this operation **/ static logoutUser() { return new Promise( async (resolve) => { try { resolve(Service.successResponse('')); } catch (e) { resolve(Service.rejectResponse( e.message || 'Invalid input', e.status || 405, )); } }, ); } /** * Updated user * This can only be done by the logged in user. * * username String name that need to be deleted * body User Updated user object * no response value expected for this operation **/ static updateUser({ username, body }) { return new Promise( async (resolve) => { try { resolve(Service.successResponse('')); } catch (e) { resolve(Service.rejectResponse( e.message || 'Invalid input', e.status || 405, )); } }, ); } } module.exports = UserService;