diff --git a/inc/Gtfs/CalendarDate.php b/inc/Gtfs/CalendarDate.php
new file mode 100644
index 0000000..a3f9240
--- /dev/null
+++ b/inc/Gtfs/CalendarDate.php
@@ -0,0 +1,161 @@
+<?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.CalendarDate</code>
+ */
+class CalendarDate extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The trip_id field contains an ID that identifies a trip. The trip_id is dataset unique.
+     *
+     * Generated from protobuf field <code>string service_id = 1;</code>
+     */
+    protected $service_id = '';
+    /**
+     * Generated from protobuf field <code>string date = 2;</code>
+     */
+    protected $date = '';
+    /**
+     * Generated from protobuf field <code>.gtfs.CalendarDate.ExceptionType exception_type = 3;</code>
+     */
+    protected $exception_type = 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 $service_id
+     *           The trip_id field contains an ID that identifies a trip. The trip_id is dataset unique.
+     *     @type string $date
+     *     @type int $exception_type
+     *     @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 trip_id field contains an ID that identifies a trip. The trip_id is dataset unique.
+     *
+     * Generated from protobuf field <code>string service_id = 1;</code>
+     * @return string
+     */
+    public function getServiceId()
+    {
+        return $this->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 service_id = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setServiceId($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->service_id = $var;
+
+        return $this;
+    }
+
+    /**
+     * Generated from protobuf field <code>string date = 2;</code>
+     * @return string
+     */
+    public function getDate()
+    {
+        return $this->date;
+    }
+
+    /**
+     * Generated from protobuf field <code>string date = 2;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setDate($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->date = $var;
+
+        return $this;
+    }
+
+    /**
+     * Generated from protobuf field <code>.gtfs.CalendarDate.ExceptionType exception_type = 3;</code>
+     * @return int
+     */
+    public function getExceptionType()
+    {
+        return $this->exception_type;
+    }
+
+    /**
+     * Generated from protobuf field <code>.gtfs.CalendarDate.ExceptionType exception_type = 3;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setExceptionType($var)
+    {
+        GPBUtil::checkEnum($var, \Gtfs\CalendarDate_ExceptionType::class);
+        $this->exception_type = $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;
+    }
+
+}
+
