use crate::converter::bool_from_str;
use crate::converter::f32_from_str;
use crate::converter::f64_from_str;
use crate::converter::i16_from_str;
use crate::converter::i32_from_str;
use crate::converter::i8_from_str;
use crate::converter::option_f64_from_str;
use crate::converter::option_i8_from_str_wind_comp;
use crate::converter::option_u16_from_str;
use crate::converter::option_u32_from_str;
use crate::converter::option_u8_from_str;
use crate::converter::ts_from_string;
use crate::converter::u16_from_str;
use crate::converter::u32_from_str;
use crate::converter::u8_from_str;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Ofp {
pub fetch: Fetch,
pub params: Params,
pub general: General,
pub origin: Airport,
pub destination: Airport,
#[serde(alias = "alternate")]
pub alternates: Option<Vec<Airport>>,
pub takeoff_altn: Option<Airport>,
pub enroute_altn: Option<Airport>,
pub navlog: Option<Navlog>,
pub etops: Option<Etops>,
pub tlr: Option<Tlr>,
pub atc: Option<Atc>,
pub aircraft: Aircraft,
pub fuel: Fuel,
pub fuel_extra: FuelExtra,
pub times: Times,
pub weights: Weights,
pub impacts: Option<Impacts>,
pub crew: Crew,
pub notams: Option<Notams>,
pub weather: Weather,
pub sigmets: Option<Sigmets>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Fetch {
#[serde(alias = "userid", deserialize_with = "u32_from_str")]
pub user_id: u32,
pub static_id: Option<String>,
pub status: String,
#[serde(deserialize_with = "f32_from_str")]
pub time: f32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Params {
#[serde(deserialize_with = "u32_from_str")]
pub request_id: u32,
pub sequence_id: String,
#[serde(deserialize_with = "u32_from_str")]
pub user_id: u32,
#[serde(deserialize_with = "u32_from_str")]
pub time_generated: u32,
pub static_id: Option<String>,
pub xml_file: String,
pub ofp_layout: String,
pub airac: String,
pub units: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct General {
#[serde(deserialize_with = "u8_from_str")]
pub release: u8,
pub icao_airline: String,
pub flight_number: String,
#[serde(deserialize_with = "bool_from_str")]
pub is_etops: bool,
pub dx_rmk: Vec<String>,
pub sys_rmk: Option<String>,
#[serde(deserialize_with = "bool_from_str")]
pub is_detailed_profile: bool,
pub cruise_profile: String,
pub climb_profile: String,
pub descent_profile: String,
pub alternate_profile: String,
pub reserve_profile: String,
#[serde(deserialize_with = "u16_from_str")]
pub costindex: u16,
pub cont_rule: String,
#[serde(deserialize_with = "u16_from_str")]
pub initial_altitude: u16,
pub stepclimb_string: String,
#[serde(deserialize_with = "i8_from_str")]
pub avg_temp_dev: i8,
#[serde(deserialize_with = "u16_from_str")]
pub avg_tropopause: u16,
#[serde(deserialize_with = "i8_from_str")]
pub avg_wind_comp: i8,
#[serde(deserialize_with = "u16_from_str")]
pub avg_wind_dir: u16,
#[serde(deserialize_with = "u8_from_str")]
pub avg_wind_spd: u8,
#[serde(deserialize_with = "u16_from_str")]
pub gc_distance: u16,
#[serde(deserialize_with = "u16_from_str")]
pub route_distance: u16,
#[serde(deserialize_with = "u16_from_str")]
pub air_distance: u16,
#[serde(deserialize_with = "u32_from_str")]
pub total_burn: u32,
#[serde(deserialize_with = "u16_from_str")]
pub cruise_tas: u16,
pub cruise_mach: String,
#[serde(deserialize_with = "u16_from_str")]
pub passengers: u16,
pub route: String,
pub route_ifps: String,
pub route_navigraph: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Airport {
pub icao_code: String,
pub iata_code: String,
pub faa_code: Option<String>,
pub icao_region: String,
#[serde(deserialize_with = "i16_from_str")]
pub elevation: i16,
#[serde(deserialize_with = "f64_from_str")]
pub pos_lat: f64,
#[serde(deserialize_with = "f64_from_str")]
pub pos_long: f64,
pub name: String,
#[serde(deserialize_with = "i8_from_str")]
pub timezone: i8,
pub plan_rwy: Option<String>,
#[serde(deserialize_with = "u16_from_str")]
pub trans_alt: u16,
#[serde(deserialize_with = "u16_from_str")]
pub trans_level: u16,
#[serde(default, deserialize_with = "option_u16_from_str")]
pub cruise_altitude: Option<u16>,
#[serde(default, deserialize_with = "option_u16_from_str")]
pub distance: Option<u16>,
#[serde(default, deserialize_with = "option_u16_from_str")]
pub gc_distance: Option<u16>,
#[serde(default, deserialize_with = "option_u16_from_str")]
pub air_distance: Option<u16>,
#[serde(default, deserialize_with = "option_u16_from_str")]
pub track_true: Option<u16>,
#[serde(default, deserialize_with = "option_u16_from_str")]
pub track_mag: Option<u16>,
#[serde(default, deserialize_with = "option_u16_from_str")]
pub tas: Option<u16>,
#[serde(default, deserialize_with = "option_u16_from_str")]
pub gs: Option<u16>,
#[serde(default, deserialize_with = "option_i8_from_str_wind_comp")]
pub avg_wind_comp: Option<i8>,
#[serde(default, deserialize_with = "option_u16_from_str")]
pub avg_wind_dir: Option<u16>,
#[serde(default, deserialize_with = "option_u8_from_str")]
pub avg_wind_spd: Option<u8>,
#[serde(default, deserialize_with = "option_u16_from_str")]
pub avg_tropopause: Option<u16>,
pub avg_tdv: Option<String>,
#[serde(default, deserialize_with = "option_u16_from_str")]
pub ete: Option<u16>,
#[serde(default, deserialize_with = "option_u16_from_str")]
pub burn: Option<u16>,
pub route: Option<String>,
pub route_ifps: Option<String>,
pub metar: String,
pub metar_time: Option<DateTime<Utc>>,
pub metar_category: Option<String>,
#[serde(default, deserialize_with = "option_u16_from_str")]
pub metar_visibility: Option<u16>,
#[serde(default, deserialize_with = "option_u16_from_str")]
pub metar_ceiling: Option<u16>,
pub taf: String,
pub taf_time: Option<DateTime<Utc>>,
pub atis: Option<Vec<Atis>>,
pub notam: Option<Vec<Notam>>,
pub fcst_cig: Option<String>,
pub fcst_vis: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Atis {
pub network: String,
pub issued: Option<DateTime<Utc>>,
pub letter: Option<String>,
pub phonetic: Option<String>,
#[serde(alias = "type")]
pub variant: String,
pub message: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Notam {
pub source_id: String,
pub account_id: String,
#[serde(alias = "notam_id")]
pub id: String,
pub location_id: String,
pub location_icao: String,
pub location_name: String,
pub location_type: String,
pub date_created: DateTime<Utc>,
pub date_effective: DateTime<Utc>,
pub date_expire: Option<DateTime<Utc>>,
#[serde(default, deserialize_with = "bool_from_str")]
pub date_expire_is_estimated: bool,
pub date_modified: DateTime<Utc>,
#[serde(alias = "notam_schedule")]
pub schedule: Option<String>,
#[serde(alias = "notam_html")]
pub html: String,
#[serde(alias = "notam_text")]
pub text: String,
#[serde(alias = "notam_raw")]
pub raw: String,
#[serde(alias = "notam_nrc")]
pub nrc: String,
#[serde(alias = "notam_qcode")]
pub qcode: Option<String>,
#[serde(alias = "notam_qcode_category")]
pub qcode_category: String,
#[serde(alias = "notam_qcode_subject")]
pub qcode_subject: Option<String>,
#[serde(alias = "notam_qcode_status")]
pub qcode_status: Option<String>,
#[serde(
default,
alias = "notam_is_obstacle",
deserialize_with = "bool_from_str"
)]
pub is_obstacle: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Navlog {
#[serde(alias = "fix")]
pub fixes: Vec<Fix>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Fix {
pub ident: String,
pub name: String,
#[serde(alias = "type")]
pub variant: String,
pub icao_region: Option<String>,
#[serde(default, deserialize_with = "option_f64_from_str")]
pub frequency: Option<f64>,
#[serde(deserialize_with = "f64_from_str")]
pub pos_lat: f64,
#[serde(deserialize_with = "f64_from_str")]
pub pos_long: f64,
pub stage: String,
pub via_airway: String,
#[serde(deserialize_with = "bool_from_str")]
pub is_sid_star: bool,
#[serde(deserialize_with = "u16_from_str")]
pub distance: u16,
#[serde(deserialize_with = "u16_from_str")]
pub track_true: u16,
#[serde(deserialize_with = "u16_from_str")]
pub track_mag: u16,
#[serde(deserialize_with = "u16_from_str")]
pub heading_true: u16,
#[serde(deserialize_with = "u16_from_str")]
pub heading_mag: u16,
#[serde(deserialize_with = "u16_from_str")]
pub altitude_feet: u16,
#[serde(deserialize_with = "u16_from_str")]
pub ind_airspeed: u16,
#[serde(deserialize_with = "u16_from_str")]
pub true_airspeed: u16,
pub mach: String,
pub mach_thousandths: String,
#[serde(deserialize_with = "i8_from_str")]
pub wind_component: i8,
#[serde(deserialize_with = "u16_from_str")]
pub groundspeed: u16,
#[serde(deserialize_with = "u16_from_str")]
pub time_leg: u16,
#[serde(deserialize_with = "u16_from_str")]
pub time_total: u16,
#[serde(deserialize_with = "u16_from_str")]
pub fuel_flow: u16,
#[serde(deserialize_with = "u32_from_str")]
pub fuel_leg: u32,
#[serde(deserialize_with = "u32_from_str")]
pub fuel_totalused: u32,
#[serde(deserialize_with = "u32_from_str")]
pub fuel_min_onboard: u32,
#[serde(deserialize_with = "u32_from_str")]
pub fuel_plan_onboard: u32,
#[serde(deserialize_with = "i8_from_str")]
pub oat: i8,
#[serde(deserialize_with = "i8_from_str")]
pub oat_isa_dev: i8,
#[serde(deserialize_with = "u16_from_str")]
pub wind_dir: u16,
#[serde(deserialize_with = "u16_from_str")]
pub wind_spd: u16,
#[serde(deserialize_with = "u16_from_str")]
pub shear: u16,
#[serde(deserialize_with = "u16_from_str")]
pub tropopause_feet: u16,
#[serde(deserialize_with = "u16_from_str")]
pub ground_height: u16,
#[serde(deserialize_with = "u16_from_str")]
pub mora: u16,
pub fir: String,
pub fir_units: String,
pub fir_valid_levels: String,
pub wind_data: FixWind,
pub fir_crossing: Option<FirCrossing>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct FixWind {
pub level: Vec<FixWindLevel>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct FixWindLevel {
#[serde(deserialize_with = "u16_from_str")]
pub altitude: u16,
#[serde(deserialize_with = "u16_from_str")]
pub wind_dir: u16,
#[serde(deserialize_with = "u8_from_str")]
pub wind_spd: u8,
#[serde(deserialize_with = "i8_from_str")]
pub oat: i8,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct FirCrossing {
pub fir: Vec<Fir>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Fir {
#[serde(alias = "fir_icao")]
pub icao: String,
#[serde(alias = "fir_name")]
pub name: String,
#[serde(deserialize_with = "f64_from_str")]
pub pos_lat_entry: f64,
#[serde(deserialize_with = "f64_from_str")]
pub pos_long_entry: f64,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Etops {
pub rule: String,
pub entry: EtopsAirport,
pub exit: EtopsAirport,
pub suitable_airport: Vec<Airport>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct EtopsAirport {
pub icao_code: String,
pub iata_code: String,
pub faa_code: Option<String>,
pub icao_region: String,
#[serde(deserialize_with = "f64_from_str")]
pub pos_lat_apt: f64,
#[serde(deserialize_with = "f64_from_str")]
pub pos_long_apt: f64,
#[serde(deserialize_with = "f64_from_str")]
pub pos_lat_fix: f64,
#[serde(deserialize_with = "f64_from_str")]
pub pos_long_fix: f64,
#[serde(deserialize_with = "u16_from_str")]
pub elapsed_time: u16,
#[serde(deserialize_with = "u32_from_str")]
pub min_fob: u32,
#[serde(deserialize_with = "u32_from_str")]
pub est_fob: u32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Tlr {
pub takeoff: TlrContainer,
pub landing: TlrContainer,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct TlrContainer {
pub conditions: TlrConditions,
pub distance_dry: Option<TlrDistance>,
pub distance_wet: Option<TlrDistance>,
pub runway: Vec<TlrRunway>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct TlrConditions {
pub airport_icao: String,
pub planned_runway: String,
#[serde(deserialize_with = "u32_from_str")]
pub planned_weight: u32,
#[serde(deserialize_with = "u16_from_str")]
pub wind_direction: u16,
#[serde(deserialize_with = "u8_from_str")]
pub wind_speed: u8,
#[serde(deserialize_with = "i8_from_str")]
pub temperature: i8,
#[serde(deserialize_with = "f64_from_str")]
pub altimeter: f64,
pub surface_condition: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct TlrRunway {
pub identifier: String,
#[serde(deserialize_with = "u16_from_str")]
pub length: u16,
#[serde(deserialize_with = "u16_from_str")]
pub length_tora: u16,
#[serde(deserialize_with = "u16_from_str")]
pub length_toda: u16,
#[serde(deserialize_with = "u16_from_str")]
pub length_asda: u16,
#[serde(deserialize_with = "u16_from_str")]
pub length_lda: u16,
#[serde(deserialize_with = "u16_from_str")]
pub elevation: u16,
#[serde(deserialize_with = "f64_from_str")]
pub gradient: f64,
#[serde(deserialize_with = "u16_from_str")]
pub true_course: u16,
#[serde(deserialize_with = "u16_from_str")]
pub magnetic_course: u16,
#[serde(deserialize_with = "i8_from_str")]
pub headwind_component: i8,
#[serde(deserialize_with = "i8_from_str")]
pub crosswind_component: i8,
#[serde(default, deserialize_with = "option_f64_from_str")]
pub ils_frequency: Option<f64>,
pub flap_setting: Option<String>,
pub thrust_setting: Option<String>,
pub bleed_setting: Option<String>,
pub anti_ice_setting: Option<String>,
#[serde(default, deserialize_with = "option_u8_from_str")]
pub flex_temperature: Option<u8>,
#[serde(default, deserialize_with = "option_u8_from_str")]
pub max_temperature: Option<u8>,
#[serde(default, deserialize_with = "option_u32_from_str")]
pub max_weight: Option<u32>,
pub limit_code: Option<String>,
pub limit_obstacle: Option<String>,
#[serde(default, deserialize_with = "option_u8_from_str")]
pub speeds_v1: Option<u8>,
#[serde(default, deserialize_with = "option_u8_from_str")]
pub speeds_vr: Option<u8>,
#[serde(default, deserialize_with = "option_u8_from_str")]
pub speeds_v2: Option<u8>,
#[serde(default, deserialize_with = "option_u8_from_str")]
pub speeds_other: Option<u8>,
pub speeds_other_id: Option<String>,
#[serde(default, deserialize_with = "option_u16_from_str")]
pub distance_decide: Option<u16>,
#[serde(default, deserialize_with = "option_u16_from_str")]
pub distance_reject: Option<u16>,
#[serde(default, deserialize_with = "option_u16_from_str")]
pub distance_margin: Option<u16>,
#[serde(default, deserialize_with = "option_u16_from_str")]
pub distance_continue: Option<u16>,
#[serde(default, deserialize_with = "option_u32_from_str")]
pub max_weight_dry: Option<u32>,
#[serde(default, deserialize_with = "option_u32_from_str")]
pub max_weight_wet: Option<u32>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct TlrDistance {
#[serde(deserialize_with = "u32_from_str")]
pub weight: u32,
pub flap_setting: String,
pub brake_setting: String,
pub reverser_credit: String,
#[serde(default, deserialize_with = "option_u8_from_str")]
pub speeds_vref: Option<u8>,
#[serde(deserialize_with = "u16_from_str")]
pub actual_distance: u16,
#[serde(deserialize_with = "u16_from_str")]
pub factored_distance: u16,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Atc {
pub flightplan_text: String,
pub route: String,
pub route_ifps: String,
pub callsign: String,
pub initial_spd: String,
pub initial_spd_unit: String,
pub initial_alt: String,
pub initial_alt_unit: String,
pub section18: String,
pub fir_orig: String,
pub fir_dest: String,
pub fir_altn: Option<Vec<String>>,
pub fir_etops: Option<Vec<String>>,
pub fir_enroute: Option<Vec<String>>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Aircraft {
pub icaocode: String,
pub iatacode: String,
pub base_type: String,
pub icao_code: String,
pub iata_code: String,
pub name: Option<String>,
pub reg: String,
pub fin: Option<String>,
pub selcal: Option<String>,
pub equip: Option<String>,
pub fuelfact: String,
pub fuelfactor: String,
#[serde(deserialize_with = "u16_from_str")]
pub max_passengers: u16,
pub supports_tlr: String,
pub internal_id: String,
#[serde(deserialize_with = "bool_from_str")]
pub is_custom: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Fuel {
#[serde(deserialize_with = "u32_from_str")]
pub taxi: u32,
#[serde(deserialize_with = "u32_from_str")]
pub enroute_burn: u32,
#[serde(deserialize_with = "u32_from_str")]
pub contingency: u32,
#[serde(deserialize_with = "u32_from_str")]
pub alternate_burn: u32,
#[serde(deserialize_with = "u32_from_str")]
pub reserve: u32,
#[serde(deserialize_with = "u32_from_str")]
pub etops: u32,
#[serde(deserialize_with = "u32_from_str")]
pub extra: u32,
#[serde(deserialize_with = "u32_from_str")]
pub extra_required: u32,
#[serde(deserialize_with = "u32_from_str")]
pub extra_optional: u32,
#[serde(deserialize_with = "u32_from_str")]
pub min_takeoff: u32,
#[serde(deserialize_with = "u32_from_str")]
pub plan_takeoff: u32,
#[serde(deserialize_with = "u32_from_str")]
pub plan_ramp: u32,
#[serde(deserialize_with = "u32_from_str")]
pub plan_landing: u32,
#[serde(deserialize_with = "u32_from_str")]
pub avg_fuel_flow: u32,
#[serde(deserialize_with = "u32_from_str")]
pub max_tanks: u32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct FuelExtra {
pub bucket: Vec<FuelBucket>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct FuelBucket {
pub label: String,
#[serde(deserialize_with = "u32_from_str")]
pub fuel: u32,
#[serde(deserialize_with = "u16_from_str")]
pub time: u16,
pub required: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Times {
#[serde(deserialize_with = "u16_from_str")]
pub est_time_enroute: u16,
#[serde(deserialize_with = "u16_from_str")]
pub sched_time_enroute: u16,
#[serde(deserialize_with = "ts_from_string")]
pub sched_out: DateTime<Utc>,
#[serde(deserialize_with = "ts_from_string")]
pub sched_off: DateTime<Utc>,
#[serde(deserialize_with = "ts_from_string")]
pub sched_on: DateTime<Utc>,
#[serde(deserialize_with = "ts_from_string")]
pub sched_in: DateTime<Utc>,
#[serde(deserialize_with = "u16_from_str")]
pub sched_block: u16,
#[serde(deserialize_with = "ts_from_string")]
pub est_out: DateTime<Utc>,
#[serde(deserialize_with = "ts_from_string")]
pub est_off: DateTime<Utc>,
#[serde(deserialize_with = "ts_from_string")]
pub est_on: DateTime<Utc>,
#[serde(deserialize_with = "ts_from_string")]
pub est_in: DateTime<Utc>,
#[serde(deserialize_with = "u16_from_str")]
pub est_block: u16,
#[serde(deserialize_with = "i8_from_str")]
pub orig_timezone: i8,
#[serde(deserialize_with = "i8_from_str")]
pub dest_timezone: i8,
#[serde(deserialize_with = "u16_from_str")]
pub taxi_out: u16,
#[serde(deserialize_with = "u16_from_str")]
pub taxi_in: u16,
#[serde(deserialize_with = "u16_from_str")]
pub reserve_time: u16,
#[serde(deserialize_with = "u16_from_str")]
pub endurance: u16,
#[serde(deserialize_with = "u16_from_str")]
pub contfuel_time: u16,
#[serde(deserialize_with = "u16_from_str")]
pub etopsfuel_time: u16,
#[serde(deserialize_with = "u16_from_str")]
pub extrafuel_time: u16,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Weights {
#[serde(deserialize_with = "u32_from_str")]
pub oew: u32,
#[serde(deserialize_with = "u16_from_str")]
pub pax_count: u16,
#[serde(deserialize_with = "u16_from_str")]
pub bag_count: u16,
#[serde(deserialize_with = "u16_from_str")]
pub pax_count_actual: u16,
#[serde(deserialize_with = "u16_from_str")]
pub bag_count_actual: u16,
#[serde(deserialize_with = "f64_from_str")]
pub pax_weight: f64,
#[serde(deserialize_with = "f64_from_str")]
pub bag_weight: f64,
#[serde(deserialize_with = "f64_from_str")]
pub freight_added: f64,
#[serde(deserialize_with = "u32_from_str")]
pub cargo: u32,
#[serde(deserialize_with = "u32_from_str")]
pub payload: u32,
#[serde(deserialize_with = "u32_from_str")]
pub est_zfw: u32,
#[serde(deserialize_with = "u32_from_str")]
pub max_zfw: u32,
#[serde(deserialize_with = "u32_from_str")]
pub est_tow: u32,
#[serde(deserialize_with = "u32_from_str")]
pub max_tow: u32,
#[serde(deserialize_with = "u32_from_str")]
pub max_tow_struct: u32,
pub tow_limit_code: String,
#[serde(deserialize_with = "u32_from_str")]
pub est_ldw: u32,
#[serde(deserialize_with = "u32_from_str")]
pub max_ldw: u32,
#[serde(deserialize_with = "u32_from_str")]
pub est_ramp: u32,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Impacts {
pub minus_6000ft: Option<Impact>,
pub minus_4000ft: Option<Impact>,
pub minus_2000ft: Option<Impact>,
pub plus_2000ft: Option<Impact>,
pub plus_4000ft: Option<Impact>,
pub plus_6000ft: Option<Impact>,
pub higher_ci: Option<Impact>,
pub lower_ci: Option<Impact>,
pub zfw_plus_1000: Option<Impact>,
pub zfw_minus_1000: Option<Impact>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Impact {
#[serde(deserialize_with = "u32_from_str")]
pub time_enroute: u32,
#[serde(deserialize_with = "i32_from_str")]
pub time_difference: i32,
#[serde(deserialize_with = "u32_from_str")]
pub enroute_burn: u32,
#[serde(deserialize_with = "i32_from_str")]
pub burn_difference: i32,
#[serde(deserialize_with = "u32_from_str")]
pub ramp_fuel: u32,
#[serde(deserialize_with = "u16_from_str")]
pub initial_fl: u16,
#[serde(deserialize_with = "u16_from_str")]
pub initial_tas: u16,
pub initial_mach: String,
#[serde(deserialize_with = "u16_from_str")]
pub cost_index: u16,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Crew {
#[serde(deserialize_with = "u32_from_str")]
pub pilot_id: u32,
pub cpt: String,
pub fo: String,
pub dx: String,
pub pu: String,
pub fa: Vec<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Notams {
#[serde(alias = "rec-count")]
pub rec_count: String,
pub notamdrec: Vec<NotamDrec>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct NotamDrec {
pub source_id: String,
pub account_id: String,
#[serde(alias = "notam_id")]
pub id: String,
#[serde(alias = "notam_part")]
pub part: String,
pub cns_location_id: String,
pub icao_id: String,
pub icao_name: Option<String>,
pub total_parts: String,
#[serde(alias = "notam_created_dtg")]
pub created_dtg: String,
#[serde(alias = "notam_effective_dtg")]
pub effective_dtg: String,
#[serde(alias = "notam_expire_dtg")]
pub expire_dtg: Option<String>,
#[serde(alias = "notam_expire_dtg_estimated")]
pub expire_dtg_estimated: Option<String>,
#[serde(alias = "notam_lastmod_dtg")]
pub lastmod_dtg: String,
#[serde(alias = "notam_inserted_dtg")]
pub inserted_dtg: String,
#[serde(alias = "notam_text")]
pub text: String,
#[serde(alias = "notam_report")]
pub report: String,
#[serde(alias = "notam_nrc")]
pub nrc: Option<String>,
#[serde(alias = "notam_qcode")]
pub qcode: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Weather {
pub orig_metar: String,
pub orig_taf: String,
pub dest_metar: String,
pub dest_taf: String,
pub altn_metar: Option<Vec<String>>,
pub altn_taf: Option<Vec<String>>,
pub toaltn_metar: Option<String>,
pub toaltn_taf: Option<String>,
pub eualtn_metar: Option<String>,
pub eualtn_taf: Option<String>,
pub etops_metar: Option<Vec<String>>,
pub etops_taf: Option<Vec<String>>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Sigmets {
pub sigmet: Vec<Sigmet>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Sigmet {
#[serde(alias = "type")]
pub variant: String,
pub loc: String,
pub address: String,
pub title: String,
pub fir: String,
pub fir_name: String,
pub id: String,
pub hazard: String,
pub qualifier: Option<String>,
#[serde(deserialize_with = "ts_from_string")]
pub issued: DateTime<Utc>,
#[serde(deserialize_with = "ts_from_string")]
pub start: DateTime<Utc>,
#[serde(deserialize_with = "ts_from_string")]
pub end: DateTime<Utc>,
pub text: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct GenericOfp {
pub user_id: u32,
pub time: u32,
pub airac: String,
pub airline_icao: String,
pub flight_number: String,
pub callsign: String,
pub costindex: u16,
pub initial_altitude: u16,
pub stepclimb: String,
pub route_distance: u16,
pub total_burn: u32,
pub route: String,
pub origin_icao: String,
pub origin_name: String,
pub origin_plan_rwy: String,
pub origin_procedure: String,
pub destination_icao: String,
pub destination_name: String,
pub destination_plan_rwy: String,
pub destination_procedure: String,
pub alternates: Vec<String>,
}