"Fossies" - the Fresh Open Source Software Archive

Member "protobuf-3.21.1/src/google/protobuf/util/internal/testdata/anys.proto" (27 May 2022, 4332 Bytes) of package /linux/misc/protobuf-all-3.21.1.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/empty.proto";
   38 import "google/protobuf/struct.proto";
   39 import "google/protobuf/timestamp.proto";
   40 import "google/protobuf/wrappers.proto";
   41 
   42 // Top-level test cases proto used by MarshallingTest. See description
   43 // at the top of the class MarshallingTest for details on how to write
   44 // test cases.
   45 message AnyTestCases {
   46   AnyWrapper empty_any = 1;
   47   AnyWrapper type_only_any = 2;
   48   AnyWrapper wrapper_any = 3;
   49   AnyWrapper any_with_timestamp_value = 4;
   50   AnyWrapper any_with_duration_value = 5;
   51   AnyWrapper any_with_struct_value = 6;
   52   AnyWrapper recursive_any = 7;
   53   AnyWrapper any_with_message_value = 8;
   54   AnyWrapper any_with_nested_message = 9;
   55   AnyWrapper any_with_message_with_wrapper_type = 10;
   56   AnyWrapper any_with_message_with_timestamp = 11;
   57   AnyWrapper any_with_message_containing_map = 12;
   58   AnyWrapper any_with_message_containing_struct = 13;
   59   AnyWrapper any_with_message_containing_repeated_message = 14;
   60   AnyWrapper recursive_any_with_type_field_at_end = 15;
   61   AnyWrapper repeated_any = 16;
   62   AnyWrapper empty_any_with_null_type_url = 17;
   63   AnyWrapper any_with_empty = 18;
   64   AnyWrapper any_with_default_timestamp = 19;
   65 
   66   google.protobuf.Any top_level_any = 50;
   67   google.protobuf.Any top_level_any_with_type_field_at_end = 51;
   68   google.protobuf.Any top_level_any_with_pivot_one = 52;
   69   google.protobuf.Any top_level_any_with_pivot_two = 53;
   70   google.protobuf.Any top_level_any_unordered = 54;
   71 }
   72 
   73 message AnyWrapper {
   74   google.protobuf.Any any = 1;
   75 }
   76 
   77 // Hack to make sure the types we put into the any are included in the types.
   78 // Real solution is to add these types to the service config.
   79 message Imports {
   80   google.protobuf.DoubleValue dbl = 1;
   81   google.protobuf.Struct struct = 2;
   82   google.protobuf.Timestamp timestamp = 3;
   83   google.protobuf.Duration duration = 4;
   84   google.protobuf.Int32Value i32 = 5;
   85   google.protobuf.Empty empty = 6;
   86   Data data = 100;
   87 }
   88 
   89 message Data {
   90   int32 attr = 1;
   91   string str = 2;
   92   repeated string msgs = 3;
   93   Data nested_data = 4;
   94   google.protobuf.Int32Value int_wrapper = 5;
   95   google.protobuf.Timestamp time = 6;
   96   map<string, string> map_data = 7;
   97   google.protobuf.Struct struct_data = 8;
   98   repeated Data repeated_data = 9;
   99   repeated google.protobuf.Any repeated_any = 10;
  100 }
  101 
  102 service AnyTestService {
  103   rpc Call(AnyTestCases) returns (AnyTestCases);
  104   rpc Call1(Imports) returns (Imports);
  105 }
  106 
  107 message AnyIn {
  108   string something = 1;
  109   google.protobuf.Any any = 2;
  110 }
  111 
  112 message AnyOut {
  113   google.protobuf.Any any = 1;
  114 }
  115 
  116 message AnyM {
  117   string foo = 1;
  118 }