forked from pseudomuto/protoc-gen-doc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vehicle.proto
69 lines (60 loc) · 2.11 KB
/
Vehicle.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package com.example;
/**
* Represents a manufacturer of cars.
*/
message Manufacturer {
/**
* Manufacturer category. A manufacturer may be either inhouse or external.
*/
enum Category {
CATEGORY_INHOUSE = 0; /** The manufacturer is inhouse. */
CATEGORY_EXTERNAL = 1; /** The manufacturer is external. */
}
required int32 id = 1; /** The unique manufacturer ID. */
required string code = 2; /** A manufacturer code, e.g. "DKL4P". */
required Category category = 3; /** Manufacturer category. */
optional string details = 4; /** Manufacturer details (minimum orders et.c.). */
}
/**
* Represents a vehicle model.
*/
message Model {
required string id = 1; /** The unique model ID. */
required string model_code = 2; /** The car model code, e.g. "PZ003". */
required string model_name = 3; /** The car model name, e.g. "Z3". */
required sint32 daily_hire_rate_dollars = 4; /// Dollars per day.
required sint32 daily_hire_rate_cents = 5; /// Cents per day.
}
/**
* Represents a vehicle that can be hired.
*/
message Vehicle {
/**
* Represents a vehicle category. E.g. "Sedan" or "Truck".
*/
message Category {
required string code = 1; /// Category code. E.g. "S".
required string description = 2; /// Category name. E.g. "Sedan".
}
required int32 id = 1; /** Unique vehicle ID. */
required Model model = 2; /** Vehicle model. */
required string reg_number = 3; /** Vehicle registration number. */
optional sint32 mileage = 4; /** Current vehicle mileage, if known. */
optional Category category = 5; /** Vehicle category. */
// Doc comments for fields can come before or
// after the field definition. And just like
// comments for messages / enums, they can be
// multi-paragraph:
/**
* Dollars per day.
*
* Taken from model if unspecified.
*/
optional sint32 daily_hire_rate_dollars = 6;
/**
* Cents per day.
*
* Taken from model if unspecified.
*/
optional sint32 daily_hire_rate_cents = 7;
}