/*
 * Reseplaneraren
 * Provides access to Västtrafik journey planner
 *
 * OpenAPI spec version: 1.10.1
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 *
 * Swagger Codegen version: 2.4.12
 *
 * Do not edit the class manually.
 *
 */

(function(root, factory) {
  if (typeof define === 'function' && define.amd) {
    // AMD. Register as an anonymous module.
    define(['ApiClient', 'model/Leg'], factory);
  } else if (typeof module === 'object' && module.exports) {
    // CommonJS-like environments that support module.exports, like Node.
    module.exports = factory(require('../ApiClient'), require('./Leg'));
  } else {
    // Browser globals (root is window)
    if (!root.Reseplaneraren) {
      root.Reseplaneraren = {};
    }
    root.Reseplaneraren.Trip = factory(root.Reseplaneraren.ApiClient, root.Reseplaneraren.Leg);
  }
}(this, function(ApiClient, Leg) {
  'use strict';

  /**
   * The Trip model module.
   * @module model/Trip
   * @version 1.10.1
   */

  /**
   * Constructs a new <code>Trip</code>.
   * @alias module:model/Trip
   * @class
   * @param alternative {Boolean} The type indicates whether this is an original connection or an realtime alternative
   */
  var exports = function(alternative) {
    this.alternative = alternative;
  };

  /**
   * Constructs a <code>Trip</code> from a plain JavaScript object, optionally creating a new instance.
   * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
   * @param {Object} data The plain JavaScript object bearing properties of interest.
   * @param {module:model/Trip} obj Optional instance to populate.
   * @return {module:model/Trip} The populated <code>Trip</code> instance.
   */
  exports.constructFromObject = function(data, obj) {
    if (data) {
      obj = obj || new exports();
      if (data.hasOwnProperty('Leg'))
        obj.leg = ApiClient.convertToType(data['Leg'], [Leg]);
      if (data.hasOwnProperty('travelWarranty'))
        obj.travelWarranty = ApiClient.convertToType(data['travelWarranty'], 'Boolean');
      if (data.hasOwnProperty('valid'))
        obj.valid = ApiClient.convertToType(data['valid'], 'Boolean');
      if (data.hasOwnProperty('alternative'))
        obj.alternative = ApiClient.convertToType(data['alternative'], 'Boolean');
      if (data.hasOwnProperty('type'))
        obj.type = ApiClient.convertToType(data['type'], 'String');
    }
    return obj;
  }

  /**
   * @member {Array.<module:model/Leg>} leg
   */
  exports.prototype.leg = undefined;

  /**
   * IMPORTANT NOTE: journeys that are presented when the default change margin has been disregarded are not covered by V�sttrafiks travel warranty (Swedish: resegaranti).
   * @member {Boolean} travelWarranty
   */
  exports.prototype.travelWarranty = undefined;

  /**
   * The state indicates if the trip is still possible to ride based on the current realtime situation
   * @member {Boolean} valid
   */
  exports.prototype.valid = undefined;

  /**
   * The type indicates whether this is an original connection or an realtime alternative
   * @member {Boolean} alternative
   */
  exports.prototype.alternative = undefined;

  /**
   * Type of trip
   * @member {module:model/Trip.TypeEnum} type
   */
  exports.prototype.type = undefined;


  /**
   * Allowed values for the <code>type</code> property.
   * @enum {String}
   * @readonly
   */
  exports.TypeEnum = {
    /**
     * value: "WALK"
     * @const
     */
    WALK: "WALK",

    /**
     * value: "BIKE"
     * @const
     */
    BIKE: "BIKE",

    /**
     * value: "CAR"
     * @const
     */
    CAR: "CAR"
  };

  return exports;

}));
