Khen Nursimulu | 7626ce1 | 2016-12-21 11:51:46 -0500 | [diff] [blame] | 1 | // See README.txt for information and build instructions. |
| 2 | |
| 3 | syntax = "proto3"; |
| 4 | |
| 5 | package tutorial; |
| 6 | |
| 7 | import "google/api/annotations.proto"; |
| 8 | |
| 9 | import public "yang_options.proto"; |
| 10 | |
| 11 | option java_package = "com.example.tutorial"; |
| 12 | option java_outer_classname = "AddressBookProtos"; |
| 13 | option csharp_namespace = "Google.Protobuf.Examples.AddressBook"; |
| 14 | |
| 15 | message House { |
| 16 | option (voltha.yang_child_rule) = MOVE_TO_PARENT_LEVEL; |
| 17 | |
| 18 | enum HouseType { |
| 19 | MOBILE = 0; |
| 20 | SINGLE = 1; |
| 21 | TOWN = 2; |
| 22 | } |
| 23 | |
| 24 | string myhouse = 1; |
| 25 | |
| 26 | message Door { |
| 27 | string colour = 1; |
| 28 | string size = 2; |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | message Girl { |
| 33 | option (voltha.yang_message_rule) = CREATE_BOTH_GROUPING_AND_CONTAINER; |
| 34 | repeated House houses = 4; |
| 35 | } |
| 36 | |
| 37 | message Person { |
| 38 | option (voltha.yang_message_rule) = CREATE_BOTH_GROUPING_AND_CONTAINER; |
| 39 | |
| 40 | string name = 1; |
| 41 | int32 id = 2; // Unique ID number for this person. |
| 42 | string email = 3; |
| 43 | repeated string khen = 4; |
| 44 | repeated PhoneNumber phones = 5; |
| 45 | |
| 46 | enum PhoneType { |
| 47 | MOBILE = 0; |
| 48 | HOME = 1; |
| 49 | WORK = 2; |
| 50 | } |
| 51 | |
| 52 | message PhoneNumber { |
| 53 | string number = 1; |
| 54 | PhoneType type = 2; |
| 55 | } |
| 56 | |
| 57 | } |
| 58 | |
| 59 | // Our address book file is just one of these. |
| 60 | message AddressBook { |
| 61 | Person people = 1 [(voltha.yang_inline_node).id = 'people', |
| 62 | (voltha.yang_inline_node).type = 'book-Person'] ; |
| 63 | Girl girl = 2; |
| 64 | } |