Class BatchResponse

  • All Implemented Interfaces:
    java.io.Serializable

    public class BatchResponse
    extends ApiData
    Smartcar BatchResponse Object
    See Also:
    Serialized Form
    • Constructor Detail

      • BatchResponse

        public BatchResponse​(com.google.gson.JsonArray responses)
        Initializes a new BatchResponse.
        Parameters:
        responses - the array of Json response objects
    • Method Detail

      • getRequestId

        public java.lang.String getRequestId()
        Return the Smartcar request id from the response headers
        Returns:
        the request id
      • setRequestId

        public void setRequestId​(java.lang.String requestId)
        Sets the Smartcar request id from the response headers
        Parameters:
        requestId - the request id
      • battery

        public VehicleBattery battery()
                               throws SmartcarException
        Get response from the /battery endpoint
        Returns:
        the battery status of the vehicle
        Throws:
        SmartcarException - if the request for this endpoint returned an HTTP error code
      • charge

        public VehicleCharge charge()
                             throws SmartcarException
        Get response from the /charge endpoint
        Returns:
        the charge status of the vehicle
        Throws:
        SmartcarException - if the request for this endpoint returned an HTTP error code
      • fuel

        public VehicleFuel fuel()
                         throws SmartcarException
        Get response from the /fuel endpoint
        Returns:
        the fuel status of the vehicle
        Throws:
        SmartcarException - if the request for this endpoint returned an HTTP error code
      • engineOil

        public VehicleEngineOil engineOil()
                                   throws SmartcarException
        Get response from the /engine/oil endpoint
        Returns:
        the engine oil status of the vehicle
        Throws:
        SmartcarException - if the request for this endpoint returned an HTTP error code
      • tirePressure

        public VehicleTirePressure tirePressure()
                                         throws SmartcarException
        Get response from the /tires/pressure endpoint
        Returns:
        the tire pressure status of the vehicle
        Throws:
        SmartcarException - if the request for this endpoint returned an HTTP error code
      • toString

        public java.lang.String toString()
        Description copied from class: ApiData
        Returns the stored data string.
        Overrides:
        toString in class ApiData
        Returns:
        a stringified representation of BatchResponse