...

Text file src/cloud.google.com/go/bigquery/storage/managedwriter/testdata/validation_proto3.proto

Documentation: cloud.google.com/go/bigquery/storage/managedwriter/testdata

     1// Copyright 2022 Google LLC
     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//     https://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
    15syntax = "proto3";
    16
    17import "google/protobuf/wrappers.proto";
    18
    19package testdata;
    20option go_package = "cloud.google.com/go/bigquery/storage/managedwriter/testdata";
    21
    22
    23enum Proto3ExampleEnum {
    24        P3_UNDEFINED = 0;
    25        P3_THING = 1;
    26        P3_OTHER_THING = 2;
    27        P3_THIRD_THING = 3;
    28}
    29
    30// Validation message in proto3 syntax with default value behavior.
    31message ValidationP3Defaults {
    32    double double_field = 1;
    33    float float_field = 2;
    34    int32 int32_field = 3;
    35    int64 int64_field = 4;
    36    uint32 uint32_field = 5;
    37    //uint64 uint64_field = 6;  
    38    sint32 sint32_field = 7;
    39    sint64 sint64_field = 8;
    40    fixed32 fixed32_field = 9;
    41    //fixed64 fixed64_field = 10;
    42    sfixed32 sfixed32_field = 11;
    43    sfixed64 sfixed64_field = 12;
    44    bool bool_field = 13;
    45    string string_field = 14;
    46    bytes bytes_field = 15;
    47    Proto3ExampleEnum enum_field = 16;
    48}
    49
    50// Validation message in proto2 syntax with field presence via optional keyword.
    51message ValidationP3Optional {
    52    optional double double_field = 1;
    53    optional float float_field = 2;
    54    optional int32 int32_field = 3;
    55    optional int64 int64_field = 4;
    56    optional uint32 uint32_field = 5;
    57    //optional uint64 uint64_field = 6;
    58    optional sint32 sint32_field = 7;
    59    optional sint64 sint64_field = 8;
    60    optional fixed32 fixed32_field = 9;
    61    //optional fixed64 fixed64_field = 10;
    62    optional sfixed32 sfixed32_field = 11;
    63    optional sfixed64 sfixed64_field = 12;
    64    optional bool bool_field = 13;
    65    optional string string_field = 14;
    66    optional bytes bytes_field = 15;
    67    optional Proto3ExampleEnum enum_field = 16;
    68}
    69
    70// Validation message in proto2 syntax with all well-known
    71// wraper types.
    72// Note: There are no well-known sint/fixed/sfixed.
    73message ValidationP3Wrappers {
    74    google.protobuf.DoubleValue double_field = 1;
    75    google.protobuf.FloatValue float_field = 2;
    76    google.protobuf.Int32Value int32_field = 3;
    77    google.protobuf.Int64Value int64_field = 4;
    78    google.protobuf.UInt32Value uint32_field = 5;
    79    //google.protobuf.UInt64Value uint64_field = 6;
    80    sint32 sint32_field = 7;
    81    sint64 sint64_field = 8;
    82    fixed32 fixed32_field = 9;
    83    //fixed64 fixed64_field = 10;
    84    sfixed32 sfixed32_field = 11;
    85    sfixed64 sfixed64_field = 12;
    86    google.protobuf.BoolValue bool_field = 13;
    87    google.protobuf.StringValue string_field = 14;
    88    google.protobuf.BytesValue bytes_field = 15;
    89    Proto3ExampleEnum enum_field = 16;
    90}
    91
    92// Validating the behavior of packed repeated scalar values.
    93// Proto3 behavior is to pack values by default.
    94message ValidationP3PackedRepeated {
    95    optional int64 id = 1;
    96    repeated double double_repeated = 2;
    97    repeated float float_repeated = 3;
    98    repeated int32 int32_repeated = 4;
    99    repeated int64 int64_repeated = 5;
   100    repeated uint32 uint32_repeated = 6;
   101    repeated sint32 sint32_repeated = 7;
   102    repeated sint64 sint64_repeated = 8;
   103    repeated fixed32 fixed32_repeated = 9;
   104    repeated sfixed32 sfixed32_repeated = 10;
   105    repeated sfixed64 sfixed64_repeated = 11;
   106    repeated bool bool_repeated = 12;
   107    repeated Proto3ExampleEnum enum_repeated = 13;
   108}

View as plain text