Skip to content

Instantly share code, notes, and snippets.

@kvofreelance
Created October 20, 2015 20:22
Show Gist options
  • Save kvofreelance/6afb80f1c7d4c2cf9303 to your computer and use it in GitHub Desktop.
Save kvofreelance/6afb80f1c7d4c2cf9303 to your computer and use it in GitHub Desktop.
NetworkApi
package com.passengerapp.main.network;
import com.passengerapp.main.network.model.request.GetFlightsInfoFromFVRequest;
import com.passengerapp.main.network.model.request.ReservationIdRequest;
import com.passengerapp.main.network.model.request.SaveFlightDetailRequest;
import com.passengerapp.main.network.model.request.SearchDriversRequest;
import com.passengerapp.main.network.model.request.SendCancelToDriverRequest;
import com.passengerapp.main.network.model.request.SendPickupRequest;
import com.passengerapp.main.network.model.response.GetFlightDetailsData;
import com.passengerapp.main.network.model.response.GoogleGetLocationByNameApiResponse;
import com.passengerapp.main.network.model.response.GooglePlacesResponse;
import com.passengerapp.main.network.model.response.GoogleRoutesResponse;
import com.passengerapp.main.network.model.response.JsonServerResponse;
import com.passengerapp.main.network.model.response.SaveFlightDetailData;
import com.passengerapp.main.network.model.response.SearchDriversData;
import com.passengerapp.main.network.model.response.SearchDriversLaterData;
import com.passengerapp.main.network.model.response.SendPickupData;
import com.passengerapp.main.network.model.response.VerfiyCouponData;
import java.util.List;
import retrofit.http.Body;
import retrofit.http.Field;
import retrofit.http.FormUrlEncoded;
import retrofit.http.GET;
import retrofit.http.POST;
import retrofit.http.Query;
import rx.Observable;
/**
* Created by adventis on 10/15/15.
*/
public interface NetworkApi {
@FormUrlEncoded
@POST("api/VerifyCoupon")
Observable<JsonServerResponse<VerfiyCouponData>> sendVeridyCoupon(@Field("MerchantId") String merchantId, @Field("CouponCode") String couponCode);
@POST("api/SendPickup")
Observable<JsonServerResponse<SendPickupData>> sendPickup(@Body SendPickupRequest request);
@POST("api/SaveFlightDetail")
Observable<JsonServerResponse<SaveFlightDetailData>> saveFlightDetail(@Body SaveFlightDetailRequest request);
@POST("api/GetFlightsInfoFromFV")
Observable<JsonServerResponse<List<SaveFlightDetailRequest>>> getFlightsInfoFromFV(@Body GetFlightsInfoFromFVRequest request);
@POST("api/SearchDrivers")
Observable<JsonServerResponse<List<SearchDriversData>>> searchDrivers(@Body SearchDriversRequest request);
@POST("api/SearchDrivers")
Observable<JsonServerResponse<List<SearchDriversLaterData>>> searchDriversLater(@Body SearchDriversRequest request);
@POST("api/SendCancelToDriver")
Observable<JsonServerResponse<String>> sendCancelToDriver(@Body SendCancelToDriverRequest request);
/*@POST("api/GetDriverLocation")
Observable<JsonServerResponse<GetDriverLocationData>> getDriverLocation(@Body DriverTokenRequest request);*/
@POST("api/GetFlightDetails")
Observable<JsonServerResponse<GetFlightDetailsData>> getFlightDetails(@Body ReservationIdRequest request);
@GET("/maps/api/place/autocomplete/json?sensor=false")
GooglePlacesResponse getNamesOfPlace(@Query(value = "input", encoded=true) String input, @Query(value="key") String key);
@GET("/maps/api/place/textsearch/json?sensor=true")
Observable<GoogleGetLocationByNameApiResponse> getLocationByName(@Query(value = "query", encoded=true) String query, @Query(value="key") String key);
@GET("/maps/api/directions/json?sensor=false&mode=driving&alternatives=true")
Observable<GoogleRoutesResponse> getRoutes(@Query(value="origin") String origin, @Query(value="destination") String dstLat);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment