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 31syntax = "proto3"; 32 33package proto_util_converter.testing; 34 35import "google/protobuf/struct.proto"; 36 37message StructTestCases { 38 StructWrapper empty_value = 1; 39 StructWrapper empty_value2 = 2; 40 StructWrapper null_value = 3; 41 StructWrapper simple_struct = 4; 42 StructWrapper longer_struct = 5; 43 StructWrapper struct_with_nested_struct = 6; 44 StructWrapper struct_with_nested_list = 7; 45 StructWrapper struct_with_list_of_nulls = 8; 46 StructWrapper struct_with_list_of_lists = 9; 47 StructWrapper struct_with_list_of_structs = 10; 48 StructWrapper struct_with_empty_list = 11; 49 StructWrapper struct_with_list_with_empty_struct = 12; 50 google.protobuf.Struct top_level_struct = 13; 51 google.protobuf.Struct top_level_struct_with_empty_list = 14; 52 google.protobuf.Struct top_level_struct_with_list_with_empty_struct = 15; 53 ValueWrapper value_wrapper_simple = 16; 54 ValueWrapper value_wrapper_with_struct = 17; 55 ValueWrapper value_wrapper_with_list = 18; 56 ValueWrapper value_wrapper_with_empty_list = 19; 57 ValueWrapper value_wrapper_with_list_with_empty_struct = 20; 58 ListValueWrapper list_value_wrapper = 21; 59 ListValueWrapper list_value_wrapper_with_empty_list = 22; 60 ListValueWrapper list_value_wrapper_with_list_with_empty_struct = 23; 61 google.protobuf.Value top_level_value_simple = 24; 62 google.protobuf.Value top_level_value_with_struct = 25; 63 google.protobuf.Value top_level_value_with_list = 26; 64 google.protobuf.Value top_level_value_with_empty_list = 27; 65 google.protobuf.Value top_level_value_with_list_with_empty_struct = 28; 66 google.protobuf.ListValue top_level_listvalue = 29; 67 google.protobuf.ListValue top_level_empty_listvalue = 30; 68 google.protobuf.ListValue top_level_listvalue_with_empty_struct = 31; 69 RepeatedValueWrapper repeated_value = 32; 70 RepeatedValueWrapper repeated_value_nested_list = 33; 71 RepeatedValueWrapper repeated_value_nested_list2 = 34; 72 RepeatedValueWrapper repeated_value_nested_list3 = 35; 73 RepeatedListValueWrapper repeated_listvalue = 36; 74 MapOfStruct map_of_struct = 37; 75 MapOfStruct map_of_struct_value = 38; 76 MapOfStruct map_of_listvalue = 39; 77} 78 79message StructWrapper { 80 google.protobuf.Struct struct = 1; 81} 82 83message ValueWrapper { 84 google.protobuf.Value value = 1; 85} 86 87message RepeatedValueWrapper { 88 repeated google.protobuf.Value values = 1; 89} 90 91message ListValueWrapper { 92 google.protobuf.ListValue shopping_list = 1; 93} 94 95message RepeatedListValueWrapper { 96 repeated google.protobuf.ListValue dimensions = 1; 97} 98 99message MapOfStruct { 100 map<string, google.protobuf.Struct> struct_map = 1; 101 map<string, google.protobuf.Value> value_map = 2; 102 map<string, google.protobuf.ListValue> listvalue_map = 3; 103} 104 105// Hack to test return types with Struct as top-level message. Struct typers 106// cannot be directly used in API requests. Hence using Dummy as request type. 107message Dummy { 108 string text = 1; 109} 110 111service StructTestService { 112 rpc Call(Dummy) returns (StructTestCases); 113} 114 115message StructType { 116 google.protobuf.Struct object = 1; 117} 118