Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
788 changes: 413 additions & 375 deletions golang/gtfs/gtfs-realtime.pb.go

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion gtfs-realtime.proto
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,18 @@ message Alert {
// Time when the alert should be shown to the user. If missing, the
// alert will be shown as long as it appears in the feed.
// If multiple ranges are given, the alert will be shown during all of them.
repeated TimeRange active_period = 1;
// Should not be used - for backwards-compatibility only.
repeated TimeRange active_period = 1 [deprecated = true];

// Time when the alert should be shown to the user strictly for informative reasons.
// If missing, the consuming application can decide when it's appropriate to be shown.
// If multiple ranges are given, the alert will be shown during all of them.
repeated TimeRange communication_period = 2;

// Time when the services are affected by the alert. If communication_period is specified,
// every time interval in impact_period must be fully contained within at least
// one time interval of communication_period.
repeated TimeRange impact_period = 3;

// Entities whose users we should notify of this alert.
repeated EntitySelector informed_entity = 5;
Expand Down
2 changes: 1 addition & 1 deletion java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<groupId>org.mobilitydata</groupId>
<artifactId>gtfs-realtime-bindings</artifactId>
<version>0.1.1-SNAPSHOT</version>
<version>0.2.0</version>

<name>gtfs-realtime-bindings</name>
<description>Java classes generated from the GTFS-realtime protocol buffer specification.</description>
Expand Down
1,939 changes: 1,544 additions & 395 deletions java/src/main/java/com/google/transit/realtime/GtfsRealtime.java

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions nodejs/gtfs-realtime.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1387,6 +1387,12 @@ export namespace transit_realtime {
/** Alert activePeriod */
activePeriod?: (transit_realtime.ITimeRange[]|null);

/** Alert communicationPeriod */
communicationPeriod?: (transit_realtime.ITimeRange[]|null);

/** Alert impactPeriod */
impactPeriod?: (transit_realtime.ITimeRange[]|null);

/** Alert informedEntity */
informedEntity?: (transit_realtime.IEntitySelector[]|null);

Expand Down Expand Up @@ -1445,6 +1451,12 @@ export namespace transit_realtime {
/** Alert activePeriod. */
public activePeriod: transit_realtime.ITimeRange[];

/** Alert communicationPeriod. */
public communicationPeriod: transit_realtime.ITimeRange[];

/** Alert impactPeriod. */
public impactPeriod: transit_realtime.ITimeRange[];

/** Alert informedEntity. */
public informedEntity: transit_realtime.IEntitySelector[];

Expand Down
92 changes: 92 additions & 0 deletions nodejs/gtfs-realtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -4157,6 +4157,8 @@ $root.transit_realtime = (function() {
* @memberof transit_realtime
* @interface IAlert
* @property {Array.<transit_realtime.ITimeRange>|null} [activePeriod] Alert activePeriod
* @property {Array.<transit_realtime.ITimeRange>|null} [communicationPeriod] Alert communicationPeriod
* @property {Array.<transit_realtime.ITimeRange>|null} [impactPeriod] Alert impactPeriod
* @property {Array.<transit_realtime.IEntitySelector>|null} [informedEntity] Alert informedEntity
* @property {transit_realtime.Alert.Cause|null} [cause] Alert cause
* @property {transit_realtime.Alert.Effect|null} [effect] Alert effect
Expand Down Expand Up @@ -4184,6 +4186,8 @@ $root.transit_realtime = (function() {
*/
function Alert(properties) {
this.activePeriod = [];
this.communicationPeriod = [];
this.impactPeriod = [];
this.informedEntity = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
Expand All @@ -4199,6 +4203,22 @@ $root.transit_realtime = (function() {
*/
Alert.prototype.activePeriod = $util.emptyArray;

/**
* Alert communicationPeriod.
* @member {Array.<transit_realtime.ITimeRange>} communicationPeriod
* @memberof transit_realtime.Alert
* @instance
*/
Alert.prototype.communicationPeriod = $util.emptyArray;

/**
* Alert impactPeriod.
* @member {Array.<transit_realtime.ITimeRange>} impactPeriod
* @memberof transit_realtime.Alert
* @instance
*/
Alert.prototype.impactPeriod = $util.emptyArray;

/**
* Alert informedEntity.
* @member {Array.<transit_realtime.IEntitySelector>} informedEntity
Expand Down Expand Up @@ -4330,6 +4350,12 @@ $root.transit_realtime = (function() {
if (message.activePeriod != null && message.activePeriod.length)
for (var i = 0; i < message.activePeriod.length; ++i)
$root.transit_realtime.TimeRange.encode(message.activePeriod[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.communicationPeriod != null && message.communicationPeriod.length)
for (var i = 0; i < message.communicationPeriod.length; ++i)
$root.transit_realtime.TimeRange.encode(message.communicationPeriod[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
if (message.impactPeriod != null && message.impactPeriod.length)
for (var i = 0; i < message.impactPeriod.length; ++i)
$root.transit_realtime.TimeRange.encode(message.impactPeriod[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
if (message.informedEntity != null && message.informedEntity.length)
for (var i = 0; i < message.informedEntity.length; ++i)
$root.transit_realtime.EntitySelector.encode(message.informedEntity[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
Expand Down Expand Up @@ -4412,6 +4438,22 @@ $root.transit_realtime = (function() {
message.activePeriod.push($root.transit_realtime.TimeRange.decode(reader, reader.uint32(), undefined, _depth + 1));
continue;
}
case 2: {
if (wireType !== 2)
break;
if (!(message.communicationPeriod && message.communicationPeriod.length))
message.communicationPeriod = [];
message.communicationPeriod.push($root.transit_realtime.TimeRange.decode(reader, reader.uint32(), undefined, _depth + 1));
continue;
}
case 3: {
if (wireType !== 2)
break;
if (!(message.impactPeriod && message.impactPeriod.length))
message.impactPeriod = [];
message.impactPeriod.push($root.transit_realtime.TimeRange.decode(reader, reader.uint32(), undefined, _depth + 1));
continue;
}
case 5: {
if (wireType !== 2)
break;
Expand Down Expand Up @@ -4542,6 +4584,24 @@ $root.transit_realtime = (function() {
return "activePeriod." + error;
}
}
if (message.communicationPeriod != null && message.hasOwnProperty("communicationPeriod")) {
if (!Array.isArray(message.communicationPeriod))
return "communicationPeriod: array expected";
for (var i = 0; i < message.communicationPeriod.length; ++i) {
var error = $root.transit_realtime.TimeRange.verify(message.communicationPeriod[i], _depth + 1);
if (error)
return "communicationPeriod." + error;
}
}
if (message.impactPeriod != null && message.hasOwnProperty("impactPeriod")) {
if (!Array.isArray(message.impactPeriod))
return "impactPeriod: array expected";
for (var i = 0; i < message.impactPeriod.length; ++i) {
var error = $root.transit_realtime.TimeRange.verify(message.impactPeriod[i], _depth + 1);
if (error)
return "impactPeriod." + error;
}
}
if (message.informedEntity != null && message.hasOwnProperty("informedEntity")) {
if (!Array.isArray(message.informedEntity))
return "informedEntity: array expected";
Expand Down Expand Up @@ -4671,6 +4731,26 @@ $root.transit_realtime = (function() {
message.activePeriod[i] = $root.transit_realtime.TimeRange.fromObject(object.activePeriod[i], _depth + 1);
}
}
if (object.communicationPeriod) {
if (!Array.isArray(object.communicationPeriod))
throw TypeError(".transit_realtime.Alert.communicationPeriod: array expected");
message.communicationPeriod = Array(object.communicationPeriod.length);
for (var i = 0; i < object.communicationPeriod.length; ++i) {
if (typeof object.communicationPeriod[i] !== "object")
throw TypeError(".transit_realtime.Alert.communicationPeriod: object expected");
message.communicationPeriod[i] = $root.transit_realtime.TimeRange.fromObject(object.communicationPeriod[i], _depth + 1);
}
}
if (object.impactPeriod) {
if (!Array.isArray(object.impactPeriod))
throw TypeError(".transit_realtime.Alert.impactPeriod: array expected");
message.impactPeriod = Array(object.impactPeriod.length);
for (var i = 0; i < object.impactPeriod.length; ++i) {
if (typeof object.impactPeriod[i] !== "object")
throw TypeError(".transit_realtime.Alert.impactPeriod: object expected");
message.impactPeriod[i] = $root.transit_realtime.TimeRange.fromObject(object.impactPeriod[i], _depth + 1);
}
}
if (object.informedEntity) {
if (!Array.isArray(object.informedEntity))
throw TypeError(".transit_realtime.Alert.informedEntity: array expected");
Expand Down Expand Up @@ -4880,6 +4960,8 @@ $root.transit_realtime = (function() {
var object = {};
if (options.arrays || options.defaults) {
object.activePeriod = [];
object.communicationPeriod = [];
object.impactPeriod = [];
object.informedEntity = [];
}
if (options.defaults) {
Expand All @@ -4901,6 +4983,16 @@ $root.transit_realtime = (function() {
for (var j = 0; j < message.activePeriod.length; ++j)
object.activePeriod[j] = $root.transit_realtime.TimeRange.toObject(message.activePeriod[j], options);
}
if (message.communicationPeriod && message.communicationPeriod.length) {
object.communicationPeriod = Array(message.communicationPeriod.length);
for (var j = 0; j < message.communicationPeriod.length; ++j)
object.communicationPeriod[j] = $root.transit_realtime.TimeRange.toObject(message.communicationPeriod[j], options);
}
if (message.impactPeriod && message.impactPeriod.length) {
object.impactPeriod = Array(message.impactPeriod.length);
for (var j = 0; j < message.impactPeriod.length; ++j)
object.impactPeriod[j] = $root.transit_realtime.TimeRange.toObject(message.impactPeriod[j], options);
}
if (message.informedEntity && message.informedEntity.length) {
object.informedEntity = Array(message.informedEntity.length);
for (var j = 0; j < message.informedEntity.length; ++j)
Expand Down
2 changes: 1 addition & 1 deletion nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"tags": [
"gtfs-realtime"
],
"version": "2.1.0",
"version": "2.2.0",
"repository": {
"type": "git",
"url": "https://github.com/MobilityData/gtfs-realtime-bindings.git"
Expand Down
Loading
Loading