createBookingLiveData

abstract fun createBookingLiveData(iotUnit: IotUnit, startsAt: Long, endsAt: Long?): LiveData<SimpleResponse<Booking>?>

Create a booking for the given unit. startsAt and endsAt are defined in epoch in milliseconds. endsAt is an optional parameter because some units can have an open ended booking.

Returns a LiveData with the response of this operation (Response) and the newly created Booking.

After logout LiveData.getValue is set to null. You need to re-observe this LiveData once the user is logged out!