1// Copyright 2010 Google Inc. 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// http://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// 15 16package protorpc; 17 18// Message used to nest inside another message. 19message NestedMessage { 20 required string a_value = 1; 21} 22 23// Message that contains nested messages. 24message HasNestedMessage { 25 optional NestedMessage nested = 1; 26 repeated NestedMessage repeated_nested = 2; 27} 28 29message HasDefault { 30 optional string a_value = 1 [default="a default"]; 31} 32 33// Message that contains all variants as optional fields. 34message OptionalMessage { 35 enum SimpleEnum { 36 VAL1 = 1; 37 VAL2 = 2; 38 } 39 40 optional double double_value = 1; 41 optional float float_value = 2; 42 optional int64 int64_value = 3; 43 optional uint64 uint64_value = 4; 44 optional int32 int32_value = 5; 45 optional bool bool_value = 6; 46 optional string string_value = 7; 47 optional bytes bytes_value = 8; 48 optional SimpleEnum enum_value = 10; 49 50 // TODO(rafek): Add support for these variants. 51 // optional uint32 uint32_value = 9; 52 // optional sint32 sint32_value = 11; 53 // optional sint64 sint64_value = 12; 54} 55 56// Message that contains all variants as repeated fields. 57message RepeatedMessage { 58 enum SimpleEnum { 59 VAL1 = 1; 60 VAL2 = 2; 61 } 62 63 repeated double double_value = 1; 64 repeated float float_value = 2; 65 repeated int64 int64_value = 3; 66 repeated uint64 uint64_value = 4; 67 repeated int32 int32_value = 5; 68 repeated bool bool_value = 6; 69 repeated string string_value = 7; 70 repeated bytes bytes_value = 8; 71 repeated SimpleEnum enum_value = 10; 72 73 // TODO(rafek): Add support for these variants. 74 // repeated uint32 uint32_value = 9; 75 // repeated sint32 sint32_value = 11; 76 // repeated sint64 sint64_value = 12; 77} 78 79// Message that has nested message with all optional fields. 80message HasOptionalNestedMessage { 81 optional OptionalMessage nested = 1; 82 repeated OptionalMessage repeated_nested = 2; 83} 84