Files
Automatic-Parking/Source/ProofOfConcept/Models/VehiclesResponse.cs
Szakáts Alpár Zsolt f049d023c9
All checks were successful
Build, Push and Run Container / build (push) Successful in 25s
Adds Tesla API integration
Adds an endpoint to interact with the Tesla API via a command proxy.

This includes fetching vehicle information and configuring telemetry settings. It introduces new models to represent the Tesla API responses and request structures.
2025-08-17 12:03:26 +02:00

29 lines
1.2 KiB
C#

namespace ProofOfConcept.Models;
using System.Text.Json.Serialization;
public sealed class VehiclesEnvelope
{
[JsonPropertyName("response")]
public List<VehicleSummary> Response { get; set; } = new();
[JsonPropertyName("count")]
public int Count { get; set; }
}
public sealed class VehicleSummary
{
// Tesla fields commonly present on /api/1/vehicles
[JsonPropertyName("id")] public long Id { get; set; }
[JsonPropertyName("vehicle_id")] public long VehicleId { get; set; }
[JsonPropertyName("vin")] public string? Vin { get; set; }
[JsonPropertyName("display_name")] public string? DisplayName { get; set; }
[JsonPropertyName("state")] public string? State { get; set; }
// Extra fields sometimes included; safe to keep nullable
[JsonPropertyName("in_service")] public bool? InService { get; set; }
[JsonPropertyName("calendar_enabled")] public bool? CalendarEnabled { get; set; }
[JsonPropertyName("id_s")] public string? IdS { get; set; }
[JsonPropertyName("option_codes")] public string? OptionCodes { get; set; }
[JsonPropertyName("color")] public string? Color { get; set; }
}