blob: 25a03538c6fa7881f8c797cce0cac7d96535e3a5 [file] [log] [blame]
Jon Skeetf3504cf2015-04-28 14:49:49 +01001// Generated by the protocol buffer compiler. DO NOT EDIT!
Jon Skeetca89a1a2015-08-25 14:32:28 +01002// source: google/protobuf/descriptor.proto
Jon Skeetf3504cf2015-04-28 14:49:49 +01003#pragma warning disable 1591, 0612, 3021
4#region Designer generated code
5
Jon Skeete38294a2015-06-09 19:30:44 +01006using pb = global::Google.Protobuf;
7using pbc = global::Google.Protobuf.Collections;
Jon Skeet76940942015-07-14 10:25:40 +01008using pbr = global::Google.Protobuf.Reflection;
Jon Skeetf3504cf2015-04-28 14:49:49 +01009using scg = global::System.Collections.Generic;
Jon Skeet9c888fa2015-07-14 11:13:52 +010010namespace Google.Protobuf.Reflection {
Jon Skeetf3504cf2015-04-28 14:49:49 +010011
Jon Skeetb0888a42015-09-29 13:37:30 +010012 /// <summary>Holder for reflection information generated from google/protobuf/descriptor.proto</summary>
Jon Skeete2c82302015-09-29 14:34:31 +010013 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +010014 internal static partial class DescriptorProtoFile {
Jon Skeetf3504cf2015-04-28 14:49:49 +010015
Jon Skeet5ca6dd72015-04-28 18:47:47 +010016 #region Descriptor
Jon Skeetb0888a42015-09-29 13:37:30 +010017 /// <summary>File descriptor for google/protobuf/descriptor.proto</summary>
Jon Skeet76940942015-07-14 10:25:40 +010018 public static pbr::FileDescriptor Descriptor {
Jon Skeetf3504cf2015-04-28 14:49:49 +010019 get { return descriptor; }
20 }
Jon Skeet76940942015-07-14 10:25:40 +010021 private static pbr::FileDescriptor descriptor;
Jon Skeetf3504cf2015-04-28 14:49:49 +010022
23 static DescriptorProtoFile() {
24 byte[] descriptorData = global::System.Convert.FromBase64String(
25 string.Concat(
Jon Skeet94898172015-09-01 15:47:48 +010026 "CiBnb29nbGUvcHJvdG9idWYvZGVzY3JpcHRvci5wcm90bxIPZ29vZ2xlLnBy",
27 "b3RvYnVmIkcKEUZpbGVEZXNjcmlwdG9yU2V0EjIKBGZpbGUYASADKAsyJC5n",
28 "b29nbGUucHJvdG9idWYuRmlsZURlc2NyaXB0b3JQcm90byLbAwoTRmlsZURl",
29 "c2NyaXB0b3JQcm90bxIMCgRuYW1lGAEgASgJEg8KB3BhY2thZ2UYAiABKAkS",
30 "EgoKZGVwZW5kZW5jeRgDIAMoCRIZChFwdWJsaWNfZGVwZW5kZW5jeRgKIAMo",
31 "BRIXCg93ZWFrX2RlcGVuZGVuY3kYCyADKAUSNgoMbWVzc2FnZV90eXBlGAQg",
32 "AygLMiAuZ29vZ2xlLnByb3RvYnVmLkRlc2NyaXB0b3JQcm90bxI3CgllbnVt",
33 "X3R5cGUYBSADKAsyJC5nb29nbGUucHJvdG9idWYuRW51bURlc2NyaXB0b3JQ",
34 "cm90bxI4CgdzZXJ2aWNlGAYgAygLMicuZ29vZ2xlLnByb3RvYnVmLlNlcnZp",
35 "Y2VEZXNjcmlwdG9yUHJvdG8SOAoJZXh0ZW5zaW9uGAcgAygLMiUuZ29vZ2xl",
36 "LnByb3RvYnVmLkZpZWxkRGVzY3JpcHRvclByb3RvEi0KB29wdGlvbnMYCCAB",
37 "KAsyHC5nb29nbGUucHJvdG9idWYuRmlsZU9wdGlvbnMSOQoQc291cmNlX2Nv",
38 "ZGVfaW5mbxgJIAEoCzIfLmdvb2dsZS5wcm90b2J1Zi5Tb3VyY2VDb2RlSW5m",
39 "bxIOCgZzeW50YXgYDCABKAki8AQKD0Rlc2NyaXB0b3JQcm90bxIMCgRuYW1l",
40 "GAEgASgJEjQKBWZpZWxkGAIgAygLMiUuZ29vZ2xlLnByb3RvYnVmLkZpZWxk",
41 "RGVzY3JpcHRvclByb3RvEjgKCWV4dGVuc2lvbhgGIAMoCzIlLmdvb2dsZS5w",
42 "cm90b2J1Zi5GaWVsZERlc2NyaXB0b3JQcm90bxI1CgtuZXN0ZWRfdHlwZRgD",
43 "IAMoCzIgLmdvb2dsZS5wcm90b2J1Zi5EZXNjcmlwdG9yUHJvdG8SNwoJZW51",
44 "bV90eXBlGAQgAygLMiQuZ29vZ2xlLnByb3RvYnVmLkVudW1EZXNjcmlwdG9y",
45 "UHJvdG8SSAoPZXh0ZW5zaW9uX3JhbmdlGAUgAygLMi8uZ29vZ2xlLnByb3Rv",
46 "YnVmLkRlc2NyaXB0b3JQcm90by5FeHRlbnNpb25SYW5nZRI5CgpvbmVvZl9k",
47 "ZWNsGAggAygLMiUuZ29vZ2xlLnByb3RvYnVmLk9uZW9mRGVzY3JpcHRvclBy",
48 "b3RvEjAKB29wdGlvbnMYByABKAsyHy5nb29nbGUucHJvdG9idWYuTWVzc2Fn",
49 "ZU9wdGlvbnMSRgoOcmVzZXJ2ZWRfcmFuZ2UYCSADKAsyLi5nb29nbGUucHJv",
50 "dG9idWYuRGVzY3JpcHRvclByb3RvLlJlc2VydmVkUmFuZ2USFQoNcmVzZXJ2",
51 "ZWRfbmFtZRgKIAMoCRosCg5FeHRlbnNpb25SYW5nZRINCgVzdGFydBgBIAEo",
52 "BRILCgNlbmQYAiABKAUaKwoNUmVzZXJ2ZWRSYW5nZRINCgVzdGFydBgBIAEo",
Jon Skeet55313c92015-10-24 06:46:02 +010053 "BRILCgNlbmQYAiABKAUivAUKFEZpZWxkRGVzY3JpcHRvclByb3RvEgwKBG5h",
Jon Skeet94898172015-09-01 15:47:48 +010054 "bWUYASABKAkSDgoGbnVtYmVyGAMgASgFEjoKBWxhYmVsGAQgASgOMisuZ29v",
55 "Z2xlLnByb3RvYnVmLkZpZWxkRGVzY3JpcHRvclByb3RvLkxhYmVsEjgKBHR5",
56 "cGUYBSABKA4yKi5nb29nbGUucHJvdG9idWYuRmllbGREZXNjcmlwdG9yUHJv",
57 "dG8uVHlwZRIRCgl0eXBlX25hbWUYBiABKAkSEAoIZXh0ZW5kZWUYAiABKAkS",
Jon Skeet55313c92015-10-24 06:46:02 +010058 "FQoNZGVmYXVsdF92YWx1ZRgHIAEoCRITCgtvbmVvZl9pbmRleBgJIAEoBRIR",
59 "Cglqc29uX25hbWUYCiABKAkSLgoHb3B0aW9ucxgIIAEoCzIdLmdvb2dsZS5w",
60 "cm90b2J1Zi5GaWVsZE9wdGlvbnMitgIKBFR5cGUSDwoLVFlQRV9ET1VCTEUQ",
61 "ARIOCgpUWVBFX0ZMT0FUEAISDgoKVFlQRV9JTlQ2NBADEg8KC1RZUEVfVUlO",
62 "VDY0EAQSDgoKVFlQRV9JTlQzMhAFEhAKDFRZUEVfRklYRUQ2NBAGEhAKDFRZ",
63 "UEVfRklYRUQzMhAHEg0KCVRZUEVfQk9PTBAIEg8KC1RZUEVfU1RSSU5HEAkS",
64 "DgoKVFlQRV9HUk9VUBAKEhAKDFRZUEVfTUVTU0FHRRALEg4KClRZUEVfQllU",
65 "RVMQDBIPCgtUWVBFX1VJTlQzMhANEg0KCVRZUEVfRU5VTRAOEhEKDVRZUEVf",
66 "U0ZJWEVEMzIQDxIRCg1UWVBFX1NGSVhFRDY0EBASDwoLVFlQRV9TSU5UMzIQ",
67 "ERIPCgtUWVBFX1NJTlQ2NBASIkMKBUxhYmVsEhIKDkxBQkVMX09QVElPTkFM",
68 "EAESEgoOTEFCRUxfUkVRVUlSRUQQAhISCg5MQUJFTF9SRVBFQVRFRBADIiQK",
69 "FE9uZW9mRGVzY3JpcHRvclByb3RvEgwKBG5hbWUYASABKAkijAEKE0VudW1E",
70 "ZXNjcmlwdG9yUHJvdG8SDAoEbmFtZRgBIAEoCRI4CgV2YWx1ZRgCIAMoCzIp",
71 "Lmdvb2dsZS5wcm90b2J1Zi5FbnVtVmFsdWVEZXNjcmlwdG9yUHJvdG8SLQoH",
72 "b3B0aW9ucxgDIAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5FbnVtT3B0aW9ucyJs",
73 "ChhFbnVtVmFsdWVEZXNjcmlwdG9yUHJvdG8SDAoEbmFtZRgBIAEoCRIOCgZu",
74 "dW1iZXIYAiABKAUSMgoHb3B0aW9ucxgDIAEoCzIhLmdvb2dsZS5wcm90b2J1",
75 "Zi5FbnVtVmFsdWVPcHRpb25zIpABChZTZXJ2aWNlRGVzY3JpcHRvclByb3Rv",
76 "EgwKBG5hbWUYASABKAkSNgoGbWV0aG9kGAIgAygLMiYuZ29vZ2xlLnByb3Rv",
77 "YnVmLk1ldGhvZERlc2NyaXB0b3JQcm90bxIwCgdvcHRpb25zGAMgASgLMh8u",
78 "Z29vZ2xlLnByb3RvYnVmLlNlcnZpY2VPcHRpb25zIsEBChVNZXRob2REZXNj",
79 "cmlwdG9yUHJvdG8SDAoEbmFtZRgBIAEoCRISCgppbnB1dF90eXBlGAIgASgJ",
80 "EhMKC291dHB1dF90eXBlGAMgASgJEi8KB29wdGlvbnMYBCABKAsyHi5nb29n",
81 "bGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxIfChBjbGllbnRfc3RyZWFtaW5n",
82 "GAUgASgIOgVmYWxzZRIfChBzZXJ2ZXJfc3RyZWFtaW5nGAYgASgIOgVmYWxz",
83 "ZSKqBQoLRmlsZU9wdGlvbnMSFAoMamF2YV9wYWNrYWdlGAEgASgJEhwKFGph",
84 "dmFfb3V0ZXJfY2xhc3NuYW1lGAggASgJEiIKE2phdmFfbXVsdGlwbGVfZmls",
85 "ZXMYCiABKAg6BWZhbHNlEiwKHWphdmFfZ2VuZXJhdGVfZXF1YWxzX2FuZF9o",
86 "YXNoGBQgASgIOgVmYWxzZRIlChZqYXZhX3N0cmluZ19jaGVja191dGY4GBsg",
87 "ASgIOgVmYWxzZRJGCgxvcHRpbWl6ZV9mb3IYCSABKA4yKS5nb29nbGUucHJv",
88 "dG9idWYuRmlsZU9wdGlvbnMuT3B0aW1pemVNb2RlOgVTUEVFRBISCgpnb19w",
89 "YWNrYWdlGAsgASgJEiIKE2NjX2dlbmVyaWNfc2VydmljZXMYECABKAg6BWZh",
90 "bHNlEiQKFWphdmFfZ2VuZXJpY19zZXJ2aWNlcxgRIAEoCDoFZmFsc2USIgoT",
91 "cHlfZ2VuZXJpY19zZXJ2aWNlcxgSIAEoCDoFZmFsc2USGQoKZGVwcmVjYXRl",
92 "ZBgXIAEoCDoFZmFsc2USHwoQY2NfZW5hYmxlX2FyZW5hcxgfIAEoCDoFZmFs",
93 "c2USGQoRb2JqY19jbGFzc19wcmVmaXgYJCABKAkSGAoQY3NoYXJwX25hbWVz",
94 "cGFjZRglIAEoCRInCh9qYXZhbmFub191c2VfZGVwcmVjYXRlZF9wYWNrYWdl",
95 "GCYgASgIEkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9uGOcHIAMoCzIkLmdvb2ds",
96 "ZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9uIjoKDE9wdGltaXplTW9k",
97 "ZRIJCgVTUEVFRBABEg0KCUNPREVfU0laRRACEhAKDExJVEVfUlVOVElNRRAD",
98 "KgkI6AcQgICAgAIi5gEKDk1lc3NhZ2VPcHRpb25zEiYKF21lc3NhZ2Vfc2V0",
99 "X3dpcmVfZm9ybWF0GAEgASgIOgVmYWxzZRIuCh9ub19zdGFuZGFyZF9kZXNj",
100 "cmlwdG9yX2FjY2Vzc29yGAIgASgIOgVmYWxzZRIZCgpkZXByZWNhdGVkGAMg",
101 "ASgIOgVmYWxzZRIRCgltYXBfZW50cnkYByABKAgSQwoUdW5pbnRlcnByZXRl",
102 "ZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVmLlVuaW50ZXJwcmV0",
103 "ZWRPcHRpb24qCQjoBxCAgICAAiKYAwoMRmllbGRPcHRpb25zEjoKBWN0eXBl",
104 "GAEgASgOMiMuZ29vZ2xlLnByb3RvYnVmLkZpZWxkT3B0aW9ucy5DVHlwZToG",
105 "U1RSSU5HEg4KBnBhY2tlZBgCIAEoCBI/CgZqc3R5cGUYBiABKA4yJC5nb29n",
106 "bGUucHJvdG9idWYuRmllbGRPcHRpb25zLkpTVHlwZToJSlNfTk9STUFMEhMK",
107 "BGxhenkYBSABKAg6BWZhbHNlEhkKCmRlcHJlY2F0ZWQYAyABKAg6BWZhbHNl",
108 "EhMKBHdlYWsYCiABKAg6BWZhbHNlEkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9u",
109 "GOcHIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9u",
110 "Ii8KBUNUeXBlEgoKBlNUUklORxAAEggKBENPUkQQARIQCgxTVFJJTkdfUElF",
111 "Q0UQAiI1CgZKU1R5cGUSDQoJSlNfTk9STUFMEAASDQoJSlNfU1RSSU5HEAES",
112 "DQoJSlNfTlVNQkVSEAIqCQjoBxCAgICAAiKNAQoLRW51bU9wdGlvbnMSEwoL",
113 "YWxsb3dfYWxpYXMYAiABKAgSGQoKZGVwcmVjYXRlZBgDIAEoCDoFZmFsc2US",
114 "QwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3Rv",
115 "YnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24qCQjoBxCAgICAAiJ9ChBFbnVtVmFs",
116 "dWVPcHRpb25zEhkKCmRlcHJlY2F0ZWQYASABKAg6BWZhbHNlEkMKFHVuaW50",
117 "ZXJwcmV0ZWRfb3B0aW9uGOcHIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5Vbmlu",
118 "dGVycHJldGVkT3B0aW9uKgkI6AcQgICAgAIiewoOU2VydmljZU9wdGlvbnMS",
119 "GQoKZGVwcmVjYXRlZBghIAEoCDoFZmFsc2USQwoUdW5pbnRlcnByZXRlZF9v",
120 "cHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVmLlVuaW50ZXJwcmV0ZWRP",
121 "cHRpb24qCQjoBxCAgICAAiJ6Cg1NZXRob2RPcHRpb25zEhkKCmRlcHJlY2F0",
122 "ZWQYISABKAg6BWZhbHNlEkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9uGOcHIAMo",
123 "CzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9uKgkI6AcQ",
124 "gICAgAIingIKE1VuaW50ZXJwcmV0ZWRPcHRpb24SOwoEbmFtZRgCIAMoCzIt",
125 "Lmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9uLk5hbWVQYXJ0",
126 "EhgKEGlkZW50aWZpZXJfdmFsdWUYAyABKAkSGgoScG9zaXRpdmVfaW50X3Zh",
127 "bHVlGAQgASgEEhoKEm5lZ2F0aXZlX2ludF92YWx1ZRgFIAEoAxIUCgxkb3Vi",
128 "bGVfdmFsdWUYBiABKAESFAoMc3RyaW5nX3ZhbHVlGAcgASgMEhcKD2FnZ3Jl",
129 "Z2F0ZV92YWx1ZRgIIAEoCRozCghOYW1lUGFydBIRCgluYW1lX3BhcnQYASAC",
130 "KAkSFAoMaXNfZXh0ZW5zaW9uGAIgAigIItUBCg5Tb3VyY2VDb2RlSW5mbxI6",
131 "Cghsb2NhdGlvbhgBIAMoCzIoLmdvb2dsZS5wcm90b2J1Zi5Tb3VyY2VDb2Rl",
132 "SW5mby5Mb2NhdGlvbhqGAQoITG9jYXRpb24SEAoEcGF0aBgBIAMoBUICEAES",
133 "EAoEc3BhbhgCIAMoBUICEAESGAoQbGVhZGluZ19jb21tZW50cxgDIAEoCRIZ",
134 "ChF0cmFpbGluZ19jb21tZW50cxgEIAEoCRIhChlsZWFkaW5nX2RldGFjaGVk",
135 "X2NvbW1lbnRzGAYgAygJQlgKE2NvbS5nb29nbGUucHJvdG9idWZCEERlc2Ny",
136 "aXB0b3JQcm90b3NIAVoKZGVzY3JpcHRvcqICA0dQQqoCGkdvb2dsZS5Qcm90",
137 "b2J1Zi5SZWZsZWN0aW9u"));
Jon Skeet76940942015-07-14 10:25:40 +0100138 descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
Jon Skeet96cffaa2015-07-20 19:25:07 +0100139 new pbr::FileDescriptor[] { },
Jon Skeet4668c3d2015-07-22 11:38:22 +0100140 new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] {
141 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.FileDescriptorSet), new[]{ "File" }, null, null, null),
142 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.FileDescriptorProto), new[]{ "Name", "Package", "Dependency", "PublicDependency", "WeakDependency", "MessageType", "EnumType", "Service", "Extension", "Options", "SourceCodeInfo", "Syntax" }, null, null, null),
143 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.DescriptorProto), new[]{ "Name", "Field", "Extension", "NestedType", "EnumType", "ExtensionRange", "OneofDecl", "Options", "ReservedRange", "ReservedName" }, null, null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.DescriptorProto.Types.ExtensionRange), new[]{ "Start", "End" }, null, null, null),
144 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.DescriptorProto.Types.ReservedRange), new[]{ "Start", "End" }, null, null, null)}),
Jon Skeet55313c92015-10-24 06:46:02 +0100145 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.FieldDescriptorProto), new[]{ "Name", "Number", "Label", "Type", "TypeName", "Extendee", "DefaultValue", "OneofIndex", "JsonName", "Options" }, null, new[]{ typeof(global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type), typeof(global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label) }, null),
Jon Skeet4668c3d2015-07-22 11:38:22 +0100146 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.OneofDescriptorProto), new[]{ "Name" }, null, null, null),
147 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.EnumDescriptorProto), new[]{ "Name", "Value", "Options" }, null, null, null),
148 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.EnumValueDescriptorProto), new[]{ "Name", "Number", "Options" }, null, null, null),
149 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.ServiceDescriptorProto), new[]{ "Name", "Method", "Options" }, null, null, null),
150 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.MethodDescriptorProto), new[]{ "Name", "InputType", "OutputType", "Options", "ClientStreaming", "ServerStreaming" }, null, null, null),
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700151 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.FileOptions), new[]{ "JavaPackage", "JavaOuterClassname", "JavaMultipleFiles", "JavaGenerateEqualsAndHash", "JavaStringCheckUtf8", "OptimizeFor", "GoPackage", "CcGenericServices", "JavaGenericServices", "PyGenericServices", "Deprecated", "CcEnableArenas", "ObjcClassPrefix", "CsharpNamespace", "JavananoUseDeprecatedPackage", "UninterpretedOption" }, null, new[]{ typeof(global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode) }, null),
Jon Skeet4668c3d2015-07-22 11:38:22 +0100152 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.MessageOptions), new[]{ "MessageSetWireFormat", "NoStandardDescriptorAccessor", "Deprecated", "MapEntry", "UninterpretedOption" }, null, null, null),
153 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.FieldOptions), new[]{ "Ctype", "Packed", "Jstype", "Lazy", "Deprecated", "Weak", "UninterpretedOption" }, null, new[]{ typeof(global::Google.Protobuf.Reflection.FieldOptions.Types.CType), typeof(global::Google.Protobuf.Reflection.FieldOptions.Types.JSType) }, null),
154 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.EnumOptions), new[]{ "AllowAlias", "Deprecated", "UninterpretedOption" }, null, null, null),
155 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.EnumValueOptions), new[]{ "Deprecated", "UninterpretedOption" }, null, null, null),
156 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.ServiceOptions), new[]{ "Deprecated", "UninterpretedOption" }, null, null, null),
157 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.MethodOptions), new[]{ "Deprecated", "UninterpretedOption" }, null, null, null),
158 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.UninterpretedOption), new[]{ "Name", "IdentifierValue", "PositiveIntValue", "NegativeIntValue", "DoubleValue", "StringValue", "AggregateValue" }, null, null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.UninterpretedOption.Types.NamePart), new[]{ "NamePart_", "IsExtension" }, null, null, null)}),
159 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.SourceCodeInfo), new[]{ "Location" }, null, null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location), new[]{ "Path", "Span", "LeadingComments", "TrailingComments", "LeadingDetachedComments" }, null, null, null)})
160 }));
Jon Skeetf3504cf2015-04-28 14:49:49 +0100161 }
162 #endregion
163
164 }
165 #region Messages
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100166 /// <summary>
167 /// The protocol compiler can output a FileDescriptorSet containing the .proto
168 /// files it parses.
169 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100170 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +0100171 internal sealed partial class FileDescriptorSet : pb::IMessage<FileDescriptorSet> {
Jon Skeete38294a2015-06-09 19:30:44 +0100172 private static readonly pb::MessageParser<FileDescriptorSet> _parser = new pb::MessageParser<FileDescriptorSet>(() => new FileDescriptorSet());
173 public static pb::MessageParser<FileDescriptorSet> Parser { get { return _parser; } }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100174
Jon Skeet76940942015-07-14 10:25:40 +0100175 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +0100176 get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[0]; }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100177 }
178
Jon Skeet96cffaa2015-07-20 19:25:07 +0100179 pbr::MessageDescriptor pb::IMessage.Descriptor {
180 get { return Descriptor; }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100181 }
182
Jon Skeet53508222015-07-01 17:16:55 +0100183 public FileDescriptorSet() {
184 OnConstruction();
185 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100186
Jon Skeet53508222015-07-01 17:16:55 +0100187 partial void OnConstruction();
188
189 public FileDescriptorSet(FileDescriptorSet other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100190 file_ = other.file_.Clone();
Jon Skeete38294a2015-06-09 19:30:44 +0100191 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100192
193 public FileDescriptorSet Clone() {
194 return new FileDescriptorSet(this);
195 }
196
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100197 /// <summary>Field number for the "file" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100198 public const int FileFieldNumber = 1;
Jon Skeet9c888fa2015-07-14 11:13:52 +0100199 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.FileDescriptorProto> _repeated_file_codec
200 = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Reflection.FileDescriptorProto.Parser);
201 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.FileDescriptorProto> file_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.FileDescriptorProto>();
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700202 public pbc::RepeatedField<global::Google.Protobuf.Reflection.FileDescriptorProto> File {
Jon Skeetf3504cf2015-04-28 14:49:49 +0100203 get { return file_; }
204 }
Jon Skeete38294a2015-06-09 19:30:44 +0100205
206 public override bool Equals(object other) {
207 return Equals(other as FileDescriptorSet);
Jon Skeetf3504cf2015-04-28 14:49:49 +0100208 }
209
Jon Skeete38294a2015-06-09 19:30:44 +0100210 public bool Equals(FileDescriptorSet other) {
211 if (ReferenceEquals(other, null)) {
212 return false;
213 }
214 if (ReferenceEquals(other, this)) {
Jon Skeetf3504cf2015-04-28 14:49:49 +0100215 return true;
216 }
Jon Skeete38294a2015-06-09 19:30:44 +0100217 if(!file_.Equals(other.file_)) return false;
218 return true;
Jon Skeetf3504cf2015-04-28 14:49:49 +0100219 }
220
Jon Skeete38294a2015-06-09 19:30:44 +0100221 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +0100222 int hash = 1;
Jon Skeete38294a2015-06-09 19:30:44 +0100223 hash ^= file_.GetHashCode();
224 return hash;
Jon Skeetf3504cf2015-04-28 14:49:49 +0100225 }
226
Jon Skeet5b9288e2015-07-03 12:45:36 +0100227 public override string ToString() {
228 return pb::JsonFormatter.Default.Format(this);
229 }
230
Jon Skeet96ddf012015-06-12 09:53:12 +0100231 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100232 file_.WriteTo(output, _repeated_file_codec);
Jon Skeetf3504cf2015-04-28 14:49:49 +0100233 }
234
Jon Skeete38294a2015-06-09 19:30:44 +0100235 public int CalculateSize() {
236 int size = 0;
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100237 size += file_.CalculateSize(_repeated_file_codec);
Jon Skeetf3504cf2015-04-28 14:49:49 +0100238 return size;
239 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +0100240
Jon Skeete38294a2015-06-09 19:30:44 +0100241 public void MergeFrom(FileDescriptorSet other) {
242 if (other == null) {
243 return;
244 }
245 file_.Add(other.file_);
Jon Skeetf3504cf2015-04-28 14:49:49 +0100246 }
247
Jon Skeet96ddf012015-06-12 09:53:12 +0100248 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +0100249 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +0100250 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +0100251 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +0100252 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100253 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +0100254 break;
255 case 10: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100256 file_.AddEntriesFrom(input, _repeated_file_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100257 break;
258 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100259 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100260 }
261 }
Jon Skeete38294a2015-06-09 19:30:44 +0100262
Jon Skeetf3504cf2015-04-28 14:49:49 +0100263 }
264
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100265 /// <summary>
266 /// Describes a complete .proto file.
267 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100268 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +0100269 internal sealed partial class FileDescriptorProto : pb::IMessage<FileDescriptorProto> {
Jon Skeete38294a2015-06-09 19:30:44 +0100270 private static readonly pb::MessageParser<FileDescriptorProto> _parser = new pb::MessageParser<FileDescriptorProto>(() => new FileDescriptorProto());
271 public static pb::MessageParser<FileDescriptorProto> Parser { get { return _parser; } }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100272
Jon Skeet76940942015-07-14 10:25:40 +0100273 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +0100274 get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[1]; }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100275 }
276
Jon Skeet96cffaa2015-07-20 19:25:07 +0100277 pbr::MessageDescriptor pb::IMessage.Descriptor {
278 get { return Descriptor; }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100279 }
280
Jon Skeet53508222015-07-01 17:16:55 +0100281 public FileDescriptorProto() {
282 OnConstruction();
283 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100284
Jon Skeet53508222015-07-01 17:16:55 +0100285 partial void OnConstruction();
286
287 public FileDescriptorProto(FileDescriptorProto other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100288 name_ = other.name_;
289 package_ = other.package_;
290 dependency_ = other.dependency_.Clone();
291 publicDependency_ = other.publicDependency_.Clone();
292 weakDependency_ = other.weakDependency_.Clone();
293 messageType_ = other.messageType_.Clone();
294 enumType_ = other.enumType_.Clone();
295 service_ = other.service_.Clone();
296 extension_ = other.extension_.Clone();
297 Options = other.options_ != null ? other.Options.Clone() : null;
298 SourceCodeInfo = other.sourceCodeInfo_ != null ? other.SourceCodeInfo.Clone() : null;
299 syntax_ = other.syntax_;
Jon Skeete38294a2015-06-09 19:30:44 +0100300 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100301
302 public FileDescriptorProto Clone() {
303 return new FileDescriptorProto(this);
304 }
305
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100306 /// <summary>Field number for the "name" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100307 public const int NameFieldNumber = 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +0100308 private string name_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100309 /// <summary>
310 /// file name, relative to root of source tree
311 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700312 public string Name {
Jon Skeetf3504cf2015-04-28 14:49:49 +0100313 get { return name_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +0100314 set {
Jon Skeetd18cc082015-07-30 13:50:02 +0100315 name_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +0100316 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100317 }
318
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100319 /// <summary>Field number for the "package" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100320 public const int PackageFieldNumber = 2;
Jon Skeetf3504cf2015-04-28 14:49:49 +0100321 private string package_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100322 /// <summary>
323 /// e.g. "foo", "foo.bar", etc.
324 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700325 public string Package {
Jon Skeetf3504cf2015-04-28 14:49:49 +0100326 get { return package_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +0100327 set {
Jon Skeetd18cc082015-07-30 13:50:02 +0100328 package_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +0100329 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100330 }
331
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100332 /// <summary>Field number for the "dependency" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100333 public const int DependencyFieldNumber = 3;
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100334 private static readonly pb::FieldCodec<string> _repeated_dependency_codec
335 = pb::FieldCodec.ForString(26);
Jon Skeete38294a2015-06-09 19:30:44 +0100336 private readonly pbc::RepeatedField<string> dependency_ = new pbc::RepeatedField<string>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100337 /// <summary>
338 /// Names of files imported by this file.
339 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700340 public pbc::RepeatedField<string> Dependency {
Jon Skeete38294a2015-06-09 19:30:44 +0100341 get { return dependency_; }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100342 }
343
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100344 /// <summary>Field number for the "public_dependency" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100345 public const int PublicDependencyFieldNumber = 10;
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100346 private static readonly pb::FieldCodec<int> _repeated_publicDependency_codec
347 = pb::FieldCodec.ForInt32(80);
Jon Skeete38294a2015-06-09 19:30:44 +0100348 private readonly pbc::RepeatedField<int> publicDependency_ = new pbc::RepeatedField<int>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100349 /// <summary>
350 /// Indexes of the public imported files in the dependency list above.
351 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700352 public pbc::RepeatedField<int> PublicDependency {
Jon Skeete38294a2015-06-09 19:30:44 +0100353 get { return publicDependency_; }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100354 }
355
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100356 /// <summary>Field number for the "weak_dependency" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100357 public const int WeakDependencyFieldNumber = 11;
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100358 private static readonly pb::FieldCodec<int> _repeated_weakDependency_codec
359 = pb::FieldCodec.ForInt32(88);
Jon Skeete38294a2015-06-09 19:30:44 +0100360 private readonly pbc::RepeatedField<int> weakDependency_ = new pbc::RepeatedField<int>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100361 /// <summary>
362 /// Indexes of the weak imported files in the dependency list.
363 /// For Google-internal migration only. Do not use.
364 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700365 public pbc::RepeatedField<int> WeakDependency {
Jon Skeete38294a2015-06-09 19:30:44 +0100366 get { return weakDependency_; }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100367 }
368
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100369 /// <summary>Field number for the "message_type" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100370 public const int MessageTypeFieldNumber = 4;
Jon Skeet9c888fa2015-07-14 11:13:52 +0100371 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.DescriptorProto> _repeated_messageType_codec
372 = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Reflection.DescriptorProto.Parser);
373 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.DescriptorProto> messageType_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.DescriptorProto>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100374 /// <summary>
375 /// All top-level definitions in this file.
376 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700377 public pbc::RepeatedField<global::Google.Protobuf.Reflection.DescriptorProto> MessageType {
Jon Skeetf3504cf2015-04-28 14:49:49 +0100378 get { return messageType_; }
379 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100380
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100381 /// <summary>Field number for the "enum_type" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100382 public const int EnumTypeFieldNumber = 5;
Jon Skeet9c888fa2015-07-14 11:13:52 +0100383 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.EnumDescriptorProto> _repeated_enumType_codec
384 = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.Reflection.EnumDescriptorProto.Parser);
385 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.EnumDescriptorProto> enumType_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.EnumDescriptorProto>();
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700386 public pbc::RepeatedField<global::Google.Protobuf.Reflection.EnumDescriptorProto> EnumType {
Jon Skeetf3504cf2015-04-28 14:49:49 +0100387 get { return enumType_; }
388 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100389
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100390 /// <summary>Field number for the "service" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100391 public const int ServiceFieldNumber = 6;
Jon Skeet9c888fa2015-07-14 11:13:52 +0100392 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.ServiceDescriptorProto> _repeated_service_codec
393 = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.Reflection.ServiceDescriptorProto.Parser);
394 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.ServiceDescriptorProto> service_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.ServiceDescriptorProto>();
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700395 public pbc::RepeatedField<global::Google.Protobuf.Reflection.ServiceDescriptorProto> Service {
Jon Skeetf3504cf2015-04-28 14:49:49 +0100396 get { return service_; }
397 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100398
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100399 /// <summary>Field number for the "extension" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100400 public const int ExtensionFieldNumber = 7;
Jon Skeet9c888fa2015-07-14 11:13:52 +0100401 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.FieldDescriptorProto> _repeated_extension_codec
402 = pb::FieldCodec.ForMessage(58, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser);
403 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.FieldDescriptorProto> extension_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.FieldDescriptorProto>();
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700404 public pbc::RepeatedField<global::Google.Protobuf.Reflection.FieldDescriptorProto> Extension {
Jon Skeetf3504cf2015-04-28 14:49:49 +0100405 get { return extension_; }
406 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100407
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100408 /// <summary>Field number for the "options" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100409 public const int OptionsFieldNumber = 8;
Jon Skeet9c888fa2015-07-14 11:13:52 +0100410 private global::Google.Protobuf.Reflection.FileOptions options_;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700411 public global::Google.Protobuf.Reflection.FileOptions Options {
Jon Skeete38294a2015-06-09 19:30:44 +0100412 get { return options_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +0100413 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +0100414 options_ = value;
415 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100416 }
417
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100418 /// <summary>Field number for the "source_code_info" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100419 public const int SourceCodeInfoFieldNumber = 9;
Jon Skeet9c888fa2015-07-14 11:13:52 +0100420 private global::Google.Protobuf.Reflection.SourceCodeInfo sourceCodeInfo_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100421 /// <summary>
422 /// This field contains optional information about the original source code.
423 /// You may safely remove this entire field without harming runtime
424 /// functionality of the descriptors -- the information is needed only by
425 /// development tools.
426 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700427 public global::Google.Protobuf.Reflection.SourceCodeInfo SourceCodeInfo {
Jon Skeete38294a2015-06-09 19:30:44 +0100428 get { return sourceCodeInfo_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +0100429 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +0100430 sourceCodeInfo_ = value;
431 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100432 }
433
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100434 /// <summary>Field number for the "syntax" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100435 public const int SyntaxFieldNumber = 12;
Jon Skeetf3504cf2015-04-28 14:49:49 +0100436 private string syntax_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100437 /// <summary>
438 /// The syntax of the proto file.
439 /// The supported values are "proto2" and "proto3".
440 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700441 public string Syntax {
Jon Skeetf3504cf2015-04-28 14:49:49 +0100442 get { return syntax_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +0100443 set {
Jon Skeetd18cc082015-07-30 13:50:02 +0100444 syntax_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +0100445 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100446 }
447
Jon Skeete38294a2015-06-09 19:30:44 +0100448 public override bool Equals(object other) {
449 return Equals(other as FileDescriptorProto);
450 }
451
452 public bool Equals(FileDescriptorProto other) {
453 if (ReferenceEquals(other, null)) {
454 return false;
455 }
456 if (ReferenceEquals(other, this)) {
Jon Skeetf3504cf2015-04-28 14:49:49 +0100457 return true;
458 }
Jon Skeete38294a2015-06-09 19:30:44 +0100459 if (Name != other.Name) return false;
460 if (Package != other.Package) return false;
461 if(!dependency_.Equals(other.dependency_)) return false;
462 if(!publicDependency_.Equals(other.publicDependency_)) return false;
463 if(!weakDependency_.Equals(other.weakDependency_)) return false;
464 if(!messageType_.Equals(other.messageType_)) return false;
465 if(!enumType_.Equals(other.enumType_)) return false;
466 if(!service_.Equals(other.service_)) return false;
467 if(!extension_.Equals(other.extension_)) return false;
Jon Skeetbfee2df2015-06-23 16:09:27 +0100468 if (!object.Equals(Options, other.Options)) return false;
469 if (!object.Equals(SourceCodeInfo, other.SourceCodeInfo)) return false;
470 if (Syntax != other.Syntax) return false;
Jon Skeete38294a2015-06-09 19:30:44 +0100471 return true;
Jon Skeetf3504cf2015-04-28 14:49:49 +0100472 }
473
Jon Skeete38294a2015-06-09 19:30:44 +0100474 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +0100475 int hash = 1;
Jon Skeetfb1547b2015-06-12 13:11:54 +0100476 if (Name.Length != 0) hash ^= Name.GetHashCode();
477 if (Package.Length != 0) hash ^= Package.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +0100478 hash ^= dependency_.GetHashCode();
479 hash ^= publicDependency_.GetHashCode();
480 hash ^= weakDependency_.GetHashCode();
481 hash ^= messageType_.GetHashCode();
482 hash ^= enumType_.GetHashCode();
483 hash ^= service_.GetHashCode();
484 hash ^= extension_.GetHashCode();
485 if (options_ != null) hash ^= Options.GetHashCode();
486 if (sourceCodeInfo_ != null) hash ^= SourceCodeInfo.GetHashCode();
Jon Skeetfb1547b2015-06-12 13:11:54 +0100487 if (Syntax.Length != 0) hash ^= Syntax.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +0100488 return hash;
Jon Skeetf3504cf2015-04-28 14:49:49 +0100489 }
490
Jon Skeet5b9288e2015-07-03 12:45:36 +0100491 public override string ToString() {
492 return pb::JsonFormatter.Default.Format(this);
493 }
494
Jon Skeet96ddf012015-06-12 09:53:12 +0100495 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeetfb1547b2015-06-12 13:11:54 +0100496 if (Name.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100497 output.WriteRawTag(10);
498 output.WriteString(Name);
Jon Skeete38294a2015-06-09 19:30:44 +0100499 }
Jon Skeetfb1547b2015-06-12 13:11:54 +0100500 if (Package.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100501 output.WriteRawTag(18);
502 output.WriteString(Package);
Jon Skeete38294a2015-06-09 19:30:44 +0100503 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100504 dependency_.WriteTo(output, _repeated_dependency_codec);
505 messageType_.WriteTo(output, _repeated_messageType_codec);
506 enumType_.WriteTo(output, _repeated_enumType_codec);
507 service_.WriteTo(output, _repeated_service_codec);
508 extension_.WriteTo(output, _repeated_extension_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100509 if (options_ != null) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100510 output.WriteRawTag(66);
511 output.WriteMessage(Options);
Jon Skeete38294a2015-06-09 19:30:44 +0100512 }
513 if (sourceCodeInfo_ != null) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100514 output.WriteRawTag(74);
515 output.WriteMessage(SourceCodeInfo);
Jon Skeete38294a2015-06-09 19:30:44 +0100516 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100517 publicDependency_.WriteTo(output, _repeated_publicDependency_codec);
518 weakDependency_.WriteTo(output, _repeated_weakDependency_codec);
Jon Skeetfb1547b2015-06-12 13:11:54 +0100519 if (Syntax.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100520 output.WriteRawTag(98);
521 output.WriteString(Syntax);
Jon Skeetf3504cf2015-04-28 14:49:49 +0100522 }
523 }
524
Jon Skeete38294a2015-06-09 19:30:44 +0100525 public int CalculateSize() {
526 int size = 0;
Jon Skeetfb1547b2015-06-12 13:11:54 +0100527 if (Name.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100528 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
Jon Skeetf3504cf2015-04-28 14:49:49 +0100529 }
Jon Skeetfb1547b2015-06-12 13:11:54 +0100530 if (Package.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100531 size += 1 + pb::CodedOutputStream.ComputeStringSize(Package);
Jon Skeetf3504cf2015-04-28 14:49:49 +0100532 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100533 size += dependency_.CalculateSize(_repeated_dependency_codec);
534 size += publicDependency_.CalculateSize(_repeated_publicDependency_codec);
535 size += weakDependency_.CalculateSize(_repeated_weakDependency_codec);
536 size += messageType_.CalculateSize(_repeated_messageType_codec);
537 size += enumType_.CalculateSize(_repeated_enumType_codec);
538 size += service_.CalculateSize(_repeated_service_codec);
539 size += extension_.CalculateSize(_repeated_extension_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100540 if (options_ != null) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100541 size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options);
Jon Skeetf3504cf2015-04-28 14:49:49 +0100542 }
Jon Skeete38294a2015-06-09 19:30:44 +0100543 if (sourceCodeInfo_ != null) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100544 size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceCodeInfo);
Jon Skeetf3504cf2015-04-28 14:49:49 +0100545 }
Jon Skeetfb1547b2015-06-12 13:11:54 +0100546 if (Syntax.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100547 size += 1 + pb::CodedOutputStream.ComputeStringSize(Syntax);
Jon Skeetf3504cf2015-04-28 14:49:49 +0100548 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100549 return size;
550 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +0100551
Jon Skeete38294a2015-06-09 19:30:44 +0100552 public void MergeFrom(FileDescriptorProto other) {
553 if (other == null) {
554 return;
555 }
Jon Skeetfb1547b2015-06-12 13:11:54 +0100556 if (other.Name.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +0100557 Name = other.Name;
558 }
Jon Skeetfb1547b2015-06-12 13:11:54 +0100559 if (other.Package.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +0100560 Package = other.Package;
561 }
562 dependency_.Add(other.dependency_);
563 publicDependency_.Add(other.publicDependency_);
564 weakDependency_.Add(other.weakDependency_);
565 messageType_.Add(other.messageType_);
566 enumType_.Add(other.enumType_);
567 service_.Add(other.service_);
568 extension_.Add(other.extension_);
569 if (other.options_ != null) {
570 if (options_ == null) {
Jon Skeet9c888fa2015-07-14 11:13:52 +0100571 options_ = new global::Google.Protobuf.Reflection.FileOptions();
Jon Skeete38294a2015-06-09 19:30:44 +0100572 }
573 Options.MergeFrom(other.Options);
574 }
575 if (other.sourceCodeInfo_ != null) {
576 if (sourceCodeInfo_ == null) {
Jon Skeet9c888fa2015-07-14 11:13:52 +0100577 sourceCodeInfo_ = new global::Google.Protobuf.Reflection.SourceCodeInfo();
Jon Skeete38294a2015-06-09 19:30:44 +0100578 }
579 SourceCodeInfo.MergeFrom(other.SourceCodeInfo);
580 }
Jon Skeetfb1547b2015-06-12 13:11:54 +0100581 if (other.Syntax.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +0100582 Syntax = other.Syntax;
583 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100584 }
585
Jon Skeet96ddf012015-06-12 09:53:12 +0100586 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +0100587 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +0100588 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +0100589 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +0100590 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100591 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +0100592 break;
593 case 10: {
Jon Skeetfb1547b2015-06-12 13:11:54 +0100594 Name = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +0100595 break;
596 }
597 case 18: {
Jon Skeetfb1547b2015-06-12 13:11:54 +0100598 Package = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +0100599 break;
600 }
601 case 26: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100602 dependency_.AddEntriesFrom(input, _repeated_dependency_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100603 break;
604 }
605 case 34: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100606 messageType_.AddEntriesFrom(input, _repeated_messageType_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100607 break;
608 }
609 case 42: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100610 enumType_.AddEntriesFrom(input, _repeated_enumType_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100611 break;
612 }
613 case 50: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100614 service_.AddEntriesFrom(input, _repeated_service_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100615 break;
616 }
617 case 58: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100618 extension_.AddEntriesFrom(input, _repeated_extension_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100619 break;
620 }
621 case 66: {
622 if (options_ == null) {
Jon Skeet9c888fa2015-07-14 11:13:52 +0100623 options_ = new global::Google.Protobuf.Reflection.FileOptions();
Jon Skeete38294a2015-06-09 19:30:44 +0100624 }
625 input.ReadMessage(options_);
626 break;
627 }
628 case 74: {
629 if (sourceCodeInfo_ == null) {
Jon Skeet9c888fa2015-07-14 11:13:52 +0100630 sourceCodeInfo_ = new global::Google.Protobuf.Reflection.SourceCodeInfo();
Jon Skeete38294a2015-06-09 19:30:44 +0100631 }
632 input.ReadMessage(sourceCodeInfo_);
633 break;
634 }
635 case 82:
636 case 80: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100637 publicDependency_.AddEntriesFrom(input, _repeated_publicDependency_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100638 break;
639 }
640 case 90:
641 case 88: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100642 weakDependency_.AddEntriesFrom(input, _repeated_weakDependency_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100643 break;
644 }
645 case 98: {
Jon Skeetfb1547b2015-06-12 13:11:54 +0100646 Syntax = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +0100647 break;
648 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100649 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100650 }
651 }
Jon Skeete38294a2015-06-09 19:30:44 +0100652
Jon Skeetf3504cf2015-04-28 14:49:49 +0100653 }
654
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100655 /// <summary>
656 /// Describes a message type.
657 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100658 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +0100659 internal sealed partial class DescriptorProto : pb::IMessage<DescriptorProto> {
Jon Skeete38294a2015-06-09 19:30:44 +0100660 private static readonly pb::MessageParser<DescriptorProto> _parser = new pb::MessageParser<DescriptorProto>(() => new DescriptorProto());
661 public static pb::MessageParser<DescriptorProto> Parser { get { return _parser; } }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100662
Jon Skeet76940942015-07-14 10:25:40 +0100663 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +0100664 get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[2]; }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100665 }
666
Jon Skeet96cffaa2015-07-20 19:25:07 +0100667 pbr::MessageDescriptor pb::IMessage.Descriptor {
668 get { return Descriptor; }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100669 }
670
Jon Skeet53508222015-07-01 17:16:55 +0100671 public DescriptorProto() {
672 OnConstruction();
673 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100674
Jon Skeet53508222015-07-01 17:16:55 +0100675 partial void OnConstruction();
676
677 public DescriptorProto(DescriptorProto other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100678 name_ = other.name_;
679 field_ = other.field_.Clone();
680 extension_ = other.extension_.Clone();
681 nestedType_ = other.nestedType_.Clone();
682 enumType_ = other.enumType_.Clone();
683 extensionRange_ = other.extensionRange_.Clone();
684 oneofDecl_ = other.oneofDecl_.Clone();
685 Options = other.options_ != null ? other.Options.Clone() : null;
686 reservedRange_ = other.reservedRange_.Clone();
687 reservedName_ = other.reservedName_.Clone();
Jon Skeetf3504cf2015-04-28 14:49:49 +0100688 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100689
690 public DescriptorProto Clone() {
691 return new DescriptorProto(this);
692 }
693
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100694 /// <summary>Field number for the "name" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100695 public const int NameFieldNumber = 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +0100696 private string name_ = "";
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700697 public string Name {
Jon Skeetf3504cf2015-04-28 14:49:49 +0100698 get { return name_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +0100699 set {
Jon Skeetd18cc082015-07-30 13:50:02 +0100700 name_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +0100701 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100702 }
703
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100704 /// <summary>Field number for the "field" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100705 public const int FieldFieldNumber = 2;
Jon Skeet9c888fa2015-07-14 11:13:52 +0100706 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.FieldDescriptorProto> _repeated_field_codec
707 = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser);
708 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.FieldDescriptorProto> field_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.FieldDescriptorProto>();
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700709 public pbc::RepeatedField<global::Google.Protobuf.Reflection.FieldDescriptorProto> Field {
Jon Skeetf3504cf2015-04-28 14:49:49 +0100710 get { return field_; }
711 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100712
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100713 /// <summary>Field number for the "extension" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100714 public const int ExtensionFieldNumber = 6;
Jon Skeet9c888fa2015-07-14 11:13:52 +0100715 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.FieldDescriptorProto> _repeated_extension_codec
716 = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser);
717 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.FieldDescriptorProto> extension_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.FieldDescriptorProto>();
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700718 public pbc::RepeatedField<global::Google.Protobuf.Reflection.FieldDescriptorProto> Extension {
Jon Skeetf3504cf2015-04-28 14:49:49 +0100719 get { return extension_; }
720 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100721
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100722 /// <summary>Field number for the "nested_type" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100723 public const int NestedTypeFieldNumber = 3;
Jon Skeet9c888fa2015-07-14 11:13:52 +0100724 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.DescriptorProto> _repeated_nestedType_codec
725 = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.Reflection.DescriptorProto.Parser);
726 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.DescriptorProto> nestedType_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.DescriptorProto>();
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700727 public pbc::RepeatedField<global::Google.Protobuf.Reflection.DescriptorProto> NestedType {
Jon Skeetf3504cf2015-04-28 14:49:49 +0100728 get { return nestedType_; }
729 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100730
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100731 /// <summary>Field number for the "enum_type" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100732 public const int EnumTypeFieldNumber = 4;
Jon Skeet9c888fa2015-07-14 11:13:52 +0100733 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.EnumDescriptorProto> _repeated_enumType_codec
734 = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Reflection.EnumDescriptorProto.Parser);
735 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.EnumDescriptorProto> enumType_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.EnumDescriptorProto>();
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700736 public pbc::RepeatedField<global::Google.Protobuf.Reflection.EnumDescriptorProto> EnumType {
Jon Skeetf3504cf2015-04-28 14:49:49 +0100737 get { return enumType_; }
738 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100739
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100740 /// <summary>Field number for the "extension_range" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100741 public const int ExtensionRangeFieldNumber = 5;
Jon Skeet9c888fa2015-07-14 11:13:52 +0100742 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.DescriptorProto.Types.ExtensionRange> _repeated_extensionRange_codec
743 = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.Reflection.DescriptorProto.Types.ExtensionRange.Parser);
744 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.DescriptorProto.Types.ExtensionRange> extensionRange_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.DescriptorProto.Types.ExtensionRange>();
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700745 public pbc::RepeatedField<global::Google.Protobuf.Reflection.DescriptorProto.Types.ExtensionRange> ExtensionRange {
Jon Skeetf3504cf2015-04-28 14:49:49 +0100746 get { return extensionRange_; }
747 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100748
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100749 /// <summary>Field number for the "oneof_decl" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100750 public const int OneofDeclFieldNumber = 8;
Jon Skeet9c888fa2015-07-14 11:13:52 +0100751 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.OneofDescriptorProto> _repeated_oneofDecl_codec
752 = pb::FieldCodec.ForMessage(66, global::Google.Protobuf.Reflection.OneofDescriptorProto.Parser);
753 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.OneofDescriptorProto> oneofDecl_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.OneofDescriptorProto>();
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700754 public pbc::RepeatedField<global::Google.Protobuf.Reflection.OneofDescriptorProto> OneofDecl {
Jon Skeetf3504cf2015-04-28 14:49:49 +0100755 get { return oneofDecl_; }
756 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100757
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100758 /// <summary>Field number for the "options" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +0100759 public const int OptionsFieldNumber = 7;
Jon Skeet9c888fa2015-07-14 11:13:52 +0100760 private global::Google.Protobuf.Reflection.MessageOptions options_;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700761 public global::Google.Protobuf.Reflection.MessageOptions Options {
Jon Skeete38294a2015-06-09 19:30:44 +0100762 get { return options_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +0100763 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +0100764 options_ = value;
765 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100766 }
767
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100768 /// <summary>Field number for the "reserved_range" field.</summary>
Jie Luoa21a2cf2015-05-29 17:57:05 -0700769 public const int ReservedRangeFieldNumber = 9;
Jon Skeet9c888fa2015-07-14 11:13:52 +0100770 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.DescriptorProto.Types.ReservedRange> _repeated_reservedRange_codec
771 = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.Reflection.DescriptorProto.Types.ReservedRange.Parser);
772 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.DescriptorProto.Types.ReservedRange> reservedRange_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.DescriptorProto.Types.ReservedRange>();
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700773 public pbc::RepeatedField<global::Google.Protobuf.Reflection.DescriptorProto.Types.ReservedRange> ReservedRange {
Jie Luoa21a2cf2015-05-29 17:57:05 -0700774 get { return reservedRange_; }
775 }
Jie Luoa21a2cf2015-05-29 17:57:05 -0700776
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100777 /// <summary>Field number for the "reserved_name" field.</summary>
Jie Luoa21a2cf2015-05-29 17:57:05 -0700778 public const int ReservedNameFieldNumber = 10;
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100779 private static readonly pb::FieldCodec<string> _repeated_reservedName_codec
780 = pb::FieldCodec.ForString(82);
Jon Skeete38294a2015-06-09 19:30:44 +0100781 private readonly pbc::RepeatedField<string> reservedName_ = new pbc::RepeatedField<string>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100782 /// <summary>
783 /// Reserved field names, which may not be used by fields in the same message.
784 /// A given name may only be reserved once.
785 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700786 public pbc::RepeatedField<string> ReservedName {
Jon Skeete38294a2015-06-09 19:30:44 +0100787 get { return reservedName_; }
Jie Luoa21a2cf2015-05-29 17:57:05 -0700788 }
789
Jon Skeete38294a2015-06-09 19:30:44 +0100790 public override bool Equals(object other) {
791 return Equals(other as DescriptorProto);
792 }
793
794 public bool Equals(DescriptorProto other) {
795 if (ReferenceEquals(other, null)) {
796 return false;
797 }
798 if (ReferenceEquals(other, this)) {
Jon Skeetf3504cf2015-04-28 14:49:49 +0100799 return true;
800 }
Jon Skeete38294a2015-06-09 19:30:44 +0100801 if (Name != other.Name) return false;
802 if(!field_.Equals(other.field_)) return false;
803 if(!extension_.Equals(other.extension_)) return false;
804 if(!nestedType_.Equals(other.nestedType_)) return false;
805 if(!enumType_.Equals(other.enumType_)) return false;
806 if(!extensionRange_.Equals(other.extensionRange_)) return false;
807 if(!oneofDecl_.Equals(other.oneofDecl_)) return false;
Jon Skeetbfee2df2015-06-23 16:09:27 +0100808 if (!object.Equals(Options, other.Options)) return false;
809 if(!reservedRange_.Equals(other.reservedRange_)) return false;
Jon Skeete38294a2015-06-09 19:30:44 +0100810 if(!reservedName_.Equals(other.reservedName_)) return false;
811 return true;
Jon Skeetf3504cf2015-04-28 14:49:49 +0100812 }
813
Jon Skeete38294a2015-06-09 19:30:44 +0100814 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +0100815 int hash = 1;
Jon Skeetfb1547b2015-06-12 13:11:54 +0100816 if (Name.Length != 0) hash ^= Name.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +0100817 hash ^= field_.GetHashCode();
818 hash ^= extension_.GetHashCode();
819 hash ^= nestedType_.GetHashCode();
820 hash ^= enumType_.GetHashCode();
821 hash ^= extensionRange_.GetHashCode();
822 hash ^= oneofDecl_.GetHashCode();
823 if (options_ != null) hash ^= Options.GetHashCode();
824 hash ^= reservedRange_.GetHashCode();
825 hash ^= reservedName_.GetHashCode();
826 return hash;
Jon Skeetf3504cf2015-04-28 14:49:49 +0100827 }
828
Jon Skeet5b9288e2015-07-03 12:45:36 +0100829 public override string ToString() {
830 return pb::JsonFormatter.Default.Format(this);
831 }
832
Jon Skeet96ddf012015-06-12 09:53:12 +0100833 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeetfb1547b2015-06-12 13:11:54 +0100834 if (Name.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100835 output.WriteRawTag(10);
836 output.WriteString(Name);
Jon Skeetf3504cf2015-04-28 14:49:49 +0100837 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100838 field_.WriteTo(output, _repeated_field_codec);
839 nestedType_.WriteTo(output, _repeated_nestedType_codec);
840 enumType_.WriteTo(output, _repeated_enumType_codec);
841 extensionRange_.WriteTo(output, _repeated_extensionRange_codec);
842 extension_.WriteTo(output, _repeated_extension_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100843 if (options_ != null) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100844 output.WriteRawTag(58);
845 output.WriteMessage(Options);
Jon Skeete38294a2015-06-09 19:30:44 +0100846 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100847 oneofDecl_.WriteTo(output, _repeated_oneofDecl_codec);
848 reservedRange_.WriteTo(output, _repeated_reservedRange_codec);
849 reservedName_.WriteTo(output, _repeated_reservedName_codec);
Jon Skeetf3504cf2015-04-28 14:49:49 +0100850 }
851
Jon Skeete38294a2015-06-09 19:30:44 +0100852 public int CalculateSize() {
853 int size = 0;
Jon Skeetfb1547b2015-06-12 13:11:54 +0100854 if (Name.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100855 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
Jon Skeetf3504cf2015-04-28 14:49:49 +0100856 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100857 size += field_.CalculateSize(_repeated_field_codec);
858 size += extension_.CalculateSize(_repeated_extension_codec);
859 size += nestedType_.CalculateSize(_repeated_nestedType_codec);
860 size += enumType_.CalculateSize(_repeated_enumType_codec);
861 size += extensionRange_.CalculateSize(_repeated_extensionRange_codec);
862 size += oneofDecl_.CalculateSize(_repeated_oneofDecl_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100863 if (options_ != null) {
Jon Skeet828b7e62015-06-17 14:59:10 +0100864 size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options);
Jon Skeetf3504cf2015-04-28 14:49:49 +0100865 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100866 size += reservedRange_.CalculateSize(_repeated_reservedRange_codec);
867 size += reservedName_.CalculateSize(_repeated_reservedName_codec);
Jon Skeetf3504cf2015-04-28 14:49:49 +0100868 return size;
869 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +0100870
Jon Skeete38294a2015-06-09 19:30:44 +0100871 public void MergeFrom(DescriptorProto other) {
872 if (other == null) {
873 return;
874 }
Jon Skeetfb1547b2015-06-12 13:11:54 +0100875 if (other.Name.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +0100876 Name = other.Name;
877 }
878 field_.Add(other.field_);
879 extension_.Add(other.extension_);
880 nestedType_.Add(other.nestedType_);
881 enumType_.Add(other.enumType_);
882 extensionRange_.Add(other.extensionRange_);
883 oneofDecl_.Add(other.oneofDecl_);
884 if (other.options_ != null) {
885 if (options_ == null) {
Jon Skeet9c888fa2015-07-14 11:13:52 +0100886 options_ = new global::Google.Protobuf.Reflection.MessageOptions();
Jon Skeete38294a2015-06-09 19:30:44 +0100887 }
888 Options.MergeFrom(other.Options);
889 }
890 reservedRange_.Add(other.reservedRange_);
891 reservedName_.Add(other.reservedName_);
Jon Skeetf3504cf2015-04-28 14:49:49 +0100892 }
893
Jon Skeet96ddf012015-06-12 09:53:12 +0100894 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +0100895 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +0100896 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +0100897 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +0100898 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100899 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +0100900 break;
901 case 10: {
Jon Skeetfb1547b2015-06-12 13:11:54 +0100902 Name = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +0100903 break;
904 }
905 case 18: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100906 field_.AddEntriesFrom(input, _repeated_field_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100907 break;
908 }
909 case 26: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100910 nestedType_.AddEntriesFrom(input, _repeated_nestedType_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100911 break;
912 }
913 case 34: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100914 enumType_.AddEntriesFrom(input, _repeated_enumType_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100915 break;
916 }
917 case 42: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100918 extensionRange_.AddEntriesFrom(input, _repeated_extensionRange_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100919 break;
920 }
921 case 50: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100922 extension_.AddEntriesFrom(input, _repeated_extension_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100923 break;
924 }
925 case 58: {
926 if (options_ == null) {
Jon Skeet9c888fa2015-07-14 11:13:52 +0100927 options_ = new global::Google.Protobuf.Reflection.MessageOptions();
Jon Skeete38294a2015-06-09 19:30:44 +0100928 }
929 input.ReadMessage(options_);
930 break;
931 }
932 case 66: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100933 oneofDecl_.AddEntriesFrom(input, _repeated_oneofDecl_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100934 break;
935 }
936 case 74: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100937 reservedRange_.AddEntriesFrom(input, _repeated_reservedRange_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100938 break;
939 }
940 case 82: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +0100941 reservedName_.AddEntriesFrom(input, _repeated_reservedName_codec);
Jon Skeete38294a2015-06-09 19:30:44 +0100942 break;
943 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100944 }
Jie Luoa21a2cf2015-05-29 17:57:05 -0700945 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100946 }
Jon Skeetf3504cf2015-04-28 14:49:49 +0100947
948 #region Nested types
Jon Skeetb0888a42015-09-29 13:37:30 +0100949 /// <summary>Container for nested types declared in the DescriptorProto message type.</summary>
Jon Skeete2c82302015-09-29 14:34:31 +0100950 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeetf3504cf2015-04-28 14:49:49 +0100951 public static partial class Types {
Jon Skeete38294a2015-06-09 19:30:44 +0100952 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +0100953 internal sealed partial class ExtensionRange : pb::IMessage<ExtensionRange> {
Jon Skeete38294a2015-06-09 19:30:44 +0100954 private static readonly pb::MessageParser<ExtensionRange> _parser = new pb::MessageParser<ExtensionRange>(() => new ExtensionRange());
955 public static pb::MessageParser<ExtensionRange> Parser { get { return _parser; } }
956
Jon Skeet76940942015-07-14 10:25:40 +0100957 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +0100958 get { return global::Google.Protobuf.Reflection.DescriptorProto.Descriptor.NestedTypes[0]; }
Jon Skeete38294a2015-06-09 19:30:44 +0100959 }
960
Jon Skeet96cffaa2015-07-20 19:25:07 +0100961 pbr::MessageDescriptor pb::IMessage.Descriptor {
962 get { return Descriptor; }
Jon Skeete38294a2015-06-09 19:30:44 +0100963 }
964
Jon Skeet53508222015-07-01 17:16:55 +0100965 public ExtensionRange() {
966 OnConstruction();
967 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100968
Jon Skeet53508222015-07-01 17:16:55 +0100969 partial void OnConstruction();
970
971 public ExtensionRange(ExtensionRange other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100972 start_ = other.start_;
973 end_ = other.end_;
Jon Skeete38294a2015-06-09 19:30:44 +0100974 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +0100975
976 public ExtensionRange Clone() {
977 return new ExtensionRange(this);
978 }
979
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100980 /// <summary>Field number for the "start" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +0100981 public const int StartFieldNumber = 1;
982 private int start_;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700983 public int Start {
Jon Skeete38294a2015-06-09 19:30:44 +0100984 get { return start_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +0100985 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +0100986 start_ = value;
987 }
Jon Skeete38294a2015-06-09 19:30:44 +0100988 }
989
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100990 /// <summary>Field number for the "end" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +0100991 public const int EndFieldNumber = 2;
992 private int end_;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -0700993 public int End {
Jon Skeete38294a2015-06-09 19:30:44 +0100994 get { return end_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +0100995 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +0100996 end_ = value;
997 }
Jon Skeete38294a2015-06-09 19:30:44 +0100998 }
999
Jon Skeete38294a2015-06-09 19:30:44 +01001000 public override bool Equals(object other) {
1001 return Equals(other as ExtensionRange);
1002 }
1003
1004 public bool Equals(ExtensionRange other) {
1005 if (ReferenceEquals(other, null)) {
1006 return false;
1007 }
1008 if (ReferenceEquals(other, this)) {
1009 return true;
1010 }
1011 if (Start != other.Start) return false;
1012 if (End != other.End) return false;
1013 return true;
1014 }
1015
1016 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +01001017 int hash = 1;
Jon Skeete38294a2015-06-09 19:30:44 +01001018 if (Start != 0) hash ^= Start.GetHashCode();
1019 if (End != 0) hash ^= End.GetHashCode();
1020 return hash;
1021 }
1022
Jon Skeet5b9288e2015-07-03 12:45:36 +01001023 public override string ToString() {
1024 return pb::JsonFormatter.Default.Format(this);
1025 }
1026
Jon Skeet96ddf012015-06-12 09:53:12 +01001027 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeete38294a2015-06-09 19:30:44 +01001028 if (Start != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001029 output.WriteRawTag(8);
1030 output.WriteInt32(Start);
Jon Skeete38294a2015-06-09 19:30:44 +01001031 }
1032 if (End != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001033 output.WriteRawTag(16);
1034 output.WriteInt32(End);
Jon Skeete38294a2015-06-09 19:30:44 +01001035 }
1036 }
1037
1038 public int CalculateSize() {
1039 int size = 0;
1040 if (Start != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001041 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Start);
Jon Skeete38294a2015-06-09 19:30:44 +01001042 }
1043 if (End != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001044 size += 1 + pb::CodedOutputStream.ComputeInt32Size(End);
Jon Skeete38294a2015-06-09 19:30:44 +01001045 }
1046 return size;
1047 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +01001048
Jon Skeete38294a2015-06-09 19:30:44 +01001049 public void MergeFrom(ExtensionRange other) {
1050 if (other == null) {
1051 return;
1052 }
1053 if (other.Start != 0) {
1054 Start = other.Start;
1055 }
1056 if (other.End != 0) {
1057 End = other.End;
1058 }
1059 }
1060
Jon Skeet96ddf012015-06-12 09:53:12 +01001061 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +01001062 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01001063 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01001064 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +01001065 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01001066 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +01001067 break;
1068 case 8: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01001069 Start = input.ReadInt32();
Jon Skeete38294a2015-06-09 19:30:44 +01001070 break;
1071 }
1072 case 16: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01001073 End = input.ReadInt32();
Jon Skeete38294a2015-06-09 19:30:44 +01001074 break;
1075 }
1076 }
1077 }
1078 }
1079
1080 }
1081
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001082 /// <summary>
1083 /// Range of reserved tag numbers. Reserved tag numbers may not be used by
1084 /// fields or extension ranges in the same message. Reserved ranges may
1085 /// not overlap.
1086 /// </summary>
Jon Skeete38294a2015-06-09 19:30:44 +01001087 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +01001088 internal sealed partial class ReservedRange : pb::IMessage<ReservedRange> {
Jon Skeete38294a2015-06-09 19:30:44 +01001089 private static readonly pb::MessageParser<ReservedRange> _parser = new pb::MessageParser<ReservedRange>(() => new ReservedRange());
1090 public static pb::MessageParser<ReservedRange> Parser { get { return _parser; } }
1091
Jon Skeet76940942015-07-14 10:25:40 +01001092 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +01001093 get { return global::Google.Protobuf.Reflection.DescriptorProto.Descriptor.NestedTypes[1]; }
Jon Skeete38294a2015-06-09 19:30:44 +01001094 }
1095
Jon Skeet96cffaa2015-07-20 19:25:07 +01001096 pbr::MessageDescriptor pb::IMessage.Descriptor {
1097 get { return Descriptor; }
Jon Skeete38294a2015-06-09 19:30:44 +01001098 }
1099
Jon Skeet53508222015-07-01 17:16:55 +01001100 public ReservedRange() {
1101 OnConstruction();
1102 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01001103
Jon Skeet53508222015-07-01 17:16:55 +01001104 partial void OnConstruction();
1105
1106 public ReservedRange(ReservedRange other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01001107 start_ = other.start_;
1108 end_ = other.end_;
Jon Skeete38294a2015-06-09 19:30:44 +01001109 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01001110
1111 public ReservedRange Clone() {
1112 return new ReservedRange(this);
1113 }
1114
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001115 /// <summary>Field number for the "start" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01001116 public const int StartFieldNumber = 1;
1117 private int start_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001118 /// <summary>
1119 /// Inclusive.
1120 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07001121 public int Start {
Jon Skeete38294a2015-06-09 19:30:44 +01001122 get { return start_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01001123 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01001124 start_ = value;
1125 }
Jon Skeete38294a2015-06-09 19:30:44 +01001126 }
1127
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001128 /// <summary>Field number for the "end" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01001129 public const int EndFieldNumber = 2;
1130 private int end_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001131 /// <summary>
1132 /// Exclusive.
1133 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07001134 public int End {
Jon Skeete38294a2015-06-09 19:30:44 +01001135 get { return end_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01001136 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01001137 end_ = value;
1138 }
Jon Skeete38294a2015-06-09 19:30:44 +01001139 }
1140
Jon Skeete38294a2015-06-09 19:30:44 +01001141 public override bool Equals(object other) {
1142 return Equals(other as ReservedRange);
1143 }
1144
1145 public bool Equals(ReservedRange other) {
1146 if (ReferenceEquals(other, null)) {
1147 return false;
1148 }
1149 if (ReferenceEquals(other, this)) {
1150 return true;
1151 }
1152 if (Start != other.Start) return false;
1153 if (End != other.End) return false;
1154 return true;
1155 }
1156
1157 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +01001158 int hash = 1;
Jon Skeete38294a2015-06-09 19:30:44 +01001159 if (Start != 0) hash ^= Start.GetHashCode();
1160 if (End != 0) hash ^= End.GetHashCode();
1161 return hash;
1162 }
1163
Jon Skeet5b9288e2015-07-03 12:45:36 +01001164 public override string ToString() {
1165 return pb::JsonFormatter.Default.Format(this);
1166 }
1167
Jon Skeet96ddf012015-06-12 09:53:12 +01001168 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeete38294a2015-06-09 19:30:44 +01001169 if (Start != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001170 output.WriteRawTag(8);
1171 output.WriteInt32(Start);
Jon Skeete38294a2015-06-09 19:30:44 +01001172 }
1173 if (End != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001174 output.WriteRawTag(16);
1175 output.WriteInt32(End);
Jon Skeete38294a2015-06-09 19:30:44 +01001176 }
1177 }
1178
1179 public int CalculateSize() {
1180 int size = 0;
1181 if (Start != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001182 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Start);
Jon Skeete38294a2015-06-09 19:30:44 +01001183 }
1184 if (End != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001185 size += 1 + pb::CodedOutputStream.ComputeInt32Size(End);
Jon Skeete38294a2015-06-09 19:30:44 +01001186 }
1187 return size;
1188 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +01001189
Jon Skeete38294a2015-06-09 19:30:44 +01001190 public void MergeFrom(ReservedRange other) {
1191 if (other == null) {
1192 return;
1193 }
1194 if (other.Start != 0) {
1195 Start = other.Start;
1196 }
1197 if (other.End != 0) {
1198 End = other.End;
1199 }
1200 }
1201
Jon Skeet96ddf012015-06-12 09:53:12 +01001202 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +01001203 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01001204 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01001205 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +01001206 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01001207 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +01001208 break;
1209 case 8: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01001210 Start = input.ReadInt32();
Jon Skeete38294a2015-06-09 19:30:44 +01001211 break;
1212 }
1213 case 16: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01001214 End = input.ReadInt32();
Jon Skeete38294a2015-06-09 19:30:44 +01001215 break;
1216 }
1217 }
1218 }
1219 }
1220
1221 }
1222
1223 }
1224 #endregion
1225
1226 }
1227
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001228 /// <summary>
1229 /// Describes a field within a message.
1230 /// </summary>
Jon Skeete38294a2015-06-09 19:30:44 +01001231 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +01001232 internal sealed partial class FieldDescriptorProto : pb::IMessage<FieldDescriptorProto> {
Jon Skeete38294a2015-06-09 19:30:44 +01001233 private static readonly pb::MessageParser<FieldDescriptorProto> _parser = new pb::MessageParser<FieldDescriptorProto>(() => new FieldDescriptorProto());
1234 public static pb::MessageParser<FieldDescriptorProto> Parser { get { return _parser; } }
1235
Jon Skeet76940942015-07-14 10:25:40 +01001236 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +01001237 get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[3]; }
Jon Skeete38294a2015-06-09 19:30:44 +01001238 }
1239
Jon Skeet96cffaa2015-07-20 19:25:07 +01001240 pbr::MessageDescriptor pb::IMessage.Descriptor {
1241 get { return Descriptor; }
Jon Skeete38294a2015-06-09 19:30:44 +01001242 }
1243
Jon Skeet53508222015-07-01 17:16:55 +01001244 public FieldDescriptorProto() {
1245 OnConstruction();
1246 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01001247
Jon Skeet53508222015-07-01 17:16:55 +01001248 partial void OnConstruction();
1249
1250 public FieldDescriptorProto(FieldDescriptorProto other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01001251 name_ = other.name_;
1252 number_ = other.number_;
1253 label_ = other.label_;
1254 type_ = other.type_;
1255 typeName_ = other.typeName_;
1256 extendee_ = other.extendee_;
1257 defaultValue_ = other.defaultValue_;
1258 oneofIndex_ = other.oneofIndex_;
Jon Skeet55313c92015-10-24 06:46:02 +01001259 jsonName_ = other.jsonName_;
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01001260 Options = other.options_ != null ? other.Options.Clone() : null;
Jon Skeete38294a2015-06-09 19:30:44 +01001261 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01001262
1263 public FieldDescriptorProto Clone() {
1264 return new FieldDescriptorProto(this);
1265 }
1266
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001267 /// <summary>Field number for the "name" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01001268 public const int NameFieldNumber = 1;
1269 private string name_ = "";
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07001270 public string Name {
Jon Skeete38294a2015-06-09 19:30:44 +01001271 get { return name_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01001272 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01001273 name_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01001274 }
Jon Skeete38294a2015-06-09 19:30:44 +01001275 }
1276
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001277 /// <summary>Field number for the "number" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01001278 public const int NumberFieldNumber = 3;
1279 private int number_;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07001280 public int Number {
Jon Skeete38294a2015-06-09 19:30:44 +01001281 get { return number_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01001282 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01001283 number_ = value;
1284 }
Jon Skeete38294a2015-06-09 19:30:44 +01001285 }
1286
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001287 /// <summary>Field number for the "label" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01001288 public const int LabelFieldNumber = 4;
Jon Skeet9c888fa2015-07-14 11:13:52 +01001289 private global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label label_ = global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07001290 public global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label Label {
Jon Skeete38294a2015-06-09 19:30:44 +01001291 get { return label_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01001292 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01001293 label_ = value;
1294 }
Jon Skeete38294a2015-06-09 19:30:44 +01001295 }
1296
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001297 /// <summary>Field number for the "type" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01001298 public const int TypeFieldNumber = 5;
Jon Skeet9c888fa2015-07-14 11:13:52 +01001299 private global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type type_ = global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type.TYPE_DOUBLE;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001300 /// <summary>
1301 /// If type_name is set, this need not be set. If both this and type_name
1302 /// are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
1303 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07001304 public global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type Type {
Jon Skeete38294a2015-06-09 19:30:44 +01001305 get { return type_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01001306 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01001307 type_ = value;
1308 }
Jon Skeete38294a2015-06-09 19:30:44 +01001309 }
1310
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001311 /// <summary>Field number for the "type_name" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01001312 public const int TypeNameFieldNumber = 6;
1313 private string typeName_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001314 /// <summary>
1315 /// For message and enum types, this is the name of the type. If the name
1316 /// starts with a '.', it is fully-qualified. Otherwise, C++-like scoping
1317 /// rules are used to find the type (i.e. first the nested types within this
1318 /// message are searched, then within the parent, on up to the root
1319 /// namespace).
1320 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07001321 public string TypeName {
Jon Skeete38294a2015-06-09 19:30:44 +01001322 get { return typeName_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01001323 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01001324 typeName_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01001325 }
Jon Skeete38294a2015-06-09 19:30:44 +01001326 }
1327
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001328 /// <summary>Field number for the "extendee" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01001329 public const int ExtendeeFieldNumber = 2;
1330 private string extendee_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001331 /// <summary>
1332 /// For extensions, this is the name of the type being extended. It is
1333 /// resolved in the same manner as type_name.
1334 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07001335 public string Extendee {
Jon Skeete38294a2015-06-09 19:30:44 +01001336 get { return extendee_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01001337 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01001338 extendee_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01001339 }
Jon Skeete38294a2015-06-09 19:30:44 +01001340 }
1341
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001342 /// <summary>Field number for the "default_value" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01001343 public const int DefaultValueFieldNumber = 7;
1344 private string defaultValue_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001345 /// <summary>
1346 /// For numeric types, contains the original text representation of the value.
1347 /// For booleans, "true" or "false".
1348 /// For strings, contains the default text contents (not escaped in any way).
1349 /// For bytes, contains the C escaped value. All bytes >= 128 are escaped.
1350 /// TODO(kenton): Base-64 encode?
1351 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07001352 public string DefaultValue {
Jon Skeete38294a2015-06-09 19:30:44 +01001353 get { return defaultValue_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01001354 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01001355 defaultValue_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01001356 }
Jon Skeete38294a2015-06-09 19:30:44 +01001357 }
1358
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001359 /// <summary>Field number for the "oneof_index" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01001360 public const int OneofIndexFieldNumber = 9;
1361 private int oneofIndex_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001362 /// <summary>
1363 /// If set, gives the index of a oneof in the containing type's oneof_decl
1364 /// list. This field is a member of that oneof.
1365 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07001366 public int OneofIndex {
Jon Skeete38294a2015-06-09 19:30:44 +01001367 get { return oneofIndex_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01001368 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01001369 oneofIndex_ = value;
1370 }
Jon Skeete38294a2015-06-09 19:30:44 +01001371 }
1372
Jon Skeet55313c92015-10-24 06:46:02 +01001373 /// <summary>Field number for the "json_name" field.</summary>
1374 public const int JsonNameFieldNumber = 10;
1375 private string jsonName_ = "";
1376 /// <summary>
1377 /// JSON name of this field. The value is set by protocol compiler. If the
1378 /// user has set a "json_name" option on this field, that option's value
1379 /// will be used. Otherwise, it's deduced from the field's name by converting
1380 /// it to camelCase.
1381 /// </summary>
1382 public string JsonName {
1383 get { return jsonName_; }
1384 set {
1385 jsonName_ = pb::Preconditions.CheckNotNull(value, "value");
1386 }
1387 }
1388
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001389 /// <summary>Field number for the "options" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01001390 public const int OptionsFieldNumber = 8;
Jon Skeet9c888fa2015-07-14 11:13:52 +01001391 private global::Google.Protobuf.Reflection.FieldOptions options_;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07001392 public global::Google.Protobuf.Reflection.FieldOptions Options {
Jon Skeete38294a2015-06-09 19:30:44 +01001393 get { return options_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01001394 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01001395 options_ = value;
1396 }
Jon Skeete38294a2015-06-09 19:30:44 +01001397 }
1398
1399 public override bool Equals(object other) {
1400 return Equals(other as FieldDescriptorProto);
1401 }
1402
1403 public bool Equals(FieldDescriptorProto other) {
1404 if (ReferenceEquals(other, null)) {
1405 return false;
1406 }
1407 if (ReferenceEquals(other, this)) {
1408 return true;
1409 }
1410 if (Name != other.Name) return false;
1411 if (Number != other.Number) return false;
1412 if (Label != other.Label) return false;
1413 if (Type != other.Type) return false;
1414 if (TypeName != other.TypeName) return false;
1415 if (Extendee != other.Extendee) return false;
1416 if (DefaultValue != other.DefaultValue) return false;
1417 if (OneofIndex != other.OneofIndex) return false;
Jon Skeet55313c92015-10-24 06:46:02 +01001418 if (JsonName != other.JsonName) return false;
Jon Skeetbfee2df2015-06-23 16:09:27 +01001419 if (!object.Equals(Options, other.Options)) return false;
1420 return true;
Jon Skeete38294a2015-06-09 19:30:44 +01001421 }
1422
1423 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +01001424 int hash = 1;
Jon Skeetfb1547b2015-06-12 13:11:54 +01001425 if (Name.Length != 0) hash ^= Name.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +01001426 if (Number != 0) hash ^= Number.GetHashCode();
Jon Skeet9c888fa2015-07-14 11:13:52 +01001427 if (Label != global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL) hash ^= Label.GetHashCode();
1428 if (Type != global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type.TYPE_DOUBLE) hash ^= Type.GetHashCode();
Jon Skeetfb1547b2015-06-12 13:11:54 +01001429 if (TypeName.Length != 0) hash ^= TypeName.GetHashCode();
1430 if (Extendee.Length != 0) hash ^= Extendee.GetHashCode();
1431 if (DefaultValue.Length != 0) hash ^= DefaultValue.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +01001432 if (OneofIndex != 0) hash ^= OneofIndex.GetHashCode();
Jon Skeet55313c92015-10-24 06:46:02 +01001433 if (JsonName.Length != 0) hash ^= JsonName.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +01001434 if (options_ != null) hash ^= Options.GetHashCode();
1435 return hash;
1436 }
1437
Jon Skeet5b9288e2015-07-03 12:45:36 +01001438 public override string ToString() {
1439 return pb::JsonFormatter.Default.Format(this);
1440 }
1441
Jon Skeet96ddf012015-06-12 09:53:12 +01001442 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeetfb1547b2015-06-12 13:11:54 +01001443 if (Name.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001444 output.WriteRawTag(10);
1445 output.WriteString(Name);
Jon Skeete38294a2015-06-09 19:30:44 +01001446 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01001447 if (Extendee.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001448 output.WriteRawTag(18);
1449 output.WriteString(Extendee);
Jon Skeete38294a2015-06-09 19:30:44 +01001450 }
1451 if (Number != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001452 output.WriteRawTag(24);
1453 output.WriteInt32(Number);
Jon Skeete38294a2015-06-09 19:30:44 +01001454 }
Jon Skeet9c888fa2015-07-14 11:13:52 +01001455 if (Label != global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001456 output.WriteRawTag(32);
1457 output.WriteEnum((int) Label);
Jon Skeete38294a2015-06-09 19:30:44 +01001458 }
Jon Skeet9c888fa2015-07-14 11:13:52 +01001459 if (Type != global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type.TYPE_DOUBLE) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001460 output.WriteRawTag(40);
1461 output.WriteEnum((int) Type);
Jon Skeete38294a2015-06-09 19:30:44 +01001462 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01001463 if (TypeName.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001464 output.WriteRawTag(50);
1465 output.WriteString(TypeName);
Jon Skeete38294a2015-06-09 19:30:44 +01001466 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01001467 if (DefaultValue.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001468 output.WriteRawTag(58);
1469 output.WriteString(DefaultValue);
Jon Skeete38294a2015-06-09 19:30:44 +01001470 }
1471 if (options_ != null) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001472 output.WriteRawTag(66);
1473 output.WriteMessage(Options);
Jon Skeete38294a2015-06-09 19:30:44 +01001474 }
1475 if (OneofIndex != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001476 output.WriteRawTag(72);
1477 output.WriteInt32(OneofIndex);
Jon Skeete38294a2015-06-09 19:30:44 +01001478 }
Jon Skeet55313c92015-10-24 06:46:02 +01001479 if (JsonName.Length != 0) {
1480 output.WriteRawTag(82);
1481 output.WriteString(JsonName);
1482 }
Jon Skeete38294a2015-06-09 19:30:44 +01001483 }
1484
1485 public int CalculateSize() {
1486 int size = 0;
Jon Skeetfb1547b2015-06-12 13:11:54 +01001487 if (Name.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001488 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
Jon Skeete38294a2015-06-09 19:30:44 +01001489 }
1490 if (Number != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001491 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Number);
Jon Skeete38294a2015-06-09 19:30:44 +01001492 }
Jon Skeet9c888fa2015-07-14 11:13:52 +01001493 if (Label != global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001494 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Label);
Jon Skeete38294a2015-06-09 19:30:44 +01001495 }
Jon Skeet9c888fa2015-07-14 11:13:52 +01001496 if (Type != global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type.TYPE_DOUBLE) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001497 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type);
Jon Skeete38294a2015-06-09 19:30:44 +01001498 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01001499 if (TypeName.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001500 size += 1 + pb::CodedOutputStream.ComputeStringSize(TypeName);
Jon Skeete38294a2015-06-09 19:30:44 +01001501 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01001502 if (Extendee.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001503 size += 1 + pb::CodedOutputStream.ComputeStringSize(Extendee);
Jon Skeete38294a2015-06-09 19:30:44 +01001504 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01001505 if (DefaultValue.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001506 size += 1 + pb::CodedOutputStream.ComputeStringSize(DefaultValue);
Jon Skeete38294a2015-06-09 19:30:44 +01001507 }
1508 if (OneofIndex != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001509 size += 1 + pb::CodedOutputStream.ComputeInt32Size(OneofIndex);
Jon Skeete38294a2015-06-09 19:30:44 +01001510 }
Jon Skeet55313c92015-10-24 06:46:02 +01001511 if (JsonName.Length != 0) {
1512 size += 1 + pb::CodedOutputStream.ComputeStringSize(JsonName);
1513 }
Jon Skeete38294a2015-06-09 19:30:44 +01001514 if (options_ != null) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001515 size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options);
Jon Skeete38294a2015-06-09 19:30:44 +01001516 }
1517 return size;
1518 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +01001519
Jon Skeete38294a2015-06-09 19:30:44 +01001520 public void MergeFrom(FieldDescriptorProto other) {
1521 if (other == null) {
1522 return;
1523 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01001524 if (other.Name.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01001525 Name = other.Name;
1526 }
1527 if (other.Number != 0) {
1528 Number = other.Number;
1529 }
Jon Skeet9c888fa2015-07-14 11:13:52 +01001530 if (other.Label != global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL) {
Jon Skeete38294a2015-06-09 19:30:44 +01001531 Label = other.Label;
1532 }
Jon Skeet9c888fa2015-07-14 11:13:52 +01001533 if (other.Type != global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type.TYPE_DOUBLE) {
Jon Skeete38294a2015-06-09 19:30:44 +01001534 Type = other.Type;
1535 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01001536 if (other.TypeName.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01001537 TypeName = other.TypeName;
1538 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01001539 if (other.Extendee.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01001540 Extendee = other.Extendee;
1541 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01001542 if (other.DefaultValue.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01001543 DefaultValue = other.DefaultValue;
1544 }
1545 if (other.OneofIndex != 0) {
1546 OneofIndex = other.OneofIndex;
1547 }
Jon Skeet55313c92015-10-24 06:46:02 +01001548 if (other.JsonName.Length != 0) {
1549 JsonName = other.JsonName;
1550 }
Jon Skeete38294a2015-06-09 19:30:44 +01001551 if (other.options_ != null) {
1552 if (options_ == null) {
Jon Skeet9c888fa2015-07-14 11:13:52 +01001553 options_ = new global::Google.Protobuf.Reflection.FieldOptions();
Jon Skeete38294a2015-06-09 19:30:44 +01001554 }
1555 Options.MergeFrom(other.Options);
1556 }
1557 }
1558
Jon Skeet96ddf012015-06-12 09:53:12 +01001559 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +01001560 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01001561 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01001562 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +01001563 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01001564 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +01001565 break;
1566 case 10: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01001567 Name = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01001568 break;
1569 }
1570 case 18: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01001571 Extendee = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01001572 break;
1573 }
1574 case 24: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01001575 Number = input.ReadInt32();
Jon Skeete38294a2015-06-09 19:30:44 +01001576 break;
1577 }
1578 case 32: {
Jon Skeet9c888fa2015-07-14 11:13:52 +01001579 label_ = (global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label) input.ReadEnum();
Jon Skeet96ddf012015-06-12 09:53:12 +01001580 break;
Jon Skeete38294a2015-06-09 19:30:44 +01001581 }
1582 case 40: {
Jon Skeet9c888fa2015-07-14 11:13:52 +01001583 type_ = (global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type) input.ReadEnum();
Jon Skeet96ddf012015-06-12 09:53:12 +01001584 break;
Jon Skeete38294a2015-06-09 19:30:44 +01001585 }
1586 case 50: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01001587 TypeName = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01001588 break;
1589 }
1590 case 58: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01001591 DefaultValue = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01001592 break;
1593 }
1594 case 66: {
1595 if (options_ == null) {
Jon Skeet9c888fa2015-07-14 11:13:52 +01001596 options_ = new global::Google.Protobuf.Reflection.FieldOptions();
Jon Skeete38294a2015-06-09 19:30:44 +01001597 }
1598 input.ReadMessage(options_);
1599 break;
1600 }
1601 case 72: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01001602 OneofIndex = input.ReadInt32();
Jon Skeete38294a2015-06-09 19:30:44 +01001603 break;
1604 }
Jon Skeet55313c92015-10-24 06:46:02 +01001605 case 82: {
1606 JsonName = input.ReadString();
1607 break;
1608 }
Jon Skeete38294a2015-06-09 19:30:44 +01001609 }
1610 }
1611 }
1612
1613 #region Nested types
Jon Skeetb0888a42015-09-29 13:37:30 +01001614 /// <summary>Container for nested types declared in the FieldDescriptorProto message type.</summary>
Jon Skeete2c82302015-09-29 14:34:31 +01001615 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeete38294a2015-06-09 19:30:44 +01001616 public static partial class Types {
Jon Skeet53508222015-07-01 17:16:55 +01001617 internal enum Type {
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001618 /// <summary>
1619 /// 0 is reserved for errors.
1620 /// Order is weird for historical reasons.
1621 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001622 TYPE_DOUBLE = 1,
1623 TYPE_FLOAT = 2,
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001624 /// <summary>
1625 /// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
1626 /// negative values are likely.
1627 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001628 TYPE_INT64 = 3,
1629 TYPE_UINT64 = 4,
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001630 /// <summary>
1631 /// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
1632 /// negative values are likely.
1633 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001634 TYPE_INT32 = 5,
1635 TYPE_FIXED64 = 6,
1636 TYPE_FIXED32 = 7,
1637 TYPE_BOOL = 8,
1638 TYPE_STRING = 9,
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001639 /// <summary>
1640 /// Tag-delimited aggregate.
1641 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001642 TYPE_GROUP = 10,
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001643 /// <summary>
1644 /// Length-delimited aggregate.
1645 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001646 TYPE_MESSAGE = 11,
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001647 /// <summary>
1648 /// New in version 2.
1649 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001650 TYPE_BYTES = 12,
1651 TYPE_UINT32 = 13,
1652 TYPE_ENUM = 14,
1653 TYPE_SFIXED32 = 15,
1654 TYPE_SFIXED64 = 16,
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001655 /// <summary>
1656 /// Uses ZigZag encoding.
1657 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001658 TYPE_SINT32 = 17,
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001659 /// <summary>
1660 /// Uses ZigZag encoding.
1661 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001662 TYPE_SINT64 = 18,
1663 }
1664
Jon Skeet53508222015-07-01 17:16:55 +01001665 internal enum Label {
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001666 /// <summary>
1667 /// 0 is reserved for errors
1668 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001669 LABEL_OPTIONAL = 1,
1670 LABEL_REQUIRED = 2,
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001671 /// <summary>
1672 /// TODO(sanjay): Should we add LABEL_MAP?
1673 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001674 LABEL_REPEATED = 3,
1675 }
1676
1677 }
1678 #endregion
1679
Jon Skeetf3504cf2015-04-28 14:49:49 +01001680 }
1681
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001682 /// <summary>
1683 /// Describes a oneof.
1684 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001685 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +01001686 internal sealed partial class OneofDescriptorProto : pb::IMessage<OneofDescriptorProto> {
Jon Skeete38294a2015-06-09 19:30:44 +01001687 private static readonly pb::MessageParser<OneofDescriptorProto> _parser = new pb::MessageParser<OneofDescriptorProto>(() => new OneofDescriptorProto());
1688 public static pb::MessageParser<OneofDescriptorProto> Parser { get { return _parser; } }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001689
Jon Skeet76940942015-07-14 10:25:40 +01001690 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +01001691 get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[4]; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001692 }
1693
Jon Skeet96cffaa2015-07-20 19:25:07 +01001694 pbr::MessageDescriptor pb::IMessage.Descriptor {
1695 get { return Descriptor; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001696 }
1697
Jon Skeet53508222015-07-01 17:16:55 +01001698 public OneofDescriptorProto() {
1699 OnConstruction();
1700 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01001701
Jon Skeet53508222015-07-01 17:16:55 +01001702 partial void OnConstruction();
1703
1704 public OneofDescriptorProto(OneofDescriptorProto other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01001705 name_ = other.name_;
Jon Skeete38294a2015-06-09 19:30:44 +01001706 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01001707
1708 public OneofDescriptorProto Clone() {
1709 return new OneofDescriptorProto(this);
1710 }
1711
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001712 /// <summary>Field number for the "name" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001713 public const int NameFieldNumber = 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01001714 private string name_ = "";
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07001715 public string Name {
Jon Skeetf3504cf2015-04-28 14:49:49 +01001716 get { return name_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01001717 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01001718 name_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01001719 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001720 }
1721
Jon Skeete38294a2015-06-09 19:30:44 +01001722 public override bool Equals(object other) {
1723 return Equals(other as OneofDescriptorProto);
1724 }
1725
1726 public bool Equals(OneofDescriptorProto other) {
1727 if (ReferenceEquals(other, null)) {
1728 return false;
1729 }
1730 if (ReferenceEquals(other, this)) {
Jon Skeetf3504cf2015-04-28 14:49:49 +01001731 return true;
1732 }
Jon Skeete38294a2015-06-09 19:30:44 +01001733 if (Name != other.Name) return false;
1734 return true;
Jon Skeetf3504cf2015-04-28 14:49:49 +01001735 }
1736
Jon Skeete38294a2015-06-09 19:30:44 +01001737 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +01001738 int hash = 1;
Jon Skeetfb1547b2015-06-12 13:11:54 +01001739 if (Name.Length != 0) hash ^= Name.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +01001740 return hash;
Jon Skeetf3504cf2015-04-28 14:49:49 +01001741 }
1742
Jon Skeet5b9288e2015-07-03 12:45:36 +01001743 public override string ToString() {
1744 return pb::JsonFormatter.Default.Format(this);
1745 }
1746
Jon Skeet96ddf012015-06-12 09:53:12 +01001747 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeetfb1547b2015-06-12 13:11:54 +01001748 if (Name.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001749 output.WriteRawTag(10);
1750 output.WriteString(Name);
Jon Skeetf3504cf2015-04-28 14:49:49 +01001751 }
1752 }
1753
Jon Skeete38294a2015-06-09 19:30:44 +01001754 public int CalculateSize() {
1755 int size = 0;
Jon Skeetfb1547b2015-06-12 13:11:54 +01001756 if (Name.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001757 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
Jon Skeetf3504cf2015-04-28 14:49:49 +01001758 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001759 return size;
1760 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +01001761
Jon Skeete38294a2015-06-09 19:30:44 +01001762 public void MergeFrom(OneofDescriptorProto other) {
1763 if (other == null) {
1764 return;
1765 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01001766 if (other.Name.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01001767 Name = other.Name;
1768 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001769 }
1770
Jon Skeet96ddf012015-06-12 09:53:12 +01001771 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +01001772 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01001773 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01001774 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +01001775 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01001776 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +01001777 break;
1778 case 10: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01001779 Name = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01001780 break;
1781 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001782 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001783 }
1784 }
Jon Skeete38294a2015-06-09 19:30:44 +01001785
Jon Skeetf3504cf2015-04-28 14:49:49 +01001786 }
1787
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001788 /// <summary>
1789 /// Describes an enum type.
1790 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001791 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +01001792 internal sealed partial class EnumDescriptorProto : pb::IMessage<EnumDescriptorProto> {
Jon Skeete38294a2015-06-09 19:30:44 +01001793 private static readonly pb::MessageParser<EnumDescriptorProto> _parser = new pb::MessageParser<EnumDescriptorProto>(() => new EnumDescriptorProto());
1794 public static pb::MessageParser<EnumDescriptorProto> Parser { get { return _parser; } }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001795
Jon Skeet76940942015-07-14 10:25:40 +01001796 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +01001797 get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[5]; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001798 }
1799
Jon Skeet96cffaa2015-07-20 19:25:07 +01001800 pbr::MessageDescriptor pb::IMessage.Descriptor {
1801 get { return Descriptor; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001802 }
1803
Jon Skeet53508222015-07-01 17:16:55 +01001804 public EnumDescriptorProto() {
1805 OnConstruction();
1806 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01001807
Jon Skeet53508222015-07-01 17:16:55 +01001808 partial void OnConstruction();
1809
1810 public EnumDescriptorProto(EnumDescriptorProto other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01001811 name_ = other.name_;
1812 value_ = other.value_.Clone();
1813 Options = other.options_ != null ? other.Options.Clone() : null;
Jon Skeete38294a2015-06-09 19:30:44 +01001814 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01001815
1816 public EnumDescriptorProto Clone() {
1817 return new EnumDescriptorProto(this);
1818 }
1819
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001820 /// <summary>Field number for the "name" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001821 public const int NameFieldNumber = 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01001822 private string name_ = "";
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07001823 public string Name {
Jon Skeetf3504cf2015-04-28 14:49:49 +01001824 get { return name_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01001825 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01001826 name_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01001827 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001828 }
1829
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001830 /// <summary>Field number for the "value" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001831 public const int ValueFieldNumber = 2;
Jon Skeet9c888fa2015-07-14 11:13:52 +01001832 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.EnumValueDescriptorProto> _repeated_value_codec
1833 = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.EnumValueDescriptorProto.Parser);
1834 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.EnumValueDescriptorProto> value_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.EnumValueDescriptorProto>();
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07001835 public pbc::RepeatedField<global::Google.Protobuf.Reflection.EnumValueDescriptorProto> Value {
Jon Skeetf3504cf2015-04-28 14:49:49 +01001836 get { return value_; }
1837 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001838
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001839 /// <summary>Field number for the "options" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001840 public const int OptionsFieldNumber = 3;
Jon Skeet9c888fa2015-07-14 11:13:52 +01001841 private global::Google.Protobuf.Reflection.EnumOptions options_;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07001842 public global::Google.Protobuf.Reflection.EnumOptions Options {
Jon Skeete38294a2015-06-09 19:30:44 +01001843 get { return options_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01001844 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01001845 options_ = value;
1846 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001847 }
1848
Jon Skeete38294a2015-06-09 19:30:44 +01001849 public override bool Equals(object other) {
1850 return Equals(other as EnumDescriptorProto);
1851 }
1852
1853 public bool Equals(EnumDescriptorProto other) {
1854 if (ReferenceEquals(other, null)) {
1855 return false;
1856 }
1857 if (ReferenceEquals(other, this)) {
Jon Skeetf3504cf2015-04-28 14:49:49 +01001858 return true;
1859 }
Jon Skeete38294a2015-06-09 19:30:44 +01001860 if (Name != other.Name) return false;
1861 if(!value_.Equals(other.value_)) return false;
Jon Skeetbfee2df2015-06-23 16:09:27 +01001862 if (!object.Equals(Options, other.Options)) return false;
1863 return true;
Jon Skeetf3504cf2015-04-28 14:49:49 +01001864 }
1865
Jon Skeete38294a2015-06-09 19:30:44 +01001866 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +01001867 int hash = 1;
Jon Skeetfb1547b2015-06-12 13:11:54 +01001868 if (Name.Length != 0) hash ^= Name.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +01001869 hash ^= value_.GetHashCode();
1870 if (options_ != null) hash ^= Options.GetHashCode();
1871 return hash;
Jon Skeetf3504cf2015-04-28 14:49:49 +01001872 }
1873
Jon Skeet5b9288e2015-07-03 12:45:36 +01001874 public override string ToString() {
1875 return pb::JsonFormatter.Default.Format(this);
1876 }
1877
Jon Skeet96ddf012015-06-12 09:53:12 +01001878 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeetfb1547b2015-06-12 13:11:54 +01001879 if (Name.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001880 output.WriteRawTag(10);
1881 output.WriteString(Name);
Jon Skeete38294a2015-06-09 19:30:44 +01001882 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01001883 value_.WriteTo(output, _repeated_value_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01001884 if (options_ != null) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001885 output.WriteRawTag(26);
1886 output.WriteMessage(Options);
Jon Skeetf3504cf2015-04-28 14:49:49 +01001887 }
1888 }
1889
Jon Skeete38294a2015-06-09 19:30:44 +01001890 public int CalculateSize() {
1891 int size = 0;
Jon Skeetfb1547b2015-06-12 13:11:54 +01001892 if (Name.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001893 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
Jon Skeetf3504cf2015-04-28 14:49:49 +01001894 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01001895 size += value_.CalculateSize(_repeated_value_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01001896 if (options_ != null) {
Jon Skeet828b7e62015-06-17 14:59:10 +01001897 size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options);
Jon Skeetf3504cf2015-04-28 14:49:49 +01001898 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001899 return size;
1900 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +01001901
Jon Skeete38294a2015-06-09 19:30:44 +01001902 public void MergeFrom(EnumDescriptorProto other) {
1903 if (other == null) {
1904 return;
Jon Skeetf3504cf2015-04-28 14:49:49 +01001905 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01001906 if (other.Name.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01001907 Name = other.Name;
Jon Skeetf3504cf2015-04-28 14:49:49 +01001908 }
Jon Skeete38294a2015-06-09 19:30:44 +01001909 value_.Add(other.value_);
1910 if (other.options_ != null) {
1911 if (options_ == null) {
Jon Skeet9c888fa2015-07-14 11:13:52 +01001912 options_ = new global::Google.Protobuf.Reflection.EnumOptions();
Jon Skeetf3504cf2015-04-28 14:49:49 +01001913 }
Jon Skeete38294a2015-06-09 19:30:44 +01001914 Options.MergeFrom(other.Options);
Jon Skeetf3504cf2015-04-28 14:49:49 +01001915 }
Jon Skeete38294a2015-06-09 19:30:44 +01001916 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001917
Jon Skeet96ddf012015-06-12 09:53:12 +01001918 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +01001919 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01001920 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01001921 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +01001922 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01001923 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +01001924 break;
1925 case 10: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01001926 Name = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01001927 break;
1928 }
1929 case 18: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +01001930 value_.AddEntriesFrom(input, _repeated_value_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01001931 break;
1932 }
1933 case 26: {
1934 if (options_ == null) {
Jon Skeet9c888fa2015-07-14 11:13:52 +01001935 options_ = new global::Google.Protobuf.Reflection.EnumOptions();
Jon Skeete38294a2015-06-09 19:30:44 +01001936 }
1937 input.ReadMessage(options_);
1938 break;
1939 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001940 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001941 }
1942 }
Jon Skeete38294a2015-06-09 19:30:44 +01001943
Jon Skeetf3504cf2015-04-28 14:49:49 +01001944 }
1945
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001946 /// <summary>
1947 /// Describes a value within an enum.
1948 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001949 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +01001950 internal sealed partial class EnumValueDescriptorProto : pb::IMessage<EnumValueDescriptorProto> {
Jon Skeete38294a2015-06-09 19:30:44 +01001951 private static readonly pb::MessageParser<EnumValueDescriptorProto> _parser = new pb::MessageParser<EnumValueDescriptorProto>(() => new EnumValueDescriptorProto());
1952 public static pb::MessageParser<EnumValueDescriptorProto> Parser { get { return _parser; } }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001953
Jon Skeet76940942015-07-14 10:25:40 +01001954 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +01001955 get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[6]; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001956 }
1957
Jon Skeet96cffaa2015-07-20 19:25:07 +01001958 pbr::MessageDescriptor pb::IMessage.Descriptor {
1959 get { return Descriptor; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001960 }
1961
Jon Skeet53508222015-07-01 17:16:55 +01001962 public EnumValueDescriptorProto() {
1963 OnConstruction();
1964 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01001965
Jon Skeet53508222015-07-01 17:16:55 +01001966 partial void OnConstruction();
1967
1968 public EnumValueDescriptorProto(EnumValueDescriptorProto other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01001969 name_ = other.name_;
1970 number_ = other.number_;
1971 Options = other.options_ != null ? other.Options.Clone() : null;
Jon Skeete38294a2015-06-09 19:30:44 +01001972 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01001973
1974 public EnumValueDescriptorProto Clone() {
1975 return new EnumValueDescriptorProto(this);
1976 }
1977
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001978 /// <summary>Field number for the "name" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001979 public const int NameFieldNumber = 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01001980 private string name_ = "";
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07001981 public string Name {
Jon Skeetf3504cf2015-04-28 14:49:49 +01001982 get { return name_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01001983 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01001984 name_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01001985 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001986 }
1987
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001988 /// <summary>Field number for the "number" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001989 public const int NumberFieldNumber = 2;
Jon Skeetf3504cf2015-04-28 14:49:49 +01001990 private int number_;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07001991 public int Number {
Jon Skeetf3504cf2015-04-28 14:49:49 +01001992 get { return number_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01001993 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01001994 number_ = value;
1995 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01001996 }
1997
Jon Skeet18e0a2e2015-10-01 10:38:01 +01001998 /// <summary>Field number for the "options" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01001999 public const int OptionsFieldNumber = 3;
Jon Skeet9c888fa2015-07-14 11:13:52 +01002000 private global::Google.Protobuf.Reflection.EnumValueOptions options_;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002001 public global::Google.Protobuf.Reflection.EnumValueOptions Options {
Jon Skeete38294a2015-06-09 19:30:44 +01002002 get { return options_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002003 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01002004 options_ = value;
2005 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002006 }
2007
Jon Skeete38294a2015-06-09 19:30:44 +01002008 public override bool Equals(object other) {
2009 return Equals(other as EnumValueDescriptorProto);
2010 }
2011
2012 public bool Equals(EnumValueDescriptorProto other) {
2013 if (ReferenceEquals(other, null)) {
2014 return false;
2015 }
2016 if (ReferenceEquals(other, this)) {
Jon Skeetf3504cf2015-04-28 14:49:49 +01002017 return true;
2018 }
Jon Skeete38294a2015-06-09 19:30:44 +01002019 if (Name != other.Name) return false;
2020 if (Number != other.Number) return false;
Jon Skeetbfee2df2015-06-23 16:09:27 +01002021 if (!object.Equals(Options, other.Options)) return false;
2022 return true;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002023 }
2024
Jon Skeete38294a2015-06-09 19:30:44 +01002025 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +01002026 int hash = 1;
Jon Skeetfb1547b2015-06-12 13:11:54 +01002027 if (Name.Length != 0) hash ^= Name.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +01002028 if (Number != 0) hash ^= Number.GetHashCode();
2029 if (options_ != null) hash ^= Options.GetHashCode();
2030 return hash;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002031 }
2032
Jon Skeet5b9288e2015-07-03 12:45:36 +01002033 public override string ToString() {
2034 return pb::JsonFormatter.Default.Format(this);
2035 }
2036
Jon Skeet96ddf012015-06-12 09:53:12 +01002037 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeetfb1547b2015-06-12 13:11:54 +01002038 if (Name.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002039 output.WriteRawTag(10);
2040 output.WriteString(Name);
Jon Skeete38294a2015-06-09 19:30:44 +01002041 }
2042 if (Number != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002043 output.WriteRawTag(16);
2044 output.WriteInt32(Number);
Jon Skeete38294a2015-06-09 19:30:44 +01002045 }
2046 if (options_ != null) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002047 output.WriteRawTag(26);
2048 output.WriteMessage(Options);
Jon Skeetf3504cf2015-04-28 14:49:49 +01002049 }
2050 }
2051
Jon Skeete38294a2015-06-09 19:30:44 +01002052 public int CalculateSize() {
2053 int size = 0;
Jon Skeetfb1547b2015-06-12 13:11:54 +01002054 if (Name.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002055 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
Jon Skeetf3504cf2015-04-28 14:49:49 +01002056 }
Jon Skeete38294a2015-06-09 19:30:44 +01002057 if (Number != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002058 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Number);
Jon Skeetf3504cf2015-04-28 14:49:49 +01002059 }
Jon Skeete38294a2015-06-09 19:30:44 +01002060 if (options_ != null) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002061 size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options);
Jon Skeetf3504cf2015-04-28 14:49:49 +01002062 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002063 return size;
2064 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +01002065
Jon Skeete38294a2015-06-09 19:30:44 +01002066 public void MergeFrom(EnumValueDescriptorProto other) {
2067 if (other == null) {
2068 return;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002069 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01002070 if (other.Name.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01002071 Name = other.Name;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002072 }
Jon Skeete38294a2015-06-09 19:30:44 +01002073 if (other.Number != 0) {
2074 Number = other.Number;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002075 }
Jon Skeete38294a2015-06-09 19:30:44 +01002076 if (other.options_ != null) {
2077 if (options_ == null) {
Jon Skeet9c888fa2015-07-14 11:13:52 +01002078 options_ = new global::Google.Protobuf.Reflection.EnumValueOptions();
Jon Skeetf3504cf2015-04-28 14:49:49 +01002079 }
Jon Skeete38294a2015-06-09 19:30:44 +01002080 Options.MergeFrom(other.Options);
Jon Skeetf3504cf2015-04-28 14:49:49 +01002081 }
Jon Skeete38294a2015-06-09 19:30:44 +01002082 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002083
Jon Skeet96ddf012015-06-12 09:53:12 +01002084 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +01002085 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01002086 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01002087 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +01002088 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01002089 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +01002090 break;
2091 case 10: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01002092 Name = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01002093 break;
2094 }
2095 case 16: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01002096 Number = input.ReadInt32();
Jon Skeete38294a2015-06-09 19:30:44 +01002097 break;
2098 }
2099 case 26: {
2100 if (options_ == null) {
Jon Skeet9c888fa2015-07-14 11:13:52 +01002101 options_ = new global::Google.Protobuf.Reflection.EnumValueOptions();
Jon Skeete38294a2015-06-09 19:30:44 +01002102 }
2103 input.ReadMessage(options_);
2104 break;
2105 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002106 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002107 }
2108 }
Jon Skeete38294a2015-06-09 19:30:44 +01002109
Jon Skeetf3504cf2015-04-28 14:49:49 +01002110 }
2111
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002112 /// <summary>
2113 /// Describes a service.
2114 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01002115 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +01002116 internal sealed partial class ServiceDescriptorProto : pb::IMessage<ServiceDescriptorProto> {
Jon Skeete38294a2015-06-09 19:30:44 +01002117 private static readonly pb::MessageParser<ServiceDescriptorProto> _parser = new pb::MessageParser<ServiceDescriptorProto>(() => new ServiceDescriptorProto());
2118 public static pb::MessageParser<ServiceDescriptorProto> Parser { get { return _parser; } }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002119
Jon Skeet76940942015-07-14 10:25:40 +01002120 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +01002121 get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[7]; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002122 }
2123
Jon Skeet96cffaa2015-07-20 19:25:07 +01002124 pbr::MessageDescriptor pb::IMessage.Descriptor {
2125 get { return Descriptor; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002126 }
2127
Jon Skeet53508222015-07-01 17:16:55 +01002128 public ServiceDescriptorProto() {
2129 OnConstruction();
2130 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01002131
Jon Skeet53508222015-07-01 17:16:55 +01002132 partial void OnConstruction();
2133
2134 public ServiceDescriptorProto(ServiceDescriptorProto other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01002135 name_ = other.name_;
2136 method_ = other.method_.Clone();
2137 Options = other.options_ != null ? other.Options.Clone() : null;
Jon Skeete38294a2015-06-09 19:30:44 +01002138 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01002139
2140 public ServiceDescriptorProto Clone() {
2141 return new ServiceDescriptorProto(this);
2142 }
2143
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002144 /// <summary>Field number for the "name" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01002145 public const int NameFieldNumber = 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002146 private string name_ = "";
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002147 public string Name {
Jon Skeetf3504cf2015-04-28 14:49:49 +01002148 get { return name_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002149 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01002150 name_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01002151 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002152 }
2153
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002154 /// <summary>Field number for the "method" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01002155 public const int MethodFieldNumber = 2;
Jon Skeet9c888fa2015-07-14 11:13:52 +01002156 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.MethodDescriptorProto> _repeated_method_codec
2157 = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.MethodDescriptorProto.Parser);
2158 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.MethodDescriptorProto> method_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.MethodDescriptorProto>();
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002159 public pbc::RepeatedField<global::Google.Protobuf.Reflection.MethodDescriptorProto> Method {
Jon Skeetf3504cf2015-04-28 14:49:49 +01002160 get { return method_; }
2161 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002162
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002163 /// <summary>Field number for the "options" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01002164 public const int OptionsFieldNumber = 3;
Jon Skeet9c888fa2015-07-14 11:13:52 +01002165 private global::Google.Protobuf.Reflection.ServiceOptions options_;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002166 public global::Google.Protobuf.Reflection.ServiceOptions Options {
Jon Skeete38294a2015-06-09 19:30:44 +01002167 get { return options_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002168 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01002169 options_ = value;
2170 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002171 }
2172
Jon Skeete38294a2015-06-09 19:30:44 +01002173 public override bool Equals(object other) {
2174 return Equals(other as ServiceDescriptorProto);
2175 }
2176
2177 public bool Equals(ServiceDescriptorProto other) {
2178 if (ReferenceEquals(other, null)) {
2179 return false;
2180 }
2181 if (ReferenceEquals(other, this)) {
Jon Skeetf3504cf2015-04-28 14:49:49 +01002182 return true;
2183 }
Jon Skeete38294a2015-06-09 19:30:44 +01002184 if (Name != other.Name) return false;
2185 if(!method_.Equals(other.method_)) return false;
Jon Skeetbfee2df2015-06-23 16:09:27 +01002186 if (!object.Equals(Options, other.Options)) return false;
2187 return true;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002188 }
2189
Jon Skeete38294a2015-06-09 19:30:44 +01002190 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +01002191 int hash = 1;
Jon Skeetfb1547b2015-06-12 13:11:54 +01002192 if (Name.Length != 0) hash ^= Name.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +01002193 hash ^= method_.GetHashCode();
2194 if (options_ != null) hash ^= Options.GetHashCode();
2195 return hash;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002196 }
2197
Jon Skeet5b9288e2015-07-03 12:45:36 +01002198 public override string ToString() {
2199 return pb::JsonFormatter.Default.Format(this);
2200 }
2201
Jon Skeet96ddf012015-06-12 09:53:12 +01002202 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeetfb1547b2015-06-12 13:11:54 +01002203 if (Name.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002204 output.WriteRawTag(10);
2205 output.WriteString(Name);
Jon Skeete38294a2015-06-09 19:30:44 +01002206 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01002207 method_.WriteTo(output, _repeated_method_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01002208 if (options_ != null) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002209 output.WriteRawTag(26);
2210 output.WriteMessage(Options);
Jon Skeetf3504cf2015-04-28 14:49:49 +01002211 }
2212 }
2213
Jon Skeete38294a2015-06-09 19:30:44 +01002214 public int CalculateSize() {
2215 int size = 0;
Jon Skeetfb1547b2015-06-12 13:11:54 +01002216 if (Name.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002217 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
Jon Skeetf3504cf2015-04-28 14:49:49 +01002218 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01002219 size += method_.CalculateSize(_repeated_method_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01002220 if (options_ != null) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002221 size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options);
Jon Skeetf3504cf2015-04-28 14:49:49 +01002222 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002223 return size;
2224 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +01002225
Jon Skeete38294a2015-06-09 19:30:44 +01002226 public void MergeFrom(ServiceDescriptorProto other) {
2227 if (other == null) {
2228 return;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002229 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01002230 if (other.Name.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01002231 Name = other.Name;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002232 }
Jon Skeete38294a2015-06-09 19:30:44 +01002233 method_.Add(other.method_);
2234 if (other.options_ != null) {
2235 if (options_ == null) {
Jon Skeet9c888fa2015-07-14 11:13:52 +01002236 options_ = new global::Google.Protobuf.Reflection.ServiceOptions();
Jon Skeetf3504cf2015-04-28 14:49:49 +01002237 }
Jon Skeete38294a2015-06-09 19:30:44 +01002238 Options.MergeFrom(other.Options);
Jon Skeetf3504cf2015-04-28 14:49:49 +01002239 }
Jon Skeete38294a2015-06-09 19:30:44 +01002240 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002241
Jon Skeet96ddf012015-06-12 09:53:12 +01002242 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +01002243 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01002244 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01002245 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +01002246 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01002247 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +01002248 break;
2249 case 10: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01002250 Name = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01002251 break;
2252 }
2253 case 18: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +01002254 method_.AddEntriesFrom(input, _repeated_method_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01002255 break;
2256 }
2257 case 26: {
2258 if (options_ == null) {
Jon Skeet9c888fa2015-07-14 11:13:52 +01002259 options_ = new global::Google.Protobuf.Reflection.ServiceOptions();
Jon Skeete38294a2015-06-09 19:30:44 +01002260 }
2261 input.ReadMessage(options_);
2262 break;
2263 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002264 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002265 }
2266 }
Jon Skeete38294a2015-06-09 19:30:44 +01002267
Jon Skeetf3504cf2015-04-28 14:49:49 +01002268 }
2269
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002270 /// <summary>
2271 /// Describes a method of a service.
2272 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01002273 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +01002274 internal sealed partial class MethodDescriptorProto : pb::IMessage<MethodDescriptorProto> {
Jon Skeete38294a2015-06-09 19:30:44 +01002275 private static readonly pb::MessageParser<MethodDescriptorProto> _parser = new pb::MessageParser<MethodDescriptorProto>(() => new MethodDescriptorProto());
2276 public static pb::MessageParser<MethodDescriptorProto> Parser { get { return _parser; } }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002277
Jon Skeet76940942015-07-14 10:25:40 +01002278 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +01002279 get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[8]; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002280 }
2281
Jon Skeet96cffaa2015-07-20 19:25:07 +01002282 pbr::MessageDescriptor pb::IMessage.Descriptor {
2283 get { return Descriptor; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002284 }
2285
Jon Skeet53508222015-07-01 17:16:55 +01002286 public MethodDescriptorProto() {
2287 OnConstruction();
2288 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01002289
Jon Skeet53508222015-07-01 17:16:55 +01002290 partial void OnConstruction();
2291
2292 public MethodDescriptorProto(MethodDescriptorProto other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01002293 name_ = other.name_;
2294 inputType_ = other.inputType_;
2295 outputType_ = other.outputType_;
2296 Options = other.options_ != null ? other.Options.Clone() : null;
2297 clientStreaming_ = other.clientStreaming_;
2298 serverStreaming_ = other.serverStreaming_;
Jon Skeete38294a2015-06-09 19:30:44 +01002299 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01002300
2301 public MethodDescriptorProto Clone() {
2302 return new MethodDescriptorProto(this);
2303 }
2304
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002305 /// <summary>Field number for the "name" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01002306 public const int NameFieldNumber = 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002307 private string name_ = "";
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002308 public string Name {
Jon Skeetf3504cf2015-04-28 14:49:49 +01002309 get { return name_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002310 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01002311 name_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01002312 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002313 }
2314
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002315 /// <summary>Field number for the "input_type" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01002316 public const int InputTypeFieldNumber = 2;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002317 private string inputType_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002318 /// <summary>
2319 /// Input and output type names. These are resolved in the same way as
2320 /// FieldDescriptorProto.type_name, but must refer to a message type.
2321 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002322 public string InputType {
Jon Skeetf3504cf2015-04-28 14:49:49 +01002323 get { return inputType_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002324 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01002325 inputType_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01002326 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002327 }
2328
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002329 /// <summary>Field number for the "output_type" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01002330 public const int OutputTypeFieldNumber = 3;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002331 private string outputType_ = "";
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002332 public string OutputType {
Jon Skeetf3504cf2015-04-28 14:49:49 +01002333 get { return outputType_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002334 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01002335 outputType_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01002336 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002337 }
2338
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002339 /// <summary>Field number for the "options" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01002340 public const int OptionsFieldNumber = 4;
Jon Skeet9c888fa2015-07-14 11:13:52 +01002341 private global::Google.Protobuf.Reflection.MethodOptions options_;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002342 public global::Google.Protobuf.Reflection.MethodOptions Options {
Jon Skeete38294a2015-06-09 19:30:44 +01002343 get { return options_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002344 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01002345 options_ = value;
2346 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002347 }
2348
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002349 /// <summary>Field number for the "client_streaming" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01002350 public const int ClientStreamingFieldNumber = 5;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002351 private bool clientStreaming_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002352 /// <summary>
2353 /// Identifies if client streams multiple client messages
2354 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002355 public bool ClientStreaming {
Jon Skeetf3504cf2015-04-28 14:49:49 +01002356 get { return clientStreaming_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002357 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01002358 clientStreaming_ = value;
2359 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002360 }
2361
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002362 /// <summary>Field number for the "server_streaming" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01002363 public const int ServerStreamingFieldNumber = 6;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002364 private bool serverStreaming_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002365 /// <summary>
2366 /// Identifies if server streams multiple server messages
2367 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002368 public bool ServerStreaming {
Jon Skeetf3504cf2015-04-28 14:49:49 +01002369 get { return serverStreaming_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002370 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01002371 serverStreaming_ = value;
2372 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002373 }
2374
Jon Skeete38294a2015-06-09 19:30:44 +01002375 public override bool Equals(object other) {
2376 return Equals(other as MethodDescriptorProto);
2377 }
2378
2379 public bool Equals(MethodDescriptorProto other) {
2380 if (ReferenceEquals(other, null)) {
2381 return false;
2382 }
2383 if (ReferenceEquals(other, this)) {
Jon Skeetf3504cf2015-04-28 14:49:49 +01002384 return true;
2385 }
Jon Skeete38294a2015-06-09 19:30:44 +01002386 if (Name != other.Name) return false;
2387 if (InputType != other.InputType) return false;
2388 if (OutputType != other.OutputType) return false;
Jon Skeetbfee2df2015-06-23 16:09:27 +01002389 if (!object.Equals(Options, other.Options)) return false;
2390 if (ClientStreaming != other.ClientStreaming) return false;
Jon Skeete38294a2015-06-09 19:30:44 +01002391 if (ServerStreaming != other.ServerStreaming) return false;
2392 return true;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002393 }
2394
Jon Skeete38294a2015-06-09 19:30:44 +01002395 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +01002396 int hash = 1;
Jon Skeetfb1547b2015-06-12 13:11:54 +01002397 if (Name.Length != 0) hash ^= Name.GetHashCode();
2398 if (InputType.Length != 0) hash ^= InputType.GetHashCode();
2399 if (OutputType.Length != 0) hash ^= OutputType.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +01002400 if (options_ != null) hash ^= Options.GetHashCode();
2401 if (ClientStreaming != false) hash ^= ClientStreaming.GetHashCode();
2402 if (ServerStreaming != false) hash ^= ServerStreaming.GetHashCode();
2403 return hash;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002404 }
2405
Jon Skeet5b9288e2015-07-03 12:45:36 +01002406 public override string ToString() {
2407 return pb::JsonFormatter.Default.Format(this);
2408 }
2409
Jon Skeet96ddf012015-06-12 09:53:12 +01002410 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeetfb1547b2015-06-12 13:11:54 +01002411 if (Name.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002412 output.WriteRawTag(10);
2413 output.WriteString(Name);
Jon Skeete38294a2015-06-09 19:30:44 +01002414 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01002415 if (InputType.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002416 output.WriteRawTag(18);
2417 output.WriteString(InputType);
Jon Skeete38294a2015-06-09 19:30:44 +01002418 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01002419 if (OutputType.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002420 output.WriteRawTag(26);
2421 output.WriteString(OutputType);
Jon Skeete38294a2015-06-09 19:30:44 +01002422 }
2423 if (options_ != null) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002424 output.WriteRawTag(34);
2425 output.WriteMessage(Options);
Jon Skeete38294a2015-06-09 19:30:44 +01002426 }
2427 if (ClientStreaming != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002428 output.WriteRawTag(40);
2429 output.WriteBool(ClientStreaming);
Jon Skeete38294a2015-06-09 19:30:44 +01002430 }
2431 if (ServerStreaming != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002432 output.WriteRawTag(48);
2433 output.WriteBool(ServerStreaming);
Jon Skeetf3504cf2015-04-28 14:49:49 +01002434 }
2435 }
2436
Jon Skeete38294a2015-06-09 19:30:44 +01002437 public int CalculateSize() {
2438 int size = 0;
Jon Skeetfb1547b2015-06-12 13:11:54 +01002439 if (Name.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002440 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
Jon Skeetf3504cf2015-04-28 14:49:49 +01002441 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01002442 if (InputType.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002443 size += 1 + pb::CodedOutputStream.ComputeStringSize(InputType);
Jon Skeetf3504cf2015-04-28 14:49:49 +01002444 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01002445 if (OutputType.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002446 size += 1 + pb::CodedOutputStream.ComputeStringSize(OutputType);
Jon Skeetf3504cf2015-04-28 14:49:49 +01002447 }
Jon Skeete38294a2015-06-09 19:30:44 +01002448 if (options_ != null) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002449 size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options);
Jon Skeetf3504cf2015-04-28 14:49:49 +01002450 }
Jon Skeete38294a2015-06-09 19:30:44 +01002451 if (ClientStreaming != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002452 size += 1 + 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002453 }
Jon Skeete38294a2015-06-09 19:30:44 +01002454 if (ServerStreaming != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002455 size += 1 + 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002456 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002457 return size;
2458 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +01002459
Jon Skeete38294a2015-06-09 19:30:44 +01002460 public void MergeFrom(MethodDescriptorProto other) {
2461 if (other == null) {
2462 return;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002463 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01002464 if (other.Name.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01002465 Name = other.Name;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002466 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01002467 if (other.InputType.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01002468 InputType = other.InputType;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002469 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01002470 if (other.OutputType.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01002471 OutputType = other.OutputType;
2472 }
2473 if (other.options_ != null) {
2474 if (options_ == null) {
Jon Skeet9c888fa2015-07-14 11:13:52 +01002475 options_ = new global::Google.Protobuf.Reflection.MethodOptions();
Jon Skeetf3504cf2015-04-28 14:49:49 +01002476 }
Jon Skeete38294a2015-06-09 19:30:44 +01002477 Options.MergeFrom(other.Options);
Jon Skeetf3504cf2015-04-28 14:49:49 +01002478 }
Jon Skeete38294a2015-06-09 19:30:44 +01002479 if (other.ClientStreaming != false) {
2480 ClientStreaming = other.ClientStreaming;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002481 }
Jon Skeete38294a2015-06-09 19:30:44 +01002482 if (other.ServerStreaming != false) {
2483 ServerStreaming = other.ServerStreaming;
Jon Skeetf3504cf2015-04-28 14:49:49 +01002484 }
Jon Skeete38294a2015-06-09 19:30:44 +01002485 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002486
Jon Skeet96ddf012015-06-12 09:53:12 +01002487 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +01002488 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01002489 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01002490 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +01002491 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01002492 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +01002493 break;
2494 case 10: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01002495 Name = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01002496 break;
2497 }
2498 case 18: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01002499 InputType = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01002500 break;
2501 }
2502 case 26: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01002503 OutputType = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01002504 break;
2505 }
2506 case 34: {
2507 if (options_ == null) {
Jon Skeet9c888fa2015-07-14 11:13:52 +01002508 options_ = new global::Google.Protobuf.Reflection.MethodOptions();
Jon Skeete38294a2015-06-09 19:30:44 +01002509 }
2510 input.ReadMessage(options_);
2511 break;
2512 }
2513 case 40: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01002514 ClientStreaming = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01002515 break;
2516 }
2517 case 48: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01002518 ServerStreaming = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01002519 break;
2520 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002521 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002522 }
2523 }
Jon Skeete38294a2015-06-09 19:30:44 +01002524
Jon Skeetf3504cf2015-04-28 14:49:49 +01002525 }
2526
2527 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +01002528 internal sealed partial class FileOptions : pb::IMessage<FileOptions> {
Jon Skeete38294a2015-06-09 19:30:44 +01002529 private static readonly pb::MessageParser<FileOptions> _parser = new pb::MessageParser<FileOptions>(() => new FileOptions());
2530 public static pb::MessageParser<FileOptions> Parser { get { return _parser; } }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002531
Jon Skeet76940942015-07-14 10:25:40 +01002532 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +01002533 get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[9]; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01002534 }
2535
Jon Skeet96cffaa2015-07-20 19:25:07 +01002536 pbr::MessageDescriptor pb::IMessage.Descriptor {
2537 get { return Descriptor; }
Jon Skeete38294a2015-06-09 19:30:44 +01002538 }
2539
Jon Skeet53508222015-07-01 17:16:55 +01002540 public FileOptions() {
2541 OnConstruction();
2542 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01002543
Jon Skeet53508222015-07-01 17:16:55 +01002544 partial void OnConstruction();
2545
2546 public FileOptions(FileOptions other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01002547 javaPackage_ = other.javaPackage_;
2548 javaOuterClassname_ = other.javaOuterClassname_;
2549 javaMultipleFiles_ = other.javaMultipleFiles_;
2550 javaGenerateEqualsAndHash_ = other.javaGenerateEqualsAndHash_;
2551 javaStringCheckUtf8_ = other.javaStringCheckUtf8_;
2552 optimizeFor_ = other.optimizeFor_;
2553 goPackage_ = other.goPackage_;
2554 ccGenericServices_ = other.ccGenericServices_;
2555 javaGenericServices_ = other.javaGenericServices_;
2556 pyGenericServices_ = other.pyGenericServices_;
2557 deprecated_ = other.deprecated_;
2558 ccEnableArenas_ = other.ccEnableArenas_;
2559 objcClassPrefix_ = other.objcClassPrefix_;
2560 csharpNamespace_ = other.csharpNamespace_;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002561 javananoUseDeprecatedPackage_ = other.javananoUseDeprecatedPackage_;
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01002562 uninterpretedOption_ = other.uninterpretedOption_.Clone();
Jon Skeete38294a2015-06-09 19:30:44 +01002563 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01002564
2565 public FileOptions Clone() {
2566 return new FileOptions(this);
2567 }
2568
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002569 /// <summary>Field number for the "java_package" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01002570 public const int JavaPackageFieldNumber = 1;
2571 private string javaPackage_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002572 /// <summary>
2573 /// Sets the Java package where classes generated from this .proto will be
2574 /// placed. By default, the proto package is used, but this is often
2575 /// inappropriate because proto packages do not normally start with backwards
2576 /// domain names.
2577 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002578 public string JavaPackage {
Jon Skeete38294a2015-06-09 19:30:44 +01002579 get { return javaPackage_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002580 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01002581 javaPackage_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01002582 }
Jon Skeete38294a2015-06-09 19:30:44 +01002583 }
2584
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002585 /// <summary>Field number for the "java_outer_classname" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01002586 public const int JavaOuterClassnameFieldNumber = 8;
2587 private string javaOuterClassname_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002588 /// <summary>
2589 /// If set, all the classes from the .proto file are wrapped in a single
2590 /// outer class with the given name. This applies to both Proto1
2591 /// (equivalent to the old "--one_java_file" option) and Proto2 (where
2592 /// a .proto always translates to a single class, but you may want to
2593 /// explicitly choose the class name).
2594 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002595 public string JavaOuterClassname {
Jon Skeete38294a2015-06-09 19:30:44 +01002596 get { return javaOuterClassname_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002597 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01002598 javaOuterClassname_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01002599 }
Jon Skeete38294a2015-06-09 19:30:44 +01002600 }
2601
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002602 /// <summary>Field number for the "java_multiple_files" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01002603 public const int JavaMultipleFilesFieldNumber = 10;
2604 private bool javaMultipleFiles_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002605 /// <summary>
2606 /// If set true, then the Java code generator will generate a separate .java
2607 /// file for each top-level message, enum, and service defined in the .proto
2608 /// file. Thus, these types will *not* be nested inside the outer class
2609 /// named by java_outer_classname. However, the outer class will still be
2610 /// generated to contain the file's getDescriptor() method as well as any
2611 /// top-level extensions defined in the file.
2612 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002613 public bool JavaMultipleFiles {
Jon Skeete38294a2015-06-09 19:30:44 +01002614 get { return javaMultipleFiles_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002615 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01002616 javaMultipleFiles_ = value;
2617 }
Jon Skeete38294a2015-06-09 19:30:44 +01002618 }
2619
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002620 /// <summary>Field number for the "java_generate_equals_and_hash" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01002621 public const int JavaGenerateEqualsAndHashFieldNumber = 20;
2622 private bool javaGenerateEqualsAndHash_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002623 /// <summary>
2624 /// If set true, then the Java code generator will generate equals() and
2625 /// hashCode() methods for all messages defined in the .proto file.
2626 /// This increases generated code size, potentially substantially for large
2627 /// protos, which may harm a memory-constrained application.
2628 /// - In the full runtime this is a speed optimization, as the
2629 /// AbstractMessage base class includes reflection-based implementations of
2630 /// these methods.
2631 /// - In the lite runtime, setting this option changes the semantics of
2632 /// equals() and hashCode() to more closely match those of the full runtime;
2633 /// the generated methods compute their results based on field values rather
2634 /// than object identity. (Implementations should not assume that hashcodes
2635 /// will be consistent across runtimes or versions of the protocol compiler.)
2636 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002637 public bool JavaGenerateEqualsAndHash {
Jon Skeete38294a2015-06-09 19:30:44 +01002638 get { return javaGenerateEqualsAndHash_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002639 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01002640 javaGenerateEqualsAndHash_ = value;
2641 }
Jon Skeete38294a2015-06-09 19:30:44 +01002642 }
2643
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002644 /// <summary>Field number for the "java_string_check_utf8" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01002645 public const int JavaStringCheckUtf8FieldNumber = 27;
2646 private bool javaStringCheckUtf8_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002647 /// <summary>
2648 /// If set true, then the Java2 code generator will generate code that
2649 /// throws an exception whenever an attempt is made to assign a non-UTF-8
2650 /// byte sequence to a string field.
2651 /// Message reflection will do the same.
2652 /// However, an extension field still accepts non-UTF-8 byte sequences.
2653 /// This option has no effect on when used with the lite runtime.
2654 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002655 public bool JavaStringCheckUtf8 {
Jon Skeete38294a2015-06-09 19:30:44 +01002656 get { return javaStringCheckUtf8_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002657 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01002658 javaStringCheckUtf8_ = value;
2659 }
Jon Skeete38294a2015-06-09 19:30:44 +01002660 }
2661
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002662 /// <summary>Field number for the "optimize_for" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01002663 public const int OptimizeForFieldNumber = 9;
Jon Skeet9c888fa2015-07-14 11:13:52 +01002664 private global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode optimizeFor_ = global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode.SPEED;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002665 public global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode OptimizeFor {
Jon Skeete38294a2015-06-09 19:30:44 +01002666 get { return optimizeFor_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002667 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01002668 optimizeFor_ = value;
2669 }
Jon Skeete38294a2015-06-09 19:30:44 +01002670 }
2671
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002672 /// <summary>Field number for the "go_package" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01002673 public const int GoPackageFieldNumber = 11;
2674 private string goPackage_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002675 /// <summary>
2676 /// Sets the Go package where structs generated from this .proto will be
2677 /// placed. If omitted, the Go package will be derived from the following:
2678 /// - The basename of the package import path, if provided.
2679 /// - Otherwise, the package statement in the .proto file, if present.
2680 /// - Otherwise, the basename of the .proto file, without extension.
2681 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002682 public string GoPackage {
Jon Skeete38294a2015-06-09 19:30:44 +01002683 get { return goPackage_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002684 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01002685 goPackage_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01002686 }
Jon Skeete38294a2015-06-09 19:30:44 +01002687 }
2688
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002689 /// <summary>Field number for the "cc_generic_services" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01002690 public const int CcGenericServicesFieldNumber = 16;
2691 private bool ccGenericServices_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002692 /// <summary>
2693 /// Should generic services be generated in each language? "Generic" services
2694 /// are not specific to any particular RPC system. They are generated by the
2695 /// main code generators in each language (without additional plugins).
2696 /// Generic services were the only kind of service generation supported by
2697 /// early versions of google.protobuf.
Jon Skeetcff900e2015-11-06 18:38:31 +00002698 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002699 /// Generic services are now considered deprecated in favor of using plugins
2700 /// that generate code specific to your particular RPC system. Therefore,
2701 /// these default to false. Old code which depends on generic services should
2702 /// explicitly set them to true.
2703 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002704 public bool CcGenericServices {
Jon Skeete38294a2015-06-09 19:30:44 +01002705 get { return ccGenericServices_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002706 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01002707 ccGenericServices_ = value;
2708 }
Jon Skeete38294a2015-06-09 19:30:44 +01002709 }
2710
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002711 /// <summary>Field number for the "java_generic_services" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01002712 public const int JavaGenericServicesFieldNumber = 17;
2713 private bool javaGenericServices_;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002714 public bool JavaGenericServices {
Jon Skeete38294a2015-06-09 19:30:44 +01002715 get { return javaGenericServices_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002716 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01002717 javaGenericServices_ = value;
2718 }
Jon Skeete38294a2015-06-09 19:30:44 +01002719 }
2720
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002721 /// <summary>Field number for the "py_generic_services" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01002722 public const int PyGenericServicesFieldNumber = 18;
2723 private bool pyGenericServices_;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002724 public bool PyGenericServices {
Jon Skeete38294a2015-06-09 19:30:44 +01002725 get { return pyGenericServices_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002726 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01002727 pyGenericServices_ = value;
2728 }
Jon Skeete38294a2015-06-09 19:30:44 +01002729 }
2730
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002731 /// <summary>Field number for the "deprecated" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01002732 public const int DeprecatedFieldNumber = 23;
2733 private bool deprecated_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002734 /// <summary>
2735 /// Is this file deprecated?
2736 /// Depending on the target platform, this can emit Deprecated annotations
2737 /// for everything in the file, or it will be completely ignored; in the very
2738 /// least, this is a formalization for deprecating files.
2739 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002740 public bool Deprecated {
Jon Skeete38294a2015-06-09 19:30:44 +01002741 get { return deprecated_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002742 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01002743 deprecated_ = value;
2744 }
Jon Skeete38294a2015-06-09 19:30:44 +01002745 }
2746
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002747 /// <summary>Field number for the "cc_enable_arenas" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01002748 public const int CcEnableArenasFieldNumber = 31;
2749 private bool ccEnableArenas_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002750 /// <summary>
2751 /// Enables the use of arenas for the proto messages in this file. This applies
2752 /// only to generated classes for C++.
2753 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002754 public bool CcEnableArenas {
Jon Skeete38294a2015-06-09 19:30:44 +01002755 get { return ccEnableArenas_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002756 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01002757 ccEnableArenas_ = value;
2758 }
Jon Skeete38294a2015-06-09 19:30:44 +01002759 }
2760
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002761 /// <summary>Field number for the "objc_class_prefix" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01002762 public const int ObjcClassPrefixFieldNumber = 36;
2763 private string objcClassPrefix_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002764 /// <summary>
2765 /// Sets the objective c class prefix which is prepended to all objective c
2766 /// generated classes from this .proto. There is no default.
2767 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002768 public string ObjcClassPrefix {
Jon Skeete38294a2015-06-09 19:30:44 +01002769 get { return objcClassPrefix_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002770 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01002771 objcClassPrefix_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01002772 }
Jon Skeete38294a2015-06-09 19:30:44 +01002773 }
2774
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002775 /// <summary>Field number for the "csharp_namespace" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01002776 public const int CsharpNamespaceFieldNumber = 37;
2777 private string csharpNamespace_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002778 /// <summary>
2779 /// Namespace for generated classes; defaults to the package.
2780 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002781 public string CsharpNamespace {
Jon Skeete38294a2015-06-09 19:30:44 +01002782 get { return csharpNamespace_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01002783 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01002784 csharpNamespace_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01002785 }
Jon Skeete38294a2015-06-09 19:30:44 +01002786 }
2787
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002788 /// <summary>Field number for the "javanano_use_deprecated_package" field.</summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002789 public const int JavananoUseDeprecatedPackageFieldNumber = 38;
2790 private bool javananoUseDeprecatedPackage_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002791 /// <summary>
2792 /// Whether the nano proto compiler should generate in the deprecated non-nano
2793 /// suffixed package.
2794 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002795 public bool JavananoUseDeprecatedPackage {
2796 get { return javananoUseDeprecatedPackage_; }
2797 set {
2798 javananoUseDeprecatedPackage_ = value;
2799 }
2800 }
2801
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002802 /// <summary>Field number for the "uninterpreted_option" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01002803 public const int UninterpretedOptionFieldNumber = 999;
Jon Skeet9c888fa2015-07-14 11:13:52 +01002804 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.UninterpretedOption> _repeated_uninterpretedOption_codec
2805 = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser);
2806 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> uninterpretedOption_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +01002807 /// <summary>
2808 /// The parser stores options it doesn't recognize here. See above.
2809 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002810 public pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> UninterpretedOption {
Jon Skeete38294a2015-06-09 19:30:44 +01002811 get { return uninterpretedOption_; }
2812 }
2813
2814 public override bool Equals(object other) {
2815 return Equals(other as FileOptions);
2816 }
2817
2818 public bool Equals(FileOptions other) {
2819 if (ReferenceEquals(other, null)) {
2820 return false;
2821 }
2822 if (ReferenceEquals(other, this)) {
2823 return true;
2824 }
2825 if (JavaPackage != other.JavaPackage) return false;
2826 if (JavaOuterClassname != other.JavaOuterClassname) return false;
2827 if (JavaMultipleFiles != other.JavaMultipleFiles) return false;
2828 if (JavaGenerateEqualsAndHash != other.JavaGenerateEqualsAndHash) return false;
2829 if (JavaStringCheckUtf8 != other.JavaStringCheckUtf8) return false;
2830 if (OptimizeFor != other.OptimizeFor) return false;
2831 if (GoPackage != other.GoPackage) return false;
2832 if (CcGenericServices != other.CcGenericServices) return false;
2833 if (JavaGenericServices != other.JavaGenericServices) return false;
2834 if (PyGenericServices != other.PyGenericServices) return false;
2835 if (Deprecated != other.Deprecated) return false;
2836 if (CcEnableArenas != other.CcEnableArenas) return false;
2837 if (ObjcClassPrefix != other.ObjcClassPrefix) return false;
2838 if (CsharpNamespace != other.CsharpNamespace) return false;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002839 if (JavananoUseDeprecatedPackage != other.JavananoUseDeprecatedPackage) return false;
Jon Skeete38294a2015-06-09 19:30:44 +01002840 if(!uninterpretedOption_.Equals(other.uninterpretedOption_)) return false;
2841 return true;
2842 }
2843
2844 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +01002845 int hash = 1;
Jon Skeetfb1547b2015-06-12 13:11:54 +01002846 if (JavaPackage.Length != 0) hash ^= JavaPackage.GetHashCode();
2847 if (JavaOuterClassname.Length != 0) hash ^= JavaOuterClassname.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +01002848 if (JavaMultipleFiles != false) hash ^= JavaMultipleFiles.GetHashCode();
2849 if (JavaGenerateEqualsAndHash != false) hash ^= JavaGenerateEqualsAndHash.GetHashCode();
2850 if (JavaStringCheckUtf8 != false) hash ^= JavaStringCheckUtf8.GetHashCode();
Jon Skeet9c888fa2015-07-14 11:13:52 +01002851 if (OptimizeFor != global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode.SPEED) hash ^= OptimizeFor.GetHashCode();
Jon Skeetfb1547b2015-06-12 13:11:54 +01002852 if (GoPackage.Length != 0) hash ^= GoPackage.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +01002853 if (CcGenericServices != false) hash ^= CcGenericServices.GetHashCode();
2854 if (JavaGenericServices != false) hash ^= JavaGenericServices.GetHashCode();
2855 if (PyGenericServices != false) hash ^= PyGenericServices.GetHashCode();
2856 if (Deprecated != false) hash ^= Deprecated.GetHashCode();
2857 if (CcEnableArenas != false) hash ^= CcEnableArenas.GetHashCode();
Jon Skeetfb1547b2015-06-12 13:11:54 +01002858 if (ObjcClassPrefix.Length != 0) hash ^= ObjcClassPrefix.GetHashCode();
2859 if (CsharpNamespace.Length != 0) hash ^= CsharpNamespace.GetHashCode();
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002860 if (JavananoUseDeprecatedPackage != false) hash ^= JavananoUseDeprecatedPackage.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +01002861 hash ^= uninterpretedOption_.GetHashCode();
2862 return hash;
2863 }
2864
Jon Skeet5b9288e2015-07-03 12:45:36 +01002865 public override string ToString() {
2866 return pb::JsonFormatter.Default.Format(this);
2867 }
2868
Jon Skeet96ddf012015-06-12 09:53:12 +01002869 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeetfb1547b2015-06-12 13:11:54 +01002870 if (JavaPackage.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002871 output.WriteRawTag(10);
2872 output.WriteString(JavaPackage);
Jon Skeete38294a2015-06-09 19:30:44 +01002873 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01002874 if (JavaOuterClassname.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002875 output.WriteRawTag(66);
2876 output.WriteString(JavaOuterClassname);
Jon Skeete38294a2015-06-09 19:30:44 +01002877 }
Jon Skeet9c888fa2015-07-14 11:13:52 +01002878 if (OptimizeFor != global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode.SPEED) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002879 output.WriteRawTag(72);
2880 output.WriteEnum((int) OptimizeFor);
Jon Skeete38294a2015-06-09 19:30:44 +01002881 }
2882 if (JavaMultipleFiles != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002883 output.WriteRawTag(80);
2884 output.WriteBool(JavaMultipleFiles);
Jon Skeete38294a2015-06-09 19:30:44 +01002885 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01002886 if (GoPackage.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002887 output.WriteRawTag(90);
2888 output.WriteString(GoPackage);
Jon Skeete38294a2015-06-09 19:30:44 +01002889 }
2890 if (CcGenericServices != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002891 output.WriteRawTag(128, 1);
2892 output.WriteBool(CcGenericServices);
Jon Skeete38294a2015-06-09 19:30:44 +01002893 }
2894 if (JavaGenericServices != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002895 output.WriteRawTag(136, 1);
2896 output.WriteBool(JavaGenericServices);
Jon Skeete38294a2015-06-09 19:30:44 +01002897 }
2898 if (PyGenericServices != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002899 output.WriteRawTag(144, 1);
2900 output.WriteBool(PyGenericServices);
Jon Skeete38294a2015-06-09 19:30:44 +01002901 }
2902 if (JavaGenerateEqualsAndHash != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002903 output.WriteRawTag(160, 1);
2904 output.WriteBool(JavaGenerateEqualsAndHash);
Jon Skeete38294a2015-06-09 19:30:44 +01002905 }
2906 if (Deprecated != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002907 output.WriteRawTag(184, 1);
2908 output.WriteBool(Deprecated);
Jon Skeete38294a2015-06-09 19:30:44 +01002909 }
2910 if (JavaStringCheckUtf8 != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002911 output.WriteRawTag(216, 1);
2912 output.WriteBool(JavaStringCheckUtf8);
Jon Skeete38294a2015-06-09 19:30:44 +01002913 }
2914 if (CcEnableArenas != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002915 output.WriteRawTag(248, 1);
2916 output.WriteBool(CcEnableArenas);
Jon Skeete38294a2015-06-09 19:30:44 +01002917 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01002918 if (ObjcClassPrefix.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002919 output.WriteRawTag(162, 2);
2920 output.WriteString(ObjcClassPrefix);
Jon Skeete38294a2015-06-09 19:30:44 +01002921 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01002922 if (CsharpNamespace.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002923 output.WriteRawTag(170, 2);
2924 output.WriteString(CsharpNamespace);
Jon Skeete38294a2015-06-09 19:30:44 +01002925 }
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002926 if (JavananoUseDeprecatedPackage != false) {
2927 output.WriteRawTag(176, 2);
2928 output.WriteBool(JavananoUseDeprecatedPackage);
2929 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01002930 uninterpretedOption_.WriteTo(output, _repeated_uninterpretedOption_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01002931 }
2932
2933 public int CalculateSize() {
2934 int size = 0;
Jon Skeetfb1547b2015-06-12 13:11:54 +01002935 if (JavaPackage.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002936 size += 1 + pb::CodedOutputStream.ComputeStringSize(JavaPackage);
Jon Skeete38294a2015-06-09 19:30:44 +01002937 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01002938 if (JavaOuterClassname.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002939 size += 1 + pb::CodedOutputStream.ComputeStringSize(JavaOuterClassname);
Jon Skeete38294a2015-06-09 19:30:44 +01002940 }
2941 if (JavaMultipleFiles != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002942 size += 1 + 1;
Jon Skeete38294a2015-06-09 19:30:44 +01002943 }
2944 if (JavaGenerateEqualsAndHash != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002945 size += 2 + 1;
Jon Skeete38294a2015-06-09 19:30:44 +01002946 }
2947 if (JavaStringCheckUtf8 != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002948 size += 2 + 1;
Jon Skeete38294a2015-06-09 19:30:44 +01002949 }
Jon Skeet9c888fa2015-07-14 11:13:52 +01002950 if (OptimizeFor != global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode.SPEED) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002951 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) OptimizeFor);
Jon Skeete38294a2015-06-09 19:30:44 +01002952 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01002953 if (GoPackage.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002954 size += 1 + pb::CodedOutputStream.ComputeStringSize(GoPackage);
Jon Skeete38294a2015-06-09 19:30:44 +01002955 }
2956 if (CcGenericServices != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002957 size += 2 + 1;
Jon Skeete38294a2015-06-09 19:30:44 +01002958 }
2959 if (JavaGenericServices != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002960 size += 2 + 1;
Jon Skeete38294a2015-06-09 19:30:44 +01002961 }
2962 if (PyGenericServices != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002963 size += 2 + 1;
Jon Skeete38294a2015-06-09 19:30:44 +01002964 }
2965 if (Deprecated != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002966 size += 2 + 1;
Jon Skeete38294a2015-06-09 19:30:44 +01002967 }
2968 if (CcEnableArenas != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002969 size += 2 + 1;
Jon Skeete38294a2015-06-09 19:30:44 +01002970 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01002971 if (ObjcClassPrefix.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002972 size += 2 + pb::CodedOutputStream.ComputeStringSize(ObjcClassPrefix);
Jon Skeete38294a2015-06-09 19:30:44 +01002973 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01002974 if (CsharpNamespace.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01002975 size += 2 + pb::CodedOutputStream.ComputeStringSize(CsharpNamespace);
Jon Skeete38294a2015-06-09 19:30:44 +01002976 }
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07002977 if (JavananoUseDeprecatedPackage != false) {
2978 size += 2 + 1;
2979 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01002980 size += uninterpretedOption_.CalculateSize(_repeated_uninterpretedOption_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01002981 return size;
2982 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +01002983
Jon Skeete38294a2015-06-09 19:30:44 +01002984 public void MergeFrom(FileOptions other) {
2985 if (other == null) {
2986 return;
2987 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01002988 if (other.JavaPackage.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01002989 JavaPackage = other.JavaPackage;
2990 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01002991 if (other.JavaOuterClassname.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01002992 JavaOuterClassname = other.JavaOuterClassname;
2993 }
2994 if (other.JavaMultipleFiles != false) {
2995 JavaMultipleFiles = other.JavaMultipleFiles;
2996 }
2997 if (other.JavaGenerateEqualsAndHash != false) {
2998 JavaGenerateEqualsAndHash = other.JavaGenerateEqualsAndHash;
2999 }
3000 if (other.JavaStringCheckUtf8 != false) {
3001 JavaStringCheckUtf8 = other.JavaStringCheckUtf8;
3002 }
Jon Skeet9c888fa2015-07-14 11:13:52 +01003003 if (other.OptimizeFor != global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode.SPEED) {
Jon Skeete38294a2015-06-09 19:30:44 +01003004 OptimizeFor = other.OptimizeFor;
3005 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01003006 if (other.GoPackage.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01003007 GoPackage = other.GoPackage;
3008 }
3009 if (other.CcGenericServices != false) {
3010 CcGenericServices = other.CcGenericServices;
3011 }
3012 if (other.JavaGenericServices != false) {
3013 JavaGenericServices = other.JavaGenericServices;
3014 }
3015 if (other.PyGenericServices != false) {
3016 PyGenericServices = other.PyGenericServices;
3017 }
3018 if (other.Deprecated != false) {
3019 Deprecated = other.Deprecated;
3020 }
3021 if (other.CcEnableArenas != false) {
3022 CcEnableArenas = other.CcEnableArenas;
3023 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01003024 if (other.ObjcClassPrefix.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01003025 ObjcClassPrefix = other.ObjcClassPrefix;
3026 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01003027 if (other.CsharpNamespace.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01003028 CsharpNamespace = other.CsharpNamespace;
3029 }
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07003030 if (other.JavananoUseDeprecatedPackage != false) {
3031 JavananoUseDeprecatedPackage = other.JavananoUseDeprecatedPackage;
3032 }
Jon Skeete38294a2015-06-09 19:30:44 +01003033 uninterpretedOption_.Add(other.uninterpretedOption_);
3034 }
3035
Jon Skeet96ddf012015-06-12 09:53:12 +01003036 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +01003037 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01003038 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01003039 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +01003040 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01003041 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +01003042 break;
3043 case 10: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003044 JavaPackage = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01003045 break;
3046 }
3047 case 66: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003048 JavaOuterClassname = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01003049 break;
3050 }
3051 case 72: {
Jon Skeet9c888fa2015-07-14 11:13:52 +01003052 optimizeFor_ = (global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode) input.ReadEnum();
Jon Skeet96ddf012015-06-12 09:53:12 +01003053 break;
Jon Skeete38294a2015-06-09 19:30:44 +01003054 }
3055 case 80: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003056 JavaMultipleFiles = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01003057 break;
3058 }
3059 case 90: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003060 GoPackage = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01003061 break;
3062 }
3063 case 128: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003064 CcGenericServices = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01003065 break;
3066 }
3067 case 136: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003068 JavaGenericServices = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01003069 break;
3070 }
3071 case 144: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003072 PyGenericServices = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01003073 break;
3074 }
3075 case 160: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003076 JavaGenerateEqualsAndHash = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01003077 break;
3078 }
3079 case 184: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003080 Deprecated = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01003081 break;
3082 }
3083 case 216: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003084 JavaStringCheckUtf8 = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01003085 break;
3086 }
3087 case 248: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003088 CcEnableArenas = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01003089 break;
3090 }
3091 case 290: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003092 ObjcClassPrefix = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01003093 break;
3094 }
3095 case 298: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003096 CsharpNamespace = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01003097 break;
3098 }
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07003099 case 304: {
3100 JavananoUseDeprecatedPackage = input.ReadBool();
3101 break;
3102 }
Jon Skeete38294a2015-06-09 19:30:44 +01003103 case 7994: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +01003104 uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01003105 break;
3106 }
3107 }
3108 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003109 }
3110
3111 #region Nested types
Jon Skeetb0888a42015-09-29 13:37:30 +01003112 /// <summary>Container for nested types declared in the FileOptions message type.</summary>
Jon Skeete2c82302015-09-29 14:34:31 +01003113 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeetf3504cf2015-04-28 14:49:49 +01003114 public static partial class Types {
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003115 /// <summary>
3116 /// Generated classes can be optimized for speed or code size.
3117 /// </summary>
Jon Skeet53508222015-07-01 17:16:55 +01003118 internal enum OptimizeMode {
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003119 /// <summary>
3120 /// Generate complete code for parsing, serialization,
3121 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01003122 SPEED = 1,
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003123 /// <summary>
3124 /// etc.
3125 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01003126 CODE_SIZE = 2,
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003127 /// <summary>
3128 /// Generate code using MessageLite and the lite runtime.
3129 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01003130 LITE_RUNTIME = 3,
3131 }
3132
3133 }
3134 #endregion
3135
Jon Skeetf3504cf2015-04-28 14:49:49 +01003136 }
3137
3138 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +01003139 internal sealed partial class MessageOptions : pb::IMessage<MessageOptions> {
Jon Skeete38294a2015-06-09 19:30:44 +01003140 private static readonly pb::MessageParser<MessageOptions> _parser = new pb::MessageParser<MessageOptions>(() => new MessageOptions());
3141 public static pb::MessageParser<MessageOptions> Parser { get { return _parser; } }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003142
Jon Skeet76940942015-07-14 10:25:40 +01003143 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +01003144 get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[10]; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003145 }
3146
Jon Skeet96cffaa2015-07-20 19:25:07 +01003147 pbr::MessageDescriptor pb::IMessage.Descriptor {
3148 get { return Descriptor; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003149 }
3150
Jon Skeet53508222015-07-01 17:16:55 +01003151 public MessageOptions() {
3152 OnConstruction();
3153 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01003154
Jon Skeet53508222015-07-01 17:16:55 +01003155 partial void OnConstruction();
3156
3157 public MessageOptions(MessageOptions other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01003158 messageSetWireFormat_ = other.messageSetWireFormat_;
3159 noStandardDescriptorAccessor_ = other.noStandardDescriptorAccessor_;
3160 deprecated_ = other.deprecated_;
3161 mapEntry_ = other.mapEntry_;
3162 uninterpretedOption_ = other.uninterpretedOption_.Clone();
Jon Skeete38294a2015-06-09 19:30:44 +01003163 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01003164
3165 public MessageOptions Clone() {
3166 return new MessageOptions(this);
3167 }
3168
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003169 /// <summary>Field number for the "message_set_wire_format" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01003170 public const int MessageSetWireFormatFieldNumber = 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01003171 private bool messageSetWireFormat_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003172 /// <summary>
3173 /// Set true to use the old proto1 MessageSet wire format for extensions.
3174 /// This is provided for backwards-compatibility with the MessageSet wire
3175 /// format. You should not use this for any other reason: It's less
3176 /// efficient, has fewer features, and is more complicated.
Jon Skeetcff900e2015-11-06 18:38:31 +00003177 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003178 /// The message must be defined exactly as follows:
3179 /// message Foo {
3180 /// option message_set_wire_format = true;
3181 /// extensions 4 to max;
3182 /// }
3183 /// Note that the message cannot have any defined fields; MessageSets only
3184 /// have extensions.
Jon Skeetcff900e2015-11-06 18:38:31 +00003185 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003186 /// All extensions of your type must be singular messages; e.g. they cannot
3187 /// be int32s, enums, or repeated messages.
Jon Skeetcff900e2015-11-06 18:38:31 +00003188 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003189 /// Because this is an option, the above two restrictions are not enforced by
3190 /// the protocol compiler.
3191 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07003192 public bool MessageSetWireFormat {
Jon Skeetf3504cf2015-04-28 14:49:49 +01003193 get { return messageSetWireFormat_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01003194 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01003195 messageSetWireFormat_ = value;
3196 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003197 }
3198
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003199 /// <summary>Field number for the "no_standard_descriptor_accessor" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01003200 public const int NoStandardDescriptorAccessorFieldNumber = 2;
Jon Skeetf3504cf2015-04-28 14:49:49 +01003201 private bool noStandardDescriptorAccessor_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003202 /// <summary>
3203 /// Disables the generation of the standard "descriptor()" accessor, which can
3204 /// conflict with a field of the same name. This is meant to make migration
3205 /// from proto1 easier; new code should avoid fields named "descriptor".
3206 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07003207 public bool NoStandardDescriptorAccessor {
Jon Skeetf3504cf2015-04-28 14:49:49 +01003208 get { return noStandardDescriptorAccessor_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01003209 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01003210 noStandardDescriptorAccessor_ = value;
3211 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003212 }
3213
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003214 /// <summary>Field number for the "deprecated" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01003215 public const int DeprecatedFieldNumber = 3;
Jon Skeetf3504cf2015-04-28 14:49:49 +01003216 private bool deprecated_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003217 /// <summary>
3218 /// Is this message deprecated?
3219 /// Depending on the target platform, this can emit Deprecated annotations
3220 /// for the message, or it will be completely ignored; in the very least,
3221 /// this is a formalization for deprecating messages.
3222 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07003223 public bool Deprecated {
Jon Skeetf3504cf2015-04-28 14:49:49 +01003224 get { return deprecated_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01003225 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01003226 deprecated_ = value;
3227 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003228 }
3229
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003230 /// <summary>Field number for the "map_entry" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01003231 public const int MapEntryFieldNumber = 7;
Jon Skeetf3504cf2015-04-28 14:49:49 +01003232 private bool mapEntry_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003233 /// <summary>
3234 /// Whether the message is an automatically generated map entry type for the
3235 /// maps field.
Jon Skeetcff900e2015-11-06 18:38:31 +00003236 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003237 /// For maps fields:
3238 /// map&lt;KeyType, ValueType> map_field = 1;
3239 /// The parsed descriptor looks like:
3240 /// message MapFieldEntry {
3241 /// option map_entry = true;
3242 /// optional KeyType key = 1;
3243 /// optional ValueType value = 2;
3244 /// }
3245 /// repeated MapFieldEntry map_field = 1;
Jon Skeetcff900e2015-11-06 18:38:31 +00003246 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003247 /// Implementations may choose not to generate the map_entry=true message, but
3248 /// use a native map in the target language to hold the keys and values.
3249 /// The reflection APIs in such implementions still need to work as
3250 /// if the field is a repeated message field.
Jon Skeetcff900e2015-11-06 18:38:31 +00003251 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003252 /// NOTE: Do not set the option in .proto files. Always use the maps syntax
3253 /// instead. The option should only be implicitly set by the proto compiler
3254 /// parser.
3255 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07003256 public bool MapEntry {
Jon Skeetf3504cf2015-04-28 14:49:49 +01003257 get { return mapEntry_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01003258 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01003259 mapEntry_ = value;
3260 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003261 }
3262
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003263 /// <summary>Field number for the "uninterpreted_option" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01003264 public const int UninterpretedOptionFieldNumber = 999;
Jon Skeet9c888fa2015-07-14 11:13:52 +01003265 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.UninterpretedOption> _repeated_uninterpretedOption_codec
3266 = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser);
3267 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> uninterpretedOption_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003268 /// <summary>
3269 /// The parser stores options it doesn't recognize here. See above.
3270 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07003271 public pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> UninterpretedOption {
Jon Skeetf3504cf2015-04-28 14:49:49 +01003272 get { return uninterpretedOption_; }
3273 }
Jon Skeete38294a2015-06-09 19:30:44 +01003274
3275 public override bool Equals(object other) {
3276 return Equals(other as MessageOptions);
Jon Skeetf3504cf2015-04-28 14:49:49 +01003277 }
3278
Jon Skeete38294a2015-06-09 19:30:44 +01003279 public bool Equals(MessageOptions other) {
3280 if (ReferenceEquals(other, null)) {
3281 return false;
3282 }
3283 if (ReferenceEquals(other, this)) {
Jon Skeetf3504cf2015-04-28 14:49:49 +01003284 return true;
3285 }
Jon Skeete38294a2015-06-09 19:30:44 +01003286 if (MessageSetWireFormat != other.MessageSetWireFormat) return false;
3287 if (NoStandardDescriptorAccessor != other.NoStandardDescriptorAccessor) return false;
3288 if (Deprecated != other.Deprecated) return false;
3289 if (MapEntry != other.MapEntry) return false;
3290 if(!uninterpretedOption_.Equals(other.uninterpretedOption_)) return false;
3291 return true;
Jon Skeetf3504cf2015-04-28 14:49:49 +01003292 }
3293
Jon Skeete38294a2015-06-09 19:30:44 +01003294 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +01003295 int hash = 1;
Jon Skeete38294a2015-06-09 19:30:44 +01003296 if (MessageSetWireFormat != false) hash ^= MessageSetWireFormat.GetHashCode();
3297 if (NoStandardDescriptorAccessor != false) hash ^= NoStandardDescriptorAccessor.GetHashCode();
3298 if (Deprecated != false) hash ^= Deprecated.GetHashCode();
3299 if (MapEntry != false) hash ^= MapEntry.GetHashCode();
3300 hash ^= uninterpretedOption_.GetHashCode();
3301 return hash;
Jon Skeetf3504cf2015-04-28 14:49:49 +01003302 }
3303
Jon Skeet5b9288e2015-07-03 12:45:36 +01003304 public override string ToString() {
3305 return pb::JsonFormatter.Default.Format(this);
3306 }
3307
Jon Skeet96ddf012015-06-12 09:53:12 +01003308 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeete38294a2015-06-09 19:30:44 +01003309 if (MessageSetWireFormat != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003310 output.WriteRawTag(8);
3311 output.WriteBool(MessageSetWireFormat);
Jon Skeetf3504cf2015-04-28 14:49:49 +01003312 }
Jon Skeete38294a2015-06-09 19:30:44 +01003313 if (NoStandardDescriptorAccessor != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003314 output.WriteRawTag(16);
3315 output.WriteBool(NoStandardDescriptorAccessor);
Jon Skeete38294a2015-06-09 19:30:44 +01003316 }
3317 if (Deprecated != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003318 output.WriteRawTag(24);
3319 output.WriteBool(Deprecated);
Jon Skeete38294a2015-06-09 19:30:44 +01003320 }
3321 if (MapEntry != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003322 output.WriteRawTag(56);
3323 output.WriteBool(MapEntry);
Jon Skeete38294a2015-06-09 19:30:44 +01003324 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01003325 uninterpretedOption_.WriteTo(output, _repeated_uninterpretedOption_codec);
Jon Skeetf3504cf2015-04-28 14:49:49 +01003326 }
3327
Jon Skeete38294a2015-06-09 19:30:44 +01003328 public int CalculateSize() {
3329 int size = 0;
3330 if (MessageSetWireFormat != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003331 size += 1 + 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01003332 }
Jon Skeete38294a2015-06-09 19:30:44 +01003333 if (NoStandardDescriptorAccessor != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003334 size += 1 + 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01003335 }
Jon Skeete38294a2015-06-09 19:30:44 +01003336 if (Deprecated != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003337 size += 1 + 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01003338 }
Jon Skeete38294a2015-06-09 19:30:44 +01003339 if (MapEntry != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003340 size += 1 + 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01003341 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01003342 size += uninterpretedOption_.CalculateSize(_repeated_uninterpretedOption_codec);
Jon Skeetf3504cf2015-04-28 14:49:49 +01003343 return size;
3344 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +01003345
Jon Skeete38294a2015-06-09 19:30:44 +01003346 public void MergeFrom(MessageOptions other) {
3347 if (other == null) {
3348 return;
3349 }
3350 if (other.MessageSetWireFormat != false) {
3351 MessageSetWireFormat = other.MessageSetWireFormat;
3352 }
3353 if (other.NoStandardDescriptorAccessor != false) {
3354 NoStandardDescriptorAccessor = other.NoStandardDescriptorAccessor;
3355 }
3356 if (other.Deprecated != false) {
3357 Deprecated = other.Deprecated;
3358 }
3359 if (other.MapEntry != false) {
3360 MapEntry = other.MapEntry;
3361 }
3362 uninterpretedOption_.Add(other.uninterpretedOption_);
Jon Skeetf3504cf2015-04-28 14:49:49 +01003363 }
3364
Jon Skeet96ddf012015-06-12 09:53:12 +01003365 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +01003366 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01003367 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01003368 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +01003369 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01003370 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +01003371 break;
3372 case 8: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003373 MessageSetWireFormat = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01003374 break;
3375 }
3376 case 16: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003377 NoStandardDescriptorAccessor = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01003378 break;
3379 }
3380 case 24: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003381 Deprecated = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01003382 break;
3383 }
3384 case 56: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003385 MapEntry = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01003386 break;
3387 }
3388 case 7994: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +01003389 uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01003390 break;
3391 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003392 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003393 }
3394 }
Jon Skeete38294a2015-06-09 19:30:44 +01003395
Jon Skeetf3504cf2015-04-28 14:49:49 +01003396 }
3397
3398 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +01003399 internal sealed partial class FieldOptions : pb::IMessage<FieldOptions> {
Jon Skeete38294a2015-06-09 19:30:44 +01003400 private static readonly pb::MessageParser<FieldOptions> _parser = new pb::MessageParser<FieldOptions>(() => new FieldOptions());
3401 public static pb::MessageParser<FieldOptions> Parser { get { return _parser; } }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003402
Jon Skeet76940942015-07-14 10:25:40 +01003403 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +01003404 get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[11]; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003405 }
3406
Jon Skeet96cffaa2015-07-20 19:25:07 +01003407 pbr::MessageDescriptor pb::IMessage.Descriptor {
3408 get { return Descriptor; }
Jon Skeete38294a2015-06-09 19:30:44 +01003409 }
3410
Jon Skeet53508222015-07-01 17:16:55 +01003411 public FieldOptions() {
3412 OnConstruction();
3413 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01003414
Jon Skeet53508222015-07-01 17:16:55 +01003415 partial void OnConstruction();
3416
3417 public FieldOptions(FieldOptions other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01003418 ctype_ = other.ctype_;
3419 packed_ = other.packed_;
3420 jstype_ = other.jstype_;
3421 lazy_ = other.lazy_;
3422 deprecated_ = other.deprecated_;
3423 weak_ = other.weak_;
3424 uninterpretedOption_ = other.uninterpretedOption_.Clone();
Jon Skeete38294a2015-06-09 19:30:44 +01003425 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01003426
3427 public FieldOptions Clone() {
3428 return new FieldOptions(this);
3429 }
3430
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003431 /// <summary>Field number for the "ctype" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01003432 public const int CtypeFieldNumber = 1;
Jon Skeet9c888fa2015-07-14 11:13:52 +01003433 private global::Google.Protobuf.Reflection.FieldOptions.Types.CType ctype_ = global::Google.Protobuf.Reflection.FieldOptions.Types.CType.STRING;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003434 /// <summary>
3435 /// The ctype option instructs the C++ code generator to use a different
3436 /// representation of the field than it normally would. See the specific
3437 /// options below. This option is not yet implemented in the open source
3438 /// release -- sorry, we'll try to include it in a future version!
3439 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07003440 public global::Google.Protobuf.Reflection.FieldOptions.Types.CType Ctype {
Jon Skeete38294a2015-06-09 19:30:44 +01003441 get { return ctype_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01003442 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01003443 ctype_ = value;
3444 }
Jon Skeete38294a2015-06-09 19:30:44 +01003445 }
3446
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003447 /// <summary>Field number for the "packed" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01003448 public const int PackedFieldNumber = 2;
3449 private bool packed_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003450 /// <summary>
3451 /// The packed option can be enabled for repeated primitive fields to enable
3452 /// a more efficient representation on the wire. Rather than repeatedly
3453 /// writing the tag and type for each element, the entire array is encoded as
3454 /// a single length-delimited blob. In proto3, only explicit setting it to
3455 /// false will avoid using packed encoding.
3456 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07003457 public bool Packed {
Jon Skeete38294a2015-06-09 19:30:44 +01003458 get { return packed_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01003459 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01003460 packed_ = value;
3461 }
Jon Skeete38294a2015-06-09 19:30:44 +01003462 }
3463
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003464 /// <summary>Field number for the "jstype" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01003465 public const int JstypeFieldNumber = 6;
Jon Skeet9c888fa2015-07-14 11:13:52 +01003466 private global::Google.Protobuf.Reflection.FieldOptions.Types.JSType jstype_ = global::Google.Protobuf.Reflection.FieldOptions.Types.JSType.JS_NORMAL;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003467 /// <summary>
3468 /// The jstype option determines the JavaScript type used for values of the
3469 /// field. The option is permitted only for 64 bit integral and fixed types
3470 /// (int64, uint64, sint64, fixed64, sfixed64). By default these types are
3471 /// represented as JavaScript strings. This avoids loss of precision that can
3472 /// happen when a large value is converted to a floating point JavaScript
3473 /// numbers. Specifying JS_NUMBER for the jstype causes the generated
3474 /// JavaScript code to use the JavaScript "number" type instead of strings.
3475 /// This option is an enum to permit additional types to be added,
3476 /// e.g. goog.math.Integer.
3477 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07003478 public global::Google.Protobuf.Reflection.FieldOptions.Types.JSType Jstype {
Jon Skeete38294a2015-06-09 19:30:44 +01003479 get { return jstype_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01003480 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01003481 jstype_ = value;
3482 }
Jon Skeete38294a2015-06-09 19:30:44 +01003483 }
3484
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003485 /// <summary>Field number for the "lazy" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01003486 public const int LazyFieldNumber = 5;
3487 private bool lazy_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003488 /// <summary>
3489 /// Should this field be parsed lazily? Lazy applies only to message-type
3490 /// fields. It means that when the outer message is initially parsed, the
3491 /// inner message's contents will not be parsed but instead stored in encoded
3492 /// form. The inner message will actually be parsed when it is first accessed.
Jon Skeetcff900e2015-11-06 18:38:31 +00003493 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003494 /// This is only a hint. Implementations are free to choose whether to use
3495 /// eager or lazy parsing regardless of the value of this option. However,
3496 /// setting this option true suggests that the protocol author believes that
3497 /// using lazy parsing on this field is worth the additional bookkeeping
3498 /// overhead typically needed to implement it.
Jon Skeetcff900e2015-11-06 18:38:31 +00003499 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003500 /// This option does not affect the public interface of any generated code;
3501 /// all method signatures remain the same. Furthermore, thread-safety of the
3502 /// interface is not affected by this option; const methods remain safe to
3503 /// call from multiple threads concurrently, while non-const methods continue
3504 /// to require exclusive access.
Jon Skeetcff900e2015-11-06 18:38:31 +00003505 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003506 /// Note that implementations may choose not to check required fields within
3507 /// a lazy sub-message. That is, calling IsInitialized() on the outher message
3508 /// may return true even if the inner message has missing required fields.
3509 /// This is necessary because otherwise the inner message would have to be
3510 /// parsed in order to perform the check, defeating the purpose of lazy
3511 /// parsing. An implementation which chooses not to check required fields
3512 /// must be consistent about it. That is, for any particular sub-message, the
3513 /// implementation must either *always* check its required fields, or *never*
3514 /// check its required fields, regardless of whether or not the message has
3515 /// been parsed.
3516 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07003517 public bool Lazy {
Jon Skeete38294a2015-06-09 19:30:44 +01003518 get { return lazy_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01003519 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01003520 lazy_ = value;
3521 }
Jon Skeete38294a2015-06-09 19:30:44 +01003522 }
3523
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003524 /// <summary>Field number for the "deprecated" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01003525 public const int DeprecatedFieldNumber = 3;
3526 private bool deprecated_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003527 /// <summary>
3528 /// Is this field deprecated?
3529 /// Depending on the target platform, this can emit Deprecated annotations
3530 /// for accessors, or it will be completely ignored; in the very least, this
3531 /// is a formalization for deprecating fields.
3532 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07003533 public bool Deprecated {
Jon Skeete38294a2015-06-09 19:30:44 +01003534 get { return deprecated_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01003535 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01003536 deprecated_ = value;
3537 }
Jon Skeete38294a2015-06-09 19:30:44 +01003538 }
3539
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003540 /// <summary>Field number for the "weak" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01003541 public const int WeakFieldNumber = 10;
3542 private bool weak_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003543 /// <summary>
3544 /// For Google-internal migration only. Do not use.
3545 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07003546 public bool Weak {
Jon Skeete38294a2015-06-09 19:30:44 +01003547 get { return weak_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01003548 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01003549 weak_ = value;
3550 }
Jon Skeete38294a2015-06-09 19:30:44 +01003551 }
3552
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003553 /// <summary>Field number for the "uninterpreted_option" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01003554 public const int UninterpretedOptionFieldNumber = 999;
Jon Skeet9c888fa2015-07-14 11:13:52 +01003555 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.UninterpretedOption> _repeated_uninterpretedOption_codec
3556 = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser);
3557 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> uninterpretedOption_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003558 /// <summary>
3559 /// The parser stores options it doesn't recognize here. See above.
3560 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07003561 public pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> UninterpretedOption {
Jon Skeete38294a2015-06-09 19:30:44 +01003562 get { return uninterpretedOption_; }
3563 }
3564
3565 public override bool Equals(object other) {
3566 return Equals(other as FieldOptions);
3567 }
3568
3569 public bool Equals(FieldOptions other) {
3570 if (ReferenceEquals(other, null)) {
3571 return false;
3572 }
3573 if (ReferenceEquals(other, this)) {
3574 return true;
3575 }
3576 if (Ctype != other.Ctype) return false;
3577 if (Packed != other.Packed) return false;
3578 if (Jstype != other.Jstype) return false;
3579 if (Lazy != other.Lazy) return false;
3580 if (Deprecated != other.Deprecated) return false;
3581 if (Weak != other.Weak) return false;
3582 if(!uninterpretedOption_.Equals(other.uninterpretedOption_)) return false;
3583 return true;
3584 }
3585
3586 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +01003587 int hash = 1;
Jon Skeet9c888fa2015-07-14 11:13:52 +01003588 if (Ctype != global::Google.Protobuf.Reflection.FieldOptions.Types.CType.STRING) hash ^= Ctype.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +01003589 if (Packed != false) hash ^= Packed.GetHashCode();
Jon Skeet9c888fa2015-07-14 11:13:52 +01003590 if (Jstype != global::Google.Protobuf.Reflection.FieldOptions.Types.JSType.JS_NORMAL) hash ^= Jstype.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +01003591 if (Lazy != false) hash ^= Lazy.GetHashCode();
3592 if (Deprecated != false) hash ^= Deprecated.GetHashCode();
3593 if (Weak != false) hash ^= Weak.GetHashCode();
3594 hash ^= uninterpretedOption_.GetHashCode();
3595 return hash;
3596 }
3597
Jon Skeet5b9288e2015-07-03 12:45:36 +01003598 public override string ToString() {
3599 return pb::JsonFormatter.Default.Format(this);
3600 }
3601
Jon Skeet96ddf012015-06-12 09:53:12 +01003602 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeet9c888fa2015-07-14 11:13:52 +01003603 if (Ctype != global::Google.Protobuf.Reflection.FieldOptions.Types.CType.STRING) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003604 output.WriteRawTag(8);
3605 output.WriteEnum((int) Ctype);
Jon Skeete38294a2015-06-09 19:30:44 +01003606 }
3607 if (Packed != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003608 output.WriteRawTag(16);
3609 output.WriteBool(Packed);
Jon Skeete38294a2015-06-09 19:30:44 +01003610 }
3611 if (Deprecated != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003612 output.WriteRawTag(24);
3613 output.WriteBool(Deprecated);
Jon Skeete38294a2015-06-09 19:30:44 +01003614 }
3615 if (Lazy != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003616 output.WriteRawTag(40);
3617 output.WriteBool(Lazy);
Jon Skeete38294a2015-06-09 19:30:44 +01003618 }
Jon Skeet9c888fa2015-07-14 11:13:52 +01003619 if (Jstype != global::Google.Protobuf.Reflection.FieldOptions.Types.JSType.JS_NORMAL) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003620 output.WriteRawTag(48);
3621 output.WriteEnum((int) Jstype);
Jon Skeete38294a2015-06-09 19:30:44 +01003622 }
3623 if (Weak != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003624 output.WriteRawTag(80);
3625 output.WriteBool(Weak);
Jon Skeete38294a2015-06-09 19:30:44 +01003626 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01003627 uninterpretedOption_.WriteTo(output, _repeated_uninterpretedOption_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01003628 }
3629
3630 public int CalculateSize() {
3631 int size = 0;
Jon Skeet9c888fa2015-07-14 11:13:52 +01003632 if (Ctype != global::Google.Protobuf.Reflection.FieldOptions.Types.CType.STRING) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003633 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Ctype);
Jon Skeete38294a2015-06-09 19:30:44 +01003634 }
3635 if (Packed != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003636 size += 1 + 1;
Jon Skeete38294a2015-06-09 19:30:44 +01003637 }
Jon Skeet9c888fa2015-07-14 11:13:52 +01003638 if (Jstype != global::Google.Protobuf.Reflection.FieldOptions.Types.JSType.JS_NORMAL) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003639 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Jstype);
Jon Skeete38294a2015-06-09 19:30:44 +01003640 }
3641 if (Lazy != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003642 size += 1 + 1;
Jon Skeete38294a2015-06-09 19:30:44 +01003643 }
3644 if (Deprecated != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003645 size += 1 + 1;
Jon Skeete38294a2015-06-09 19:30:44 +01003646 }
3647 if (Weak != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003648 size += 1 + 1;
Jon Skeete38294a2015-06-09 19:30:44 +01003649 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01003650 size += uninterpretedOption_.CalculateSize(_repeated_uninterpretedOption_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01003651 return size;
3652 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +01003653
Jon Skeete38294a2015-06-09 19:30:44 +01003654 public void MergeFrom(FieldOptions other) {
3655 if (other == null) {
3656 return;
3657 }
Jon Skeet9c888fa2015-07-14 11:13:52 +01003658 if (other.Ctype != global::Google.Protobuf.Reflection.FieldOptions.Types.CType.STRING) {
Jon Skeete38294a2015-06-09 19:30:44 +01003659 Ctype = other.Ctype;
3660 }
3661 if (other.Packed != false) {
3662 Packed = other.Packed;
3663 }
Jon Skeet9c888fa2015-07-14 11:13:52 +01003664 if (other.Jstype != global::Google.Protobuf.Reflection.FieldOptions.Types.JSType.JS_NORMAL) {
Jon Skeete38294a2015-06-09 19:30:44 +01003665 Jstype = other.Jstype;
3666 }
3667 if (other.Lazy != false) {
3668 Lazy = other.Lazy;
3669 }
3670 if (other.Deprecated != false) {
3671 Deprecated = other.Deprecated;
3672 }
3673 if (other.Weak != false) {
3674 Weak = other.Weak;
3675 }
3676 uninterpretedOption_.Add(other.uninterpretedOption_);
3677 }
3678
Jon Skeet96ddf012015-06-12 09:53:12 +01003679 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +01003680 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01003681 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01003682 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +01003683 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01003684 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +01003685 break;
3686 case 8: {
Jon Skeet9c888fa2015-07-14 11:13:52 +01003687 ctype_ = (global::Google.Protobuf.Reflection.FieldOptions.Types.CType) input.ReadEnum();
Jon Skeet96ddf012015-06-12 09:53:12 +01003688 break;
Jon Skeete38294a2015-06-09 19:30:44 +01003689 }
3690 case 16: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003691 Packed = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01003692 break;
3693 }
3694 case 24: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003695 Deprecated = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01003696 break;
3697 }
3698 case 40: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003699 Lazy = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01003700 break;
3701 }
3702 case 48: {
Jon Skeet9c888fa2015-07-14 11:13:52 +01003703 jstype_ = (global::Google.Protobuf.Reflection.FieldOptions.Types.JSType) input.ReadEnum();
Jon Skeet96ddf012015-06-12 09:53:12 +01003704 break;
Jon Skeete38294a2015-06-09 19:30:44 +01003705 }
3706 case 80: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003707 Weak = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01003708 break;
3709 }
3710 case 7994: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +01003711 uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01003712 break;
3713 }
3714 }
3715 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003716 }
3717
3718 #region Nested types
Jon Skeetb0888a42015-09-29 13:37:30 +01003719 /// <summary>Container for nested types declared in the FieldOptions message type.</summary>
Jon Skeete2c82302015-09-29 14:34:31 +01003720 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeetf3504cf2015-04-28 14:49:49 +01003721 public static partial class Types {
Jon Skeet53508222015-07-01 17:16:55 +01003722 internal enum CType {
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003723 /// <summary>
3724 /// Default mode.
3725 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01003726 STRING = 0,
3727 CORD = 1,
3728 STRING_PIECE = 2,
3729 }
3730
Jon Skeet53508222015-07-01 17:16:55 +01003731 internal enum JSType {
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003732 /// <summary>
3733 /// Use the default type.
3734 /// </summary>
Jie Luoa21a2cf2015-05-29 17:57:05 -07003735 JS_NORMAL = 0,
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003736 /// <summary>
3737 /// Use JavaScript strings.
3738 /// </summary>
Jie Luoa21a2cf2015-05-29 17:57:05 -07003739 JS_STRING = 1,
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003740 /// <summary>
3741 /// Use JavaScript numbers.
3742 /// </summary>
Jie Luoa21a2cf2015-05-29 17:57:05 -07003743 JS_NUMBER = 2,
3744 }
3745
Jon Skeetf3504cf2015-04-28 14:49:49 +01003746 }
3747 #endregion
3748
Jon Skeetf3504cf2015-04-28 14:49:49 +01003749 }
3750
3751 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +01003752 internal sealed partial class EnumOptions : pb::IMessage<EnumOptions> {
Jon Skeete38294a2015-06-09 19:30:44 +01003753 private static readonly pb::MessageParser<EnumOptions> _parser = new pb::MessageParser<EnumOptions>(() => new EnumOptions());
3754 public static pb::MessageParser<EnumOptions> Parser { get { return _parser; } }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003755
Jon Skeet76940942015-07-14 10:25:40 +01003756 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +01003757 get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[12]; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003758 }
3759
Jon Skeet96cffaa2015-07-20 19:25:07 +01003760 pbr::MessageDescriptor pb::IMessage.Descriptor {
3761 get { return Descriptor; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003762 }
3763
Jon Skeet53508222015-07-01 17:16:55 +01003764 public EnumOptions() {
3765 OnConstruction();
3766 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01003767
Jon Skeet53508222015-07-01 17:16:55 +01003768 partial void OnConstruction();
3769
3770 public EnumOptions(EnumOptions other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01003771 allowAlias_ = other.allowAlias_;
3772 deprecated_ = other.deprecated_;
3773 uninterpretedOption_ = other.uninterpretedOption_.Clone();
Jon Skeete38294a2015-06-09 19:30:44 +01003774 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01003775
3776 public EnumOptions Clone() {
3777 return new EnumOptions(this);
3778 }
3779
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003780 /// <summary>Field number for the "allow_alias" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01003781 public const int AllowAliasFieldNumber = 2;
Jon Skeetf3504cf2015-04-28 14:49:49 +01003782 private bool allowAlias_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003783 /// <summary>
3784 /// Set this option to true to allow mapping different tag names to the same
3785 /// value.
3786 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07003787 public bool AllowAlias {
Jon Skeetf3504cf2015-04-28 14:49:49 +01003788 get { return allowAlias_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01003789 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01003790 allowAlias_ = value;
3791 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003792 }
3793
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003794 /// <summary>Field number for the "deprecated" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01003795 public const int DeprecatedFieldNumber = 3;
Jon Skeetf3504cf2015-04-28 14:49:49 +01003796 private bool deprecated_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003797 /// <summary>
3798 /// Is this enum deprecated?
3799 /// Depending on the target platform, this can emit Deprecated annotations
3800 /// for the enum, or it will be completely ignored; in the very least, this
3801 /// is a formalization for deprecating enums.
3802 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07003803 public bool Deprecated {
Jon Skeetf3504cf2015-04-28 14:49:49 +01003804 get { return deprecated_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01003805 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01003806 deprecated_ = value;
3807 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003808 }
3809
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003810 /// <summary>Field number for the "uninterpreted_option" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01003811 public const int UninterpretedOptionFieldNumber = 999;
Jon Skeet9c888fa2015-07-14 11:13:52 +01003812 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.UninterpretedOption> _repeated_uninterpretedOption_codec
3813 = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser);
3814 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> uninterpretedOption_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003815 /// <summary>
3816 /// The parser stores options it doesn't recognize here. See above.
3817 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07003818 public pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> UninterpretedOption {
Jon Skeetf3504cf2015-04-28 14:49:49 +01003819 get { return uninterpretedOption_; }
3820 }
Jon Skeete38294a2015-06-09 19:30:44 +01003821
3822 public override bool Equals(object other) {
3823 return Equals(other as EnumOptions);
Jon Skeetf3504cf2015-04-28 14:49:49 +01003824 }
3825
Jon Skeete38294a2015-06-09 19:30:44 +01003826 public bool Equals(EnumOptions other) {
3827 if (ReferenceEquals(other, null)) {
3828 return false;
3829 }
3830 if (ReferenceEquals(other, this)) {
Jon Skeetf3504cf2015-04-28 14:49:49 +01003831 return true;
3832 }
Jon Skeete38294a2015-06-09 19:30:44 +01003833 if (AllowAlias != other.AllowAlias) return false;
3834 if (Deprecated != other.Deprecated) return false;
3835 if(!uninterpretedOption_.Equals(other.uninterpretedOption_)) return false;
3836 return true;
Jon Skeetf3504cf2015-04-28 14:49:49 +01003837 }
3838
Jon Skeete38294a2015-06-09 19:30:44 +01003839 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +01003840 int hash = 1;
Jon Skeete38294a2015-06-09 19:30:44 +01003841 if (AllowAlias != false) hash ^= AllowAlias.GetHashCode();
3842 if (Deprecated != false) hash ^= Deprecated.GetHashCode();
3843 hash ^= uninterpretedOption_.GetHashCode();
3844 return hash;
Jon Skeetf3504cf2015-04-28 14:49:49 +01003845 }
3846
Jon Skeet5b9288e2015-07-03 12:45:36 +01003847 public override string ToString() {
3848 return pb::JsonFormatter.Default.Format(this);
3849 }
3850
Jon Skeet96ddf012015-06-12 09:53:12 +01003851 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeete38294a2015-06-09 19:30:44 +01003852 if (AllowAlias != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003853 output.WriteRawTag(16);
3854 output.WriteBool(AllowAlias);
Jon Skeetf3504cf2015-04-28 14:49:49 +01003855 }
Jon Skeete38294a2015-06-09 19:30:44 +01003856 if (Deprecated != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003857 output.WriteRawTag(24);
3858 output.WriteBool(Deprecated);
Jon Skeete38294a2015-06-09 19:30:44 +01003859 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01003860 uninterpretedOption_.WriteTo(output, _repeated_uninterpretedOption_codec);
Jon Skeetf3504cf2015-04-28 14:49:49 +01003861 }
3862
Jon Skeete38294a2015-06-09 19:30:44 +01003863 public int CalculateSize() {
3864 int size = 0;
3865 if (AllowAlias != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003866 size += 1 + 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01003867 }
Jon Skeete38294a2015-06-09 19:30:44 +01003868 if (Deprecated != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003869 size += 1 + 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01003870 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01003871 size += uninterpretedOption_.CalculateSize(_repeated_uninterpretedOption_codec);
Jon Skeetf3504cf2015-04-28 14:49:49 +01003872 return size;
3873 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +01003874
Jon Skeete38294a2015-06-09 19:30:44 +01003875 public void MergeFrom(EnumOptions other) {
3876 if (other == null) {
3877 return;
3878 }
3879 if (other.AllowAlias != false) {
3880 AllowAlias = other.AllowAlias;
3881 }
3882 if (other.Deprecated != false) {
3883 Deprecated = other.Deprecated;
3884 }
3885 uninterpretedOption_.Add(other.uninterpretedOption_);
Jon Skeetf3504cf2015-04-28 14:49:49 +01003886 }
3887
Jon Skeet96ddf012015-06-12 09:53:12 +01003888 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +01003889 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01003890 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01003891 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +01003892 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01003893 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +01003894 break;
3895 case 16: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003896 AllowAlias = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01003897 break;
3898 }
3899 case 24: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01003900 Deprecated = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01003901 break;
3902 }
3903 case 7994: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +01003904 uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01003905 break;
3906 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003907 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003908 }
3909 }
Jon Skeete38294a2015-06-09 19:30:44 +01003910
Jon Skeetf3504cf2015-04-28 14:49:49 +01003911 }
3912
3913 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +01003914 internal sealed partial class EnumValueOptions : pb::IMessage<EnumValueOptions> {
Jon Skeete38294a2015-06-09 19:30:44 +01003915 private static readonly pb::MessageParser<EnumValueOptions> _parser = new pb::MessageParser<EnumValueOptions>(() => new EnumValueOptions());
3916 public static pb::MessageParser<EnumValueOptions> Parser { get { return _parser; } }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003917
Jon Skeet76940942015-07-14 10:25:40 +01003918 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +01003919 get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[13]; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003920 }
3921
Jon Skeet96cffaa2015-07-20 19:25:07 +01003922 pbr::MessageDescriptor pb::IMessage.Descriptor {
3923 get { return Descriptor; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003924 }
3925
Jon Skeet53508222015-07-01 17:16:55 +01003926 public EnumValueOptions() {
3927 OnConstruction();
3928 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01003929
Jon Skeet53508222015-07-01 17:16:55 +01003930 partial void OnConstruction();
3931
3932 public EnumValueOptions(EnumValueOptions other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01003933 deprecated_ = other.deprecated_;
3934 uninterpretedOption_ = other.uninterpretedOption_.Clone();
Jon Skeete38294a2015-06-09 19:30:44 +01003935 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01003936
3937 public EnumValueOptions Clone() {
3938 return new EnumValueOptions(this);
3939 }
3940
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003941 /// <summary>Field number for the "deprecated" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01003942 public const int DeprecatedFieldNumber = 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01003943 private bool deprecated_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003944 /// <summary>
3945 /// Is this enum value deprecated?
3946 /// Depending on the target platform, this can emit Deprecated annotations
3947 /// for the enum value, or it will be completely ignored; in the very least,
3948 /// this is a formalization for deprecating enum values.
3949 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07003950 public bool Deprecated {
Jon Skeetf3504cf2015-04-28 14:49:49 +01003951 get { return deprecated_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01003952 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01003953 deprecated_ = value;
3954 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01003955 }
3956
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003957 /// <summary>Field number for the "uninterpreted_option" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01003958 public const int UninterpretedOptionFieldNumber = 999;
Jon Skeet9c888fa2015-07-14 11:13:52 +01003959 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.UninterpretedOption> _repeated_uninterpretedOption_codec
3960 = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser);
3961 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> uninterpretedOption_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +01003962 /// <summary>
3963 /// The parser stores options it doesn't recognize here. See above.
3964 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07003965 public pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> UninterpretedOption {
Jon Skeetf3504cf2015-04-28 14:49:49 +01003966 get { return uninterpretedOption_; }
3967 }
Jon Skeete38294a2015-06-09 19:30:44 +01003968
3969 public override bool Equals(object other) {
3970 return Equals(other as EnumValueOptions);
Jon Skeetf3504cf2015-04-28 14:49:49 +01003971 }
3972
Jon Skeete38294a2015-06-09 19:30:44 +01003973 public bool Equals(EnumValueOptions other) {
3974 if (ReferenceEquals(other, null)) {
3975 return false;
3976 }
3977 if (ReferenceEquals(other, this)) {
Jon Skeetf3504cf2015-04-28 14:49:49 +01003978 return true;
3979 }
Jon Skeete38294a2015-06-09 19:30:44 +01003980 if (Deprecated != other.Deprecated) return false;
3981 if(!uninterpretedOption_.Equals(other.uninterpretedOption_)) return false;
3982 return true;
Jon Skeetf3504cf2015-04-28 14:49:49 +01003983 }
3984
Jon Skeete38294a2015-06-09 19:30:44 +01003985 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +01003986 int hash = 1;
Jon Skeete38294a2015-06-09 19:30:44 +01003987 if (Deprecated != false) hash ^= Deprecated.GetHashCode();
3988 hash ^= uninterpretedOption_.GetHashCode();
3989 return hash;
Jon Skeetf3504cf2015-04-28 14:49:49 +01003990 }
3991
Jon Skeet5b9288e2015-07-03 12:45:36 +01003992 public override string ToString() {
3993 return pb::JsonFormatter.Default.Format(this);
3994 }
3995
Jon Skeet96ddf012015-06-12 09:53:12 +01003996 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeete38294a2015-06-09 19:30:44 +01003997 if (Deprecated != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01003998 output.WriteRawTag(8);
3999 output.WriteBool(Deprecated);
Jon Skeetf3504cf2015-04-28 14:49:49 +01004000 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01004001 uninterpretedOption_.WriteTo(output, _repeated_uninterpretedOption_codec);
Jon Skeetf3504cf2015-04-28 14:49:49 +01004002 }
4003
Jon Skeete38294a2015-06-09 19:30:44 +01004004 public int CalculateSize() {
4005 int size = 0;
4006 if (Deprecated != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004007 size += 1 + 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01004008 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01004009 size += uninterpretedOption_.CalculateSize(_repeated_uninterpretedOption_codec);
Jon Skeetf3504cf2015-04-28 14:49:49 +01004010 return size;
4011 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +01004012
Jon Skeete38294a2015-06-09 19:30:44 +01004013 public void MergeFrom(EnumValueOptions other) {
4014 if (other == null) {
4015 return;
4016 }
4017 if (other.Deprecated != false) {
4018 Deprecated = other.Deprecated;
4019 }
4020 uninterpretedOption_.Add(other.uninterpretedOption_);
Jon Skeetf3504cf2015-04-28 14:49:49 +01004021 }
4022
Jon Skeet96ddf012015-06-12 09:53:12 +01004023 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +01004024 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01004025 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01004026 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +01004027 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01004028 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +01004029 break;
4030 case 8: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01004031 Deprecated = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01004032 break;
4033 }
4034 case 7994: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +01004035 uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01004036 break;
4037 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004038 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004039 }
4040 }
Jon Skeete38294a2015-06-09 19:30:44 +01004041
Jon Skeetf3504cf2015-04-28 14:49:49 +01004042 }
4043
4044 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +01004045 internal sealed partial class ServiceOptions : pb::IMessage<ServiceOptions> {
Jon Skeete38294a2015-06-09 19:30:44 +01004046 private static readonly pb::MessageParser<ServiceOptions> _parser = new pb::MessageParser<ServiceOptions>(() => new ServiceOptions());
4047 public static pb::MessageParser<ServiceOptions> Parser { get { return _parser; } }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004048
Jon Skeet76940942015-07-14 10:25:40 +01004049 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +01004050 get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[14]; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004051 }
4052
Jon Skeet96cffaa2015-07-20 19:25:07 +01004053 pbr::MessageDescriptor pb::IMessage.Descriptor {
4054 get { return Descriptor; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004055 }
4056
Jon Skeet53508222015-07-01 17:16:55 +01004057 public ServiceOptions() {
4058 OnConstruction();
4059 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01004060
Jon Skeet53508222015-07-01 17:16:55 +01004061 partial void OnConstruction();
4062
4063 public ServiceOptions(ServiceOptions other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01004064 deprecated_ = other.deprecated_;
4065 uninterpretedOption_ = other.uninterpretedOption_.Clone();
Jon Skeete38294a2015-06-09 19:30:44 +01004066 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01004067
4068 public ServiceOptions Clone() {
4069 return new ServiceOptions(this);
4070 }
4071
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004072 /// <summary>Field number for the "deprecated" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01004073 public const int DeprecatedFieldNumber = 33;
Jon Skeetf3504cf2015-04-28 14:49:49 +01004074 private bool deprecated_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004075 /// <summary>
4076 /// Is this service deprecated?
4077 /// Depending on the target platform, this can emit Deprecated annotations
4078 /// for the service, or it will be completely ignored; in the very least,
4079 /// this is a formalization for deprecating services.
4080 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07004081 public bool Deprecated {
Jon Skeetf3504cf2015-04-28 14:49:49 +01004082 get { return deprecated_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01004083 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01004084 deprecated_ = value;
4085 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004086 }
4087
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004088 /// <summary>Field number for the "uninterpreted_option" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01004089 public const int UninterpretedOptionFieldNumber = 999;
Jon Skeet9c888fa2015-07-14 11:13:52 +01004090 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.UninterpretedOption> _repeated_uninterpretedOption_codec
4091 = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser);
4092 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> uninterpretedOption_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004093 /// <summary>
4094 /// The parser stores options it doesn't recognize here. See above.
4095 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07004096 public pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> UninterpretedOption {
Jon Skeetf3504cf2015-04-28 14:49:49 +01004097 get { return uninterpretedOption_; }
4098 }
Jon Skeete38294a2015-06-09 19:30:44 +01004099
4100 public override bool Equals(object other) {
4101 return Equals(other as ServiceOptions);
Jon Skeetf3504cf2015-04-28 14:49:49 +01004102 }
4103
Jon Skeete38294a2015-06-09 19:30:44 +01004104 public bool Equals(ServiceOptions other) {
4105 if (ReferenceEquals(other, null)) {
4106 return false;
4107 }
4108 if (ReferenceEquals(other, this)) {
Jon Skeetf3504cf2015-04-28 14:49:49 +01004109 return true;
4110 }
Jon Skeete38294a2015-06-09 19:30:44 +01004111 if (Deprecated != other.Deprecated) return false;
4112 if(!uninterpretedOption_.Equals(other.uninterpretedOption_)) return false;
4113 return true;
Jon Skeetf3504cf2015-04-28 14:49:49 +01004114 }
4115
Jon Skeete38294a2015-06-09 19:30:44 +01004116 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +01004117 int hash = 1;
Jon Skeete38294a2015-06-09 19:30:44 +01004118 if (Deprecated != false) hash ^= Deprecated.GetHashCode();
4119 hash ^= uninterpretedOption_.GetHashCode();
4120 return hash;
Jon Skeetf3504cf2015-04-28 14:49:49 +01004121 }
4122
Jon Skeet5b9288e2015-07-03 12:45:36 +01004123 public override string ToString() {
4124 return pb::JsonFormatter.Default.Format(this);
4125 }
4126
Jon Skeet96ddf012015-06-12 09:53:12 +01004127 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeete38294a2015-06-09 19:30:44 +01004128 if (Deprecated != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004129 output.WriteRawTag(136, 2);
4130 output.WriteBool(Deprecated);
Jon Skeetf3504cf2015-04-28 14:49:49 +01004131 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01004132 uninterpretedOption_.WriteTo(output, _repeated_uninterpretedOption_codec);
Jon Skeetf3504cf2015-04-28 14:49:49 +01004133 }
4134
Jon Skeete38294a2015-06-09 19:30:44 +01004135 public int CalculateSize() {
4136 int size = 0;
4137 if (Deprecated != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004138 size += 2 + 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01004139 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01004140 size += uninterpretedOption_.CalculateSize(_repeated_uninterpretedOption_codec);
Jon Skeetf3504cf2015-04-28 14:49:49 +01004141 return size;
4142 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +01004143
Jon Skeete38294a2015-06-09 19:30:44 +01004144 public void MergeFrom(ServiceOptions other) {
4145 if (other == null) {
4146 return;
4147 }
4148 if (other.Deprecated != false) {
4149 Deprecated = other.Deprecated;
4150 }
4151 uninterpretedOption_.Add(other.uninterpretedOption_);
Jon Skeetf3504cf2015-04-28 14:49:49 +01004152 }
4153
Jon Skeet96ddf012015-06-12 09:53:12 +01004154 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +01004155 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01004156 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01004157 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +01004158 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01004159 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +01004160 break;
4161 case 264: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01004162 Deprecated = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01004163 break;
4164 }
4165 case 7994: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +01004166 uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01004167 break;
4168 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004169 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004170 }
4171 }
Jon Skeete38294a2015-06-09 19:30:44 +01004172
Jon Skeetf3504cf2015-04-28 14:49:49 +01004173 }
4174
4175 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +01004176 internal sealed partial class MethodOptions : pb::IMessage<MethodOptions> {
Jon Skeete38294a2015-06-09 19:30:44 +01004177 private static readonly pb::MessageParser<MethodOptions> _parser = new pb::MessageParser<MethodOptions>(() => new MethodOptions());
4178 public static pb::MessageParser<MethodOptions> Parser { get { return _parser; } }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004179
Jon Skeet76940942015-07-14 10:25:40 +01004180 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +01004181 get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[15]; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004182 }
4183
Jon Skeet96cffaa2015-07-20 19:25:07 +01004184 pbr::MessageDescriptor pb::IMessage.Descriptor {
4185 get { return Descriptor; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004186 }
4187
Jon Skeet53508222015-07-01 17:16:55 +01004188 public MethodOptions() {
4189 OnConstruction();
4190 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01004191
Jon Skeet53508222015-07-01 17:16:55 +01004192 partial void OnConstruction();
4193
4194 public MethodOptions(MethodOptions other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01004195 deprecated_ = other.deprecated_;
4196 uninterpretedOption_ = other.uninterpretedOption_.Clone();
Jon Skeete38294a2015-06-09 19:30:44 +01004197 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01004198
4199 public MethodOptions Clone() {
4200 return new MethodOptions(this);
4201 }
4202
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004203 /// <summary>Field number for the "deprecated" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01004204 public const int DeprecatedFieldNumber = 33;
Jon Skeetf3504cf2015-04-28 14:49:49 +01004205 private bool deprecated_;
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004206 /// <summary>
4207 /// Is this method deprecated?
4208 /// Depending on the target platform, this can emit Deprecated annotations
4209 /// for the method, or it will be completely ignored; in the very least,
4210 /// this is a formalization for deprecating methods.
4211 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07004212 public bool Deprecated {
Jon Skeetf3504cf2015-04-28 14:49:49 +01004213 get { return deprecated_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01004214 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01004215 deprecated_ = value;
4216 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004217 }
4218
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004219 /// <summary>Field number for the "uninterpreted_option" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01004220 public const int UninterpretedOptionFieldNumber = 999;
Jon Skeet9c888fa2015-07-14 11:13:52 +01004221 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.UninterpretedOption> _repeated_uninterpretedOption_codec
4222 = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser);
4223 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> uninterpretedOption_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004224 /// <summary>
4225 /// The parser stores options it doesn't recognize here. See above.
4226 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07004227 public pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> UninterpretedOption {
Jon Skeetf3504cf2015-04-28 14:49:49 +01004228 get { return uninterpretedOption_; }
4229 }
Jon Skeete38294a2015-06-09 19:30:44 +01004230
4231 public override bool Equals(object other) {
4232 return Equals(other as MethodOptions);
Jon Skeetf3504cf2015-04-28 14:49:49 +01004233 }
4234
Jon Skeete38294a2015-06-09 19:30:44 +01004235 public bool Equals(MethodOptions other) {
4236 if (ReferenceEquals(other, null)) {
4237 return false;
4238 }
4239 if (ReferenceEquals(other, this)) {
Jon Skeetf3504cf2015-04-28 14:49:49 +01004240 return true;
4241 }
Jon Skeete38294a2015-06-09 19:30:44 +01004242 if (Deprecated != other.Deprecated) return false;
4243 if(!uninterpretedOption_.Equals(other.uninterpretedOption_)) return false;
4244 return true;
Jon Skeetf3504cf2015-04-28 14:49:49 +01004245 }
4246
Jon Skeete38294a2015-06-09 19:30:44 +01004247 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +01004248 int hash = 1;
Jon Skeete38294a2015-06-09 19:30:44 +01004249 if (Deprecated != false) hash ^= Deprecated.GetHashCode();
4250 hash ^= uninterpretedOption_.GetHashCode();
4251 return hash;
Jon Skeetf3504cf2015-04-28 14:49:49 +01004252 }
4253
Jon Skeet5b9288e2015-07-03 12:45:36 +01004254 public override string ToString() {
4255 return pb::JsonFormatter.Default.Format(this);
4256 }
4257
Jon Skeet96ddf012015-06-12 09:53:12 +01004258 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeete38294a2015-06-09 19:30:44 +01004259 if (Deprecated != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004260 output.WriteRawTag(136, 2);
4261 output.WriteBool(Deprecated);
Jon Skeetf3504cf2015-04-28 14:49:49 +01004262 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01004263 uninterpretedOption_.WriteTo(output, _repeated_uninterpretedOption_codec);
Jon Skeetf3504cf2015-04-28 14:49:49 +01004264 }
4265
Jon Skeete38294a2015-06-09 19:30:44 +01004266 public int CalculateSize() {
4267 int size = 0;
4268 if (Deprecated != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004269 size += 2 + 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01004270 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01004271 size += uninterpretedOption_.CalculateSize(_repeated_uninterpretedOption_codec);
Jon Skeetf3504cf2015-04-28 14:49:49 +01004272 return size;
4273 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +01004274
Jon Skeete38294a2015-06-09 19:30:44 +01004275 public void MergeFrom(MethodOptions other) {
4276 if (other == null) {
4277 return;
4278 }
4279 if (other.Deprecated != false) {
4280 Deprecated = other.Deprecated;
4281 }
4282 uninterpretedOption_.Add(other.uninterpretedOption_);
Jon Skeetf3504cf2015-04-28 14:49:49 +01004283 }
4284
Jon Skeet96ddf012015-06-12 09:53:12 +01004285 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +01004286 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01004287 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01004288 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +01004289 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01004290 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +01004291 break;
4292 case 264: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01004293 Deprecated = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01004294 break;
4295 }
4296 case 7994: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +01004297 uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01004298 break;
4299 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004300 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004301 }
4302 }
Jon Skeete38294a2015-06-09 19:30:44 +01004303
Jon Skeetf3504cf2015-04-28 14:49:49 +01004304 }
4305
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004306 /// <summary>
4307 /// A message representing a option the parser does not recognize. This only
4308 /// appears in options protos created by the compiler::Parser class.
4309 /// DescriptorPool resolves these when building Descriptor objects. Therefore,
4310 /// options protos in descriptor objects (e.g. returned by Descriptor::options(),
4311 /// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
4312 /// in them.
4313 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01004314 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +01004315 internal sealed partial class UninterpretedOption : pb::IMessage<UninterpretedOption> {
Jon Skeete38294a2015-06-09 19:30:44 +01004316 private static readonly pb::MessageParser<UninterpretedOption> _parser = new pb::MessageParser<UninterpretedOption>(() => new UninterpretedOption());
4317 public static pb::MessageParser<UninterpretedOption> Parser { get { return _parser; } }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004318
Jon Skeet76940942015-07-14 10:25:40 +01004319 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +01004320 get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[16]; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004321 }
4322
Jon Skeet96cffaa2015-07-20 19:25:07 +01004323 pbr::MessageDescriptor pb::IMessage.Descriptor {
4324 get { return Descriptor; }
Jon Skeete38294a2015-06-09 19:30:44 +01004325 }
4326
Jon Skeet53508222015-07-01 17:16:55 +01004327 public UninterpretedOption() {
4328 OnConstruction();
4329 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01004330
Jon Skeet53508222015-07-01 17:16:55 +01004331 partial void OnConstruction();
4332
4333 public UninterpretedOption(UninterpretedOption other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01004334 name_ = other.name_.Clone();
4335 identifierValue_ = other.identifierValue_;
4336 positiveIntValue_ = other.positiveIntValue_;
4337 negativeIntValue_ = other.negativeIntValue_;
4338 doubleValue_ = other.doubleValue_;
4339 stringValue_ = other.stringValue_;
4340 aggregateValue_ = other.aggregateValue_;
Jon Skeete38294a2015-06-09 19:30:44 +01004341 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01004342
4343 public UninterpretedOption Clone() {
4344 return new UninterpretedOption(this);
4345 }
4346
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004347 /// <summary>Field number for the "name" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01004348 public const int NameFieldNumber = 2;
Jon Skeet9c888fa2015-07-14 11:13:52 +01004349 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.UninterpretedOption.Types.NamePart> _repeated_name_codec
4350 = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.UninterpretedOption.Types.NamePart.Parser);
4351 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption.Types.NamePart> name_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption.Types.NamePart>();
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07004352 public pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption.Types.NamePart> Name {
Jon Skeete38294a2015-06-09 19:30:44 +01004353 get { return name_; }
4354 }
4355
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004356 /// <summary>Field number for the "identifier_value" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01004357 public const int IdentifierValueFieldNumber = 3;
4358 private string identifierValue_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004359 /// <summary>
4360 /// The value of the uninterpreted option, in whatever type the tokenizer
4361 /// identified it as during parsing. Exactly one of these should be set.
4362 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07004363 public string IdentifierValue {
Jon Skeete38294a2015-06-09 19:30:44 +01004364 get { return identifierValue_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01004365 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01004366 identifierValue_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01004367 }
Jon Skeete38294a2015-06-09 19:30:44 +01004368 }
4369
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004370 /// <summary>Field number for the "positive_int_value" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01004371 public const int PositiveIntValueFieldNumber = 4;
4372 private ulong positiveIntValue_;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07004373 public ulong PositiveIntValue {
Jon Skeete38294a2015-06-09 19:30:44 +01004374 get { return positiveIntValue_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01004375 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01004376 positiveIntValue_ = value;
4377 }
Jon Skeete38294a2015-06-09 19:30:44 +01004378 }
4379
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004380 /// <summary>Field number for the "negative_int_value" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01004381 public const int NegativeIntValueFieldNumber = 5;
4382 private long negativeIntValue_;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07004383 public long NegativeIntValue {
Jon Skeete38294a2015-06-09 19:30:44 +01004384 get { return negativeIntValue_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01004385 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01004386 negativeIntValue_ = value;
4387 }
Jon Skeete38294a2015-06-09 19:30:44 +01004388 }
4389
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004390 /// <summary>Field number for the "double_value" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01004391 public const int DoubleValueFieldNumber = 6;
4392 private double doubleValue_;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07004393 public double DoubleValue {
Jon Skeete38294a2015-06-09 19:30:44 +01004394 get { return doubleValue_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01004395 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01004396 doubleValue_ = value;
4397 }
Jon Skeete38294a2015-06-09 19:30:44 +01004398 }
4399
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004400 /// <summary>Field number for the "string_value" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01004401 public const int StringValueFieldNumber = 7;
4402 private pb::ByteString stringValue_ = pb::ByteString.Empty;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07004403 public pb::ByteString StringValue {
Jon Skeete38294a2015-06-09 19:30:44 +01004404 get { return stringValue_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01004405 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01004406 stringValue_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01004407 }
Jon Skeete38294a2015-06-09 19:30:44 +01004408 }
4409
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004410 /// <summary>Field number for the "aggregate_value" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01004411 public const int AggregateValueFieldNumber = 8;
4412 private string aggregateValue_ = "";
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07004413 public string AggregateValue {
Jon Skeete38294a2015-06-09 19:30:44 +01004414 get { return aggregateValue_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01004415 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01004416 aggregateValue_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01004417 }
Jon Skeete38294a2015-06-09 19:30:44 +01004418 }
4419
Jon Skeete38294a2015-06-09 19:30:44 +01004420 public override bool Equals(object other) {
4421 return Equals(other as UninterpretedOption);
4422 }
4423
4424 public bool Equals(UninterpretedOption other) {
4425 if (ReferenceEquals(other, null)) {
4426 return false;
4427 }
4428 if (ReferenceEquals(other, this)) {
4429 return true;
4430 }
4431 if(!name_.Equals(other.name_)) return false;
4432 if (IdentifierValue != other.IdentifierValue) return false;
4433 if (PositiveIntValue != other.PositiveIntValue) return false;
4434 if (NegativeIntValue != other.NegativeIntValue) return false;
4435 if (DoubleValue != other.DoubleValue) return false;
4436 if (StringValue != other.StringValue) return false;
4437 if (AggregateValue != other.AggregateValue) return false;
4438 return true;
4439 }
4440
4441 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +01004442 int hash = 1;
Jon Skeete38294a2015-06-09 19:30:44 +01004443 hash ^= name_.GetHashCode();
Jon Skeetfb1547b2015-06-12 13:11:54 +01004444 if (IdentifierValue.Length != 0) hash ^= IdentifierValue.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +01004445 if (PositiveIntValue != 0UL) hash ^= PositiveIntValue.GetHashCode();
4446 if (NegativeIntValue != 0L) hash ^= NegativeIntValue.GetHashCode();
4447 if (DoubleValue != 0D) hash ^= DoubleValue.GetHashCode();
Jon Skeetfb1547b2015-06-12 13:11:54 +01004448 if (StringValue.Length != 0) hash ^= StringValue.GetHashCode();
4449 if (AggregateValue.Length != 0) hash ^= AggregateValue.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +01004450 return hash;
4451 }
4452
Jon Skeet5b9288e2015-07-03 12:45:36 +01004453 public override string ToString() {
4454 return pb::JsonFormatter.Default.Format(this);
4455 }
4456
Jon Skeet96ddf012015-06-12 09:53:12 +01004457 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeetf2a27cc2015-06-26 17:37:14 +01004458 name_.WriteTo(output, _repeated_name_codec);
Jon Skeetfb1547b2015-06-12 13:11:54 +01004459 if (IdentifierValue.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004460 output.WriteRawTag(26);
4461 output.WriteString(IdentifierValue);
Jon Skeete38294a2015-06-09 19:30:44 +01004462 }
4463 if (PositiveIntValue != 0UL) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004464 output.WriteRawTag(32);
4465 output.WriteUInt64(PositiveIntValue);
Jon Skeete38294a2015-06-09 19:30:44 +01004466 }
4467 if (NegativeIntValue != 0L) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004468 output.WriteRawTag(40);
4469 output.WriteInt64(NegativeIntValue);
Jon Skeete38294a2015-06-09 19:30:44 +01004470 }
4471 if (DoubleValue != 0D) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004472 output.WriteRawTag(49);
4473 output.WriteDouble(DoubleValue);
Jon Skeete38294a2015-06-09 19:30:44 +01004474 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01004475 if (StringValue.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004476 output.WriteRawTag(58);
4477 output.WriteBytes(StringValue);
Jon Skeete38294a2015-06-09 19:30:44 +01004478 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01004479 if (AggregateValue.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004480 output.WriteRawTag(66);
4481 output.WriteString(AggregateValue);
Jon Skeete38294a2015-06-09 19:30:44 +01004482 }
4483 }
4484
4485 public int CalculateSize() {
4486 int size = 0;
Jon Skeetf2a27cc2015-06-26 17:37:14 +01004487 size += name_.CalculateSize(_repeated_name_codec);
Jon Skeetfb1547b2015-06-12 13:11:54 +01004488 if (IdentifierValue.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004489 size += 1 + pb::CodedOutputStream.ComputeStringSize(IdentifierValue);
Jon Skeete38294a2015-06-09 19:30:44 +01004490 }
4491 if (PositiveIntValue != 0UL) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004492 size += 1 + pb::CodedOutputStream.ComputeUInt64Size(PositiveIntValue);
Jon Skeete38294a2015-06-09 19:30:44 +01004493 }
4494 if (NegativeIntValue != 0L) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004495 size += 1 + pb::CodedOutputStream.ComputeInt64Size(NegativeIntValue);
Jon Skeete38294a2015-06-09 19:30:44 +01004496 }
4497 if (DoubleValue != 0D) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004498 size += 1 + 8;
Jon Skeete38294a2015-06-09 19:30:44 +01004499 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01004500 if (StringValue.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004501 size += 1 + pb::CodedOutputStream.ComputeBytesSize(StringValue);
Jon Skeete38294a2015-06-09 19:30:44 +01004502 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01004503 if (AggregateValue.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004504 size += 1 + pb::CodedOutputStream.ComputeStringSize(AggregateValue);
Jon Skeete38294a2015-06-09 19:30:44 +01004505 }
4506 return size;
4507 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +01004508
Jon Skeete38294a2015-06-09 19:30:44 +01004509 public void MergeFrom(UninterpretedOption other) {
4510 if (other == null) {
4511 return;
4512 }
4513 name_.Add(other.name_);
Jon Skeetfb1547b2015-06-12 13:11:54 +01004514 if (other.IdentifierValue.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01004515 IdentifierValue = other.IdentifierValue;
4516 }
4517 if (other.PositiveIntValue != 0UL) {
4518 PositiveIntValue = other.PositiveIntValue;
4519 }
4520 if (other.NegativeIntValue != 0L) {
4521 NegativeIntValue = other.NegativeIntValue;
4522 }
4523 if (other.DoubleValue != 0D) {
4524 DoubleValue = other.DoubleValue;
4525 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01004526 if (other.StringValue.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01004527 StringValue = other.StringValue;
4528 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01004529 if (other.AggregateValue.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01004530 AggregateValue = other.AggregateValue;
4531 }
4532 }
4533
Jon Skeet96ddf012015-06-12 09:53:12 +01004534 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +01004535 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01004536 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01004537 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +01004538 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01004539 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +01004540 break;
4541 case 18: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +01004542 name_.AddEntriesFrom(input, _repeated_name_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01004543 break;
4544 }
4545 case 26: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01004546 IdentifierValue = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01004547 break;
4548 }
4549 case 32: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01004550 PositiveIntValue = input.ReadUInt64();
Jon Skeete38294a2015-06-09 19:30:44 +01004551 break;
4552 }
4553 case 40: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01004554 NegativeIntValue = input.ReadInt64();
Jon Skeete38294a2015-06-09 19:30:44 +01004555 break;
4556 }
4557 case 49: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01004558 DoubleValue = input.ReadDouble();
Jon Skeete38294a2015-06-09 19:30:44 +01004559 break;
4560 }
4561 case 58: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01004562 StringValue = input.ReadBytes();
Jon Skeete38294a2015-06-09 19:30:44 +01004563 break;
4564 }
4565 case 66: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01004566 AggregateValue = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01004567 break;
4568 }
4569 }
4570 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004571 }
4572
4573 #region Nested types
Jon Skeetb0888a42015-09-29 13:37:30 +01004574 /// <summary>Container for nested types declared in the UninterpretedOption message type.</summary>
Jon Skeete2c82302015-09-29 14:34:31 +01004575 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeetf3504cf2015-04-28 14:49:49 +01004576 public static partial class Types {
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004577 /// <summary>
4578 /// The name of the uninterpreted option. Each string represents a segment in
4579 /// a dot-separated name. is_extension is true iff a segment represents an
4580 /// extension (denoted with parentheses in options specs in .proto files).
4581 /// E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents
4582 /// "foo.(bar.baz).qux".
4583 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01004584 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +01004585 internal sealed partial class NamePart : pb::IMessage<NamePart> {
Jon Skeete38294a2015-06-09 19:30:44 +01004586 private static readonly pb::MessageParser<NamePart> _parser = new pb::MessageParser<NamePart>(() => new NamePart());
4587 public static pb::MessageParser<NamePart> Parser { get { return _parser; } }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004588
Jon Skeet76940942015-07-14 10:25:40 +01004589 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +01004590 get { return global::Google.Protobuf.Reflection.UninterpretedOption.Descriptor.NestedTypes[0]; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004591 }
4592
Jon Skeet96cffaa2015-07-20 19:25:07 +01004593 pbr::MessageDescriptor pb::IMessage.Descriptor {
4594 get { return Descriptor; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004595 }
4596
Jon Skeet53508222015-07-01 17:16:55 +01004597 public NamePart() {
4598 OnConstruction();
4599 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01004600
Jon Skeet53508222015-07-01 17:16:55 +01004601 partial void OnConstruction();
4602
4603 public NamePart(NamePart other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01004604 namePart_ = other.namePart_;
4605 isExtension_ = other.isExtension_;
Jon Skeete38294a2015-06-09 19:30:44 +01004606 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01004607
4608 public NamePart Clone() {
4609 return new NamePart(this);
4610 }
4611
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004612 /// <summary>Field number for the "name_part" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01004613 public const int NamePart_FieldNumber = 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01004614 private string namePart_ = "";
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07004615 public string NamePart_ {
Jon Skeetf3504cf2015-04-28 14:49:49 +01004616 get { return namePart_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01004617 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01004618 namePart_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01004619 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004620 }
4621
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004622 /// <summary>Field number for the "is_extension" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01004623 public const int IsExtensionFieldNumber = 2;
Jon Skeetf3504cf2015-04-28 14:49:49 +01004624 private bool isExtension_;
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07004625 public bool IsExtension {
Jon Skeetf3504cf2015-04-28 14:49:49 +01004626 get { return isExtension_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01004627 set {
Jon Skeetbfee2df2015-06-23 16:09:27 +01004628 isExtension_ = value;
4629 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004630 }
4631
Jon Skeete38294a2015-06-09 19:30:44 +01004632 public override bool Equals(object other) {
4633 return Equals(other as NamePart);
4634 }
4635
4636 public bool Equals(NamePart other) {
4637 if (ReferenceEquals(other, null)) {
4638 return false;
4639 }
4640 if (ReferenceEquals(other, this)) {
Jon Skeetf3504cf2015-04-28 14:49:49 +01004641 return true;
4642 }
Jon Skeete38294a2015-06-09 19:30:44 +01004643 if (NamePart_ != other.NamePart_) return false;
4644 if (IsExtension != other.IsExtension) return false;
4645 return true;
Jon Skeetf3504cf2015-04-28 14:49:49 +01004646 }
4647
Jon Skeete38294a2015-06-09 19:30:44 +01004648 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +01004649 int hash = 1;
Jon Skeetfb1547b2015-06-12 13:11:54 +01004650 if (NamePart_.Length != 0) hash ^= NamePart_.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +01004651 if (IsExtension != false) hash ^= IsExtension.GetHashCode();
4652 return hash;
Jon Skeetf3504cf2015-04-28 14:49:49 +01004653 }
4654
Jon Skeet5b9288e2015-07-03 12:45:36 +01004655 public override string ToString() {
4656 return pb::JsonFormatter.Default.Format(this);
4657 }
4658
Jon Skeet96ddf012015-06-12 09:53:12 +01004659 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeetfb1547b2015-06-12 13:11:54 +01004660 if (NamePart_.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004661 output.WriteRawTag(10);
4662 output.WriteString(NamePart_);
Jon Skeete38294a2015-06-09 19:30:44 +01004663 }
4664 if (IsExtension != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004665 output.WriteRawTag(16);
4666 output.WriteBool(IsExtension);
Jon Skeetf3504cf2015-04-28 14:49:49 +01004667 }
4668 }
4669
Jon Skeete38294a2015-06-09 19:30:44 +01004670 public int CalculateSize() {
4671 int size = 0;
Jon Skeetfb1547b2015-06-12 13:11:54 +01004672 if (NamePart_.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004673 size += 1 + pb::CodedOutputStream.ComputeStringSize(NamePart_);
Jon Skeetf3504cf2015-04-28 14:49:49 +01004674 }
Jon Skeete38294a2015-06-09 19:30:44 +01004675 if (IsExtension != false) {
Jon Skeet828b7e62015-06-17 14:59:10 +01004676 size += 1 + 1;
Jon Skeetf3504cf2015-04-28 14:49:49 +01004677 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004678 return size;
4679 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +01004680
Jon Skeete38294a2015-06-09 19:30:44 +01004681 public void MergeFrom(NamePart other) {
4682 if (other == null) {
4683 return;
4684 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01004685 if (other.NamePart_.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01004686 NamePart_ = other.NamePart_;
4687 }
4688 if (other.IsExtension != false) {
4689 IsExtension = other.IsExtension;
4690 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004691 }
4692
Jon Skeet96ddf012015-06-12 09:53:12 +01004693 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +01004694 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01004695 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01004696 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +01004697 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01004698 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +01004699 break;
4700 case 10: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01004701 NamePart_ = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01004702 break;
4703 }
4704 case 16: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01004705 IsExtension = input.ReadBool();
Jon Skeete38294a2015-06-09 19:30:44 +01004706 break;
4707 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004708 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004709 }
4710 }
Jon Skeete38294a2015-06-09 19:30:44 +01004711
Jon Skeetf3504cf2015-04-28 14:49:49 +01004712 }
4713
4714 }
4715 #endregion
4716
Jon Skeetf3504cf2015-04-28 14:49:49 +01004717 }
4718
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004719 /// <summary>
4720 /// Encapsulates information about the original source file from which a
4721 /// FileDescriptorProto was generated.
4722 /// </summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01004723 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +01004724 internal sealed partial class SourceCodeInfo : pb::IMessage<SourceCodeInfo> {
Jon Skeete38294a2015-06-09 19:30:44 +01004725 private static readonly pb::MessageParser<SourceCodeInfo> _parser = new pb::MessageParser<SourceCodeInfo>(() => new SourceCodeInfo());
4726 public static pb::MessageParser<SourceCodeInfo> Parser { get { return _parser; } }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004727
Jon Skeet76940942015-07-14 10:25:40 +01004728 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +01004729 get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[17]; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004730 }
4731
Jon Skeet96cffaa2015-07-20 19:25:07 +01004732 pbr::MessageDescriptor pb::IMessage.Descriptor {
4733 get { return Descriptor; }
Jon Skeete38294a2015-06-09 19:30:44 +01004734 }
4735
Jon Skeet53508222015-07-01 17:16:55 +01004736 public SourceCodeInfo() {
4737 OnConstruction();
4738 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01004739
Jon Skeet53508222015-07-01 17:16:55 +01004740 partial void OnConstruction();
4741
4742 public SourceCodeInfo(SourceCodeInfo other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01004743 location_ = other.location_.Clone();
Jon Skeete38294a2015-06-09 19:30:44 +01004744 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01004745
4746 public SourceCodeInfo Clone() {
4747 return new SourceCodeInfo(this);
4748 }
4749
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004750 /// <summary>Field number for the "location" field.</summary>
Jon Skeete38294a2015-06-09 19:30:44 +01004751 public const int LocationFieldNumber = 1;
Jon Skeet9c888fa2015-07-14 11:13:52 +01004752 private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location> _repeated_location_codec
4753 = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location.Parser);
4754 private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location> location_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004755 /// <summary>
4756 /// A Location identifies a piece of source code in a .proto file which
4757 /// corresponds to a particular definition. This information is intended
4758 /// to be useful to IDEs, code indexers, documentation generators, and similar
4759 /// tools.
Jon Skeetcff900e2015-11-06 18:38:31 +00004760 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004761 /// For example, say we have a file like:
4762 /// message Foo {
4763 /// optional string foo = 1;
4764 /// }
4765 /// Let's look at just the field definition:
4766 /// optional string foo = 1;
4767 /// ^ ^^ ^^ ^ ^^^
4768 /// a bc de f ghi
4769 /// We have the following locations:
4770 /// span path represents
4771 /// [a,i) [ 4, 0, 2, 0 ] The whole field definition.
4772 /// [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
4773 /// [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
4774 /// [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
4775 /// [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
Jon Skeetcff900e2015-11-06 18:38:31 +00004776 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004777 /// Notes:
4778 /// - A location may refer to a repeated field itself (i.e. not to any
4779 /// particular index within it). This is used whenever a set of elements are
4780 /// logically enclosed in a single code segment. For example, an entire
4781 /// extend block (possibly containing multiple extension definitions) will
4782 /// have an outer location whose path refers to the "extensions" repeated
4783 /// field without an index.
4784 /// - Multiple locations may have the same path. This happens when a single
4785 /// logical declaration is spread out across multiple places. The most
4786 /// obvious example is the "extend" block again -- there may be multiple
4787 /// extend blocks in the same scope, each of which will have the same path.
4788 /// - A location's span is not always a subset of its parent's span. For
4789 /// example, the "extendee" of an extension declaration appears at the
4790 /// beginning of the "extend" block and is shared by all extensions within
4791 /// the block.
4792 /// - Just because a location's span is a subset of some other location's span
4793 /// does not mean that it is a descendent. For example, a "group" defines
4794 /// both a type and a field in a single declaration. Thus, the locations
4795 /// corresponding to the type and field and their components will overlap.
4796 /// - Code which tries to interpret locations should probably be designed to
4797 /// ignore those that it doesn't understand, as more types of locations could
4798 /// be recorded in the future.
4799 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07004800 public pbc::RepeatedField<global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location> Location {
Jon Skeete38294a2015-06-09 19:30:44 +01004801 get { return location_; }
4802 }
4803
4804 public override bool Equals(object other) {
4805 return Equals(other as SourceCodeInfo);
4806 }
4807
4808 public bool Equals(SourceCodeInfo other) {
4809 if (ReferenceEquals(other, null)) {
4810 return false;
4811 }
4812 if (ReferenceEquals(other, this)) {
4813 return true;
4814 }
4815 if(!location_.Equals(other.location_)) return false;
4816 return true;
4817 }
4818
4819 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +01004820 int hash = 1;
Jon Skeete38294a2015-06-09 19:30:44 +01004821 hash ^= location_.GetHashCode();
4822 return hash;
4823 }
4824
Jon Skeet5b9288e2015-07-03 12:45:36 +01004825 public override string ToString() {
4826 return pb::JsonFormatter.Default.Format(this);
4827 }
4828
Jon Skeet96ddf012015-06-12 09:53:12 +01004829 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeetf2a27cc2015-06-26 17:37:14 +01004830 location_.WriteTo(output, _repeated_location_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01004831 }
4832
4833 public int CalculateSize() {
4834 int size = 0;
Jon Skeetf2a27cc2015-06-26 17:37:14 +01004835 size += location_.CalculateSize(_repeated_location_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01004836 return size;
4837 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +01004838
Jon Skeete38294a2015-06-09 19:30:44 +01004839 public void MergeFrom(SourceCodeInfo other) {
4840 if (other == null) {
4841 return;
4842 }
4843 location_.Add(other.location_);
4844 }
4845
Jon Skeet96ddf012015-06-12 09:53:12 +01004846 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +01004847 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01004848 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01004849 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +01004850 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01004851 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +01004852 break;
4853 case 10: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +01004854 location_.AddEntriesFrom(input, _repeated_location_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01004855 break;
4856 }
4857 }
4858 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004859 }
4860
4861 #region Nested types
Jon Skeetb0888a42015-09-29 13:37:30 +01004862 /// <summary>Container for nested types declared in the SourceCodeInfo message type.</summary>
Jon Skeete2c82302015-09-29 14:34:31 +01004863 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeetf3504cf2015-04-28 14:49:49 +01004864 public static partial class Types {
4865 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
Jon Skeet53508222015-07-01 17:16:55 +01004866 internal sealed partial class Location : pb::IMessage<Location> {
Jon Skeete38294a2015-06-09 19:30:44 +01004867 private static readonly pb::MessageParser<Location> _parser = new pb::MessageParser<Location>(() => new Location());
4868 public static pb::MessageParser<Location> Parser { get { return _parser; } }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004869
Jon Skeet76940942015-07-14 10:25:40 +01004870 public static pbr::MessageDescriptor Descriptor {
Jon Skeet9c888fa2015-07-14 11:13:52 +01004871 get { return global::Google.Protobuf.Reflection.SourceCodeInfo.Descriptor.NestedTypes[0]; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004872 }
4873
Jon Skeet96cffaa2015-07-20 19:25:07 +01004874 pbr::MessageDescriptor pb::IMessage.Descriptor {
4875 get { return Descriptor; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004876 }
4877
Jon Skeet53508222015-07-01 17:16:55 +01004878 public Location() {
4879 OnConstruction();
4880 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01004881
Jon Skeet53508222015-07-01 17:16:55 +01004882 partial void OnConstruction();
4883
4884 public Location(Location other) : this() {
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01004885 path_ = other.path_.Clone();
4886 span_ = other.span_.Clone();
4887 leadingComments_ = other.leadingComments_;
4888 trailingComments_ = other.trailingComments_;
4889 leadingDetachedComments_ = other.leadingDetachedComments_.Clone();
Jon Skeete38294a2015-06-09 19:30:44 +01004890 }
Jon Skeet6c1fe6e2015-06-23 11:54:19 +01004891
4892 public Location Clone() {
4893 return new Location(this);
4894 }
4895
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004896 /// <summary>Field number for the "path" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01004897 public const int PathFieldNumber = 1;
Jon Skeetf2a27cc2015-06-26 17:37:14 +01004898 private static readonly pb::FieldCodec<int> _repeated_path_codec
4899 = pb::FieldCodec.ForInt32(10);
Jon Skeete38294a2015-06-09 19:30:44 +01004900 private readonly pbc::RepeatedField<int> path_ = new pbc::RepeatedField<int>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004901 /// <summary>
4902 /// Identifies which part of the FileDescriptorProto was defined at this
4903 /// location.
Jon Skeetcff900e2015-11-06 18:38:31 +00004904 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004905 /// Each element is a field number or an index. They form a path from
4906 /// the root FileDescriptorProto to the place where the definition. For
4907 /// example, this path:
4908 /// [ 4, 3, 2, 7, 1 ]
4909 /// refers to:
4910 /// file.message_type(3) // 4, 3
4911 /// .field(7) // 2, 7
4912 /// .name() // 1
4913 /// This is because FileDescriptorProto.message_type has field number 4:
4914 /// repeated DescriptorProto message_type = 4;
4915 /// and DescriptorProto.field has field number 2:
4916 /// repeated FieldDescriptorProto field = 2;
4917 /// and FieldDescriptorProto.name has field number 1:
4918 /// optional string name = 1;
Jon Skeetcff900e2015-11-06 18:38:31 +00004919 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004920 /// Thus, the above path gives the location of a field name. If we removed
4921 /// the last element:
4922 /// [ 4, 3, 2, 7 ]
4923 /// this path refers to the whole field declaration (from the beginning
4924 /// of the label to the terminating semicolon).
4925 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07004926 public pbc::RepeatedField<int> Path {
Jon Skeete38294a2015-06-09 19:30:44 +01004927 get { return path_; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004928 }
4929
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004930 /// <summary>Field number for the "span" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01004931 public const int SpanFieldNumber = 2;
Jon Skeetf2a27cc2015-06-26 17:37:14 +01004932 private static readonly pb::FieldCodec<int> _repeated_span_codec
4933 = pb::FieldCodec.ForInt32(18);
Jon Skeete38294a2015-06-09 19:30:44 +01004934 private readonly pbc::RepeatedField<int> span_ = new pbc::RepeatedField<int>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004935 /// <summary>
4936 /// Always has exactly three or four elements: start line, start column,
4937 /// end line (optional, otherwise assumed same as start line), end column.
4938 /// These are packed into a single field for efficiency. Note that line
4939 /// and column numbers are zero-based -- typically you will want to add
4940 /// 1 to each before displaying to a user.
4941 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07004942 public pbc::RepeatedField<int> Span {
Jon Skeete38294a2015-06-09 19:30:44 +01004943 get { return span_; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01004944 }
4945
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004946 /// <summary>Field number for the "leading_comments" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01004947 public const int LeadingCommentsFieldNumber = 3;
Jon Skeetf3504cf2015-04-28 14:49:49 +01004948 private string leadingComments_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004949 /// <summary>
4950 /// If this SourceCodeInfo represents a complete declaration, these are any
4951 /// comments appearing before and after the declaration which appear to be
4952 /// attached to the declaration.
Jon Skeetcff900e2015-11-06 18:38:31 +00004953 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004954 /// A series of line comments appearing on consecutive lines, with no other
4955 /// tokens appearing on those lines, will be treated as a single comment.
Jon Skeetcff900e2015-11-06 18:38:31 +00004956 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004957 /// leading_detached_comments will keep paragraphs of comments that appear
4958 /// before (but not connected to) the current element. Each paragraph,
4959 /// separated by empty lines, will be one comment element in the repeated
4960 /// field.
Jon Skeetcff900e2015-11-06 18:38:31 +00004961 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004962 /// Only the comment content is provided; comment markers (e.g. //) are
4963 /// stripped out. For block comments, leading whitespace and an asterisk
4964 /// will be stripped from the beginning of each line other than the first.
4965 /// Newlines are included in the output.
Jon Skeetcff900e2015-11-06 18:38:31 +00004966 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004967 /// Examples:
Jon Skeetcff900e2015-11-06 18:38:31 +00004968 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004969 /// optional int32 foo = 1; // Comment attached to foo.
4970 /// // Comment attached to bar.
4971 /// optional int32 bar = 2;
Jon Skeetcff900e2015-11-06 18:38:31 +00004972 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004973 /// optional string baz = 3;
4974 /// // Comment attached to baz.
4975 /// // Another line attached to baz.
Jon Skeetcff900e2015-11-06 18:38:31 +00004976 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004977 /// // Comment attached to qux.
4978 /// //
4979 /// // Another line attached to qux.
4980 /// optional double qux = 4;
Jon Skeetcff900e2015-11-06 18:38:31 +00004981 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004982 /// // Detached comment for corge. This is not leading or trailing comments
4983 /// // to qux or corge because there are blank lines separating it from
4984 /// // both.
Jon Skeetcff900e2015-11-06 18:38:31 +00004985 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004986 /// // Detached comment for corge paragraph 2.
Jon Skeetcff900e2015-11-06 18:38:31 +00004987 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004988 /// optional string corge = 5;
4989 /// /* Block comment attached
4990 /// * to corge. Leading asterisks
4991 /// * will be removed. */
4992 /// /* Block comment attached to
4993 /// * grault. */
4994 /// optional int32 grault = 6;
Jon Skeetcff900e2015-11-06 18:38:31 +00004995 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +01004996 /// // ignored detached comments.
4997 /// </summary>
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07004998 public string LeadingComments {
Jon Skeetf3504cf2015-04-28 14:49:49 +01004999 get { return leadingComments_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01005000 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01005001 leadingComments_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01005002 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01005003 }
5004
Jon Skeet18e0a2e2015-10-01 10:38:01 +01005005 /// <summary>Field number for the "trailing_comments" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01005006 public const int TrailingCommentsFieldNumber = 4;
Jon Skeetf3504cf2015-04-28 14:49:49 +01005007 private string trailingComments_ = "";
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07005008 public string TrailingComments {
Jon Skeetf3504cf2015-04-28 14:49:49 +01005009 get { return trailingComments_; }
Jon Skeetbfee2df2015-06-23 16:09:27 +01005010 set {
Jon Skeetd18cc082015-07-30 13:50:02 +01005011 trailingComments_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeetbfee2df2015-06-23 16:09:27 +01005012 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01005013 }
5014
Jon Skeet18e0a2e2015-10-01 10:38:01 +01005015 /// <summary>Field number for the "leading_detached_comments" field.</summary>
Jon Skeetf3504cf2015-04-28 14:49:49 +01005016 public const int LeadingDetachedCommentsFieldNumber = 6;
Jon Skeetf2a27cc2015-06-26 17:37:14 +01005017 private static readonly pb::FieldCodec<string> _repeated_leadingDetachedComments_codec
5018 = pb::FieldCodec.ForString(50);
Jon Skeete38294a2015-06-09 19:30:44 +01005019 private readonly pbc::RepeatedField<string> leadingDetachedComments_ = new pbc::RepeatedField<string>();
Jan Tattermuschfa2fe352015-08-14 13:38:34 -07005020 public pbc::RepeatedField<string> LeadingDetachedComments {
Jon Skeete38294a2015-06-09 19:30:44 +01005021 get { return leadingDetachedComments_; }
Jon Skeetf3504cf2015-04-28 14:49:49 +01005022 }
5023
Jon Skeete38294a2015-06-09 19:30:44 +01005024 public override bool Equals(object other) {
5025 return Equals(other as Location);
5026 }
5027
5028 public bool Equals(Location other) {
5029 if (ReferenceEquals(other, null)) {
5030 return false;
5031 }
5032 if (ReferenceEquals(other, this)) {
Jon Skeetf3504cf2015-04-28 14:49:49 +01005033 return true;
5034 }
Jon Skeete38294a2015-06-09 19:30:44 +01005035 if(!path_.Equals(other.path_)) return false;
5036 if(!span_.Equals(other.span_)) return false;
5037 if (LeadingComments != other.LeadingComments) return false;
5038 if (TrailingComments != other.TrailingComments) return false;
5039 if(!leadingDetachedComments_.Equals(other.leadingDetachedComments_)) return false;
5040 return true;
Jon Skeetf3504cf2015-04-28 14:49:49 +01005041 }
5042
Jon Skeete38294a2015-06-09 19:30:44 +01005043 public override int GetHashCode() {
Jon Skeete6fc9772015-06-26 10:32:50 +01005044 int hash = 1;
Jon Skeete38294a2015-06-09 19:30:44 +01005045 hash ^= path_.GetHashCode();
5046 hash ^= span_.GetHashCode();
Jon Skeetfb1547b2015-06-12 13:11:54 +01005047 if (LeadingComments.Length != 0) hash ^= LeadingComments.GetHashCode();
5048 if (TrailingComments.Length != 0) hash ^= TrailingComments.GetHashCode();
Jon Skeete38294a2015-06-09 19:30:44 +01005049 hash ^= leadingDetachedComments_.GetHashCode();
5050 return hash;
Jon Skeetf3504cf2015-04-28 14:49:49 +01005051 }
5052
Jon Skeet5b9288e2015-07-03 12:45:36 +01005053 public override string ToString() {
5054 return pb::JsonFormatter.Default.Format(this);
5055 }
5056
Jon Skeet96ddf012015-06-12 09:53:12 +01005057 public void WriteTo(pb::CodedOutputStream output) {
Jon Skeetf2a27cc2015-06-26 17:37:14 +01005058 path_.WriteTo(output, _repeated_path_codec);
5059 span_.WriteTo(output, _repeated_span_codec);
Jon Skeetfb1547b2015-06-12 13:11:54 +01005060 if (LeadingComments.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01005061 output.WriteRawTag(26);
5062 output.WriteString(LeadingComments);
Jon Skeetf3504cf2015-04-28 14:49:49 +01005063 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01005064 if (TrailingComments.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01005065 output.WriteRawTag(34);
5066 output.WriteString(TrailingComments);
Jon Skeete38294a2015-06-09 19:30:44 +01005067 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01005068 leadingDetachedComments_.WriteTo(output, _repeated_leadingDetachedComments_codec);
Jon Skeetf3504cf2015-04-28 14:49:49 +01005069 }
5070
Jon Skeete38294a2015-06-09 19:30:44 +01005071 public int CalculateSize() {
5072 int size = 0;
Jon Skeetf2a27cc2015-06-26 17:37:14 +01005073 size += path_.CalculateSize(_repeated_path_codec);
5074 size += span_.CalculateSize(_repeated_span_codec);
Jon Skeetfb1547b2015-06-12 13:11:54 +01005075 if (LeadingComments.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01005076 size += 1 + pb::CodedOutputStream.ComputeStringSize(LeadingComments);
Jon Skeetf3504cf2015-04-28 14:49:49 +01005077 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01005078 if (TrailingComments.Length != 0) {
Jon Skeet828b7e62015-06-17 14:59:10 +01005079 size += 1 + pb::CodedOutputStream.ComputeStringSize(TrailingComments);
Jon Skeetf3504cf2015-04-28 14:49:49 +01005080 }
Jon Skeetf2a27cc2015-06-26 17:37:14 +01005081 size += leadingDetachedComments_.CalculateSize(_repeated_leadingDetachedComments_codec);
Jon Skeetf3504cf2015-04-28 14:49:49 +01005082 return size;
5083 }
Jon Skeet3e7d70c2015-06-25 12:08:55 +01005084
Jon Skeete38294a2015-06-09 19:30:44 +01005085 public void MergeFrom(Location other) {
5086 if (other == null) {
5087 return;
5088 }
5089 path_.Add(other.path_);
5090 span_.Add(other.span_);
Jon Skeetfb1547b2015-06-12 13:11:54 +01005091 if (other.LeadingComments.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01005092 LeadingComments = other.LeadingComments;
5093 }
Jon Skeetfb1547b2015-06-12 13:11:54 +01005094 if (other.TrailingComments.Length != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01005095 TrailingComments = other.TrailingComments;
5096 }
5097 leadingDetachedComments_.Add(other.leadingDetachedComments_);
Jon Skeetf3504cf2015-04-28 14:49:49 +01005098 }
5099
Jon Skeet96ddf012015-06-12 09:53:12 +01005100 public void MergeFrom(pb::CodedInputStream input) {
Jon Skeete38294a2015-06-09 19:30:44 +01005101 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +01005102 while ((tag = input.ReadTag()) != 0) {
Jon Skeete38294a2015-06-09 19:30:44 +01005103 switch(tag) {
Jon Skeete38294a2015-06-09 19:30:44 +01005104 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +01005105 input.SkipLastField();
Jon Skeete38294a2015-06-09 19:30:44 +01005106 break;
5107 case 10:
5108 case 8: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +01005109 path_.AddEntriesFrom(input, _repeated_path_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01005110 break;
5111 }
5112 case 18:
5113 case 16: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +01005114 span_.AddEntriesFrom(input, _repeated_span_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01005115 break;
5116 }
5117 case 26: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01005118 LeadingComments = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01005119 break;
5120 }
5121 case 34: {
Jon Skeetfb1547b2015-06-12 13:11:54 +01005122 TrailingComments = input.ReadString();
Jon Skeete38294a2015-06-09 19:30:44 +01005123 break;
5124 }
5125 case 50: {
Jon Skeetf2a27cc2015-06-26 17:37:14 +01005126 leadingDetachedComments_.AddEntriesFrom(input, _repeated_leadingDetachedComments_codec);
Jon Skeete38294a2015-06-09 19:30:44 +01005127 break;
5128 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01005129 }
Jon Skeetf3504cf2015-04-28 14:49:49 +01005130 }
5131 }
Jon Skeete38294a2015-06-09 19:30:44 +01005132
Jon Skeetf3504cf2015-04-28 14:49:49 +01005133 }
5134
5135 }
5136 #endregion
5137
Jon Skeetf3504cf2015-04-28 14:49:49 +01005138 }
5139
5140 #endregion
5141
5142}
5143
5144#endregion Designer generated code