Sensorberg Smart Spaces SDK for Android / com.sensorberg.smartworkspace.sdk / BookingManager

BookingManager

interface BookingManager

Manages user bookings on the units

Functions

createBooking

abstract fun createBooking(unit: 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.

deleteBooking

abstract fun deleteBooking(booking: Booking): LiveData<SimpleResponse<Void>>

Deletes an existing booking. That call is used for bookings that haven't started.

endBookingNow

abstract fun endBookingNow(booking: Booking): LiveData<SimpleResponse<Void>>

Ends an existing booking. That call is used for currently ongoing bookings.

getMyBookings

abstract fun getMyBookings(): LiveData<SimpleResponse<List<Booking>>>

Get a LiveData for the logged user existing bookings. Those can be for either DOOR or LOCKER_BOX types.

getSchedules

abstract fun getSchedules(from: LocalDate, to: LocalDate, iotUnit: IotUnit? = null): LiveData<SimpleResponse<List<Schedule>>>

Get a LiveData with the schedule for the supplied iotUnit, or if null, for all IotUnit the user has access to on the requested periods.