createBooking

abstract fun createBooking(unitId: String, startsAt: String, endsAt: String, uniqueRequestId: String = UUID.randomUUID().toString(), callback: (Result<Booking>) -> Unit): Cancelable

Support function to create a booking for the given unitId.

Note: The purpose of this function is to support clients that can not use Coroutines or the Kotlin programming language!

Since

1.5.0

Return

Cancelable It is your responsibility to cancel this operation, when no longer needed, to avoid memory leaks.

Parameters

unitId

the unit id to book.

startsAt

(ISO 8601) start time.

endsAt

(ISO 8601) end time.

uniqueRequestId

optional request id in case of Result.Error. You can retry with the same request id then.

callback

receiving the Result with the Booking.

abstract fun createBooking(unitId: String, startsAt: String, endsAt: String, uniqueRequestId: String = UUID.randomUUID().toString(), lifecycleOwner: LifecycleOwner, callback: (Result<Booking>) -> Unit): Cancelable

Support function to create a booking for the given unitId.

Note: The purpose of this function is to support clients that can not use Coroutines or the Kotlin programming language!

Since

1.9.0

Return

Cancelable In case you want to cancel before Lifecycle.State.DESTROYED

Parameters

unitId

the unit id to book.

startsAt

(ISO 8601) start time.

endsAt

(ISO 8601) end time.

uniqueRequestId

optional request id in case of Result.Error. You can retry with the same request id then.

lifecycleOwner

auto cancel the Cancelable when lifecycle state is Lifecycle.State.DESTROYED

callback

receiving the Result with the Booking.