1// This file is imported from protobuf 3.0.0-beta-2 (667f4a6)
2
3// Protocol Buffers - Google's data interchange format
4// Copyright 2008 Google Inc.  All rights reserved.
5// https://developers.google.com/protocol-buffers/
6//
7// Redistribution and use in source and binary forms, with or without
8// modification, are permitted provided that the following conditions are
9// met:
10//
11//     * Redistributions of source code must retain the above copyright
12// notice, this list of conditions and the following disclaimer.
13//     * Redistributions in binary form must reproduce the above
14// copyright notice, this list of conditions and the following disclaimer
15// in the documentation and/or other materials provided with the
16// distribution.
17//     * Neither the name of Google Inc. nor the names of its
18// contributors may be used to endorse or promote products derived from
19// this software without specific prior written permission.
20//
21// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
33syntax = "proto3";
34
35package google.protobuf;
36
37import "google/protobuf/any.proto";
38import "google/protobuf/source_context.proto";
39
40option csharp_namespace = "Google.Protobuf.WellKnownTypes";
41option java_package = "com.google.protobuf";
42option java_outer_classname = "TypeProto";
43option java_multiple_files = true;
44option java_generate_equals_and_hash = true;
45option objc_class_prefix = "GPB";
46
47// A protocol buffer message type.
48message Type {
49  // The fully qualified message name.
50  string name = 1;
51  // The list of fields.
52  repeated Field fields = 2;
53  // The list of types appearing in `oneof` definitions in this type.
54  repeated string oneofs = 3;
55  // The protocol buffer options.
56  repeated Option options = 4;
57  // The source context.
58  SourceContext source_context = 5;
59  // The source syntax.
60  Syntax syntax = 6;
61}
62
63// A single field of a message type.
64message Field {
65  // Basic field types.
66  enum Kind {
67    // Field type unknown.
68    TYPE_UNKNOWN        = 0;
69    // Field type double.
70    TYPE_DOUBLE         = 1;
71    // Field type float.
72    TYPE_FLOAT          = 2;
73    // Field type int64.
74    TYPE_INT64          = 3;
75    // Field type uint64.
76    TYPE_UINT64         = 4;
77    // Field type int32.
78    TYPE_INT32          = 5;
79    // Field type fixed64.
80    TYPE_FIXED64        = 6;
81    // Field type fixed32.
82    TYPE_FIXED32        = 7;
83    // Field type bool.
84    TYPE_BOOL           = 8;
85    // Field type string.
86    TYPE_STRING         = 9;
87    // Field type group. Proto2 syntax only, and deprecated.
88    TYPE_GROUP          = 10;
89    // Field type message.
90    TYPE_MESSAGE        = 11;
91    // Field type bytes.
92    TYPE_BYTES          = 12;
93    // Field type uint32.
94    TYPE_UINT32         = 13;
95    // Field type enum.
96    TYPE_ENUM           = 14;
97    // Field type sfixed32.
98    TYPE_SFIXED32       = 15;
99    // Field type sfixed64.
100    TYPE_SFIXED64       = 16;
101    // Field type sint32.
102    TYPE_SINT32         = 17;
103    // Field type sint64.
104    TYPE_SINT64         = 18;
105  };
106
107  // Whether a field is optional, required, or repeated.
108  enum Cardinality {
109    // For fields with unknown cardinality.
110    CARDINALITY_UNKNOWN = 0;
111    // For optional fields.
112    CARDINALITY_OPTIONAL = 1;
113    // For required fields. Proto2 syntax only.
114    CARDINALITY_REQUIRED = 2;
115    // For repeated fields.
116    CARDINALITY_REPEATED = 3;
117  };
118
119  // The field type.
120  Kind kind = 1;
121  // The field cardinality.
122  Cardinality cardinality = 2;
123  // The field number.
124  int32 number = 3;
125  // The field name.
126  string name = 4;
127  // The field type URL, without the scheme, for message or enumeration
128  // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
129  string type_url = 6;
130  // The index of the field type in `Type.oneofs`, for message or enumeration
131  // types. The first type has index 1; zero means the type is not in the list.
132  int32 oneof_index = 7;
133  // Whether to use alternative packed wire representation.
134  bool packed = 8;
135  // The protocol buffer options.
136  repeated Option options = 9;
137  // The field JSON name.
138  string json_name = 10;
139  // The string value of the default value of this field. Proto2 syntax only.
140  string default_value = 11;
141}
142
143// Enum type definition.
144message Enum {
145  // Enum type name.
146  string name = 1;
147  // Enum value definitions.
148  repeated EnumValue enumvalue = 2;
149  // Protocol buffer options.
150  repeated Option options = 3;
151  // The source context.
152  SourceContext source_context = 4;
153  // The source syntax.
154  Syntax syntax = 5;
155}
156
157// Enum value definition.
158message EnumValue {
159  // Enum value name.
160  string name = 1;
161  // Enum value number.
162  int32 number = 2;
163  // Protocol buffer options.
164  repeated Option options = 3;
165}
166
167// A protocol buffer option, which can be attached to a message, field,
168// enumeration, etc.
169message Option {
170  // The option's name. For example, `"java_package"`.
171  string name = 1;
172  // The option's value. For example, `"com.google.protobuf"`.
173  Any value = 2;
174}
175
176// The syntax in which a protocol buffer element is defined.
177enum Syntax {
178  // Syntax `proto2`.
179  SYNTAX_PROTO2 = 0;
180  // Syntax `proto3`.
181  SYNTAX_PROTO3 = 1;
182}
183