• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 google.protobuf.python.internal;
34
35message TestProto3Optional {
36  message NestedMessage {
37    // The field name "b" fails to compile in proto1 because it conflicts with
38    // a local variable named "b" in one of the generated methods.  Doh.
39    // This file needs to compile in proto1 to test backwards-compatibility.
40    optional int32 bb = 1;
41  }
42
43  enum NestedEnum {
44    UNSPECIFIED = 0;
45    FOO = 1;
46    BAR = 2;
47    BAZ = 3;
48    NEG = -1;  // Intentionally negative.
49  }
50
51  // Singular
52  optional int32 optional_int32 = 1;
53  optional int64 optional_int64 = 2;
54  optional uint32 optional_uint32 = 3;
55  optional uint64 optional_uint64 = 4;
56  optional sint32 optional_sint32 = 5;
57  optional sint64 optional_sint64 = 6;
58  optional fixed32 optional_fixed32 = 7;
59  optional fixed64 optional_fixed64 = 8;
60  optional sfixed32 optional_sfixed32 = 9;
61  optional sfixed64 optional_sfixed64 = 10;
62  optional float optional_float = 11;
63  optional double optional_double = 12;
64  optional bool optional_bool = 13;
65  optional string optional_string = 14;
66  optional bytes optional_bytes = 15;
67
68  optional NestedMessage optional_nested_message = 18;
69  optional NestedEnum optional_nested_enum = 21;
70}
71