"Fossies" - the Fresh Open Source Software Archive

Member "protobuf-3.12.3/src/google/protobuf/util/internal/testdata/anys.proto" (2 Jun 2020, 4179 Bytes) of package /linux/misc/protobuf-all-3.12.3.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 // Protocol Buffers - Google's data interchange format
    2 // Copyright 2008 Google Inc.  All rights reserved.
    3 // https://developers.google.com/protocol-buffers/
    4 //
    5 // Redistribution and use in source and binary forms, with or without
    6 // modification, are permitted provided that the following conditions are
    7 // met:
    8 //
    9 //     * Redistributions of source code must retain the above copyright
   10 // notice, this list of conditions and the following disclaimer.
   11 //     * Redistributions in binary form must reproduce the above
   12 // copyright notice, this list of conditions and the following disclaimer
   13 // in the documentation and/or other materials provided with the
   14 // distribution.
   15 //     * Neither the name of Google Inc. nor the names of its
   16 // contributors may be used to endorse or promote products derived from
   17 // this software without specific prior written permission.
   18 //
   19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   30 
   31 syntax = "proto3";
   32 
   33 package proto_util_converter.testing;
   34 
   35 import "google/protobuf/any.proto";
   36 import "google/protobuf/duration.proto";
   37 import "google/protobuf/struct.proto";
   38 import "google/protobuf/timestamp.proto";
   39 import "google/protobuf/wrappers.proto";
   40 
   41 // Top-level test cases proto used by MarshallingTest. See description
   42 // at the top of the class MarshallingTest for details on how to write
   43 // test cases.
   44 message AnyTestCases {
   45   AnyWrapper empty_any = 1;
   46   AnyWrapper type_only_any = 2;
   47   AnyWrapper wrapper_any = 3;
   48   AnyWrapper any_with_timestamp_value = 4;
   49   AnyWrapper any_with_duration_value = 5;
   50   AnyWrapper any_with_struct_value = 6;
   51   AnyWrapper recursive_any = 7;
   52   AnyWrapper any_with_message_value = 8;
   53   AnyWrapper any_with_nested_message = 9;
   54   AnyWrapper any_with_message_with_wrapper_type = 10;
   55   AnyWrapper any_with_message_with_timestamp = 11;
   56   AnyWrapper any_with_message_containing_map = 12;
   57   AnyWrapper any_with_message_containing_struct = 13;
   58   AnyWrapper any_with_message_containing_repeated_message = 14;
   59   AnyWrapper recursive_any_with_type_field_at_end = 15;
   60   AnyWrapper repeated_any = 16;
   61   AnyWrapper empty_any_with_null_type_url = 17;
   62 
   63   google.protobuf.Any top_level_any = 50;
   64   google.protobuf.Any top_level_any_with_type_field_at_end = 51;
   65   google.protobuf.Any top_level_any_with_pivot_one = 52;
   66   google.protobuf.Any top_level_any_with_pivot_two = 53;
   67   google.protobuf.Any top_level_any_unordered = 54;
   68 }
   69 
   70 message AnyWrapper {
   71   google.protobuf.Any any = 1;
   72 }
   73 
   74 // Hack to make sure the types we put into the any are included in the types.
   75 // Real solution is to add these types to the service config.
   76 message Imports {
   77   google.protobuf.DoubleValue dbl = 1;
   78   google.protobuf.Struct struct = 2;
   79   google.protobuf.Timestamp timestamp = 3;
   80   google.protobuf.Duration duration = 4;
   81   google.protobuf.Int32Value i32 = 5;
   82   Data data = 100;
   83 }
   84 
   85 message Data {
   86   int32 attr = 1;
   87   string str = 2;
   88   repeated string msgs = 3;
   89   Data nested_data = 4;
   90   google.protobuf.Int32Value int_wrapper = 5;
   91   google.protobuf.Timestamp time = 6;
   92   map<string, string> map_data = 7;
   93   google.protobuf.Struct struct_data = 8;
   94   repeated Data repeated_data = 9;
   95   repeated google.protobuf.Any repeated_any = 10;
   96 }
   97 
   98 service AnyTestService {
   99   rpc Call(AnyTestCases) returns (AnyTestCases);
  100   rpc Call1(Imports) returns (Imports);
  101 }
  102 
  103 message AnyIn {
  104   string something = 1;
  105   google.protobuf.Any any = 2;
  106 }
  107 
  108 message AnyOut {
  109   google.protobuf.Any any = 1;
  110 }
  111 
  112 message AnyM {
  113   string foo = 1;
  114 }