/*
 * Copyright (c) 2016 Uber Technologies, Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package com.uber.sdk.rides.client.model;

import javax.annotation.Nullable;

/**
 * An ongoing or completed ride. See
 * <a href="https://developer.uber.com/v1/endpoints/#request-details">Requests</a>
 * for more information.
 */
public class Ride {

    /**
     * Represents all possible Ride statuses
     */
    public enum Status {
        PROCESSING("processing"),
        NO_DRIVERS_AVAILABLE("no_drivers_available"),
        ACCEPTED("accepted"),
        ARRIVING("arriving"),
        IN_PROGRESS("in_progress"),
        DRIVER_CANCELED("driver_canceled"),
        RIDER_CANCELED("rider_canceled"),
        COMPLETED("completed");

        private String value;

        Status(String value) {
            this.value = value;
        }

        @Override
        public String toString() {
            return this.value;
        }
    }

    private String request_id;
    private Status status;
    private Driver driver;
    @Nullable
    private Integer eta;
    private float surge_multiplier;
    private Location location;
    private Vehicle vehicle;
    private String product_id;
    private boolean shared;

    /**
     * The unique ID of the ride.
     */
    public String getRideId() {
        return request_id;
    }

    /**
     * The status of the ride indicating state.
     */
    public Status getStatus() {
        return status;
    }

    /**
     * The object that contains driver details.
     */
    public Driver getDriver() {
        return driver;
    }

    /**
     * The estimated time of vehicle arrival in minutes.
     */
    @Nullable
    public Integer getEta() {
        return eta;
    }

    /**
     * The object that contains the location information of the vehicle and driver.
     */
    public Location getLocation() {
        return location;
    }

    /**
     * The object that contains vehicle details.
     */
    public Vehicle getVehicle() {
        return vehicle;
    }

    /**
     * The surge pricing multiplier used to calculate the increased price of a Request. A multiplier
     * of 1.0 means surge pricing is not in effect.
     */
    public Float getSurgeMultiplier() {
        return surge_multiplier;
    }

    /**
     * The product ID associated to the Ride.
     */
    public String getProductId() {
        return product_id;
    }

    /**
     * Indicates whether the ride is a shared ride or not. UberPool is an example of a shared ride.
     */
    public boolean isShared() {
        return shared;
    }
}
@@ -1164,16 +1164,49 @@
 model;%0A%0A
+import com.squareup.moshi.Json;%0A%0A
 import j
@@ -1499,16 +1499,43 @@
 %0A       
+ @Json(name = %22processing%22)
  PROCESS
@@ -1560,16 +1560,53 @@
 %0A       
+ @Json(name = %22no_drivers_available%22)
  NO_DRIV
@@ -1651,16 +1651,41 @@
 %0A       
+ @Json(name = %22accepted%22)
  ACCEPTE
@@ -1706,16 +1706,41 @@
 %0A       
+ @Json(name = %22arriving%22)
  ARRIVIN
@@ -1761,16 +1761,44 @@
 %0A       
+ @Json(name = %22in_progress%22)
  IN_PROG
@@ -1825,16 +1825,48 @@
 %0A       
+ @Json(name = %22driver_canceled%22)
  DRIVER_
@@ -1901,16 +1901,47 @@
 %0A       
+ @Json(name = %22rider_canceled%22)
  RIDER_C
@@ -1974,16 +1974,42 @@
 %0A       
+ @Json(name = %22completed%22)
  COMPLET
@@ -2133,103 +2133,8 @@
    %7D
-%0A%0A        @Override%0A        public String toString() %7B%0A            return this.value;%0A        %7D
 %0A   

Add @Json annotations to Ride.Status values