diff --git a/inc/Gtfs/Trip.php b/inc/Gtfs/Trip.php
new file mode 100644
index 0000000..0452c4f
--- /dev/null
+++ b/inc/Gtfs/Trip.php
@@ -0,0 +1,346 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: proto/gtfs.proto
+
+namespace Gtfs;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Generated from protobuf message <code>gtfs.Trip</code>
+ */
+class Trip extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The route_id field contains an ID that uniquely identifies a route.
+     *
+     * Generated from protobuf field <code>string route_id = 1;</code>
+     */
+    protected $route_id = '';
+    /**
+     * The service_id contains an ID that uniquely identifies a set of dates when service is available for one or more routes.
+     *
+     * Generated from protobuf field <code>string service_id = 2;</code>
+     */
+    protected $service_id = '';
+    /**
+     * The trip_id field contains an ID that identifies a trip. The trip_id is dataset unique.
+     *
+     * Generated from protobuf field <code>string trip_id = 3;</code>
+     */
+    protected $trip_id = '';
+    /**
+     * The trip_headsign field contains the text that appears on a sign that identifies the trip's destination to passengers.
+     *
+     * Generated from protobuf field <code>string trip_headsign = 4;</code>
+     */
+    protected $trip_headsign = '';
+    /**
+     * The trip_short_name field contains the text that appears in schedules and sign boards to identify the trip to passengers.
+     *
+     * Generated from protobuf field <code>string trip_short_name = 5;</code>
+     */
+    protected $trip_short_name = '';
+    /**
+     * Generated from protobuf field <code>.gtfs.Trip.Direction direction_id = 6;</code>
+     */
+    protected $direction_id = 0;
+    /**
+     * The block_id field identifies the block to which the trip belongs.
+     * A block consists of two or more sequential trips made using the same vehicle,
+     * where a passenger can transfer from one trip to the next just by staying in the vehicle.
+     *
+     * Generated from protobuf field <code>string block_id = 7;</code>
+     */
+    protected $block_id = '';
+    /**
+     * The shape_id field contains an ID that defines a shape for the trip.
+     *
+     * Generated from protobuf field <code>string shape_id = 8;</code>
+     */
+    protected $shape_id = '';
+    /**
+     * The extensions namespace allows 3rd-party developers to extend the
+     * GTFS specification in order to add and evaluate new features and
+     * modifications to the spec.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Any extension = 2000;</code>
+     */
+    protected $extension = null;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $route_id
+     *           The route_id field contains an ID that uniquely identifies a route.
+     *     @type string $service_id
+     *           The service_id contains an ID that uniquely identifies a set of dates when service is available for one or more routes.
+     *     @type string $trip_id
+     *           The trip_id field contains an ID that identifies a trip. The trip_id is dataset unique.
+     *     @type string $trip_headsign
+     *           The trip_headsign field contains the text that appears on a sign that identifies the trip's destination to passengers.
+     *     @type string $trip_short_name
+     *           The trip_short_name field contains the text that appears in schedules and sign boards to identify the trip to passengers.
+     *     @type int $direction_id
+     *     @type string $block_id
+     *           The block_id field identifies the block to which the trip belongs.
+     *           A block consists of two or more sequential trips made using the same vehicle,
+     *           where a passenger can transfer from one trip to the next just by staying in the vehicle.
+     *     @type string $shape_id
+     *           The shape_id field contains an ID that defines a shape for the trip.
+     *     @type \Google\Protobuf\Any $extension
+     *           The extensions namespace allows 3rd-party developers to extend the
+     *           GTFS specification in order to add and evaluate new features and
+     *           modifications to the spec.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Proto\Gtfs::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The route_id field contains an ID that uniquely identifies a route.
+     *
+     * Generated from protobuf field <code>string route_id = 1;</code>
+     * @return string
+     */
+    public function getRouteId()
+    {
+        return $this->route_id;
+    }
+
+    /**
+     * The route_id field contains an ID that uniquely identifies a route.
+     *
+     * Generated from protobuf field <code>string route_id = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setRouteId($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->route_id = $var;
+
+        return $this;
+    }
+
+    /**
+     * The service_id contains an ID that uniquely identifies a set of dates when service is available for one or more routes.
+     *
+     * Generated from protobuf field <code>string service_id = 2;</code>
+     * @return string
+     */
+    public function getServiceId()
+    {
+        return $this->service_id;
+    }
+
+    /**
+     * The service_id contains an ID that uniquely identifies a set of dates when service is available for one or more routes.
+     *
+     * Generated from protobuf field <code>string service_id = 2;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setServiceId($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->service_id = $var;
+
+        return $this;
+    }
+
+    /**
+     * The trip_id field contains an ID that identifies a trip. The trip_id is dataset unique.
+     *
+     * Generated from protobuf field <code>string trip_id = 3;</code>
+     * @return string
+     */
+    public function getTripId()
+    {
+        return $this->trip_id;
+    }
+
+    /**
+     * The trip_id field contains an ID that identifies a trip. The trip_id is dataset unique.
+     *
+     * Generated from protobuf field <code>string trip_id = 3;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setTripId($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->trip_id = $var;
+
+        return $this;
+    }
+
+    /**
+     * The trip_headsign field contains the text that appears on a sign that identifies the trip's destination to passengers.
+     *
+     * Generated from protobuf field <code>string trip_headsign = 4;</code>
+     * @return string
+     */
+    public function getTripHeadsign()
+    {
+        return $this->trip_headsign;
+    }
+
+    /**
+     * The trip_headsign field contains the text that appears on a sign that identifies the trip's destination to passengers.
+     *
+     * Generated from protobuf field <code>string trip_headsign = 4;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setTripHeadsign($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->trip_headsign = $var;
+
+        return $this;
+    }
+
+    /**
+     * The trip_short_name field contains the text that appears in schedules and sign boards to identify the trip to passengers.
+     *
+     * Generated from protobuf field <code>string trip_short_name = 5;</code>
+     * @return string
+     */
+    public function getTripShortName()
+    {
+        return $this->trip_short_name;
+    }
+
+    /**
+     * The trip_short_name field contains the text that appears in schedules and sign boards to identify the trip to passengers.
+     *
+     * Generated from protobuf field <code>string trip_short_name = 5;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setTripShortName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->trip_short_name = $var;
+
+        return $this;
+    }
+
+    /**
+     * Generated from protobuf field <code>.gtfs.Trip.Direction direction_id = 6;</code>
+     * @return int
+     */
+    public function getDirectionId()
+    {
+        return $this->direction_id;
+    }
+
+    /**
+     * Generated from protobuf field <code>.gtfs.Trip.Direction direction_id = 6;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setDirectionId($var)
+    {
+        GPBUtil::checkEnum($var, \Gtfs\Trip_Direction::class);
+        $this->direction_id = $var;
+
+        return $this;
+    }
+
+    /**
+     * The block_id field identifies the block to which the trip belongs.
+     * A block consists of two or more sequential trips made using the same vehicle,
+     * where a passenger can transfer from one trip to the next just by staying in the vehicle.
+     *
+     * Generated from protobuf field <code>string block_id = 7;</code>
+     * @return string
+     */
+    public function getBlockId()
+    {
+        return $this->block_id;
+    }
+
+    /**
+     * The block_id field identifies the block to which the trip belongs.
+     * A block consists of two or more sequential trips made using the same vehicle,
+     * where a passenger can transfer from one trip to the next just by staying in the vehicle.
+     *
+     * Generated from protobuf field <code>string block_id = 7;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setBlockId($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->block_id = $var;
+
+        return $this;
+    }
+
+    /**
+     * The shape_id field contains an ID that defines a shape for the trip.
+     *
+     * Generated from protobuf field <code>string shape_id = 8;</code>
+     * @return string
+     */
+    public function getShapeId()
+    {
+        return $this->shape_id;
+    }
+
+    /**
+     * The shape_id field contains an ID that defines a shape for the trip.
+     *
+     * Generated from protobuf field <code>string shape_id = 8;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setShapeId($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->shape_id = $var;
+
+        return $this;
+    }
+
+    /**
+     * The extensions namespace allows 3rd-party developers to extend the
+     * GTFS specification in order to add and evaluate new features and
+     * modifications to the spec.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Any extension = 2000;</code>
+     * @return \Google\Protobuf\Any
+     */
+    public function getExtension()
+    {
+        return $this->extension;
+    }
+
+    /**
+     * The extensions namespace allows 3rd-party developers to extend the
+     * GTFS specification in order to add and evaluate new features and
+     * modifications to the spec.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Any extension = 2000;</code>
+     * @param \Google\Protobuf\Any $var
+     * @return $this
+     */
+    public function setExtension($var)
+    {
+        GPBUtil::checkMessage($var, \Google\Protobuf\Any::class);
+        $this->extension = $var;
+
+        return $this;
+    }
+
+}
+
