summaryrefslogtreecommitdiff
path: root/example/toy.proto
blob: a425a0aa93ae4334db7fffdfb23cabe00d356673 (plain)
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
syntax = "proto3";


package main;

import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp

message Basket {                        // `autogenpb:nomutex`
	repeated string   name  = 1;    // `autogenpb:sort` `autogenpb:unique`
	string   favorite       = 2;    // `autogenpb:sort` `autogenpb:unique`
	int64    price          = 3;    // `autogenpb:sort`
        repeated Banana banna   = 4;
        repeated Pear   pears   = 5;
        repeated Apple  stacks  = 6;
}

// "Fruit" must exist. you can put anything in it
message Toy {
        string brand             = 1;    // `autogenpb:unique` `autogenpb:sort`
        repeated Apple apples    = 2;
        string name              = 4;    // `autogenpb:sort` `autogenpb:unique`
        string UPC               = 4;    // `autogenpb:sort` `autogenpb:unique`
        string city              = 5;    // `autogenpb:sort`
        repeated Basket  Baskets = 8;
        map<string, string> who  = 9;
        int64    cost            = 10;
}

message Toys {	        	// `autogenpb:marshal` `autogenpb:mutex`
	string   uuid	        = 1;    // `autogenpb:uuid:be456ad9-f07f-484c-adf2-d96eeabf3079`
	string   version        = 2;    // `autogenpb:version:v0.0.1`
	repeated Toy   Toys     = 3;    // THIS MUST BE "Fruit" and then "Fruit" + "s"
        // you can add additional things here but the three lines above must conform to the standard above
}