Package 

Interface IFoodApi

  • All Implemented Interfaces:

    
    public interface IFoodApi
    
                        

    This interface represents the entry point to the food service module. It exposes APIs needed for getting food specific information.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Unit init(SDKOptions sdkOptions, IFoodUserServiceProvider userServiceProvider, IFoodPaymentServiceProvider paymentProvider) This method initialize or updates the food service.
      abstract CommerceResponse<List<Brand>> getBrands() Makes a search for the available food brands.
      abstract CommerceResponse<List<FoodStore>> getFoodStores(GeoLocation location, String brandId) Makes a search based on the given location and brand and returns a list of FoodStore.
      abstract 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.
      abstract CommerceResponse<List<FoodOrderInformation>> getHistory(Boolean onlyActive) Retrieves user's food orders.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • init

         abstract 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.
      • getFoodStores

        @WorkerThread() abstract 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() abstract 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() abstract CommerceResponse<List<FoodOrderInformation>> getHistory(Boolean onlyActive)

        Retrieves user's food orders.

        Parameters:
        onlyActive - set if request should return only active orders