| // Copyright 2022 Google LLC |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // https://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| syntax = "proto2"; |
| |
| package testdata; |
| option go_package = "cloud.google.com/go/bigquery/storage/managedwriter/testdata"; |
| |
| |
| enum Proto2ExampleEnum { |
| P2_UNDEFINED = 0; |
| P2_THING = 1; |
| P2_OTHER_THING = 2; |
| P2_THIRD_THING = 3; |
| } |
| |
| // Validation message in proto2 syntax with all |
| // fields being required. |
| message ValidationP2Required { |
| required double double_field = 1; |
| required float float_field = 2; |
| required int32 int32_field = 3; |
| required int64 int64_field = 4; |
| required uint32 uint32_field = 5; |
| //required uint64 uint64_field = 6; |
| required sint32 sint32_field = 7; |
| required sint64 sint64_field = 8; |
| required fixed32 fixed32_field = 9; |
| //required fixed64 fixed64_field = 10; |
| required sfixed32 sfixed32_field = 11; |
| required sfixed64 sfixed64_field = 12; |
| required bool bool_field = 13; |
| required string string_field = 14; |
| required bytes bytes_field = 15; |
| required Proto2ExampleEnum enum_field = 16; |
| } |
| |
| // Validation message in proto2 syntax with all |
| // fields being optional. |
| message ValidationP2Optional { |
| optional double double_field = 1; |
| optional float float_field = 2; |
| optional int32 int32_field = 3; |
| optional int64 int64_field = 4; |
| optional uint32 uint32_field = 5; |
| //optional uint64 uint64_field = 6; |
| optional sint32 sint32_field = 7; |
| optional sint64 sint64_field = 8; |
| optional fixed32 fixed32_field = 9; |
| //optional fixed64 fixed64_field = 10; |
| optional sfixed32 sfixed32_field = 11; |
| optional sfixed64 sfixed64_field = 12; |
| optional bool bool_field = 13; |
| optional string string_field = 14; |
| optional bytes bytes_field = 15; |
| optional Proto2ExampleEnum enum_field = 16; |
| } |
| |
| // Validation message in proto2 syntax with all |
| // fields being optional and having custom defaults. |
| message ValidationP2OptionalWithDefaults { |
| optional double double_field = 1 [default = 1.11]; |
| optional float float_field = 2 [default = 2.22]; |
| optional int32 int32_field = 3 [default = 3]; |
| optional int64 int64_field = 4 [default = 4]; |
| optional uint32 uint32_field = 5 [default = 5]; |
| //optional uint64 uint64_field = 6 [default = 6]; |
| optional sint32 sint32_field = 7 [default = 7]; |
| optional sint64 sint64_field = 8 [default = 8]; |
| optional fixed32 fixed32_field = 9 [default = 9]; |
| //optional fixed64 fixed64_field = 10 [default = 10]; |
| optional sfixed32 sfixed32_field = 11 [default = 11]; |
| optional sfixed64 sfixed64_field = 12 [default = 12]; |
| optional bool bool_field = 13 [default = true]; |
| optional string string_field = 14 [default = "custom default"]; |
| optional bytes bytes_field = 15 [default = "optional bytes"]; |
| optional Proto2ExampleEnum enum_field = 16 [default = P2_OTHER_THING]; |
| } |
| |
| // Validating the behavior of unpacked repeated scalar values. |
| message ValidationP2UnpackedRepeated { |
| optional int64 id = 1; |
| repeated double double_repeated = 2; |
| repeated float float_repeated = 3; |
| repeated int32 int32_repeated = 4; |
| repeated int64 int64_repeated = 5; |
| repeated uint32 uint32_repeated = 6; |
| repeated sint32 sint32_repeated = 7; |
| repeated sint64 sint64_repeated = 8; |
| repeated fixed32 fixed32_repeated = 9; |
| repeated sfixed32 sfixed32_repeated = 10; |
| repeated sfixed64 sfixed64_repeated = 11; |
| repeated bool bool_repeated = 12; |
| repeated Proto2ExampleEnum enum_repeated = 13; |
| } |
| |
| // Validating the behavior of packed repeated scalar values. |
| message ValidationP2PackedRepeated { |
| optional int64 id = 1; |
| repeated double double_repeated = 2 [packed = true]; |
| repeated float float_repeated = 3 [packed = true]; |
| repeated int32 int32_repeated = 4 [packed = true]; |
| repeated int64 int64_repeated = 5 [packed = true]; |
| repeated uint32 uint32_repeated = 6 [packed = true]; |
| repeated sint32 sint32_repeated = 7 [packed = true]; |
| repeated sint64 sint64_repeated = 8 [packed = true]; |
| repeated fixed32 fixed32_repeated = 9 [packed = true]; |
| repeated sfixed32 sfixed32_repeated = 10 [packed = true]; |
| repeated sfixed64 sfixed64_repeated = 11 [packed = true]; |
| repeated bool bool_repeated = 12 [packed = true]; |
| repeated Proto2ExampleEnum enum_repeated = 13 [packed = true]; |
| } |