github.com/apache/beam/sdks/v2@v2.48.2/java/extensions/protobuf/src/test/proto/proto3_schema_messages.proto (about) 1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 /* 20 * Protocol Buffer messages used for testing Proto3 Schema implementation. 21 */ 22 23 syntax = "proto3"; 24 25 package proto3_schema_messages; 26 27 import "google/protobuf/duration.proto"; 28 import "google/protobuf/timestamp.proto"; 29 import "google/protobuf/wrappers.proto"; 30 import "google/protobuf/descriptor.proto"; 31 32 import "proto3_schema_options.proto"; 33 34 option java_package = "org.apache.beam.sdk.extensions.protobuf"; 35 36 message Primitive { 37 double primitive_double = 1; 38 float primitive_float = 2; 39 int32 primitive_int32 = 3; 40 int64 primitive_int64 = 4; 41 uint32 primitive_uint32 = 5; 42 uint64 primitive_uint64 = 6; 43 sint32 primitive_sint32 = 7; 44 sint64 primitive_sint64 = 8; 45 fixed32 primitive_fixed32 = 9; 46 fixed64 primitive_fixed64 = 10; 47 sfixed32 primitive_sfixed32 = 11; 48 sfixed64 primitive_sfixed64 = 12; 49 bool primitive_bool = 13; 50 string primitive_string = 14; 51 bytes primitive_bytes = 15; 52 } 53 54 message RepeatPrimitive { 55 repeated double repeated_double = 1; 56 repeated float repeated_float = 2; 57 repeated int32 repeated_int32 = 3; 58 repeated int64 repeated_int64 = 4; 59 repeated uint32 repeated_uint32 = 5; 60 repeated uint64 repeated_uint64 = 6; 61 repeated sint32 repeated_sint32 = 7; 62 repeated sint64 repeated_sint64 = 8; 63 repeated fixed32 repeated_fixed32 = 9; 64 repeated fixed64 repeated_fixed64 = 10; 65 repeated sfixed32 repeated_sfixed32 = 11; 66 repeated sfixed64 repeated_sfixed64 = 12; 67 repeated bool repeated_bool = 13; 68 repeated string repeated_string = 14; 69 repeated bytes repeated_bytes = 15; 70 } 71 72 message MapPrimitive { 73 map<string, string> string_string_map = 1; 74 map<string, int32> string_int_map = 2; 75 map<int32, string> int_string_map = 3; 76 map<string, bytes> string_bytes_map = 4; 77 } 78 79 message Nested { 80 Primitive nested = 1; 81 repeated Primitive nested_list = 2; 82 map<string, Primitive> nested_map = 3; 83 } 84 85 message OneOf { 86 string place1 = 1; 87 oneof special_oneof { 88 int32 oneof_int32 = 2; 89 bool oneof_bool = 3; 90 string oneof_string = 4; 91 Primitive oneof_primitive = 5; 92 } 93 int32 place2 = 6; 94 } 95 96 message OuterOneOf { 97 oneof outer_oneof { 98 OneOf oneof_oneof = 1; 99 int32 oneof_int32 = 2; 100 } 101 } 102 103 message ReversedOneOf { 104 string place1 = 6; 105 oneof oneof_reversed { 106 int32 oneof_int32 = 5; 107 bool oneof_bool = 4; 108 string oneof_string = 3; 109 Primitive oneof_primitive = 2; 110 } 111 int32 place2 = 1; 112 } 113 114 message NonContiguousOneOf { 115 string place1 = 76; 116 oneof oneof_non_contiguous_one { 117 int32 oneof_one_int32 = 55; 118 bool oneof_one_bool = 1; 119 string oneof_one_string = 189; 120 Primitive oneof_one_primitive = 22; 121 } 122 int32 place2 = 33; 123 oneof oneof_non_contiguous_two { 124 string oneof_two_first_string = 981; 125 int32 oneof_two_int32 = 2; 126 string oneof_two_second_string = 44; 127 } 128 int32 place3 = 63; 129 } 130 131 message EnumMessage { 132 enum Enum { 133 ZERO = 0; 134 TWO = 2; 135 THREE = 3; 136 } 137 Enum enum = 1; 138 } 139 140 message WktMessage { 141 google.protobuf.DoubleValue double = 1; 142 google.protobuf.FloatValue float = 2; 143 google.protobuf.Int32Value int32 = 3; 144 google.protobuf.Int64Value int64 = 4; 145 google.protobuf.UInt32Value uint32 = 5; 146 google.protobuf.UInt64Value uint64 = 6; 147 google.protobuf.BoolValue bool = 13; 148 google.protobuf.StringValue string = 14; 149 google.protobuf.BytesValue bytes = 15; 150 google.protobuf.Timestamp timestamp = 16; 151 google.protobuf.Duration duration = 17; 152 } 153 154 message OptionMessage { 155 option (proto3_schema_options.message_option_int) = 42; 156 option (proto3_schema_options.message_option_string) = "this is a message string"; 157 option (proto3_schema_options.message_option_message) = { 158 single_string: "foobar in message" 159 single_int32: 12 160 single_int64: 34 161 }; 162 option (proto3_schema_options.message_option_repeated) = "string_1"; 163 option (proto3_schema_options.message_option_repeated) = "string_2"; 164 option (proto3_schema_options.message_option_repeated) = "string_3"; 165 option (proto3_schema_options.message_option_repeated) = "string_3"; 166 option (proto3_schema_options.message_option_repeated_message) = { 167 single_string: "string in message in option in message" 168 }; 169 option (proto3_schema_options.message_option_repeated_message) = { 170 single_int32: 1 171 }; 172 option (proto3_schema_options.message_option_repeated_message) = { 173 single_int64: 2 174 }; 175 176 string field_one = 1 [ 177 (proto3_schema_options.field_option_int) = 13, 178 (proto3_schema_options.field_option_string) = "this is a field string", 179 (proto3_schema_options.field_option_message) = { 180 single_string: "foobar in field" 181 single_int32: 56 182 single_int64: 78 183 }, 184 (proto3_schema_options.field_option_repeated) = "field_string_1", 185 (proto3_schema_options.field_option_repeated) = "field_string_2", 186 (proto3_schema_options.field_option_repeated) = "field_string_3", 187 188 (proto3_schema_options.field_option_repeated_message) = { 189 single_string: "string in message in option in field" 190 }, 191 (proto3_schema_options.field_option_repeated_message) = { 192 single_int32: 77 193 }, 194 (proto3_schema_options.field_option_repeated_message) = { 195 single_int64: 88 196 }]; 197 } 198 199 message SelfNested { 200 SelfNested nested = 1; 201 } 202 203 message FirstCircularNested { 204 SecondCircularNested nested = 1; 205 } 206 207 message SecondCircularNested { 208 FirstCircularNested nested = 1; 209 } 210 211 message Empty { 212 }