requestParkingPrice

Requests the details of parking prices for a specific parking place.

The main parameter required is the ParkingDetailId of the parking place, which can be obtained from a search result or through a POI details request.

Note: This operation is synchronous and should not be executed on the main thread.

Usage Example:

// Initialize the ParkingDetailProvider
val parkingDetailProvider = ParkingDetailProviderImplementation(...)

// After obtaining the parkingDetailId from a search result or a POI details request,
// create options for the parking prices request
val options = searchResult.searchResultId.parkingDetailId?.let { parkingDetailId ->
ParkingPriceOptions(
parkingDetailId = parkingDetailId,
startTime = Calendar.getInstance(), // represents the current date and time
duration = 50.minutes
)
}

// Request parking prices
options?.let { options ->
val result = parkingDetailProvider.requestParkingPrice(options)

if (result.isSuccess()) {
val response = result.value()
// Process the response.
Log.d(response.parkingPrice?.fees?.first()?.value)
Log.d(response.rates.first().rateDetails.first().offeredTickets.first().amount)
} else {
val failure = result.failure()
// Handle failure.
Log.d(failure.message)
}
}

Important: This is a Public Preview API. It may be changed or removed at any time.

Return

The Result contains a ParkingPriceResponse in if the call succeeds or a SearchFailure if it fails.

Parameters

options

Specifies the input of the request.


Requests the details of parking prices for a specific parking place.

The main parameter required is the ParkingDetailId of the parking place, which can be obtained from a search result or through a POI details request.

This is an asynchronous call, and the result will be returned through the provided callback. Note: This operation is synchronous and should not be executed on the main thread.

Usage Example:

// Initialize the ParkingDetailProvider
val parkingDetailProvider = ParkingDetailProviderImplementation(...)

// After obtaining the parkingDetailId from a search result or a POI details request,
// create options for the parking prices request
val options = searchResult.searchResultId.parkingDetailId?.let { parkingDetailId ->
ParkingPriceOptions(
parkingDetailId = parkingDetailId,
startTime = Calendar.getInstance(), // represents the current date and time
duration = 50.minutes
)
}

// Create the callback
val callback = object : ParkingPriceCallback {
override fun onSuccess(result: ParkingPriceResponse) {
// Process the response.
Log.d(response.parkingPrice?.fees?.first()?.value)
Log.d(response.rates.first().rateDetails.first().offeredTickets.first().amount)
}

override fun onFailure(failure: SearchFailure) {
// Handle failure.
Log.d(failure.message)
}
}

// Request parking prices using the pre-created callback
options?.let { options ->
val cancellable = parkingDetailProvider.requestParkingPrice(options, callback)

// You can cancel the operation if needed:
cancellable.cancel()
}

Important: This is a Public Preview API. It may be changed or removed at any time.

Return

A Cancellable object that stops the ongoing operation if needed if it hasn't been completed yet.

Parameters

options

The object which contains the data necessary to execute the search action.

callback

The ParkingPriceCallback invoked when the search operation has been finished either successfully or with an error. The callback will be executed in the main thread.