public async Task<WeatherInfo> GetWeather(PointLatLng latLong)
{
var flightInfo = new FlightInfo
{
Position = new LatLong(latLong)
};
var aircraftInfo = new AircraftInfo
{
Id = "Id"
};
// Load this as a JObject as reports are extensible
JObject reportResponse = await _apiUrl
.AppendPathSegments("ops", "tower", "report")
.WithClient(_client)
.PostJsonAsync(new ReportRequest(aircraftInfo, flightInfo, "weather"))
.ReceiveJson<JObject>();
// Grab the weather for now if there is one and process it
var currentWeather = reportResponse.SelectToken("weather.forecast.current")?.ToObject<WeatherInfo>();
return currentWeather;
}