To support "endpoints", e.g. requesting GPS.
From https://developer.tesla.com/docs/fleet-api#vehicle_data
String of URL-encoded, semicolon-separated values. Can be many of 'charge_state',
'climate_state', 'closures_state', 'drive_state', 'gui_settings', 'location_data',
'vehicle_config', 'vehicle_state', 'vehicle_data_combo'.
Before:
let vehicle_data = api.vehicle_data(&vehicle_id).await.unwrap();
After:
let get_vehicle_data = GetVehicleData::new(vehicles_id);
let vehicle_data = api.vehicle_data(&get_vehicle_data).await.unwrap();
Or with a endpoints:
let get_vehicle_data = GetVehicleData::new_with_endpoints(123u64, vec![Endpoint::ChargeState, Endpoint::ClimateState]);
let vehicle_data = api.vehicle_data(&get_vehicle_data).await.unwrap();
CLI:
You can still use vehicle-data without endpoints, but you won't get
location data. To fetch location_data:
teslatte api vehicle 123 vehicle-data location_data
Significant refactor to progress towards different API access that Tesla
has introduced. See issues #6 and #7.
Removed `ResponseData` because it wasn't very ergonomic, forcing the user
to deref or call data(). Also it had specific fields for JSON output
which was only used for the CLI, so I introduced a field
`print_responses` in OwnerApi that the CLI can use.