go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/starlark/starlarkproto/testprotos/test.proto (about) 1 // Copyright 2018 The LUCI Authors. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 syntax = "proto3"; 16 17 package testprotos; 18 19 import "go.chromium.org/luci/common/proto/options.proto"; 20 import "go.chromium.org/luci/starlark/starlarkproto/testprotos/another.proto"; 21 import "google/protobuf/timestamp.proto"; 22 23 enum Enum { 24 ENUM_DEFAULT = 0; 25 ENUM_VAL_1 = 1; 26 } 27 28 message SimpleFields { 29 int64 i64 = 1; 30 repeated int64 i64_rep = 2; 31 int32 i32 = 3; 32 uint64 ui64 = 4; 33 uint32 ui32 = 5; 34 bool b = 6; 35 float f32 = 7; 36 double f64 = 8; 37 string s = 9; 38 bytes bs = 10; 39 repeated bytes bs_rep = 11; 40 repeated sint64 si64_rep = 12; 41 repeated string str_rep = 13; 42 string json = 14 [(luci.text_pb_format) = JSON]; 43 repeated string json_rep = 15 [(luci.text_pb_format) = JSON]; 44 } 45 46 message MessageFields { 47 Simple single = 1; 48 repeated Simple rep = 2; 49 } 50 51 message Simple { 52 int64 i = 1; 53 repeated int64 many_i = 2; 54 } 55 56 message AnotherSimple { 57 int64 j = 1; 58 } 59 60 message Complex { 61 enum InnerEnum { 62 UNKNOWN = 0; 63 ENUM_VAL_1 = 1; 64 } 65 66 message InnerMessage { 67 int64 i = 1; 68 } 69 70 int64 i64 = 1; 71 repeated int64 i64_rep = 2; 72 73 InnerEnum enum_val = 3; 74 InnerMessage msg_val = 4; 75 repeated InnerMessage msg_val_rep = 5; 76 77 oneof oneof_val { 78 Simple simple = 6; 79 AnotherSimple another_simple = 7; 80 int64 i64_oneof = 9; 81 int32 i32_oneof = 10; 82 } 83 84 map<string, Simple> mp = 8; 85 } 86 87 message RefsOtherProtos { 88 AnotherMessage another_msg = 1; 89 google.protobuf.Timestamp ts = 2; 90 } 91 92 message MapWithPrimitiveType { 93 map<string, int64> m1 = 1; 94 map<string, int32> m2 = 2; 95 map<int64, int64> m3 = 3; 96 } 97 98 message MapWithMessageType { 99 map<string, Simple> m = 1; 100 } 101 102 message Json { 103 string json = 1 [(luci.text_pb_format) = JSON]; 104 } 105 106 message NestedJson { 107 Json nested = 1; 108 }