diff --git a/inc/Gtfs/FeedHeader.php b/inc/Gtfs/FeedHeader.php
new file mode 100644
index 0000000..88ae19e
--- /dev/null
+++ b/inc/Gtfs/FeedHeader.php
@@ -0,0 +1,314 @@
+<?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;
+
+/**
+ * Metadata about a feed, included in feed messages.
+ *
+ * Generated from protobuf message <code>gtfs.FeedHeader</code>
+ */
+class FeedHeader extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Version of the feed specification.
+     * The current version is 1.0.
+     *
+     * Generated from protobuf field <code>string gtfs_version = 1;</code>
+     */
+    protected $gtfs_version = '';
+    /**
+     * The feed_publisher_name field contains the full name of the organization that publishes the feed.
+     *
+     * Generated from protobuf field <code>string feed_publisher_name = 2;</code>
+     */
+    protected $feed_publisher_name = '';
+    /**
+     * The feed_publisher_url field contains the URL of the feed publishing organization's website.
+     *
+     * Generated from protobuf field <code>string feed_publisher_url = 3;</code>
+     */
+    protected $feed_publisher_url = '';
+    /**
+     * The feed_lang field contains a IETF BCP 47 language code specifying the default language used for the text in this feed.
+     *
+     * Generated from protobuf field <code>string feed_lang = 4;</code>
+     */
+    protected $feed_lang = '';
+    /**
+     * The feed provides complete and reliable schedule information for service in the period from the beginning of the
+     * feed_start_date day to the end of the feed_end_date day in YYYYMMDD
+     *
+     * Generated from protobuf field <code>string feed_start_date = 5;</code>
+     */
+    protected $feed_start_date = '';
+    /**
+     * Generated from protobuf field <code>string feed_end_date = 6;</code>
+     */
+    protected $feed_end_date = '';
+    /**
+     * The feed publisher can specify a string here that indicates the current version of their GTFS feed.
+     *
+     * Generated from protobuf field <code>string feed_version = 7;</code>
+     */
+    protected $feed_version = '';
+    /**
+     * 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 $gtfs_version
+     *           Version of the feed specification.
+     *           The current version is 1.0.
+     *     @type string $feed_publisher_name
+     *           The feed_publisher_name field contains the full name of the organization that publishes the feed.
+     *     @type string $feed_publisher_url
+     *           The feed_publisher_url field contains the URL of the feed publishing organization's website.
+     *     @type string $feed_lang
+     *           The feed_lang field contains a IETF BCP 47 language code specifying the default language used for the text in this feed.
+     *     @type string $feed_start_date
+     *           The feed provides complete and reliable schedule information for service in the period from the beginning of the
+     *           feed_start_date day to the end of the feed_end_date day in YYYYMMDD
+     *     @type string $feed_end_date
+     *     @type string $feed_version
+     *           The feed publisher can specify a string here that indicates the current version of their GTFS feed.
+     *     @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);
+    }
+
+    /**
+     * Version of the feed specification.
+     * The current version is 1.0.
+     *
+     * Generated from protobuf field <code>string gtfs_version = 1;</code>
+     * @return string
+     */
+    public function getGtfsVersion()
+    {
+        return $this->gtfs_version;
+    }
+
+    /**
+     * Version of the feed specification.
+     * The current version is 1.0.
+     *
+     * Generated from protobuf field <code>string gtfs_version = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setGtfsVersion($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->gtfs_version = $var;
+
+        return $this;
+    }
+
+    /**
+     * The feed_publisher_name field contains the full name of the organization that publishes the feed.
+     *
+     * Generated from protobuf field <code>string feed_publisher_name = 2;</code>
+     * @return string
+     */
+    public function getFeedPublisherName()
+    {
+        return $this->feed_publisher_name;
+    }
+
+    /**
+     * The feed_publisher_name field contains the full name of the organization that publishes the feed.
+     *
+     * Generated from protobuf field <code>string feed_publisher_name = 2;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setFeedPublisherName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->feed_publisher_name = $var;
+
+        return $this;
+    }
+
+    /**
+     * The feed_publisher_url field contains the URL of the feed publishing organization's website.
+     *
+     * Generated from protobuf field <code>string feed_publisher_url = 3;</code>
+     * @return string
+     */
+    public function getFeedPublisherUrl()
+    {
+        return $this->feed_publisher_url;
+    }
+
+    /**
+     * The feed_publisher_url field contains the URL of the feed publishing organization's website.
+     *
+     * Generated from protobuf field <code>string feed_publisher_url = 3;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setFeedPublisherUrl($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->feed_publisher_url = $var;
+
+        return $this;
+    }
+
+    /**
+     * The feed_lang field contains a IETF BCP 47 language code specifying the default language used for the text in this feed.
+     *
+     * Generated from protobuf field <code>string feed_lang = 4;</code>
+     * @return string
+     */
+    public function getFeedLang()
+    {
+        return $this->feed_lang;
+    }
+
+    /**
+     * The feed_lang field contains a IETF BCP 47 language code specifying the default language used for the text in this feed.
+     *
+     * Generated from protobuf field <code>string feed_lang = 4;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setFeedLang($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->feed_lang = $var;
+
+        return $this;
+    }
+
+    /**
+     * The feed provides complete and reliable schedule information for service in the period from the beginning of the
+     * feed_start_date day to the end of the feed_end_date day in YYYYMMDD
+     *
+     * Generated from protobuf field <code>string feed_start_date = 5;</code>
+     * @return string
+     */
+    public function getFeedStartDate()
+    {
+        return $this->feed_start_date;
+    }
+
+    /**
+     * The feed provides complete and reliable schedule information for service in the period from the beginning of the
+     * feed_start_date day to the end of the feed_end_date day in YYYYMMDD
+     *
+     * Generated from protobuf field <code>string feed_start_date = 5;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setFeedStartDate($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->feed_start_date = $var;
+
+        return $this;
+    }
+
+    /**
+     * Generated from protobuf field <code>string feed_end_date = 6;</code>
+     * @return string
+     */
+    public function getFeedEndDate()
+    {
+        return $this->feed_end_date;
+    }
+
+    /**
+     * Generated from protobuf field <code>string feed_end_date = 6;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setFeedEndDate($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->feed_end_date = $var;
+
+        return $this;
+    }
+
+    /**
+     * The feed publisher can specify a string here that indicates the current version of their GTFS feed.
+     *
+     * Generated from protobuf field <code>string feed_version = 7;</code>
+     * @return string
+     */
+    public function getFeedVersion()
+    {
+        return $this->feed_version;
+    }
+
+    /**
+     * The feed publisher can specify a string here that indicates the current version of their GTFS feed.
+     *
+     * Generated from protobuf field <code>string feed_version = 7;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setFeedVersion($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->feed_version = $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;
+    }
+
+}
+
