In this project, we will create a REST API to see the list of user details where we can get a username, email ID, and contact number. So let's create a model of a user; the class name is UserModel.kt.
Here is the code of the model class:
data class UserModel(val id: Int,
val name: String,
val email: String,
val contact_number: String)
We have created a class named UserModel, where we have initialized id, name, email, and contact_number.