-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtrip.proto
38 lines (32 loc) · 1.32 KB
/
trip.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
syntax = "proto3";
package coop.drivers.dispatch.v1beta1;
import "coop/drivers/dispatch/v1beta1/latlng.proto";
import "google/protobuf/timestamp.proto";
import "validate/validate.proto";
message Trip {
string id = 1 [(validate.rules).string.min_len = 1];
// where
LatLng pickup_location = 2 [(validate.rules).message.required = true];
// when
google.protobuf.Timestamp scheduled_for = 3 [(validate.rules).timestamp.required = true];
// how much $$$
Money expected_payment = 4 [(validate.rules).message.required = true];
}
// Represents an amount of money with its currency type.
message Money {
// The three-letter currency code defined in ISO 4217.
string currency_code = 1 [(validate.rules).string.len = 3];
// The whole units of the amount.
// For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar.
int64 units = 2;
// Number of nano (10^-9) units of the amount.
// The value must be between -999,999,999 and +999,999,999 inclusive.
// If `units` is positive, `nanos` must be positive or zero.
// If `units` is zero, `nanos` can be positive, zero, or negative.
// If `units` is negative, `nanos` must be negative or zero.
// For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
int32 nanos = 3 [(validate.rules).int32 = {
gte: -999999999,
lte: 999999999
}];
}