All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.jonahwh.tesla_api_client.VehiclesApi Maven / Gradle / Ivy

There is a newer version: 2.3.1
Show newest version
package com.github.jonahwh.tesla_api_client;

import com.github.jonahwh.CollectionFormats.*;

import retrofit2.Call;
import retrofit2.http.*;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;

import com.github.jonahwh.tesla_api_client.model.ChargeStateResponse;
import com.github.jonahwh.tesla_api_client.model.ClimateSettingsResponse;
import com.github.jonahwh.tesla_api_client.model.DriveStateResponse;
import com.github.jonahwh.tesla_api_client.model.GetVehiclesResponse;
import com.github.jonahwh.tesla_api_client.model.GuistateResponse;
import com.github.jonahwh.tesla_api_client.model.MobileAccessResponse;
import com.github.jonahwh.tesla_api_client.model.VehicleConfigResponse;
import com.github.jonahwh.tesla_api_client.model.VehicleDataResponse;
import com.github.jonahwh.tesla_api_client.model.VehicleResponse;
import com.github.jonahwh.tesla_api_client.model.VehicleStateResponse;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface VehiclesApi {
  /**
   * Retrieve a vehicle
   * Retrieve a specific vehicle
   * @param vehicleId The id of the Vehicle. (required)
   * @return Call<VehicleResponse>
   */
  @Headers({
    "Content-Type:application/json"
  })
  @GET("api/1/vehicles/{vehicle_id}")
  Call getVehicle(
    @retrofit2.http.Path("vehicle_id") String vehicleId
  );

  /**
   * Charge State
   * Returns the state of charge in the battery.
   * @param vehicleId The id of the Vehicle. (required)
   * @return Call<ChargeStateResponse>
   */
  @Headers({
    "Content-Type:application/json"
  })
  @GET("api/1/vehicles/{vehicle_id}/data_request/charge_state")
  Call getVehicleChargeState(
    @retrofit2.http.Path("vehicle_id") String vehicleId
  );

  /**
   * Climate Settings
   * Returns the current temperature and climate control state.
   * @param vehicleId The id of the Vehicle. (required)
   * @return Call<ClimateSettingsResponse>
   */
  @Headers({
    "Content-Type:application/json"
  })
  @GET("api/1/vehicles/{vehicle_id}/data_request/climate_state")
  Call getVehicleClimateState(
    @retrofit2.http.Path("vehicle_id") String vehicleId
  );

  /**
   * Vehicle Config
   * Returns the vehicle's configuration
   * @param vehicleId The id of the Vehicle. (required)
   * @return Call<VehicleConfigResponse>
   */
  @Headers({
    "Content-Type:application/json"
  })
  @GET("api/1/vehicles/{vehicle_id}/data_request/vehicle_config")
  Call getVehicleConfig(
    @retrofit2.http.Path("vehicle_id") String vehicleId
  );

  /**
   * Vehicle Data
   * Returns all vehicle ∂ata, potentially cached
   * @param vehicleId The id of the Vehicle. (required)
   * @return Call<VehicleDataResponse>
   */
  @Headers({
    "Content-Type:application/json"
  })
  @GET("api/1/vehicles/{vehicle_id}/data")
  Call getVehicleData(
    @retrofit2.http.Path("vehicle_id") String vehicleId
  );

  /**
   * Driving and Position
   * Returns the driving and position state of the vehicle.
   * @param vehicleId The id of the Vehicle. (required)
   * @return Call<DriveStateResponse>
   */
  @Headers({
    "Content-Type:application/json"
  })
  @GET("api/1/vehicles/{vehicle_id}/data_request/drive_state")
  Call getVehicleDriveState(
    @retrofit2.http.Path("vehicle_id") String vehicleId
  );

  /**
   * Mobile Access
   * Determines if mobile access to the vehicle is enabled.
   * @param vehicleId The id of the Vehicle. (required)
   * @return Call<MobileAccessResponse>
   */
  @Headers({
    "Content-Type:application/json"
  })
  @GET("api/1/vehicles/{vehicle_id}/mobile_enabled")
  Call getVehicleMobileEnabled(
    @retrofit2.http.Path("vehicle_id") String vehicleId
  );

  /**
   * Vehicle State
   * Returns the vehicle's physical state, such as which doors are open.
   * @param vehicleId The id of the Vehicle. (required)
   * @return Call<VehicleStateResponse>
   */
  @Headers({
    "Content-Type:application/json"
  })
  @GET("api/1/vehicles/{vehicle_id}/data_request/vehicle_state")
  Call getVehicleState(
    @retrofit2.http.Path("vehicle_id") String vehicleId
  );

  /**
   * List all Vehicles
   * Retrieve a list of your owned vehicles (includes vehicles not yet shipped!)
   * @return Call<GetVehiclesResponse>
   */
  @Headers({
    "Content-Type:application/json"
  })
  @GET("api/1/vehicles")
  Call getVehicles();
    

  /**
   * GUI Settings
   * Returns various information about the GUI settings of the car, such as unit format and range display.
   * @param vehicleId The id of the Vehicle. (required)
   * @return Call<GuistateResponse>
   */
  @Headers({
    "Content-Type:application/json"
  })
  @GET("api/1/vehicles/{vehicle_id}/data_request/gui_settings")
  Call getVehilceGuiSettings(
    @retrofit2.http.Path("vehicle_id") String vehicleId
  );

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy