Modeling request data

We will make use of data classes to model the HTTP request data we wish to send to our API. Go ahead and create a request package in the remote package. There are four obvious requests that contain data payloads, which we will be sending to the API. These are login requests, message requests, status update requests, and requests containing user data. These four requests will be modeled by LoginRequestObject, MessageRequestObject, StatusUpdateRequestObject, and UserRequest objects, respectively.

The following code snippet shows the LoginRequestObject data class. Go ahead and add it to the request package and do the same for other request objects that follow:

package com.example.messenger.data.remote.requestdata class ...

Get Kotlin Programming By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.