blob: edd302e7872cd8e1c1fbcb0029336a2425e7e350 [file] [log] [blame]
Jon Skeet62a4aa52015-07-14 14:26:49 +01001// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: google/protobuf/type.proto
3#pragma warning disable 1591, 0612, 3021
4#region Designer generated code
5
6using pb = global::Google.Protobuf;
7using pbc = global::Google.Protobuf.Collections;
8using pbr = global::Google.Protobuf.Reflection;
9using scg = global::System.Collections.Generic;
10namespace Google.Protobuf.WellKnownTypes {
11
Jon Skeet284bb452015-11-05 09:13:53 +000012 /// <summary>Holder for reflection information generated from google/protobuf/type.proto</summary>
13 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
14 public static partial class TypeReflection {
Jon Skeet62a4aa52015-07-14 14:26:49 +010015
Jon Skeet284bb452015-11-05 09:13:53 +000016 #region Descriptor
17 /// <summary>File descriptor for google/protobuf/type.proto</summary>
18 public static pbr::FileDescriptor Descriptor {
19 get { return descriptor; }
Jon Skeet62a4aa52015-07-14 14:26:49 +010020 }
Jon Skeet284bb452015-11-05 09:13:53 +000021 private static pbr::FileDescriptor descriptor;
22
23 static TypeReflection() {
24 byte[] descriptorData = global::System.Convert.FromBase64String(
25 string.Concat(
26 "Chpnb29nbGUvcHJvdG9idWYvdHlwZS5wcm90bxIPZ29vZ2xlLnByb3RvYnVm",
27 "Ghlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvGiRnb29nbGUvcHJvdG9idWYv",
28 "c291cmNlX2NvbnRleHQucHJvdG8i1wEKBFR5cGUSDAoEbmFtZRgBIAEoCRIm",
29 "CgZmaWVsZHMYAiADKAsyFi5nb29nbGUucHJvdG9idWYuRmllbGQSDgoGb25l",
30 "b2ZzGAMgAygJEigKB29wdGlvbnMYBCADKAsyFy5nb29nbGUucHJvdG9idWYu",
31 "T3B0aW9uEjYKDnNvdXJjZV9jb250ZXh0GAUgASgLMh4uZ29vZ2xlLnByb3Rv",
32 "YnVmLlNvdXJjZUNvbnRleHQSJwoGc3ludGF4GAYgASgOMhcuZ29vZ2xlLnBy",
33 "b3RvYnVmLlN5bnRheCK+BQoFRmllbGQSKQoEa2luZBgBIAEoDjIbLmdvb2ds",
34 "ZS5wcm90b2J1Zi5GaWVsZC5LaW5kEjcKC2NhcmRpbmFsaXR5GAIgASgOMiIu",
35 "Z29vZ2xlLnByb3RvYnVmLkZpZWxkLkNhcmRpbmFsaXR5Eg4KBm51bWJlchgD",
36 "IAEoBRIMCgRuYW1lGAQgASgJEhAKCHR5cGVfdXJsGAYgASgJEhMKC29uZW9m",
37 "X2luZGV4GAcgASgFEg4KBnBhY2tlZBgIIAEoCBIoCgdvcHRpb25zGAkgAygL",
38 "MhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvbhIRCglqc29uX25hbWUYCiABKAki",
39 "yAIKBEtpbmQSEAoMVFlQRV9VTktOT1dOEAASDwoLVFlQRV9ET1VCTEUQARIO",
40 "CgpUWVBFX0ZMT0FUEAISDgoKVFlQRV9JTlQ2NBADEg8KC1RZUEVfVUlOVDY0",
41 "EAQSDgoKVFlQRV9JTlQzMhAFEhAKDFRZUEVfRklYRUQ2NBAGEhAKDFRZUEVf",
42 "RklYRUQzMhAHEg0KCVRZUEVfQk9PTBAIEg8KC1RZUEVfU1RSSU5HEAkSDgoK",
43 "VFlQRV9HUk9VUBAKEhAKDFRZUEVfTUVTU0FHRRALEg4KClRZUEVfQllURVMQ",
44 "DBIPCgtUWVBFX1VJTlQzMhANEg0KCVRZUEVfRU5VTRAOEhEKDVRZUEVfU0ZJ",
45 "WEVEMzIQDxIRCg1UWVBFX1NGSVhFRDY0EBASDwoLVFlQRV9TSU5UMzIQERIP",
46 "CgtUWVBFX1NJTlQ2NBASInQKC0NhcmRpbmFsaXR5EhcKE0NBUkRJTkFMSVRZ",
47 "X1VOS05PV04QABIYChRDQVJESU5BTElUWV9PUFRJT05BTBABEhgKFENBUkRJ",
48 "TkFMSVRZX1JFUVVJUkVEEAISGAoUQ0FSRElOQUxJVFlfUkVQRUFURUQQAyLO",
49 "AQoERW51bRIMCgRuYW1lGAEgASgJEi0KCWVudW12YWx1ZRgCIAMoCzIaLmdv",
50 "b2dsZS5wcm90b2J1Zi5FbnVtVmFsdWUSKAoHb3B0aW9ucxgDIAMoCzIXLmdv",
51 "b2dsZS5wcm90b2J1Zi5PcHRpb24SNgoOc291cmNlX2NvbnRleHQYBCABKAsy",
52 "Hi5nb29nbGUucHJvdG9idWYuU291cmNlQ29udGV4dBInCgZzeW50YXgYBSAB",
53 "KA4yFy5nb29nbGUucHJvdG9idWYuU3ludGF4IlMKCUVudW1WYWx1ZRIMCgRu",
54 "YW1lGAEgASgJEg4KBm51bWJlchgCIAEoBRIoCgdvcHRpb25zGAMgAygLMhcu",
55 "Z29vZ2xlLnByb3RvYnVmLk9wdGlvbiI7CgZPcHRpb24SDAoEbmFtZRgBIAEo",
56 "CRIjCgV2YWx1ZRgCIAEoCzIULmdvb2dsZS5wcm90b2J1Zi5BbnkqLgoGU3lu",
57 "dGF4EhEKDVNZTlRBWF9QUk9UTzIQABIRCg1TWU5UQVhfUFJPVE8zEAFCTAoT",
58 "Y29tLmdvb2dsZS5wcm90b2J1ZkIJVHlwZVByb3RvUAGgAQGiAgNHUEKqAh5H",
59 "b29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw=="));
60 descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
61 new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.SourceContextReflection.Descriptor, },
62 new pbr::GeneratedCodeInfo(new[] {typeof(global::Google.Protobuf.WellKnownTypes.Syntax), }, new pbr::GeneratedCodeInfo[] {
Jon Skeeteadd4ca2015-11-13 20:04:14 +000063 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Type), global::Google.Protobuf.WellKnownTypes.Type.Parser, new[]{ "Name", "Fields", "Oneofs", "Options", "SourceContext", "Syntax" }, null, null, null),
64 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Field), global::Google.Protobuf.WellKnownTypes.Field.Parser, new[]{ "Kind", "Cardinality", "Number", "Name", "TypeUrl", "OneofIndex", "Packed", "Options", "JsonName" }, null, new[]{ typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Kind), typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality) }, null),
65 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Enum), global::Google.Protobuf.WellKnownTypes.Enum.Parser, new[]{ "Name", "Enumvalue", "Options", "SourceContext", "Syntax" }, null, null, null),
66 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.EnumValue), global::Google.Protobuf.WellKnownTypes.EnumValue.Parser, new[]{ "Name", "Number", "Options" }, null, null, null),
67 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Option), global::Google.Protobuf.WellKnownTypes.Option.Parser, new[]{ "Name", "Value" }, null, null, null)
Jon Skeet284bb452015-11-05 09:13:53 +000068 }));
69 }
70 #endregion
71
Jon Skeet62a4aa52015-07-14 14:26:49 +010072 }
Jon Skeet94898172015-09-01 15:47:48 +010073 #region Enums
Jon Skeet18e0a2e2015-10-01 10:38:01 +010074 /// <summary>
75 /// Syntax specifies the syntax in which a service element was defined.
76 /// </summary>
Jon Skeet94898172015-09-01 15:47:48 +010077 public enum Syntax {
Jon Skeet18e0a2e2015-10-01 10:38:01 +010078 /// <summary>
79 /// Syntax "proto2"
80 /// </summary>
Jon Skeet94898172015-09-01 15:47:48 +010081 SYNTAX_PROTO2 = 0,
Jon Skeet18e0a2e2015-10-01 10:38:01 +010082 /// <summary>
83 /// Syntax "proto3"
84 /// </summary>
Jon Skeet94898172015-09-01 15:47:48 +010085 SYNTAX_PROTO3 = 1,
86 }
87
88 #endregion
89
Jon Skeet62a4aa52015-07-14 14:26:49 +010090 #region Messages
Jon Skeet18e0a2e2015-10-01 10:38:01 +010091 /// <summary>
92 /// A light-weight descriptor for a proto message type.
93 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +010094 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
95 public sealed partial class Type : pb::IMessage<Type> {
96 private static readonly pb::MessageParser<Type> _parser = new pb::MessageParser<Type>(() => new Type());
97 public static pb::MessageParser<Type> Parser { get { return _parser; } }
98
Jon Skeet62a4aa52015-07-14 14:26:49 +010099 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +0000100 get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[0]; }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100101 }
102
Jon Skeet96cffaa2015-07-20 19:25:07 +0100103 pbr::MessageDescriptor pb::IMessage.Descriptor {
104 get { return Descriptor; }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100105 }
106
Jon Skeet62a4aa52015-07-14 14:26:49 +0100107 public Type() {
108 OnConstruction();
109 }
110
111 partial void OnConstruction();
112
113 public Type(Type other) : this() {
114 name_ = other.name_;
115 fields_ = other.fields_.Clone();
116 oneofs_ = other.oneofs_.Clone();
117 options_ = other.options_.Clone();
118 SourceContext = other.sourceContext_ != null ? other.SourceContext.Clone() : null;
Jon Skeet94898172015-09-01 15:47:48 +0100119 syntax_ = other.syntax_;
Jon Skeet62a4aa52015-07-14 14:26:49 +0100120 }
121
122 public Type Clone() {
123 return new Type(this);
124 }
125
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100126 /// <summary>Field number for the "name" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100127 public const int NameFieldNumber = 1;
128 private string name_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100129 /// <summary>
130 /// The fully qualified message name.
131 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100132 public string Name {
133 get { return name_; }
134 set {
Jon Skeetd18cc082015-07-30 13:50:02 +0100135 name_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeet62a4aa52015-07-14 14:26:49 +0100136 }
137 }
138
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100139 /// <summary>Field number for the "fields" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100140 public const int FieldsFieldNumber = 2;
141 private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Field> _repeated_fields_codec
142 = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Field.Parser);
143 private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Field> fields_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Field>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100144 /// <summary>
145 /// The list of fields.
146 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100147 public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Field> Fields {
148 get { return fields_; }
149 }
150
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100151 /// <summary>Field number for the "oneofs" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100152 public const int OneofsFieldNumber = 3;
153 private static readonly pb::FieldCodec<string> _repeated_oneofs_codec
154 = pb::FieldCodec.ForString(26);
155 private readonly pbc::RepeatedField<string> oneofs_ = new pbc::RepeatedField<string>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100156 /// <summary>
157 /// The list of oneof definitions.
158 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100159 public pbc::RepeatedField<string> Oneofs {
160 get { return oneofs_; }
161 }
162
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100163 /// <summary>Field number for the "options" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100164 public const int OptionsFieldNumber = 4;
165 private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec
166 = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.WellKnownTypes.Option.Parser);
167 private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100168 /// <summary>
169 /// The proto options.
170 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100171 public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options {
172 get { return options_; }
173 }
174
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100175 /// <summary>Field number for the "source_context" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100176 public const int SourceContextFieldNumber = 5;
177 private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100178 /// <summary>
179 /// The source context.
180 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100181 public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext {
182 get { return sourceContext_; }
183 set {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100184 sourceContext_ = value;
185 }
186 }
187
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100188 /// <summary>Field number for the "syntax" field.</summary>
Jon Skeet94898172015-09-01 15:47:48 +0100189 public const int SyntaxFieldNumber = 6;
190 private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2;
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100191 /// <summary>
192 /// The source syntax.
193 /// </summary>
Jon Skeet94898172015-09-01 15:47:48 +0100194 public global::Google.Protobuf.WellKnownTypes.Syntax Syntax {
195 get { return syntax_; }
196 set {
197 syntax_ = value;
198 }
199 }
200
Jon Skeet62a4aa52015-07-14 14:26:49 +0100201 public override bool Equals(object other) {
202 return Equals(other as Type);
203 }
204
205 public bool Equals(Type other) {
206 if (ReferenceEquals(other, null)) {
207 return false;
208 }
209 if (ReferenceEquals(other, this)) {
210 return true;
211 }
212 if (Name != other.Name) return false;
213 if(!fields_.Equals(other.fields_)) return false;
214 if(!oneofs_.Equals(other.oneofs_)) return false;
215 if(!options_.Equals(other.options_)) return false;
216 if (!object.Equals(SourceContext, other.SourceContext)) return false;
Jon Skeet94898172015-09-01 15:47:48 +0100217 if (Syntax != other.Syntax) return false;
Jon Skeet62a4aa52015-07-14 14:26:49 +0100218 return true;
219 }
220
221 public override int GetHashCode() {
222 int hash = 1;
223 if (Name.Length != 0) hash ^= Name.GetHashCode();
224 hash ^= fields_.GetHashCode();
225 hash ^= oneofs_.GetHashCode();
226 hash ^= options_.GetHashCode();
227 if (sourceContext_ != null) hash ^= SourceContext.GetHashCode();
Jon Skeet94898172015-09-01 15:47:48 +0100228 if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) hash ^= Syntax.GetHashCode();
Jon Skeet62a4aa52015-07-14 14:26:49 +0100229 return hash;
230 }
231
232 public override string ToString() {
233 return pb::JsonFormatter.Default.Format(this);
234 }
235
236 public void WriteTo(pb::CodedOutputStream output) {
237 if (Name.Length != 0) {
238 output.WriteRawTag(10);
239 output.WriteString(Name);
240 }
241 fields_.WriteTo(output, _repeated_fields_codec);
242 oneofs_.WriteTo(output, _repeated_oneofs_codec);
243 options_.WriteTo(output, _repeated_options_codec);
244 if (sourceContext_ != null) {
245 output.WriteRawTag(42);
246 output.WriteMessage(SourceContext);
247 }
Jon Skeet94898172015-09-01 15:47:48 +0100248 if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
249 output.WriteRawTag(48);
250 output.WriteEnum((int) Syntax);
251 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100252 }
253
254 public int CalculateSize() {
255 int size = 0;
256 if (Name.Length != 0) {
257 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
258 }
259 size += fields_.CalculateSize(_repeated_fields_codec);
260 size += oneofs_.CalculateSize(_repeated_oneofs_codec);
261 size += options_.CalculateSize(_repeated_options_codec);
262 if (sourceContext_ != null) {
263 size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceContext);
264 }
Jon Skeet94898172015-09-01 15:47:48 +0100265 if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
266 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax);
267 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100268 return size;
269 }
270
271 public void MergeFrom(Type other) {
272 if (other == null) {
273 return;
274 }
275 if (other.Name.Length != 0) {
276 Name = other.Name;
277 }
278 fields_.Add(other.fields_);
279 oneofs_.Add(other.oneofs_);
280 options_.Add(other.options_);
281 if (other.sourceContext_ != null) {
282 if (sourceContext_ == null) {
283 sourceContext_ = new global::Google.Protobuf.WellKnownTypes.SourceContext();
284 }
285 SourceContext.MergeFrom(other.SourceContext);
286 }
Jon Skeet94898172015-09-01 15:47:48 +0100287 if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
288 Syntax = other.Syntax;
289 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100290 }
291
292 public void MergeFrom(pb::CodedInputStream input) {
293 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +0100294 while ((tag = input.ReadTag()) != 0) {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100295 switch(tag) {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100296 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100297 input.SkipLastField();
Jon Skeet62a4aa52015-07-14 14:26:49 +0100298 break;
299 case 10: {
300 Name = input.ReadString();
301 break;
302 }
303 case 18: {
304 fields_.AddEntriesFrom(input, _repeated_fields_codec);
305 break;
306 }
307 case 26: {
308 oneofs_.AddEntriesFrom(input, _repeated_oneofs_codec);
309 break;
310 }
311 case 34: {
312 options_.AddEntriesFrom(input, _repeated_options_codec);
313 break;
314 }
315 case 42: {
316 if (sourceContext_ == null) {
317 sourceContext_ = new global::Google.Protobuf.WellKnownTypes.SourceContext();
318 }
319 input.ReadMessage(sourceContext_);
320 break;
321 }
Jon Skeet94898172015-09-01 15:47:48 +0100322 case 48: {
323 syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum();
324 break;
325 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100326 }
327 }
328 }
329
330 }
331
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100332 /// <summary>
333 /// Field represents a single field of a message type.
334 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100335 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
336 public sealed partial class Field : pb::IMessage<Field> {
337 private static readonly pb::MessageParser<Field> _parser = new pb::MessageParser<Field>(() => new Field());
338 public static pb::MessageParser<Field> Parser { get { return _parser; } }
339
Jon Skeet62a4aa52015-07-14 14:26:49 +0100340 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +0000341 get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[1]; }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100342 }
343
Jon Skeet96cffaa2015-07-20 19:25:07 +0100344 pbr::MessageDescriptor pb::IMessage.Descriptor {
345 get { return Descriptor; }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100346 }
347
Jon Skeet62a4aa52015-07-14 14:26:49 +0100348 public Field() {
349 OnConstruction();
350 }
351
352 partial void OnConstruction();
353
354 public Field(Field other) : this() {
355 kind_ = other.kind_;
356 cardinality_ = other.cardinality_;
357 number_ = other.number_;
358 name_ = other.name_;
359 typeUrl_ = other.typeUrl_;
360 oneofIndex_ = other.oneofIndex_;
361 packed_ = other.packed_;
362 options_ = other.options_.Clone();
Jon Skeet94898172015-09-01 15:47:48 +0100363 jsonName_ = other.jsonName_;
Jon Skeet62a4aa52015-07-14 14:26:49 +0100364 }
365
366 public Field Clone() {
367 return new Field(this);
368 }
369
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100370 /// <summary>Field number for the "kind" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100371 public const int KindFieldNumber = 1;
372 private global::Google.Protobuf.WellKnownTypes.Field.Types.Kind kind_ = global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TYPE_UNKNOWN;
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100373 /// <summary>
374 /// The field kind.
375 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100376 public global::Google.Protobuf.WellKnownTypes.Field.Types.Kind Kind {
377 get { return kind_; }
378 set {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100379 kind_ = value;
380 }
381 }
382
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100383 /// <summary>Field number for the "cardinality" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100384 public const int CardinalityFieldNumber = 2;
385 private global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality cardinality_ = global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.CARDINALITY_UNKNOWN;
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100386 /// <summary>
387 /// The field cardinality, i.e. optional/required/repeated.
388 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100389 public global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality Cardinality {
390 get { return cardinality_; }
391 set {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100392 cardinality_ = value;
393 }
394 }
395
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100396 /// <summary>Field number for the "number" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100397 public const int NumberFieldNumber = 3;
398 private int number_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100399 /// <summary>
400 /// The proto field number.
401 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100402 public int Number {
403 get { return number_; }
404 set {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100405 number_ = value;
406 }
407 }
408
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100409 /// <summary>Field number for the "name" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100410 public const int NameFieldNumber = 4;
411 private string name_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100412 /// <summary>
413 /// The field name.
414 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100415 public string Name {
416 get { return name_; }
417 set {
Jon Skeetd18cc082015-07-30 13:50:02 +0100418 name_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeet62a4aa52015-07-14 14:26:49 +0100419 }
420 }
421
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100422 /// <summary>Field number for the "type_url" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100423 public const int TypeUrlFieldNumber = 6;
424 private string typeUrl_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100425 /// <summary>
426 /// The type URL (without the scheme) when the type is MESSAGE or ENUM,
427 /// such as `type.googleapis.com/google.protobuf.Empty`.
428 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100429 public string TypeUrl {
430 get { return typeUrl_; }
431 set {
Jon Skeetd18cc082015-07-30 13:50:02 +0100432 typeUrl_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeet62a4aa52015-07-14 14:26:49 +0100433 }
434 }
435
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100436 /// <summary>Field number for the "oneof_index" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100437 public const int OneofIndexFieldNumber = 7;
438 private int oneofIndex_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100439 /// <summary>
440 /// Index in Type.oneofs. Starts at 1. Zero means no oneof mapping.
441 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100442 public int OneofIndex {
443 get { return oneofIndex_; }
444 set {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100445 oneofIndex_ = value;
446 }
447 }
448
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100449 /// <summary>Field number for the "packed" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100450 public const int PackedFieldNumber = 8;
451 private bool packed_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100452 /// <summary>
453 /// Whether to use alternative packed wire representation.
454 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100455 public bool Packed {
456 get { return packed_; }
457 set {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100458 packed_ = value;
459 }
460 }
461
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100462 /// <summary>Field number for the "options" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100463 public const int OptionsFieldNumber = 9;
464 private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec
465 = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.WellKnownTypes.Option.Parser);
466 private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100467 /// <summary>
468 /// The proto options.
469 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100470 public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options {
471 get { return options_; }
472 }
473
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100474 /// <summary>Field number for the "json_name" field.</summary>
Jon Skeet94898172015-09-01 15:47:48 +0100475 public const int JsonNameFieldNumber = 10;
476 private string jsonName_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100477 /// <summary>
478 /// The JSON name for this field.
479 /// </summary>
Jon Skeet94898172015-09-01 15:47:48 +0100480 public string JsonName {
481 get { return jsonName_; }
482 set {
483 jsonName_ = pb::Preconditions.CheckNotNull(value, "value");
484 }
485 }
486
Jon Skeet62a4aa52015-07-14 14:26:49 +0100487 public override bool Equals(object other) {
488 return Equals(other as Field);
489 }
490
491 public bool Equals(Field other) {
492 if (ReferenceEquals(other, null)) {
493 return false;
494 }
495 if (ReferenceEquals(other, this)) {
496 return true;
497 }
498 if (Kind != other.Kind) return false;
499 if (Cardinality != other.Cardinality) return false;
500 if (Number != other.Number) return false;
501 if (Name != other.Name) return false;
502 if (TypeUrl != other.TypeUrl) return false;
503 if (OneofIndex != other.OneofIndex) return false;
504 if (Packed != other.Packed) return false;
505 if(!options_.Equals(other.options_)) return false;
Jon Skeet94898172015-09-01 15:47:48 +0100506 if (JsonName != other.JsonName) return false;
Jon Skeet62a4aa52015-07-14 14:26:49 +0100507 return true;
508 }
509
510 public override int GetHashCode() {
511 int hash = 1;
512 if (Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TYPE_UNKNOWN) hash ^= Kind.GetHashCode();
513 if (Cardinality != global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.CARDINALITY_UNKNOWN) hash ^= Cardinality.GetHashCode();
514 if (Number != 0) hash ^= Number.GetHashCode();
515 if (Name.Length != 0) hash ^= Name.GetHashCode();
516 if (TypeUrl.Length != 0) hash ^= TypeUrl.GetHashCode();
517 if (OneofIndex != 0) hash ^= OneofIndex.GetHashCode();
518 if (Packed != false) hash ^= Packed.GetHashCode();
519 hash ^= options_.GetHashCode();
Jon Skeet94898172015-09-01 15:47:48 +0100520 if (JsonName.Length != 0) hash ^= JsonName.GetHashCode();
Jon Skeet62a4aa52015-07-14 14:26:49 +0100521 return hash;
522 }
523
524 public override string ToString() {
525 return pb::JsonFormatter.Default.Format(this);
526 }
527
528 public void WriteTo(pb::CodedOutputStream output) {
529 if (Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TYPE_UNKNOWN) {
530 output.WriteRawTag(8);
531 output.WriteEnum((int) Kind);
532 }
533 if (Cardinality != global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.CARDINALITY_UNKNOWN) {
534 output.WriteRawTag(16);
535 output.WriteEnum((int) Cardinality);
536 }
537 if (Number != 0) {
538 output.WriteRawTag(24);
539 output.WriteInt32(Number);
540 }
541 if (Name.Length != 0) {
542 output.WriteRawTag(34);
543 output.WriteString(Name);
544 }
545 if (TypeUrl.Length != 0) {
546 output.WriteRawTag(50);
547 output.WriteString(TypeUrl);
548 }
549 if (OneofIndex != 0) {
550 output.WriteRawTag(56);
551 output.WriteInt32(OneofIndex);
552 }
553 if (Packed != false) {
554 output.WriteRawTag(64);
555 output.WriteBool(Packed);
556 }
557 options_.WriteTo(output, _repeated_options_codec);
Jon Skeet94898172015-09-01 15:47:48 +0100558 if (JsonName.Length != 0) {
559 output.WriteRawTag(82);
560 output.WriteString(JsonName);
561 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100562 }
563
564 public int CalculateSize() {
565 int size = 0;
566 if (Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TYPE_UNKNOWN) {
567 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Kind);
568 }
569 if (Cardinality != global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.CARDINALITY_UNKNOWN) {
570 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Cardinality);
571 }
572 if (Number != 0) {
573 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Number);
574 }
575 if (Name.Length != 0) {
576 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
577 }
578 if (TypeUrl.Length != 0) {
579 size += 1 + pb::CodedOutputStream.ComputeStringSize(TypeUrl);
580 }
581 if (OneofIndex != 0) {
582 size += 1 + pb::CodedOutputStream.ComputeInt32Size(OneofIndex);
583 }
584 if (Packed != false) {
585 size += 1 + 1;
586 }
587 size += options_.CalculateSize(_repeated_options_codec);
Jon Skeet94898172015-09-01 15:47:48 +0100588 if (JsonName.Length != 0) {
589 size += 1 + pb::CodedOutputStream.ComputeStringSize(JsonName);
590 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100591 return size;
592 }
593
594 public void MergeFrom(Field other) {
595 if (other == null) {
596 return;
597 }
598 if (other.Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TYPE_UNKNOWN) {
599 Kind = other.Kind;
600 }
601 if (other.Cardinality != global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.CARDINALITY_UNKNOWN) {
602 Cardinality = other.Cardinality;
603 }
604 if (other.Number != 0) {
605 Number = other.Number;
606 }
607 if (other.Name.Length != 0) {
608 Name = other.Name;
609 }
610 if (other.TypeUrl.Length != 0) {
611 TypeUrl = other.TypeUrl;
612 }
613 if (other.OneofIndex != 0) {
614 OneofIndex = other.OneofIndex;
615 }
616 if (other.Packed != false) {
617 Packed = other.Packed;
618 }
619 options_.Add(other.options_);
Jon Skeet94898172015-09-01 15:47:48 +0100620 if (other.JsonName.Length != 0) {
621 JsonName = other.JsonName;
622 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100623 }
624
625 public void MergeFrom(pb::CodedInputStream input) {
626 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +0100627 while ((tag = input.ReadTag()) != 0) {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100628 switch(tag) {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100629 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100630 input.SkipLastField();
Jon Skeet62a4aa52015-07-14 14:26:49 +0100631 break;
632 case 8: {
633 kind_ = (global::Google.Protobuf.WellKnownTypes.Field.Types.Kind) input.ReadEnum();
634 break;
635 }
636 case 16: {
637 cardinality_ = (global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality) input.ReadEnum();
638 break;
639 }
640 case 24: {
641 Number = input.ReadInt32();
642 break;
643 }
644 case 34: {
645 Name = input.ReadString();
646 break;
647 }
648 case 50: {
649 TypeUrl = input.ReadString();
650 break;
651 }
652 case 56: {
653 OneofIndex = input.ReadInt32();
654 break;
655 }
656 case 64: {
657 Packed = input.ReadBool();
658 break;
659 }
660 case 74: {
661 options_.AddEntriesFrom(input, _repeated_options_codec);
662 break;
663 }
Jon Skeet94898172015-09-01 15:47:48 +0100664 case 82: {
665 JsonName = input.ReadString();
666 break;
667 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100668 }
669 }
670 }
671
672 #region Nested types
Jon Skeetb0888a42015-09-29 13:37:30 +0100673 /// <summary>Container for nested types declared in the Field message type.</summary>
Jon Skeete2c82302015-09-29 14:34:31 +0100674 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet62a4aa52015-07-14 14:26:49 +0100675 public static partial class Types {
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100676 /// <summary>
677 /// Kind represents a basic field type.
678 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100679 public enum Kind {
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100680 /// <summary>
681 /// Field type unknown.
682 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100683 TYPE_UNKNOWN = 0,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100684 /// <summary>
685 /// Field type double.
686 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100687 TYPE_DOUBLE = 1,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100688 /// <summary>
689 /// Field type float.
690 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100691 TYPE_FLOAT = 2,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100692 /// <summary>
693 /// Field type int64.
694 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100695 TYPE_INT64 = 3,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100696 /// <summary>
697 /// Field type uint64.
698 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100699 TYPE_UINT64 = 4,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100700 /// <summary>
701 /// Field type int32.
702 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100703 TYPE_INT32 = 5,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100704 /// <summary>
705 /// Field type fixed64.
706 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100707 TYPE_FIXED64 = 6,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100708 /// <summary>
709 /// Field type fixed32.
710 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100711 TYPE_FIXED32 = 7,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100712 /// <summary>
713 /// Field type bool.
714 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100715 TYPE_BOOL = 8,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100716 /// <summary>
717 /// Field type string.
718 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100719 TYPE_STRING = 9,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100720 /// <summary>
721 /// Field type group (deprecated proto2 type)
722 /// </summary>
Jon Skeet94898172015-09-01 15:47:48 +0100723 TYPE_GROUP = 10,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100724 /// <summary>
725 /// Field type message.
726 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100727 TYPE_MESSAGE = 11,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100728 /// <summary>
729 /// Field type bytes.
730 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100731 TYPE_BYTES = 12,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100732 /// <summary>
733 /// Field type uint32.
734 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100735 TYPE_UINT32 = 13,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100736 /// <summary>
737 /// Field type enum.
738 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100739 TYPE_ENUM = 14,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100740 /// <summary>
741 /// Field type sfixed32.
742 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100743 TYPE_SFIXED32 = 15,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100744 /// <summary>
745 /// Field type sfixed64.
746 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100747 TYPE_SFIXED64 = 16,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100748 /// <summary>
749 /// Field type sint32.
750 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100751 TYPE_SINT32 = 17,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100752 /// <summary>
753 /// Field type sint64.
754 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100755 TYPE_SINT64 = 18,
756 }
757
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100758 /// <summary>
759 /// Cardinality represents whether a field is optional, required, or
760 /// repeated.
761 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100762 public enum Cardinality {
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100763 /// <summary>
764 /// The field cardinality is unknown. Typically an error condition.
765 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100766 CARDINALITY_UNKNOWN = 0,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100767 /// <summary>
768 /// For optional fields.
769 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100770 CARDINALITY_OPTIONAL = 1,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100771 /// <summary>
772 /// For required fields. Not used for proto3.
773 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100774 CARDINALITY_REQUIRED = 2,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100775 /// <summary>
776 /// For repeated fields.
777 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100778 CARDINALITY_REPEATED = 3,
779 }
780
781 }
782 #endregion
783
784 }
785
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100786 /// <summary>
787 /// Enum type definition.
788 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100789 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
790 public sealed partial class Enum : pb::IMessage<Enum> {
791 private static readonly pb::MessageParser<Enum> _parser = new pb::MessageParser<Enum>(() => new Enum());
792 public static pb::MessageParser<Enum> Parser { get { return _parser; } }
793
Jon Skeet62a4aa52015-07-14 14:26:49 +0100794 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +0000795 get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[2]; }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100796 }
797
Jon Skeet96cffaa2015-07-20 19:25:07 +0100798 pbr::MessageDescriptor pb::IMessage.Descriptor {
799 get { return Descriptor; }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100800 }
801
Jon Skeet62a4aa52015-07-14 14:26:49 +0100802 public Enum() {
803 OnConstruction();
804 }
805
806 partial void OnConstruction();
807
808 public Enum(Enum other) : this() {
809 name_ = other.name_;
810 enumvalue_ = other.enumvalue_.Clone();
811 options_ = other.options_.Clone();
812 SourceContext = other.sourceContext_ != null ? other.SourceContext.Clone() : null;
Jon Skeet94898172015-09-01 15:47:48 +0100813 syntax_ = other.syntax_;
Jon Skeet62a4aa52015-07-14 14:26:49 +0100814 }
815
816 public Enum Clone() {
817 return new Enum(this);
818 }
819
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100820 /// <summary>Field number for the "name" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100821 public const int NameFieldNumber = 1;
822 private string name_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100823 /// <summary>
824 /// Enum type name.
825 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100826 public string Name {
827 get { return name_; }
828 set {
Jon Skeetd18cc082015-07-30 13:50:02 +0100829 name_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeet62a4aa52015-07-14 14:26:49 +0100830 }
831 }
832
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100833 /// <summary>Field number for the "enumvalue" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100834 public const int EnumvalueFieldNumber = 2;
835 private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.EnumValue> _repeated_enumvalue_codec
836 = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.EnumValue.Parser);
837 private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.EnumValue> enumvalue_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.EnumValue>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100838 /// <summary>
839 /// Enum value definitions.
840 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100841 public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.EnumValue> Enumvalue {
842 get { return enumvalue_; }
843 }
844
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100845 /// <summary>Field number for the "options" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100846 public const int OptionsFieldNumber = 3;
847 private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec
848 = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser);
849 private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100850 /// <summary>
851 /// Proto options for the enum type.
852 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100853 public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options {
854 get { return options_; }
855 }
856
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100857 /// <summary>Field number for the "source_context" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100858 public const int SourceContextFieldNumber = 4;
859 private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100860 /// <summary>
861 /// The source context.
862 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100863 public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext {
864 get { return sourceContext_; }
865 set {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100866 sourceContext_ = value;
867 }
868 }
869
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100870 /// <summary>Field number for the "syntax" field.</summary>
Jon Skeet94898172015-09-01 15:47:48 +0100871 public const int SyntaxFieldNumber = 5;
872 private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2;
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100873 /// <summary>
874 /// The source syntax.
875 /// </summary>
Jon Skeet94898172015-09-01 15:47:48 +0100876 public global::Google.Protobuf.WellKnownTypes.Syntax Syntax {
877 get { return syntax_; }
878 set {
879 syntax_ = value;
880 }
881 }
882
Jon Skeet62a4aa52015-07-14 14:26:49 +0100883 public override bool Equals(object other) {
884 return Equals(other as Enum);
885 }
886
887 public bool Equals(Enum other) {
888 if (ReferenceEquals(other, null)) {
889 return false;
890 }
891 if (ReferenceEquals(other, this)) {
892 return true;
893 }
894 if (Name != other.Name) return false;
895 if(!enumvalue_.Equals(other.enumvalue_)) return false;
896 if(!options_.Equals(other.options_)) return false;
897 if (!object.Equals(SourceContext, other.SourceContext)) return false;
Jon Skeet94898172015-09-01 15:47:48 +0100898 if (Syntax != other.Syntax) return false;
Jon Skeet62a4aa52015-07-14 14:26:49 +0100899 return true;
900 }
901
902 public override int GetHashCode() {
903 int hash = 1;
904 if (Name.Length != 0) hash ^= Name.GetHashCode();
905 hash ^= enumvalue_.GetHashCode();
906 hash ^= options_.GetHashCode();
907 if (sourceContext_ != null) hash ^= SourceContext.GetHashCode();
Jon Skeet94898172015-09-01 15:47:48 +0100908 if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) hash ^= Syntax.GetHashCode();
Jon Skeet62a4aa52015-07-14 14:26:49 +0100909 return hash;
910 }
911
912 public override string ToString() {
913 return pb::JsonFormatter.Default.Format(this);
914 }
915
916 public void WriteTo(pb::CodedOutputStream output) {
917 if (Name.Length != 0) {
918 output.WriteRawTag(10);
919 output.WriteString(Name);
920 }
921 enumvalue_.WriteTo(output, _repeated_enumvalue_codec);
922 options_.WriteTo(output, _repeated_options_codec);
923 if (sourceContext_ != null) {
924 output.WriteRawTag(34);
925 output.WriteMessage(SourceContext);
926 }
Jon Skeet94898172015-09-01 15:47:48 +0100927 if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
928 output.WriteRawTag(40);
929 output.WriteEnum((int) Syntax);
930 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100931 }
932
933 public int CalculateSize() {
934 int size = 0;
935 if (Name.Length != 0) {
936 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
937 }
938 size += enumvalue_.CalculateSize(_repeated_enumvalue_codec);
939 size += options_.CalculateSize(_repeated_options_codec);
940 if (sourceContext_ != null) {
941 size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceContext);
942 }
Jon Skeet94898172015-09-01 15:47:48 +0100943 if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
944 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax);
945 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100946 return size;
947 }
948
949 public void MergeFrom(Enum other) {
950 if (other == null) {
951 return;
952 }
953 if (other.Name.Length != 0) {
954 Name = other.Name;
955 }
956 enumvalue_.Add(other.enumvalue_);
957 options_.Add(other.options_);
958 if (other.sourceContext_ != null) {
959 if (sourceContext_ == null) {
960 sourceContext_ = new global::Google.Protobuf.WellKnownTypes.SourceContext();
961 }
962 SourceContext.MergeFrom(other.SourceContext);
963 }
Jon Skeet94898172015-09-01 15:47:48 +0100964 if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
965 Syntax = other.Syntax;
966 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100967 }
968
969 public void MergeFrom(pb::CodedInputStream input) {
970 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +0100971 while ((tag = input.ReadTag()) != 0) {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100972 switch(tag) {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100973 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100974 input.SkipLastField();
Jon Skeet62a4aa52015-07-14 14:26:49 +0100975 break;
976 case 10: {
977 Name = input.ReadString();
978 break;
979 }
980 case 18: {
981 enumvalue_.AddEntriesFrom(input, _repeated_enumvalue_codec);
982 break;
983 }
984 case 26: {
985 options_.AddEntriesFrom(input, _repeated_options_codec);
986 break;
987 }
988 case 34: {
989 if (sourceContext_ == null) {
990 sourceContext_ = new global::Google.Protobuf.WellKnownTypes.SourceContext();
991 }
992 input.ReadMessage(sourceContext_);
993 break;
994 }
Jon Skeet94898172015-09-01 15:47:48 +0100995 case 40: {
996 syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum();
997 break;
998 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100999 }
1000 }
1001 }
1002
1003 }
1004
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001005 /// <summary>
1006 /// Enum value definition.
1007 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001008 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1009 public sealed partial class EnumValue : pb::IMessage<EnumValue> {
1010 private static readonly pb::MessageParser<EnumValue> _parser = new pb::MessageParser<EnumValue>(() => new EnumValue());
1011 public static pb::MessageParser<EnumValue> Parser { get { return _parser; } }
1012
Jon Skeet62a4aa52015-07-14 14:26:49 +01001013 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +00001014 get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[3]; }
Jon Skeet62a4aa52015-07-14 14:26:49 +01001015 }
1016
Jon Skeet96cffaa2015-07-20 19:25:07 +01001017 pbr::MessageDescriptor pb::IMessage.Descriptor {
1018 get { return Descriptor; }
Jon Skeet62a4aa52015-07-14 14:26:49 +01001019 }
1020
Jon Skeet62a4aa52015-07-14 14:26:49 +01001021 public EnumValue() {
1022 OnConstruction();
1023 }
1024
1025 partial void OnConstruction();
1026
1027 public EnumValue(EnumValue other) : this() {
1028 name_ = other.name_;
1029 number_ = other.number_;
1030 options_ = other.options_.Clone();
1031 }
1032
1033 public EnumValue Clone() {
1034 return new EnumValue(this);
1035 }
1036
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001037 /// <summary>Field number for the "name" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001038 public const int NameFieldNumber = 1;
1039 private string name_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001040 /// <summary>
1041 /// Enum value name.
1042 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001043 public string Name {
1044 get { return name_; }
1045 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01001046 name_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeet62a4aa52015-07-14 14:26:49 +01001047 }
1048 }
1049
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001050 /// <summary>Field number for the "number" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001051 public const int NumberFieldNumber = 2;
1052 private int number_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001053 /// <summary>
1054 /// Enum value number.
1055 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001056 public int Number {
1057 get { return number_; }
1058 set {
Jon Skeet62a4aa52015-07-14 14:26:49 +01001059 number_ = value;
1060 }
1061 }
1062
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001063 /// <summary>Field number for the "options" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001064 public const int OptionsFieldNumber = 3;
1065 private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec
1066 = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser);
1067 private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001068 /// <summary>
1069 /// Proto options for the enum value.
1070 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001071 public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options {
1072 get { return options_; }
1073 }
1074
1075 public override bool Equals(object other) {
1076 return Equals(other as EnumValue);
1077 }
1078
1079 public bool Equals(EnumValue other) {
1080 if (ReferenceEquals(other, null)) {
1081 return false;
1082 }
1083 if (ReferenceEquals(other, this)) {
1084 return true;
1085 }
1086 if (Name != other.Name) return false;
1087 if (Number != other.Number) return false;
1088 if(!options_.Equals(other.options_)) return false;
1089 return true;
1090 }
1091
1092 public override int GetHashCode() {
1093 int hash = 1;
1094 if (Name.Length != 0) hash ^= Name.GetHashCode();
1095 if (Number != 0) hash ^= Number.GetHashCode();
1096 hash ^= options_.GetHashCode();
1097 return hash;
1098 }
1099
1100 public override string ToString() {
1101 return pb::JsonFormatter.Default.Format(this);
1102 }
1103
1104 public void WriteTo(pb::CodedOutputStream output) {
1105 if (Name.Length != 0) {
1106 output.WriteRawTag(10);
1107 output.WriteString(Name);
1108 }
1109 if (Number != 0) {
1110 output.WriteRawTag(16);
1111 output.WriteInt32(Number);
1112 }
1113 options_.WriteTo(output, _repeated_options_codec);
1114 }
1115
1116 public int CalculateSize() {
1117 int size = 0;
1118 if (Name.Length != 0) {
1119 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
1120 }
1121 if (Number != 0) {
1122 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Number);
1123 }
1124 size += options_.CalculateSize(_repeated_options_codec);
1125 return size;
1126 }
1127
1128 public void MergeFrom(EnumValue other) {
1129 if (other == null) {
1130 return;
1131 }
1132 if (other.Name.Length != 0) {
1133 Name = other.Name;
1134 }
1135 if (other.Number != 0) {
1136 Number = other.Number;
1137 }
1138 options_.Add(other.options_);
1139 }
1140
1141 public void MergeFrom(pb::CodedInputStream input) {
1142 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01001143 while ((tag = input.ReadTag()) != 0) {
Jon Skeet62a4aa52015-07-14 14:26:49 +01001144 switch(tag) {
Jon Skeet62a4aa52015-07-14 14:26:49 +01001145 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01001146 input.SkipLastField();
Jon Skeet62a4aa52015-07-14 14:26:49 +01001147 break;
1148 case 10: {
1149 Name = input.ReadString();
1150 break;
1151 }
1152 case 16: {
1153 Number = input.ReadInt32();
1154 break;
1155 }
1156 case 26: {
1157 options_.AddEntriesFrom(input, _repeated_options_codec);
1158 break;
1159 }
1160 }
1161 }
1162 }
1163
1164 }
1165
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001166 /// <summary>
1167 /// Proto option attached to messages/fields/enums etc.
1168 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001169 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1170 public sealed partial class Option : pb::IMessage<Option> {
1171 private static readonly pb::MessageParser<Option> _parser = new pb::MessageParser<Option>(() => new Option());
1172 public static pb::MessageParser<Option> Parser { get { return _parser; } }
1173
Jon Skeet62a4aa52015-07-14 14:26:49 +01001174 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +00001175 get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[4]; }
Jon Skeet62a4aa52015-07-14 14:26:49 +01001176 }
1177
Jon Skeet96cffaa2015-07-20 19:25:07 +01001178 pbr::MessageDescriptor pb::IMessage.Descriptor {
1179 get { return Descriptor; }
Jon Skeet62a4aa52015-07-14 14:26:49 +01001180 }
1181
Jon Skeet62a4aa52015-07-14 14:26:49 +01001182 public Option() {
1183 OnConstruction();
1184 }
1185
1186 partial void OnConstruction();
1187
1188 public Option(Option other) : this() {
1189 name_ = other.name_;
1190 Value = other.value_ != null ? other.Value.Clone() : null;
1191 }
1192
1193 public Option Clone() {
1194 return new Option(this);
1195 }
1196
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001197 /// <summary>Field number for the "name" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001198 public const int NameFieldNumber = 1;
1199 private string name_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001200 /// <summary>
1201 /// Proto option name.
1202 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001203 public string Name {
1204 get { return name_; }
1205 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01001206 name_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeet62a4aa52015-07-14 14:26:49 +01001207 }
1208 }
1209
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001210 /// <summary>Field number for the "value" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001211 public const int ValueFieldNumber = 2;
1212 private global::Google.Protobuf.WellKnownTypes.Any value_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001213 /// <summary>
1214 /// Proto option value.
1215 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001216 public global::Google.Protobuf.WellKnownTypes.Any Value {
1217 get { return value_; }
1218 set {
Jon Skeet62a4aa52015-07-14 14:26:49 +01001219 value_ = value;
1220 }
1221 }
1222
1223 public override bool Equals(object other) {
1224 return Equals(other as Option);
1225 }
1226
1227 public bool Equals(Option other) {
1228 if (ReferenceEquals(other, null)) {
1229 return false;
1230 }
1231 if (ReferenceEquals(other, this)) {
1232 return true;
1233 }
1234 if (Name != other.Name) return false;
1235 if (!object.Equals(Value, other.Value)) return false;
1236 return true;
1237 }
1238
1239 public override int GetHashCode() {
1240 int hash = 1;
1241 if (Name.Length != 0) hash ^= Name.GetHashCode();
1242 if (value_ != null) hash ^= Value.GetHashCode();
1243 return hash;
1244 }
1245
1246 public override string ToString() {
1247 return pb::JsonFormatter.Default.Format(this);
1248 }
1249
1250 public void WriteTo(pb::CodedOutputStream output) {
1251 if (Name.Length != 0) {
1252 output.WriteRawTag(10);
1253 output.WriteString(Name);
1254 }
1255 if (value_ != null) {
1256 output.WriteRawTag(18);
1257 output.WriteMessage(Value);
1258 }
1259 }
1260
1261 public int CalculateSize() {
1262 int size = 0;
1263 if (Name.Length != 0) {
1264 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
1265 }
1266 if (value_ != null) {
1267 size += 1 + pb::CodedOutputStream.ComputeMessageSize(Value);
1268 }
1269 return size;
1270 }
1271
1272 public void MergeFrom(Option other) {
1273 if (other == null) {
1274 return;
1275 }
1276 if (other.Name.Length != 0) {
1277 Name = other.Name;
1278 }
1279 if (other.value_ != null) {
1280 if (value_ == null) {
1281 value_ = new global::Google.Protobuf.WellKnownTypes.Any();
1282 }
1283 Value.MergeFrom(other.Value);
1284 }
1285 }
1286
1287 public void MergeFrom(pb::CodedInputStream input) {
1288 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01001289 while ((tag = input.ReadTag()) != 0) {
Jon Skeet62a4aa52015-07-14 14:26:49 +01001290 switch(tag) {
Jon Skeet62a4aa52015-07-14 14:26:49 +01001291 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01001292 input.SkipLastField();
Jon Skeet62a4aa52015-07-14 14:26:49 +01001293 break;
1294 case 10: {
1295 Name = input.ReadString();
1296 break;
1297 }
1298 case 18: {
1299 if (value_ == null) {
1300 value_ = new global::Google.Protobuf.WellKnownTypes.Any();
1301 }
1302 input.ReadMessage(value_);
1303 break;
1304 }
1305 }
1306 }
1307 }
1308
1309 }
1310
1311 #endregion
1312
1313}
1314
1315#endregion Designer generated code