/*
 * MOTIS API
 *
 * This is the MOTIS routing API.
 *
 * The version of the OpenAPI document: v1
 * Contact: felix@triptix.tech
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Itinerary {
    /// journey duration in seconds
    #[serde(rename = "duration")]
    pub duration: i32,
    /// journey departure time
    #[serde(rename = "startTime")]
    pub start_time: String,
    /// journey arrival time
    #[serde(rename = "endTime")]
    pub end_time: String,
    /// The number of transfers this trip has.
    #[serde(rename = "transfers")]
    pub transfers: i32,
    /// Journey legs
    #[serde(rename = "legs")]
    pub legs: Vec<models::Leg>,
}

impl Itinerary {
    pub fn new(duration: i32, start_time: String, end_time: String, transfers: i32, legs: Vec<models::Leg>) -> Itinerary {
        Itinerary {
            duration,
            start_time,
            end_time,
            transfers,
            legs,
        }
    }
}

