All checks were successful
Build, Push and Run Container / build (push) Successful in 25s
Adds an endpoint to retrieve fleet status information. This endpoint uses a Tesla API proxy to fetch the fleet status based on provided VINs. It handles authentication using a bearer token and sends a POST request to the /api/1/vehicles/fleet_status endpoint. Also introduces new data models to properly serialize/deserialize the fleet status response.
25 lines
1.2 KiB
C#
25 lines
1.2 KiB
C#
namespace ProofOfConcept.Models;
|
|
|
|
using System.Collections.Generic;
|
|
using System.Text.Json.Serialization;
|
|
|
|
public class FleetRootResponse
|
|
{
|
|
[JsonPropertyName("response")] public FleetResponse FleetResponse { get; set; } = new FleetResponse();
|
|
}
|
|
|
|
public class FleetResponse
|
|
{
|
|
[JsonPropertyName("key_paired_vins")] public List<string> KeyPairedVins { get; set; } = new List<string>();
|
|
[JsonPropertyName("unpaired_vins")] public List<string> UnpairedVins { get; set; } = new List<string>();
|
|
[JsonPropertyName("vehicle_info")] public Dictionary<string, VehicleInfo> VehicleInfo { get; set; } = new Dictionary<string, VehicleInfo>();
|
|
}
|
|
|
|
public class VehicleInfo
|
|
{
|
|
[JsonPropertyName("firmware_version")] public string FirmwareVersion { get; set; } = "";
|
|
[JsonPropertyName("vehicle_command_protocol_required")] public bool VehicleCommandProtocolRequired { get; set; }
|
|
[JsonPropertyName("discounted_device_data")] public bool DiscountedDeviceData { get; set; }
|
|
[JsonPropertyName("fleet_telemetry_version")] public string FleetTelemetryVersion { get; set; } = "";
|
|
[JsonPropertyName("total_number_of_keys")] public int TotalNumberOfKeys { get; set; }
|
|
} |