-
- All Implemented Interfaces:
-
com.telenav.commerce.foodservice.api.IFoodApi
public final class FoodManager implements IFoodApi
This class represents the concrete implementation of the IFoodApi
-
-
Constructor Summary
Constructors Constructor Description FoodManager(IFoodCommerceApi foodCommerceApi)
-
Method Summary
Modifier and Type Method Description Unit
init(SDKOptions sdkOptions, IFoodUserServiceProvider userServiceProvider, IFoodPaymentServiceProvider paymentProvider)
This method initialize or updates the food service. CommerceResponse<List<Brand>>
getBrands()
Makes a search for the available food brands. CommerceResponse<List<FoodStore>>
getFoodStores(GeoLocation location, String brandId)
Makes a search based on the given location and brand and returns a list of FoodStore. CommerceResponse<List<FoodStore>>
getFoodStoresAlongRoute(GeoLocation location, String brandId, String merchantKey, List<GeoLocation> routePoints)
Returns a list of available food stores around the given location, along the provided route, and for the given brand. CommerceResponse<List<FoodOrderInformation>>
getHistory(Boolean onlyActive)
Retrieves user's food orders. -
-
Constructor Detail
-
FoodManager
FoodManager(IFoodCommerceApi foodCommerceApi)
- Parameters:
foodCommerceApi
- The food commerce API implementation.
-
-
Method Detail
-
init
Unit init(SDKOptions sdkOptions, IFoodUserServiceProvider userServiceProvider, IFoodPaymentServiceProvider paymentProvider)
This method initialize or updates the food service. Before interacting with food service, the client is responsible to call this method. In case that a switch to a different environment is desired, the method can be called again with the new endpoint and corresponding api keys and tokens.
- Parameters:
sdkOptions
- The component used to set the apiKey, apiSecret, endpoint, applicationID.userServiceProvider
- The user dependency required by food service for proper running.paymentProvider
- The user dependency required by food service for proper running.
-
getBrands
@WorkerThread() CommerceResponse<List<Brand>> getBrands()
Makes a search for the available food brands.
-
getFoodStores
@WorkerThread() CommerceResponse<List<FoodStore>> getFoodStores(GeoLocation location, String brandId)
Makes a search based on the given location and brand and returns a list of FoodStore. Maximum 9 results are retrieved.
- Parameters:
location
- the location for which the search is done.brandId
- the id of the Brand for which the search should be done.
-
getFoodStoresAlongRoute
@WorkerThread() CommerceResponse<List<FoodStore>> getFoodStoresAlongRoute(GeoLocation location, String brandId, String merchantKey, List<GeoLocation> routePoints)
Returns a list of available food stores around the given location, along the provided route, and for the given brand. The results have the first one set as the default store
- Parameters:
location
- the coordinates around which the search should be done.brandId
- the id of the Brand for which the search should be done.routePoints
- list of route GeoLocation objects representing the route points
-
getHistory
@WorkerThread() CommerceResponse<List<FoodOrderInformation>> getHistory(Boolean onlyActive)
Retrieves user's food orders.
- Parameters:
onlyActive
- set if request should return only active orders
-
-
-
-