You have an interface:
interface ContactsApi {
@GET("people.json")
suspend fun getContacts(): Response<List<Contact>>
}
And a client with its implementation named client.
Get contents from the network in this code:
suspend fun getContacts(): Flow<ApiResponse> = flow {
val response = // your answer here
if (response.isSuccessful) {
emit(response.body()!!)
} else {
emit(emptyList())
}
}