예제 #1
0
        public async Task <SignInResponse> LoginUser(string mobile, string password)
        {
            CabsClient client = new CabsClient(NetworkConstants.SIGNIN_PATH_NAME);

            client.AddParameter("mobile", mobile);
            client.AddParameter("password", password);
            string response = await client.GetResponse();

            return(JsonConvert.DeserializeObject <SignInResponse>(response));
        }
예제 #2
0
        public async Task <OtpResponse> ResetPassword(string mobile, string newPassword)
        {
            CabsClient client = new CabsClient(NetworkConstants.FORGOT_PATH_NAME);

            client.AddParameter("mobile", mobile);
            client.AddParameter("newPassword", newPassword);
            string response = await client.GetResponse();

            return(JsonConvert.DeserializeObject <OtpResponse>(response));
        }
예제 #3
0
        public async Task <ReverseGeoResposne> GetReverseCodingResult(string token, string place_id)
        {
            CabsClient client = new CabsClient(NetworkConstants.REGEOCODEPLACE_PATH_NAME);

            client.AddParameter("token", token);
            client.AddParameter("place_id", place_id);
            string response = await client.GetResponse();

            return(JsonConvert.DeserializeObject <ReverseGeoResposne>(response));
        }
예제 #4
0
        public async Task <SendTokenResponse> SendToken(string token, string code)
        {
            CabsClient client = new CabsClient(NetworkConstants.OATUH_PATH_NAME);

            client.AddParameter("code", code);
            client.AddParameter("token", token);
            string response = await client.GetResponse();

            System.Diagnostics.Debug.WriteLine(response);
            return(JsonConvert.DeserializeObject <SendTokenResponse>(response));
        }
예제 #5
0
        public async Task <PlacesResponse> GetPlaceLocation(string name, string token)
        {
            CabsClient client = new CabsClient(NetworkConstants.PLACES_PATH_NAME);

            client.AddParameter("token", token);
            client.AddParameter("name", name);
            string response = await client.GetResponse();

            System.Diagnostics.Debug.WriteLine("PLace Responese " + response);
            return(JsonConvert.DeserializeObject <PlacesResponse>(response));
        }
예제 #6
0
        public async Task <ReverseGeoResposne> GetReverseCodingResultlatlng(string token, string latlng)
        {
            CabsClient client = new CabsClient(NetworkConstants.REGEOCODELATLNG_PATH_NAME);

            client.AddParameter("token", token);
            client.AddParameter("latlng", latlng);
            string response = await client.GetResponse();

            System.Diagnostics.Debug.WriteLine(response);
            return(JsonConvert.DeserializeObject <ReverseGeoResposne>(response));
        }
예제 #7
0
        public async Task <GeoResponse> GeoCodingResult(string token, string location)
        {
            CabsClient client = new CabsClient(NetworkConstants.GEOCODE_PATH_NAME);

            client.AddParameter("address", location);
            client.AddParameter("token", token);
            string response = await client.GetResponse();

            System.Diagnostics.Debug.WriteLine("The server response : " + response);
            return(JsonConvert.DeserializeObject <GeoResponse>(response));
        }
예제 #8
0
        public async Task <CabsResponse> GetNearbyCabs(string latitude, string longitude, string token)
        {
            CabsClient client = new CabsClient(NetworkConstants.NEARBY_PATH_NAME);

            client.AddParameter("pickUpLat", latitude);
            client.AddParameter("pickUpLong", longitude);
            client.AddParameter("token", token);
            string response = await client.GetResponse();

            System.Diagnostics.Debug.WriteLine(response);
            return(JsonConvert.DeserializeObject <CabsResponse>(response));
        }
예제 #9
0
        public async Task <SignupResponse> RegisterUser(string name, string email, string mobile, string password)
        {
            CabsClient client = new CabsClient(NetworkConstants.SIGNUP_PATH_NAME);

            client.AddParameter("name", name);
            client.AddParameter("email", email);
            client.AddParameter("mobile", mobile);
            client.AddParameter("password", password);
            string response = await client.GetResponse();

            System.Diagnostics.Debug.WriteLine(response);
            return(JsonConvert.DeserializeObject <SignupResponse>(response));
        }
예제 #10
0
        public async Task <PriceEstimateResponse> GetEstimate(string token, string slatitude, string slongitude, string dlatitude, string dlongitude)
        {
            CabsClient client = new CabsClient(NetworkConstants.ESTIMATE_PATH_NAME);

            client.AddParameter("pickUpLat", slatitude);
            client.AddParameter("pickUpLong", slongitude);
            client.AddParameter("dropLat", dlatitude);
            client.AddParameter("dropLong", dlongitude);
            client.AddParameter("token", token);
            string response = await client.GetResponse();

            System.Diagnostics.Debug.WriteLine("Get Estimate :" + response);
            return(JsonConvert.DeserializeObject <PriceEstimateResponse>(response));
        }
예제 #11
0
        public async Task <BookingDetailsResponse> BookCab(string token, string start_latitude, string start_longitude)
        {
            CabsClient client = new CabsClient(NetworkConstants.BOOKINGDETAILS_PATH_NAME);

            client.AddParameter("token", token);
            client.AddParameter("start_latitude", start_latitude);
            client.AddParameter("start_longitude", start_longitude);
            //client.AddParameter("is_real", "true");
            string response = await client.GetResponse();

            System.Diagnostics.Debug.WriteLine(response);
            System.Diagnostics.Debug.WriteLine(start_latitude);
            System.Diagnostics.Debug.WriteLine(start_longitude);
            return(JsonConvert.DeserializeObject <BookingDetailsResponse>(response));
        }
예제 #12
0
        public async Task <SearchResponse> GetSuggestions(string input, string token, string latLong = "")
        {
            CabsClient client = new CabsClient(NetworkConstants.SEARCH_PATH_NAME);

            client.AddParameter("input", input);
            client.AddParameter("token", token);
            if (!latLong.Equals(""))
            {
                client.AddParameter("area", latLong);
            }
            string response = await client.GetResponse();

            System.Diagnostics.Debug.WriteLine("The server response is " + response);
            return(JsonConvert.DeserializeObject <SearchResponse>(response));
        }
예제 #13
0
        public async Task <UserResponse> GetProfile(string token)
        {
            CabsClient client = new CabsClient(NetworkConstants.ACCOUNT_PATH_NAME);

            client.AddParameter("token", token);
            string response = await client.GetResponse();

            return(JsonConvert.DeserializeObject <UserResponse>(response));
        }