You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: push-v2.md
+126-10
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Events are sent in bulk and should only be rejected in case you have issues pars
11
11
12
12
Events are sent at-least once, meaning there might be duplicates.
13
13
14
-
## Event types
14
+
## Event types - JSON
15
15
16
16
There's two different event types; vehicle events and admin events.
17
17
@@ -1256,15 +1256,6 @@ Example:
1256
1256
1257
1257
#### car_service_booking
1258
1258
1259
-
##### BookingStatus enum
1260
-
1261
-
| Value | Description |
1262
-
|----------|-------------|
1263
-
|`NEW`| The booking is newly created. |
1264
-
|`CHANGED`| The booking has been modified. |
1265
-
|`CANCELLED`| The booking has been cancelled. |
1266
-
1267
-
1268
1259
Represents a car service booking record with the status of the booking and the appointment date.
1269
1260
1270
1261
| Name | Type | Unit/Format | Example | Description | Nullable |
@@ -1304,6 +1295,131 @@ Example:
1304
1295
]
1305
1296
```
1306
1297
1298
+
## Event types - Protobuf
1299
+
1300
+
Sending events via Protobuf is also supported. Vehicle event types follow a similar structure to their JSON counterparts.
1301
+
1302
+
- Syntax: `"proto3"`
1303
+
- Timestamps: `google.protobuf.Timestamp`,
1304
+
- For a Pub/Sub example, refer to the [Google Cloud Pub/Sub documentation](https://cloud.google.com/pubsub/docs/samples/pubsub-subscribe-proto-messages#pubsub_subscribe_proto_messages-cpp).
1305
+
1306
+
#### Vehicle event types
1307
+
1308
+
1309
+
Besides the `google.protobuf.Timestamp`, Protobuf files are self-contained. The base structure of most vehicle event types follows the following message definition:
1310
+
```proto
1311
+
message GenericVehicleEventType {
1312
+
string type = 1; // String enum describing event type, see types below
1313
+
int64 id = 2; // An auto incrementing ID, not unique per event since each shard has their own counter
1314
+
int64 vehicle_id = 4; // ID of the associated vehicle
1315
+
google.protobuf.Timestamp time = 5; // Timestamp
1316
+
}
1317
+
```
1318
+
1319
+
Note on `google.protobuf.Timestamp`: This is a requirement but if you encounter issues with Schema creations, it can be replaced to be a self contained message.
1320
+
This is a known limitation of Pub/Sub topic schema creation [Google Cloud Pub/Sub documentation](https://cloud.google.com/pubsub/docs/schemas#schema-info).
1321
+
```proto
1322
+
message GenericVehicleEventType {
1323
+
string type = 1; // String enum describing event type, see types below
1324
+
int64 id = 2; // An auto incrementing ID, not unique per event since each shard has their own counter
1325
+
int64 vehicle_id = 4; // ID of the associated vehicle
1326
+
message Timestamp {
1327
+
// Represents seconds of UTC time since Unix epoch
1328
+
// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
1329
+
// 9999-12-31T23:59:59Z inclusive.
1330
+
int64 seconds = 1;
1331
+
1332
+
// Non-negative fractions of a second at nanosecond resolution. Negative
1333
+
// second values with fractions must still have non-negative nanos values
1334
+
// that count forward in time. Must be from 0 to 999,999,999
1335
+
// inclusive.
1336
+
int32 nanos = 2;
1337
+
}
1338
+
Timestamp time = 5;
1339
+
}
1340
+
```
1341
+
1342
+
1343
+
1344
+
1345
+
### CanOdometerKm
1346
+
The odometer from the CAN of the vehicle in kilometers
1347
+
```proto
1348
+
syntax = "proto3";
1349
+
1350
+
package cc.protobuf.vehicle.v1;
1351
+
1352
+
import "google/protobuf/timestamp.proto";
1353
+
1354
+
message CanOdometerKm {
1355
+
string type = 1; // Message type "can_odometer_km"
1356
+
int64 id = 2; // Unique identifier for the reading
1357
+
int64 value = 3; // Odometer value (in kilometers)
1358
+
int64 vehicle_id = 4; // ID of the associated vehicle
1359
+
google.protobuf.Timestamp time = 5; // Timestamp
1360
+
}
1361
+
```
1362
+
1363
+
1364
+
1365
+
### CanNextServiceKm
1366
+
Kilometers until next service
1367
+
```proto
1368
+
syntax = "proto3";
1369
+
1370
+
package cc.protobuf.vehicle.v1;
1371
+
1372
+
import "google/protobuf/timestamp.proto";
1373
+
1374
+
message CanNextServiceKm {
1375
+
string type = 1; // Message type "can_next_service_km"
1376
+
int64 id = 2; // Unique identifier for the service entry
1377
+
int64 value = 3; // Remaining kilometers until the next service
1378
+
int64 vehicle_id = 4; // ID of the associated vehicle
1379
+
google.protobuf.Timestamp time = 5; // Timestamp
1380
+
}
1381
+
```
1382
+
1383
+
1384
+
### CarServiceBookings
1385
+
Represents a car service booking record with the status of the booking and the appointment date.
1386
+
See [BookingStatus](#bookingstatus-enum) for possible `booking_status` values
1387
+
```proto
1388
+
syntax = "proto3";
1389
+
1390
+
package cc.protobuf.booking.v1;
1391
+
1392
+
import "google/protobuf/timestamp.proto";
1393
+
1394
+
message CarServiceBooking {
1395
+
int64 id = 1; // Unique identifier for the car service booking record
1396
+
string booking_source = 2; // Source of the booking
1397
+
string booking_id = 3; // Booking ID from the booking system
1398
+
string booking_status = 4; // Booking status
1399
+
string booking_dealer = 5; // Dealer number, KVPS or similar for the booking
1400
+
int64 vehicle_id = 6; // ID of the associated vehicle
0 commit comments