I have a login API, which accepts that a field, `type` is either "email" or "phone".

I'd like to make them Enums

```
enum class LoginBodyType (val value: String) {
    EMAIL("email"), PHONE ("phone")
}

```

I have a data class similar to follows

```
class LoginBody (val type: LoginBodyType) {
    var phone: String = ""
    var email: String = ""
    var password: String = ""
}

```

so that when I call the login function, it will be something like this

```
val body = LoginBody(LoginBodyType.EMAIL)
body.email = username
body.password = password

```

where the type will be fixed to one of the enums, but it would submit to the server as a type String.

One option is to do `body = LoginBody(LoginBodyType.EMAIL.value)` and `class LoginBody (val type: String)` but it feels like there's a more elegant solution. I'm using Retrofit 2 if that matters.