diff --git a/inc/Gtfs/Frequency.php b/inc/Gtfs/Frequency.php
new file mode 100644
index 0000000..6d53d50
--- /dev/null
+++ b/inc/Gtfs/Frequency.php
@@ -0,0 +1,208 @@
+<?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.Frequency</code>
+ */
+class Frequency extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Generated from protobuf field <code>string trip_id = 1;</code>
+     */
+    protected $trip_id = '';
+    /**
+     * Generated from protobuf field <code>string start_time = 2;</code>
+     */
+    protected $start_time = '';
+    /**
+     * Generated from protobuf field <code>string end_time = 3;</code>
+     */
+    protected $end_time = '';
+    /**
+     * Generated from protobuf field <code>int32 headway_secs = 4;</code>
+     */
+    protected $headway_secs = 0;
+    /**
+     * Generated from protobuf field <code>.gtfs.Frequency.ScheduleType exact_times = 5;</code>
+     */
+    protected $exact_times = 0;
+    /**
+     * 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 $trip_id
+     *     @type string $start_time
+     *     @type string $end_time
+     *     @type int $headway_secs
+     *     @type int $exact_times
+     *     @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);
+    }
+
+    /**
+     * Generated from protobuf field <code>string trip_id = 1;</code>
+     * @return string
+     */
+    public function getTripId()
+    {
+        return $this->trip_id;
+    }
+
+    /**
+     * Generated from protobuf field <code>string trip_id = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setTripId($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->trip_id = $var;
+
+        return $this;
+    }
+
+    /**
+     * Generated from protobuf field <code>string start_time = 2;</code>
+     * @return string
+     */
+    public function getStartTime()
+    {
+        return $this->start_time;
+    }
+
+    /**
+     * Generated from protobuf field <code>string start_time = 2;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setStartTime($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->start_time = $var;
+
+        return $this;
+    }
+
+    /**
+     * Generated from protobuf field <code>string end_time = 3;</code>
+     * @return string
+     */
+    public function getEndTime()
+    {
+        return $this->end_time;
+    }
+
+    /**
+     * Generated from protobuf field <code>string end_time = 3;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setEndTime($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->end_time = $var;
+
+        return $this;
+    }
+
+    /**
+     * Generated from protobuf field <code>int32 headway_secs = 4;</code>
+     * @return int
+     */
+    public function getHeadwaySecs()
+    {
+        return $this->headway_secs;
+    }
+
+    /**
+     * Generated from protobuf field <code>int32 headway_secs = 4;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setHeadwaySecs($var)
+    {
+        GPBUtil::checkInt32($var);
+        $this->headway_secs = $var;
+
+        return $this;
+    }
+
+    /**
+     * Generated from protobuf field <code>.gtfs.Frequency.ScheduleType exact_times = 5;</code>
+     * @return int
+     */
+    public function getExactTimes()
+    {
+        return $this->exact_times;
+    }
+
+    /**
+     * Generated from protobuf field <code>.gtfs.Frequency.ScheduleType exact_times = 5;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setExactTimes($var)
+    {
+        GPBUtil::checkEnum($var, \Gtfs\Frequency_ScheduleType::class);
+        $this->exact_times = $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;
+    }
+
+}
+
