blob: 8faa1d1c372f1910ae6cde177a9aaa98e8ff08a1 [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",
Jon Skeet9e4f3542016-01-04 14:03:01 +000033 "b3RvYnVmLlN5bnRheCLVBQoFRmllbGQSKQoEa2luZBgBIAEoDjIbLmdvb2ds",
Jon Skeet284bb452015-11-05 09:13:53 +000034 "ZS5wcm90b2J1Zi5GaWVsZC5LaW5kEjcKC2NhcmRpbmFsaXR5GAIgASgOMiIu",
35 "Z29vZ2xlLnByb3RvYnVmLkZpZWxkLkNhcmRpbmFsaXR5Eg4KBm51bWJlchgD",
36 "IAEoBRIMCgRuYW1lGAQgASgJEhAKCHR5cGVfdXJsGAYgASgJEhMKC29uZW9m",
37 "X2luZGV4GAcgASgFEg4KBnBhY2tlZBgIIAEoCBIoCgdvcHRpb25zGAkgAygL",
Jon Skeet9e4f3542016-01-04 14:03:01 +000038 "MhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvbhIRCglqc29uX25hbWUYCiABKAkS",
39 "FQoNZGVmYXVsdF92YWx1ZRgLIAEoCSLIAgoES2luZBIQCgxUWVBFX1VOS05P",
40 "V04QABIPCgtUWVBFX0RPVUJMRRABEg4KClRZUEVfRkxPQVQQAhIOCgpUWVBF",
41 "X0lOVDY0EAMSDwoLVFlQRV9VSU5UNjQQBBIOCgpUWVBFX0lOVDMyEAUSEAoM",
42 "VFlQRV9GSVhFRDY0EAYSEAoMVFlQRV9GSVhFRDMyEAcSDQoJVFlQRV9CT09M",
43 "EAgSDwoLVFlQRV9TVFJJTkcQCRIOCgpUWVBFX0dST1VQEAoSEAoMVFlQRV9N",
44 "RVNTQUdFEAsSDgoKVFlQRV9CWVRFUxAMEg8KC1RZUEVfVUlOVDMyEA0SDQoJ",
45 "VFlQRV9FTlVNEA4SEQoNVFlQRV9TRklYRUQzMhAPEhEKDVRZUEVfU0ZJWEVE",
46 "NjQQEBIPCgtUWVBFX1NJTlQzMhAREg8KC1RZUEVfU0lOVDY0EBIidAoLQ2Fy",
47 "ZGluYWxpdHkSFwoTQ0FSRElOQUxJVFlfVU5LTk9XThAAEhgKFENBUkRJTkFM",
48 "SVRZX09QVElPTkFMEAESGAoUQ0FSRElOQUxJVFlfUkVRVUlSRUQQAhIYChRD",
49 "QVJESU5BTElUWV9SRVBFQVRFRBADIs4BCgRFbnVtEgwKBG5hbWUYASABKAkS",
50 "LQoJZW51bXZhbHVlGAIgAygLMhouZ29vZ2xlLnByb3RvYnVmLkVudW1WYWx1",
51 "ZRIoCgdvcHRpb25zGAMgAygLMhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvbhI2",
52 "Cg5zb3VyY2VfY29udGV4dBgEIAEoCzIeLmdvb2dsZS5wcm90b2J1Zi5Tb3Vy",
53 "Y2VDb250ZXh0EicKBnN5bnRheBgFIAEoDjIXLmdvb2dsZS5wcm90b2J1Zi5T",
54 "eW50YXgiUwoJRW51bVZhbHVlEgwKBG5hbWUYASABKAkSDgoGbnVtYmVyGAIg",
55 "ASgFEigKB29wdGlvbnMYAyADKAsyFy5nb29nbGUucHJvdG9idWYuT3B0aW9u",
56 "IjsKBk9wdGlvbhIMCgRuYW1lGAEgASgJEiMKBXZhbHVlGAIgASgLMhQuZ29v",
57 "Z2xlLnByb3RvYnVmLkFueSouCgZTeW50YXgSEQoNU1lOVEFYX1BST1RPMhAA",
58 "EhEKDVNZTlRBWF9QUk9UTzMQAUJMChNjb20uZ29vZ2xlLnByb3RvYnVmQglU",
59 "eXBlUHJvdG9QAaABAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25v",
60 "d25UeXBlc2IGcHJvdG8z"));
Jon Skeeta2667aa2015-11-19 17:14:23 +000061 descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
Jon Skeet284bb452015-11-05 09:13:53 +000062 new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.SourceContextReflection.Descriptor, },
Jon Skeetb6159962016-02-04 07:08:55 +000063 new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Protobuf.WellKnownTypes.Syntax), }, new pbr::GeneratedClrTypeInfo[] {
64 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Type), global::Google.Protobuf.WellKnownTypes.Type.Parser, new[]{ "Name", "Fields", "Oneofs", "Options", "SourceContext", "Syntax" }, null, null, null),
65 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Field), global::Google.Protobuf.WellKnownTypes.Field.Parser, new[]{ "Kind", "Cardinality", "Number", "Name", "TypeUrl", "OneofIndex", "Packed", "Options", "JsonName", "DefaultValue" }, null, new[]{ typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Kind), typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality) }, null),
66 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Enum), global::Google.Protobuf.WellKnownTypes.Enum.Parser, new[]{ "Name", "Enumvalue", "Options", "SourceContext", "Syntax" }, null, null, null),
67 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.EnumValue), global::Google.Protobuf.WellKnownTypes.EnumValue.Parser, new[]{ "Name", "Number", "Options" }, null, null, null),
68 new pbr::GeneratedClrTypeInfo(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 +000069 }));
70 }
71 #endregion
72
Jon Skeet62a4aa52015-07-14 14:26:49 +010073 }
Jon Skeet94898172015-09-01 15:47:48 +010074 #region Enums
Jon Skeet18e0a2e2015-10-01 10:38:01 +010075 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +000076 /// The syntax in which a protocol buffer element is defined.
Jon Skeet18e0a2e2015-10-01 10:38:01 +010077 /// </summary>
Jon Skeet94898172015-09-01 15:47:48 +010078 public enum Syntax {
Jon Skeet18e0a2e2015-10-01 10:38:01 +010079 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +000080 /// Syntax `proto2`.
Jon Skeet18e0a2e2015-10-01 10:38:01 +010081 /// </summary>
Jon Skeet94898172015-09-01 15:47:48 +010082 SYNTAX_PROTO2 = 0,
Jon Skeet18e0a2e2015-10-01 10:38:01 +010083 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +000084 /// Syntax `proto3`.
Jon Skeet18e0a2e2015-10-01 10:38:01 +010085 /// </summary>
Jon Skeet94898172015-09-01 15:47:48 +010086 SYNTAX_PROTO3 = 1,
87 }
88
89 #endregion
90
Jon Skeet62a4aa52015-07-14 14:26:49 +010091 #region Messages
Jon Skeet18e0a2e2015-10-01 10:38:01 +010092 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +000093 /// A protocol buffer message type.
Jon Skeet18e0a2e2015-10-01 10:38:01 +010094 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +010095 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
96 public sealed partial class Type : pb::IMessage<Type> {
97 private static readonly pb::MessageParser<Type> _parser = new pb::MessageParser<Type>(() => new Type());
98 public static pb::MessageParser<Type> Parser { get { return _parser; } }
99
Jon Skeet62a4aa52015-07-14 14:26:49 +0100100 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +0000101 get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[0]; }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100102 }
103
Jon Skeet96cffaa2015-07-20 19:25:07 +0100104 pbr::MessageDescriptor pb::IMessage.Descriptor {
105 get { return Descriptor; }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100106 }
107
Jon Skeet62a4aa52015-07-14 14:26:49 +0100108 public Type() {
109 OnConstruction();
110 }
111
112 partial void OnConstruction();
113
114 public Type(Type other) : this() {
115 name_ = other.name_;
116 fields_ = other.fields_.Clone();
117 oneofs_ = other.oneofs_.Clone();
118 options_ = other.options_.Clone();
119 SourceContext = other.sourceContext_ != null ? other.SourceContext.Clone() : null;
Jon Skeet94898172015-09-01 15:47:48 +0100120 syntax_ = other.syntax_;
Jon Skeet62a4aa52015-07-14 14:26:49 +0100121 }
122
123 public Type Clone() {
124 return new Type(this);
125 }
126
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100127 /// <summary>Field number for the "name" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100128 public const int NameFieldNumber = 1;
129 private string name_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100130 /// <summary>
131 /// The fully qualified message name.
132 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100133 public string Name {
134 get { return name_; }
135 set {
Jon Skeet045b5282016-02-04 15:02:59 +0000136 name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
Jon Skeet62a4aa52015-07-14 14:26:49 +0100137 }
138 }
139
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100140 /// <summary>Field number for the "fields" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100141 public const int FieldsFieldNumber = 2;
142 private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Field> _repeated_fields_codec
143 = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Field.Parser);
144 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 +0100145 /// <summary>
146 /// The list of fields.
147 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100148 public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Field> Fields {
149 get { return fields_; }
150 }
151
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100152 /// <summary>Field number for the "oneofs" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100153 public const int OneofsFieldNumber = 3;
154 private static readonly pb::FieldCodec<string> _repeated_oneofs_codec
155 = pb::FieldCodec.ForString(26);
156 private readonly pbc::RepeatedField<string> oneofs_ = new pbc::RepeatedField<string>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100157 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +0000158 /// The list of types appearing in `oneof` definitions in this type.
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100159 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100160 public pbc::RepeatedField<string> Oneofs {
161 get { return oneofs_; }
162 }
163
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100164 /// <summary>Field number for the "options" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100165 public const int OptionsFieldNumber = 4;
166 private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec
167 = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.WellKnownTypes.Option.Parser);
168 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 +0100169 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +0000170 /// The protocol buffer options.
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100171 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100172 public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options {
173 get { return options_; }
174 }
175
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100176 /// <summary>Field number for the "source_context" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100177 public const int SourceContextFieldNumber = 5;
178 private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100179 /// <summary>
180 /// The source context.
181 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100182 public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext {
183 get { return sourceContext_; }
184 set {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100185 sourceContext_ = value;
186 }
187 }
188
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100189 /// <summary>Field number for the "syntax" field.</summary>
Jon Skeet94898172015-09-01 15:47:48 +0100190 public const int SyntaxFieldNumber = 6;
191 private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2;
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100192 /// <summary>
193 /// The source syntax.
194 /// </summary>
Jon Skeet94898172015-09-01 15:47:48 +0100195 public global::Google.Protobuf.WellKnownTypes.Syntax Syntax {
196 get { return syntax_; }
197 set {
198 syntax_ = value;
199 }
200 }
201
Jon Skeet62a4aa52015-07-14 14:26:49 +0100202 public override bool Equals(object other) {
203 return Equals(other as Type);
204 }
205
206 public bool Equals(Type other) {
207 if (ReferenceEquals(other, null)) {
208 return false;
209 }
210 if (ReferenceEquals(other, this)) {
211 return true;
212 }
213 if (Name != other.Name) return false;
214 if(!fields_.Equals(other.fields_)) return false;
215 if(!oneofs_.Equals(other.oneofs_)) return false;
216 if(!options_.Equals(other.options_)) return false;
217 if (!object.Equals(SourceContext, other.SourceContext)) return false;
Jon Skeet94898172015-09-01 15:47:48 +0100218 if (Syntax != other.Syntax) return false;
Jon Skeet62a4aa52015-07-14 14:26:49 +0100219 return true;
220 }
221
222 public override int GetHashCode() {
223 int hash = 1;
224 if (Name.Length != 0) hash ^= Name.GetHashCode();
225 hash ^= fields_.GetHashCode();
226 hash ^= oneofs_.GetHashCode();
227 hash ^= options_.GetHashCode();
228 if (sourceContext_ != null) hash ^= SourceContext.GetHashCode();
Jon Skeet94898172015-09-01 15:47:48 +0100229 if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) hash ^= Syntax.GetHashCode();
Jon Skeet62a4aa52015-07-14 14:26:49 +0100230 return hash;
231 }
232
233 public override string ToString() {
Jon Skeetadee6fe2015-12-15 09:24:04 +0000234 return pb::JsonFormatter.ToDiagnosticString(this);
Jon Skeet62a4aa52015-07-14 14:26:49 +0100235 }
236
237 public void WriteTo(pb::CodedOutputStream output) {
238 if (Name.Length != 0) {
239 output.WriteRawTag(10);
240 output.WriteString(Name);
241 }
242 fields_.WriteTo(output, _repeated_fields_codec);
243 oneofs_.WriteTo(output, _repeated_oneofs_codec);
244 options_.WriteTo(output, _repeated_options_codec);
245 if (sourceContext_ != null) {
246 output.WriteRawTag(42);
247 output.WriteMessage(SourceContext);
248 }
Jon Skeet94898172015-09-01 15:47:48 +0100249 if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
250 output.WriteRawTag(48);
251 output.WriteEnum((int) Syntax);
252 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100253 }
254
255 public int CalculateSize() {
256 int size = 0;
257 if (Name.Length != 0) {
258 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
259 }
260 size += fields_.CalculateSize(_repeated_fields_codec);
261 size += oneofs_.CalculateSize(_repeated_oneofs_codec);
262 size += options_.CalculateSize(_repeated_options_codec);
263 if (sourceContext_ != null) {
264 size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceContext);
265 }
Jon Skeet94898172015-09-01 15:47:48 +0100266 if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
267 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax);
268 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100269 return size;
270 }
271
272 public void MergeFrom(Type other) {
273 if (other == null) {
274 return;
275 }
276 if (other.Name.Length != 0) {
277 Name = other.Name;
278 }
279 fields_.Add(other.fields_);
280 oneofs_.Add(other.oneofs_);
281 options_.Add(other.options_);
282 if (other.sourceContext_ != null) {
283 if (sourceContext_ == null) {
284 sourceContext_ = new global::Google.Protobuf.WellKnownTypes.SourceContext();
285 }
286 SourceContext.MergeFrom(other.SourceContext);
287 }
Jon Skeet94898172015-09-01 15:47:48 +0100288 if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
289 Syntax = other.Syntax;
290 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100291 }
292
293 public void MergeFrom(pb::CodedInputStream input) {
294 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +0100295 while ((tag = input.ReadTag()) != 0) {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100296 switch(tag) {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100297 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100298 input.SkipLastField();
Jon Skeet62a4aa52015-07-14 14:26:49 +0100299 break;
300 case 10: {
301 Name = input.ReadString();
302 break;
303 }
304 case 18: {
305 fields_.AddEntriesFrom(input, _repeated_fields_codec);
306 break;
307 }
308 case 26: {
309 oneofs_.AddEntriesFrom(input, _repeated_oneofs_codec);
310 break;
311 }
312 case 34: {
313 options_.AddEntriesFrom(input, _repeated_options_codec);
314 break;
315 }
316 case 42: {
317 if (sourceContext_ == null) {
318 sourceContext_ = new global::Google.Protobuf.WellKnownTypes.SourceContext();
319 }
320 input.ReadMessage(sourceContext_);
321 break;
322 }
Jon Skeet94898172015-09-01 15:47:48 +0100323 case 48: {
324 syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum();
325 break;
326 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100327 }
328 }
329 }
330
331 }
332
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100333 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +0000334 /// A single field of a message type.
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100335 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100336 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
337 public sealed partial class Field : pb::IMessage<Field> {
338 private static readonly pb::MessageParser<Field> _parser = new pb::MessageParser<Field>(() => new Field());
339 public static pb::MessageParser<Field> Parser { get { return _parser; } }
340
Jon Skeet62a4aa52015-07-14 14:26:49 +0100341 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +0000342 get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[1]; }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100343 }
344
Jon Skeet96cffaa2015-07-20 19:25:07 +0100345 pbr::MessageDescriptor pb::IMessage.Descriptor {
346 get { return Descriptor; }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100347 }
348
Jon Skeet62a4aa52015-07-14 14:26:49 +0100349 public Field() {
350 OnConstruction();
351 }
352
353 partial void OnConstruction();
354
355 public Field(Field other) : this() {
356 kind_ = other.kind_;
357 cardinality_ = other.cardinality_;
358 number_ = other.number_;
359 name_ = other.name_;
360 typeUrl_ = other.typeUrl_;
361 oneofIndex_ = other.oneofIndex_;
362 packed_ = other.packed_;
363 options_ = other.options_.Clone();
Jon Skeet94898172015-09-01 15:47:48 +0100364 jsonName_ = other.jsonName_;
Jon Skeet9e4f3542016-01-04 14:03:01 +0000365 defaultValue_ = other.defaultValue_;
Jon Skeet62a4aa52015-07-14 14:26:49 +0100366 }
367
368 public Field Clone() {
369 return new Field(this);
370 }
371
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100372 /// <summary>Field number for the "kind" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100373 public const int KindFieldNumber = 1;
374 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 +0100375 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +0000376 /// The field type.
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100377 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100378 public global::Google.Protobuf.WellKnownTypes.Field.Types.Kind Kind {
379 get { return kind_; }
380 set {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100381 kind_ = value;
382 }
383 }
384
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100385 /// <summary>Field number for the "cardinality" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100386 public const int CardinalityFieldNumber = 2;
387 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 +0100388 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +0000389 /// The field cardinality.
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100390 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100391 public global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality Cardinality {
392 get { return cardinality_; }
393 set {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100394 cardinality_ = value;
395 }
396 }
397
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100398 /// <summary>Field number for the "number" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100399 public const int NumberFieldNumber = 3;
400 private int number_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100401 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +0000402 /// The field number.
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100403 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100404 public int Number {
405 get { return number_; }
406 set {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100407 number_ = value;
408 }
409 }
410
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100411 /// <summary>Field number for the "name" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100412 public const int NameFieldNumber = 4;
413 private string name_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100414 /// <summary>
415 /// The field name.
416 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100417 public string Name {
418 get { return name_; }
419 set {
Jon Skeet045b5282016-02-04 15:02:59 +0000420 name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
Jon Skeet62a4aa52015-07-14 14:26:49 +0100421 }
422 }
423
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100424 /// <summary>Field number for the "type_url" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100425 public const int TypeUrlFieldNumber = 6;
426 private string typeUrl_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100427 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +0000428 /// The field type URL, without the scheme, for message or enumeration
429 /// types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100430 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100431 public string TypeUrl {
432 get { return typeUrl_; }
433 set {
Jon Skeet045b5282016-02-04 15:02:59 +0000434 typeUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
Jon Skeet62a4aa52015-07-14 14:26:49 +0100435 }
436 }
437
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100438 /// <summary>Field number for the "oneof_index" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100439 public const int OneofIndexFieldNumber = 7;
440 private int oneofIndex_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100441 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +0000442 /// The index of the field type in `Type.oneofs`, for message or enumeration
443 /// types. The first type has index 1; zero means the type is not in the list.
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100444 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100445 public int OneofIndex {
446 get { return oneofIndex_; }
447 set {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100448 oneofIndex_ = value;
449 }
450 }
451
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100452 /// <summary>Field number for the "packed" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100453 public const int PackedFieldNumber = 8;
454 private bool packed_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100455 /// <summary>
456 /// Whether to use alternative packed wire representation.
457 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100458 public bool Packed {
459 get { return packed_; }
460 set {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100461 packed_ = value;
462 }
463 }
464
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100465 /// <summary>Field number for the "options" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100466 public const int OptionsFieldNumber = 9;
467 private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec
468 = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.WellKnownTypes.Option.Parser);
469 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 +0100470 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +0000471 /// The protocol buffer options.
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100472 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100473 public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options {
474 get { return options_; }
475 }
476
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100477 /// <summary>Field number for the "json_name" field.</summary>
Jon Skeet94898172015-09-01 15:47:48 +0100478 public const int JsonNameFieldNumber = 10;
479 private string jsonName_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100480 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +0000481 /// The field JSON name.
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100482 /// </summary>
Jon Skeet94898172015-09-01 15:47:48 +0100483 public string JsonName {
484 get { return jsonName_; }
485 set {
Jon Skeet045b5282016-02-04 15:02:59 +0000486 jsonName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
Jon Skeet94898172015-09-01 15:47:48 +0100487 }
488 }
489
Jon Skeet9e4f3542016-01-04 14:03:01 +0000490 /// <summary>Field number for the "default_value" field.</summary>
491 public const int DefaultValueFieldNumber = 11;
492 private string defaultValue_ = "";
493 /// <summary>
494 /// The string value of the default value of this field. Proto2 syntax only.
495 /// </summary>
496 public string DefaultValue {
497 get { return defaultValue_; }
498 set {
Jon Skeet045b5282016-02-04 15:02:59 +0000499 defaultValue_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
Jon Skeet9e4f3542016-01-04 14:03:01 +0000500 }
501 }
502
Jon Skeet62a4aa52015-07-14 14:26:49 +0100503 public override bool Equals(object other) {
504 return Equals(other as Field);
505 }
506
507 public bool Equals(Field other) {
508 if (ReferenceEquals(other, null)) {
509 return false;
510 }
511 if (ReferenceEquals(other, this)) {
512 return true;
513 }
514 if (Kind != other.Kind) return false;
515 if (Cardinality != other.Cardinality) return false;
516 if (Number != other.Number) return false;
517 if (Name != other.Name) return false;
518 if (TypeUrl != other.TypeUrl) return false;
519 if (OneofIndex != other.OneofIndex) return false;
520 if (Packed != other.Packed) return false;
521 if(!options_.Equals(other.options_)) return false;
Jon Skeet94898172015-09-01 15:47:48 +0100522 if (JsonName != other.JsonName) return false;
Jon Skeet9e4f3542016-01-04 14:03:01 +0000523 if (DefaultValue != other.DefaultValue) return false;
Jon Skeet62a4aa52015-07-14 14:26:49 +0100524 return true;
525 }
526
527 public override int GetHashCode() {
528 int hash = 1;
529 if (Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TYPE_UNKNOWN) hash ^= Kind.GetHashCode();
530 if (Cardinality != global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.CARDINALITY_UNKNOWN) hash ^= Cardinality.GetHashCode();
531 if (Number != 0) hash ^= Number.GetHashCode();
532 if (Name.Length != 0) hash ^= Name.GetHashCode();
533 if (TypeUrl.Length != 0) hash ^= TypeUrl.GetHashCode();
534 if (OneofIndex != 0) hash ^= OneofIndex.GetHashCode();
535 if (Packed != false) hash ^= Packed.GetHashCode();
536 hash ^= options_.GetHashCode();
Jon Skeet94898172015-09-01 15:47:48 +0100537 if (JsonName.Length != 0) hash ^= JsonName.GetHashCode();
Jon Skeet9e4f3542016-01-04 14:03:01 +0000538 if (DefaultValue.Length != 0) hash ^= DefaultValue.GetHashCode();
Jon Skeet62a4aa52015-07-14 14:26:49 +0100539 return hash;
540 }
541
542 public override string ToString() {
Jon Skeetadee6fe2015-12-15 09:24:04 +0000543 return pb::JsonFormatter.ToDiagnosticString(this);
Jon Skeet62a4aa52015-07-14 14:26:49 +0100544 }
545
546 public void WriteTo(pb::CodedOutputStream output) {
547 if (Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TYPE_UNKNOWN) {
548 output.WriteRawTag(8);
549 output.WriteEnum((int) Kind);
550 }
551 if (Cardinality != global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.CARDINALITY_UNKNOWN) {
552 output.WriteRawTag(16);
553 output.WriteEnum((int) Cardinality);
554 }
555 if (Number != 0) {
556 output.WriteRawTag(24);
557 output.WriteInt32(Number);
558 }
559 if (Name.Length != 0) {
560 output.WriteRawTag(34);
561 output.WriteString(Name);
562 }
563 if (TypeUrl.Length != 0) {
564 output.WriteRawTag(50);
565 output.WriteString(TypeUrl);
566 }
567 if (OneofIndex != 0) {
568 output.WriteRawTag(56);
569 output.WriteInt32(OneofIndex);
570 }
571 if (Packed != false) {
572 output.WriteRawTag(64);
573 output.WriteBool(Packed);
574 }
575 options_.WriteTo(output, _repeated_options_codec);
Jon Skeet94898172015-09-01 15:47:48 +0100576 if (JsonName.Length != 0) {
577 output.WriteRawTag(82);
578 output.WriteString(JsonName);
579 }
Jon Skeet9e4f3542016-01-04 14:03:01 +0000580 if (DefaultValue.Length != 0) {
581 output.WriteRawTag(90);
582 output.WriteString(DefaultValue);
583 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100584 }
585
586 public int CalculateSize() {
587 int size = 0;
588 if (Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TYPE_UNKNOWN) {
589 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Kind);
590 }
591 if (Cardinality != global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.CARDINALITY_UNKNOWN) {
592 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Cardinality);
593 }
594 if (Number != 0) {
595 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Number);
596 }
597 if (Name.Length != 0) {
598 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
599 }
600 if (TypeUrl.Length != 0) {
601 size += 1 + pb::CodedOutputStream.ComputeStringSize(TypeUrl);
602 }
603 if (OneofIndex != 0) {
604 size += 1 + pb::CodedOutputStream.ComputeInt32Size(OneofIndex);
605 }
606 if (Packed != false) {
607 size += 1 + 1;
608 }
609 size += options_.CalculateSize(_repeated_options_codec);
Jon Skeet94898172015-09-01 15:47:48 +0100610 if (JsonName.Length != 0) {
611 size += 1 + pb::CodedOutputStream.ComputeStringSize(JsonName);
612 }
Jon Skeet9e4f3542016-01-04 14:03:01 +0000613 if (DefaultValue.Length != 0) {
614 size += 1 + pb::CodedOutputStream.ComputeStringSize(DefaultValue);
615 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100616 return size;
617 }
618
619 public void MergeFrom(Field other) {
620 if (other == null) {
621 return;
622 }
623 if (other.Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TYPE_UNKNOWN) {
624 Kind = other.Kind;
625 }
626 if (other.Cardinality != global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.CARDINALITY_UNKNOWN) {
627 Cardinality = other.Cardinality;
628 }
629 if (other.Number != 0) {
630 Number = other.Number;
631 }
632 if (other.Name.Length != 0) {
633 Name = other.Name;
634 }
635 if (other.TypeUrl.Length != 0) {
636 TypeUrl = other.TypeUrl;
637 }
638 if (other.OneofIndex != 0) {
639 OneofIndex = other.OneofIndex;
640 }
641 if (other.Packed != false) {
642 Packed = other.Packed;
643 }
644 options_.Add(other.options_);
Jon Skeet94898172015-09-01 15:47:48 +0100645 if (other.JsonName.Length != 0) {
646 JsonName = other.JsonName;
647 }
Jon Skeet9e4f3542016-01-04 14:03:01 +0000648 if (other.DefaultValue.Length != 0) {
649 DefaultValue = other.DefaultValue;
650 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100651 }
652
653 public void MergeFrom(pb::CodedInputStream input) {
654 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +0100655 while ((tag = input.ReadTag()) != 0) {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100656 switch(tag) {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100657 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100658 input.SkipLastField();
Jon Skeet62a4aa52015-07-14 14:26:49 +0100659 break;
660 case 8: {
661 kind_ = (global::Google.Protobuf.WellKnownTypes.Field.Types.Kind) input.ReadEnum();
662 break;
663 }
664 case 16: {
665 cardinality_ = (global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality) input.ReadEnum();
666 break;
667 }
668 case 24: {
669 Number = input.ReadInt32();
670 break;
671 }
672 case 34: {
673 Name = input.ReadString();
674 break;
675 }
676 case 50: {
677 TypeUrl = input.ReadString();
678 break;
679 }
680 case 56: {
681 OneofIndex = input.ReadInt32();
682 break;
683 }
684 case 64: {
685 Packed = input.ReadBool();
686 break;
687 }
688 case 74: {
689 options_.AddEntriesFrom(input, _repeated_options_codec);
690 break;
691 }
Jon Skeet94898172015-09-01 15:47:48 +0100692 case 82: {
693 JsonName = input.ReadString();
694 break;
695 }
Jon Skeet9e4f3542016-01-04 14:03:01 +0000696 case 90: {
697 DefaultValue = input.ReadString();
698 break;
699 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100700 }
701 }
702 }
703
704 #region Nested types
Jon Skeetb0888a42015-09-29 13:37:30 +0100705 /// <summary>Container for nested types declared in the Field message type.</summary>
Jon Skeete2c82302015-09-29 14:34:31 +0100706 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet62a4aa52015-07-14 14:26:49 +0100707 public static partial class Types {
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100708 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +0000709 /// Basic field types.
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100710 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100711 public enum Kind {
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100712 /// <summary>
713 /// Field type unknown.
714 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100715 TYPE_UNKNOWN = 0,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100716 /// <summary>
717 /// Field type double.
718 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100719 TYPE_DOUBLE = 1,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100720 /// <summary>
721 /// Field type float.
722 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100723 TYPE_FLOAT = 2,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100724 /// <summary>
725 /// Field type int64.
726 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100727 TYPE_INT64 = 3,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100728 /// <summary>
729 /// Field type uint64.
730 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100731 TYPE_UINT64 = 4,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100732 /// <summary>
733 /// Field type int32.
734 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100735 TYPE_INT32 = 5,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100736 /// <summary>
737 /// Field type fixed64.
738 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100739 TYPE_FIXED64 = 6,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100740 /// <summary>
741 /// Field type fixed32.
742 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100743 TYPE_FIXED32 = 7,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100744 /// <summary>
745 /// Field type bool.
746 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100747 TYPE_BOOL = 8,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100748 /// <summary>
749 /// Field type string.
750 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100751 TYPE_STRING = 9,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100752 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +0000753 /// Field type group. Proto2 syntax only, and deprecated.
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100754 /// </summary>
Jon Skeet94898172015-09-01 15:47:48 +0100755 TYPE_GROUP = 10,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100756 /// <summary>
757 /// Field type message.
758 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100759 TYPE_MESSAGE = 11,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100760 /// <summary>
761 /// Field type bytes.
762 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100763 TYPE_BYTES = 12,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100764 /// <summary>
765 /// Field type uint32.
766 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100767 TYPE_UINT32 = 13,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100768 /// <summary>
769 /// Field type enum.
770 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100771 TYPE_ENUM = 14,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100772 /// <summary>
773 /// Field type sfixed32.
774 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100775 TYPE_SFIXED32 = 15,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100776 /// <summary>
777 /// Field type sfixed64.
778 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100779 TYPE_SFIXED64 = 16,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100780 /// <summary>
781 /// Field type sint32.
782 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100783 TYPE_SINT32 = 17,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100784 /// <summary>
785 /// Field type sint64.
786 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100787 TYPE_SINT64 = 18,
788 }
789
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100790 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +0000791 /// Whether a field is optional, required, or repeated.
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100792 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100793 public enum Cardinality {
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100794 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +0000795 /// For fields with unknown cardinality.
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100796 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100797 CARDINALITY_UNKNOWN = 0,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100798 /// <summary>
799 /// For optional fields.
800 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100801 CARDINALITY_OPTIONAL = 1,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100802 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +0000803 /// For required fields. Proto2 syntax only.
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100804 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100805 CARDINALITY_REQUIRED = 2,
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100806 /// <summary>
807 /// For repeated fields.
808 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100809 CARDINALITY_REPEATED = 3,
810 }
811
812 }
813 #endregion
814
815 }
816
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100817 /// <summary>
818 /// Enum type definition.
819 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100820 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
821 public sealed partial class Enum : pb::IMessage<Enum> {
822 private static readonly pb::MessageParser<Enum> _parser = new pb::MessageParser<Enum>(() => new Enum());
823 public static pb::MessageParser<Enum> Parser { get { return _parser; } }
824
Jon Skeet62a4aa52015-07-14 14:26:49 +0100825 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +0000826 get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[2]; }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100827 }
828
Jon Skeet96cffaa2015-07-20 19:25:07 +0100829 pbr::MessageDescriptor pb::IMessage.Descriptor {
830 get { return Descriptor; }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100831 }
832
Jon Skeet62a4aa52015-07-14 14:26:49 +0100833 public Enum() {
834 OnConstruction();
835 }
836
837 partial void OnConstruction();
838
839 public Enum(Enum other) : this() {
840 name_ = other.name_;
841 enumvalue_ = other.enumvalue_.Clone();
842 options_ = other.options_.Clone();
843 SourceContext = other.sourceContext_ != null ? other.SourceContext.Clone() : null;
Jon Skeet94898172015-09-01 15:47:48 +0100844 syntax_ = other.syntax_;
Jon Skeet62a4aa52015-07-14 14:26:49 +0100845 }
846
847 public Enum Clone() {
848 return new Enum(this);
849 }
850
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100851 /// <summary>Field number for the "name" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100852 public const int NameFieldNumber = 1;
853 private string name_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100854 /// <summary>
855 /// Enum type name.
856 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100857 public string Name {
858 get { return name_; }
859 set {
Jon Skeet045b5282016-02-04 15:02:59 +0000860 name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
Jon Skeet62a4aa52015-07-14 14:26:49 +0100861 }
862 }
863
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100864 /// <summary>Field number for the "enumvalue" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100865 public const int EnumvalueFieldNumber = 2;
866 private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.EnumValue> _repeated_enumvalue_codec
867 = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.EnumValue.Parser);
868 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 +0100869 /// <summary>
870 /// Enum value definitions.
871 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100872 public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.EnumValue> Enumvalue {
873 get { return enumvalue_; }
874 }
875
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100876 /// <summary>Field number for the "options" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100877 public const int OptionsFieldNumber = 3;
878 private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec
879 = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser);
880 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 +0100881 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +0000882 /// Protocol buffer options.
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100883 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100884 public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options {
885 get { return options_; }
886 }
887
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100888 /// <summary>Field number for the "source_context" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100889 public const int SourceContextFieldNumber = 4;
890 private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100891 /// <summary>
892 /// The source context.
893 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100894 public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext {
895 get { return sourceContext_; }
896 set {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100897 sourceContext_ = value;
898 }
899 }
900
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100901 /// <summary>Field number for the "syntax" field.</summary>
Jon Skeet94898172015-09-01 15:47:48 +0100902 public const int SyntaxFieldNumber = 5;
903 private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2;
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100904 /// <summary>
905 /// The source syntax.
906 /// </summary>
Jon Skeet94898172015-09-01 15:47:48 +0100907 public global::Google.Protobuf.WellKnownTypes.Syntax Syntax {
908 get { return syntax_; }
909 set {
910 syntax_ = value;
911 }
912 }
913
Jon Skeet62a4aa52015-07-14 14:26:49 +0100914 public override bool Equals(object other) {
915 return Equals(other as Enum);
916 }
917
918 public bool Equals(Enum other) {
919 if (ReferenceEquals(other, null)) {
920 return false;
921 }
922 if (ReferenceEquals(other, this)) {
923 return true;
924 }
925 if (Name != other.Name) return false;
926 if(!enumvalue_.Equals(other.enumvalue_)) return false;
927 if(!options_.Equals(other.options_)) return false;
928 if (!object.Equals(SourceContext, other.SourceContext)) return false;
Jon Skeet94898172015-09-01 15:47:48 +0100929 if (Syntax != other.Syntax) return false;
Jon Skeet62a4aa52015-07-14 14:26:49 +0100930 return true;
931 }
932
933 public override int GetHashCode() {
934 int hash = 1;
935 if (Name.Length != 0) hash ^= Name.GetHashCode();
936 hash ^= enumvalue_.GetHashCode();
937 hash ^= options_.GetHashCode();
938 if (sourceContext_ != null) hash ^= SourceContext.GetHashCode();
Jon Skeet94898172015-09-01 15:47:48 +0100939 if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) hash ^= Syntax.GetHashCode();
Jon Skeet62a4aa52015-07-14 14:26:49 +0100940 return hash;
941 }
942
943 public override string ToString() {
Jon Skeetadee6fe2015-12-15 09:24:04 +0000944 return pb::JsonFormatter.ToDiagnosticString(this);
Jon Skeet62a4aa52015-07-14 14:26:49 +0100945 }
946
947 public void WriteTo(pb::CodedOutputStream output) {
948 if (Name.Length != 0) {
949 output.WriteRawTag(10);
950 output.WriteString(Name);
951 }
952 enumvalue_.WriteTo(output, _repeated_enumvalue_codec);
953 options_.WriteTo(output, _repeated_options_codec);
954 if (sourceContext_ != null) {
955 output.WriteRawTag(34);
956 output.WriteMessage(SourceContext);
957 }
Jon Skeet94898172015-09-01 15:47:48 +0100958 if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
959 output.WriteRawTag(40);
960 output.WriteEnum((int) Syntax);
961 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100962 }
963
964 public int CalculateSize() {
965 int size = 0;
966 if (Name.Length != 0) {
967 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
968 }
969 size += enumvalue_.CalculateSize(_repeated_enumvalue_codec);
970 size += options_.CalculateSize(_repeated_options_codec);
971 if (sourceContext_ != null) {
972 size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceContext);
973 }
Jon Skeet94898172015-09-01 15:47:48 +0100974 if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
975 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax);
976 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100977 return size;
978 }
979
980 public void MergeFrom(Enum other) {
981 if (other == null) {
982 return;
983 }
984 if (other.Name.Length != 0) {
985 Name = other.Name;
986 }
987 enumvalue_.Add(other.enumvalue_);
988 options_.Add(other.options_);
989 if (other.sourceContext_ != null) {
990 if (sourceContext_ == null) {
991 sourceContext_ = new global::Google.Protobuf.WellKnownTypes.SourceContext();
992 }
993 SourceContext.MergeFrom(other.SourceContext);
994 }
Jon Skeet94898172015-09-01 15:47:48 +0100995 if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
996 Syntax = other.Syntax;
997 }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100998 }
999
1000 public void MergeFrom(pb::CodedInputStream input) {
1001 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01001002 while ((tag = input.ReadTag()) != 0) {
Jon Skeet62a4aa52015-07-14 14:26:49 +01001003 switch(tag) {
Jon Skeet62a4aa52015-07-14 14:26:49 +01001004 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01001005 input.SkipLastField();
Jon Skeet62a4aa52015-07-14 14:26:49 +01001006 break;
1007 case 10: {
1008 Name = input.ReadString();
1009 break;
1010 }
1011 case 18: {
1012 enumvalue_.AddEntriesFrom(input, _repeated_enumvalue_codec);
1013 break;
1014 }
1015 case 26: {
1016 options_.AddEntriesFrom(input, _repeated_options_codec);
1017 break;
1018 }
1019 case 34: {
1020 if (sourceContext_ == null) {
1021 sourceContext_ = new global::Google.Protobuf.WellKnownTypes.SourceContext();
1022 }
1023 input.ReadMessage(sourceContext_);
1024 break;
1025 }
Jon Skeet94898172015-09-01 15:47:48 +01001026 case 40: {
1027 syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum();
1028 break;
1029 }
Jon Skeet62a4aa52015-07-14 14:26:49 +01001030 }
1031 }
1032 }
1033
1034 }
1035
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001036 /// <summary>
1037 /// Enum value definition.
1038 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001039 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1040 public sealed partial class EnumValue : pb::IMessage<EnumValue> {
1041 private static readonly pb::MessageParser<EnumValue> _parser = new pb::MessageParser<EnumValue>(() => new EnumValue());
1042 public static pb::MessageParser<EnumValue> Parser { get { return _parser; } }
1043
Jon Skeet62a4aa52015-07-14 14:26:49 +01001044 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +00001045 get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[3]; }
Jon Skeet62a4aa52015-07-14 14:26:49 +01001046 }
1047
Jon Skeet96cffaa2015-07-20 19:25:07 +01001048 pbr::MessageDescriptor pb::IMessage.Descriptor {
1049 get { return Descriptor; }
Jon Skeet62a4aa52015-07-14 14:26:49 +01001050 }
1051
Jon Skeet62a4aa52015-07-14 14:26:49 +01001052 public EnumValue() {
1053 OnConstruction();
1054 }
1055
1056 partial void OnConstruction();
1057
1058 public EnumValue(EnumValue other) : this() {
1059 name_ = other.name_;
1060 number_ = other.number_;
1061 options_ = other.options_.Clone();
1062 }
1063
1064 public EnumValue Clone() {
1065 return new EnumValue(this);
1066 }
1067
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001068 /// <summary>Field number for the "name" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001069 public const int NameFieldNumber = 1;
1070 private string name_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001071 /// <summary>
1072 /// Enum value name.
1073 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001074 public string Name {
1075 get { return name_; }
1076 set {
Jon Skeet045b5282016-02-04 15:02:59 +00001077 name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
Jon Skeet62a4aa52015-07-14 14:26:49 +01001078 }
1079 }
1080
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001081 /// <summary>Field number for the "number" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001082 public const int NumberFieldNumber = 2;
1083 private int number_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001084 /// <summary>
1085 /// Enum value number.
1086 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001087 public int Number {
1088 get { return number_; }
1089 set {
Jon Skeet62a4aa52015-07-14 14:26:49 +01001090 number_ = value;
1091 }
1092 }
1093
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001094 /// <summary>Field number for the "options" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001095 public const int OptionsFieldNumber = 3;
1096 private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec
1097 = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser);
1098 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 +01001099 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +00001100 /// Protocol buffer options.
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001101 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001102 public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options {
1103 get { return options_; }
1104 }
1105
1106 public override bool Equals(object other) {
1107 return Equals(other as EnumValue);
1108 }
1109
1110 public bool Equals(EnumValue other) {
1111 if (ReferenceEquals(other, null)) {
1112 return false;
1113 }
1114 if (ReferenceEquals(other, this)) {
1115 return true;
1116 }
1117 if (Name != other.Name) return false;
1118 if (Number != other.Number) return false;
1119 if(!options_.Equals(other.options_)) return false;
1120 return true;
1121 }
1122
1123 public override int GetHashCode() {
1124 int hash = 1;
1125 if (Name.Length != 0) hash ^= Name.GetHashCode();
1126 if (Number != 0) hash ^= Number.GetHashCode();
1127 hash ^= options_.GetHashCode();
1128 return hash;
1129 }
1130
1131 public override string ToString() {
Jon Skeetadee6fe2015-12-15 09:24:04 +00001132 return pb::JsonFormatter.ToDiagnosticString(this);
Jon Skeet62a4aa52015-07-14 14:26:49 +01001133 }
1134
1135 public void WriteTo(pb::CodedOutputStream output) {
1136 if (Name.Length != 0) {
1137 output.WriteRawTag(10);
1138 output.WriteString(Name);
1139 }
1140 if (Number != 0) {
1141 output.WriteRawTag(16);
1142 output.WriteInt32(Number);
1143 }
1144 options_.WriteTo(output, _repeated_options_codec);
1145 }
1146
1147 public int CalculateSize() {
1148 int size = 0;
1149 if (Name.Length != 0) {
1150 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
1151 }
1152 if (Number != 0) {
1153 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Number);
1154 }
1155 size += options_.CalculateSize(_repeated_options_codec);
1156 return size;
1157 }
1158
1159 public void MergeFrom(EnumValue other) {
1160 if (other == null) {
1161 return;
1162 }
1163 if (other.Name.Length != 0) {
1164 Name = other.Name;
1165 }
1166 if (other.Number != 0) {
1167 Number = other.Number;
1168 }
1169 options_.Add(other.options_);
1170 }
1171
1172 public void MergeFrom(pb::CodedInputStream input) {
1173 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01001174 while ((tag = input.ReadTag()) != 0) {
Jon Skeet62a4aa52015-07-14 14:26:49 +01001175 switch(tag) {
Jon Skeet62a4aa52015-07-14 14:26:49 +01001176 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01001177 input.SkipLastField();
Jon Skeet62a4aa52015-07-14 14:26:49 +01001178 break;
1179 case 10: {
1180 Name = input.ReadString();
1181 break;
1182 }
1183 case 16: {
1184 Number = input.ReadInt32();
1185 break;
1186 }
1187 case 26: {
1188 options_.AddEntriesFrom(input, _repeated_options_codec);
1189 break;
1190 }
1191 }
1192 }
1193 }
1194
1195 }
1196
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001197 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +00001198 /// A protocol buffer option, which can be attached to a message, field,
1199 /// enumeration, etc.
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001200 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001201 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
1202 public sealed partial class Option : pb::IMessage<Option> {
1203 private static readonly pb::MessageParser<Option> _parser = new pb::MessageParser<Option>(() => new Option());
1204 public static pb::MessageParser<Option> Parser { get { return _parser; } }
1205
Jon Skeet62a4aa52015-07-14 14:26:49 +01001206 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +00001207 get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[4]; }
Jon Skeet62a4aa52015-07-14 14:26:49 +01001208 }
1209
Jon Skeet96cffaa2015-07-20 19:25:07 +01001210 pbr::MessageDescriptor pb::IMessage.Descriptor {
1211 get { return Descriptor; }
Jon Skeet62a4aa52015-07-14 14:26:49 +01001212 }
1213
Jon Skeet62a4aa52015-07-14 14:26:49 +01001214 public Option() {
1215 OnConstruction();
1216 }
1217
1218 partial void OnConstruction();
1219
1220 public Option(Option other) : this() {
1221 name_ = other.name_;
1222 Value = other.value_ != null ? other.Value.Clone() : null;
1223 }
1224
1225 public Option Clone() {
1226 return new Option(this);
1227 }
1228
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001229 /// <summary>Field number for the "name" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001230 public const int NameFieldNumber = 1;
1231 private string name_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001232 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +00001233 /// The option's name. For example, `"java_package"`.
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001234 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001235 public string Name {
1236 get { return name_; }
1237 set {
Jon Skeet045b5282016-02-04 15:02:59 +00001238 name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
Jon Skeet62a4aa52015-07-14 14:26:49 +01001239 }
1240 }
1241
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001242 /// <summary>Field number for the "value" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001243 public const int ValueFieldNumber = 2;
1244 private global::Google.Protobuf.WellKnownTypes.Any value_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001245 /// <summary>
Jon Skeet9e4f3542016-01-04 14:03:01 +00001246 /// The option's value. For example, `"com.google.protobuf"`.
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001247 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +01001248 public global::Google.Protobuf.WellKnownTypes.Any Value {
1249 get { return value_; }
1250 set {
Jon Skeet62a4aa52015-07-14 14:26:49 +01001251 value_ = value;
1252 }
1253 }
1254
1255 public override bool Equals(object other) {
1256 return Equals(other as Option);
1257 }
1258
1259 public bool Equals(Option other) {
1260 if (ReferenceEquals(other, null)) {
1261 return false;
1262 }
1263 if (ReferenceEquals(other, this)) {
1264 return true;
1265 }
1266 if (Name != other.Name) return false;
1267 if (!object.Equals(Value, other.Value)) return false;
1268 return true;
1269 }
1270
1271 public override int GetHashCode() {
1272 int hash = 1;
1273 if (Name.Length != 0) hash ^= Name.GetHashCode();
1274 if (value_ != null) hash ^= Value.GetHashCode();
1275 return hash;
1276 }
1277
1278 public override string ToString() {
Jon Skeetadee6fe2015-12-15 09:24:04 +00001279 return pb::JsonFormatter.ToDiagnosticString(this);
Jon Skeet62a4aa52015-07-14 14:26:49 +01001280 }
1281
1282 public void WriteTo(pb::CodedOutputStream output) {
1283 if (Name.Length != 0) {
1284 output.WriteRawTag(10);
1285 output.WriteString(Name);
1286 }
1287 if (value_ != null) {
1288 output.WriteRawTag(18);
1289 output.WriteMessage(Value);
1290 }
1291 }
1292
1293 public int CalculateSize() {
1294 int size = 0;
1295 if (Name.Length != 0) {
1296 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
1297 }
1298 if (value_ != null) {
1299 size += 1 + pb::CodedOutputStream.ComputeMessageSize(Value);
1300 }
1301 return size;
1302 }
1303
1304 public void MergeFrom(Option other) {
1305 if (other == null) {
1306 return;
1307 }
1308 if (other.Name.Length != 0) {
1309 Name = other.Name;
1310 }
1311 if (other.value_ != null) {
1312 if (value_ == null) {
1313 value_ = new global::Google.Protobuf.WellKnownTypes.Any();
1314 }
1315 Value.MergeFrom(other.Value);
1316 }
1317 }
1318
1319 public void MergeFrom(pb::CodedInputStream input) {
1320 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01001321 while ((tag = input.ReadTag()) != 0) {
Jon Skeet62a4aa52015-07-14 14:26:49 +01001322 switch(tag) {
Jon Skeet62a4aa52015-07-14 14:26:49 +01001323 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01001324 input.SkipLastField();
Jon Skeet62a4aa52015-07-14 14:26:49 +01001325 break;
1326 case 10: {
1327 Name = input.ReadString();
1328 break;
1329 }
1330 case 18: {
1331 if (value_ == null) {
1332 value_ = new global::Google.Protobuf.WellKnownTypes.Any();
1333 }
1334 input.ReadMessage(value_);
1335 break;
1336 }
1337 }
1338 }
1339 }
1340
1341 }
1342
1343 #endregion
1344
1345}
1346
1347#endregion Designer generated code