Conformance.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. // <auto-generated>
  2. // Generated by the protocol buffer compiler. DO NOT EDIT!
  3. // source: conformance.proto
  4. // </auto-generated>
  5. #pragma warning disable 1591, 0612, 3021
  6. #region Designer generated code
  7. using pb = global::Google.Protobuf;
  8. using pbc = global::Google.Protobuf.Collections;
  9. using pbr = global::Google.Protobuf.Reflection;
  10. using scg = global::System.Collections.Generic;
  11. namespace Conformance {
  12. /// <summary>Holder for reflection information generated from conformance.proto</summary>
  13. public static partial class ConformanceReflection {
  14. #region Descriptor
  15. /// <summary>File descriptor for conformance.proto</summary>
  16. public static pbr::FileDescriptor Descriptor {
  17. get { return descriptor; }
  18. }
  19. private static pbr::FileDescriptor descriptor;
  20. static ConformanceReflection() {
  21. byte[] descriptorData = global::System.Convert.FromBase64String(
  22. string.Concat(
  23. "ChFjb25mb3JtYW5jZS5wcm90bxILY29uZm9ybWFuY2UiowEKEkNvbmZvcm1h",
  24. "bmNlUmVxdWVzdBIaChBwcm90b2J1Zl9wYXlsb2FkGAEgASgMSAASFgoManNv",
  25. "bl9wYXlsb2FkGAIgASgJSAASOAoXcmVxdWVzdGVkX291dHB1dF9mb3JtYXQY",
  26. "AyABKA4yFy5jb25mb3JtYW5jZS5XaXJlRm9ybWF0EhQKDG1lc3NhZ2VfdHlw",
  27. "ZRgEIAEoCUIJCgdwYXlsb2FkIrEBChNDb25mb3JtYW5jZVJlc3BvbnNlEhUK",
  28. "C3BhcnNlX2Vycm9yGAEgASgJSAASGQoPc2VyaWFsaXplX2Vycm9yGAYgASgJ",
  29. "SAASFwoNcnVudGltZV9lcnJvchgCIAEoCUgAEhoKEHByb3RvYnVmX3BheWxv",
  30. "YWQYAyABKAxIABIWCgxqc29uX3BheWxvYWQYBCABKAlIABIRCgdza2lwcGVk",
  31. "GAUgASgJSABCCAoGcmVzdWx0KjUKCldpcmVGb3JtYXQSDwoLVU5TUEVDSUZJ",
  32. "RUQQABIMCghQUk9UT0JVRhABEggKBEpTT04QAkIhCh9jb20uZ29vZ2xlLnBy",
  33. "b3RvYnVmLmNvbmZvcm1hbmNlYgZwcm90bzM="));
  34. descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
  35. new pbr::FileDescriptor[] { },
  36. new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Conformance.WireFormat), }, new pbr::GeneratedClrTypeInfo[] {
  37. new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ConformanceRequest), global::Conformance.ConformanceRequest.Parser, new[]{ "ProtobufPayload", "JsonPayload", "RequestedOutputFormat", "MessageType" }, new[]{ "Payload" }, null, null),
  38. new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ConformanceResponse), global::Conformance.ConformanceResponse.Parser, new[]{ "ParseError", "SerializeError", "RuntimeError", "ProtobufPayload", "JsonPayload", "Skipped" }, new[]{ "Result" }, null, null)
  39. }));
  40. }
  41. #endregion
  42. }
  43. #region Enums
  44. public enum WireFormat {
  45. [pbr::OriginalName("UNSPECIFIED")] Unspecified = 0,
  46. [pbr::OriginalName("PROTOBUF")] Protobuf = 1,
  47. [pbr::OriginalName("JSON")] Json = 2,
  48. }
  49. #endregion
  50. #region Messages
  51. /// <summary>
  52. /// Represents a single test case's input. The testee should:
  53. ///
  54. /// 1. parse this proto (which should always succeed)
  55. /// 2. parse the protobuf or JSON payload in "payload" (which may fail)
  56. /// 3. if the parse succeeded, serialize the message in the requested format.
  57. /// </summary>
  58. public sealed partial class ConformanceRequest : pb::IMessage<ConformanceRequest> {
  59. private static readonly pb::MessageParser<ConformanceRequest> _parser = new pb::MessageParser<ConformanceRequest>(() => new ConformanceRequest());
  60. private pb::UnknownFieldSet _unknownFields;
  61. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  62. public static pb::MessageParser<ConformanceRequest> Parser { get { return _parser; } }
  63. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  64. public static pbr::MessageDescriptor Descriptor {
  65. get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[0]; }
  66. }
  67. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  68. pbr::MessageDescriptor pb::IMessage.Descriptor {
  69. get { return Descriptor; }
  70. }
  71. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  72. public ConformanceRequest() {
  73. OnConstruction();
  74. }
  75. partial void OnConstruction();
  76. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  77. public ConformanceRequest(ConformanceRequest other) : this() {
  78. requestedOutputFormat_ = other.requestedOutputFormat_;
  79. messageType_ = other.messageType_;
  80. switch (other.PayloadCase) {
  81. case PayloadOneofCase.ProtobufPayload:
  82. ProtobufPayload = other.ProtobufPayload;
  83. break;
  84. case PayloadOneofCase.JsonPayload:
  85. JsonPayload = other.JsonPayload;
  86. break;
  87. }
  88. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  89. }
  90. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  91. public ConformanceRequest Clone() {
  92. return new ConformanceRequest(this);
  93. }
  94. /// <summary>Field number for the "protobuf_payload" field.</summary>
  95. public const int ProtobufPayloadFieldNumber = 1;
  96. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  97. public pb::ByteString ProtobufPayload {
  98. get { return payloadCase_ == PayloadOneofCase.ProtobufPayload ? (pb::ByteString) payload_ : pb::ByteString.Empty; }
  99. set {
  100. payload_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  101. payloadCase_ = PayloadOneofCase.ProtobufPayload;
  102. }
  103. }
  104. /// <summary>Field number for the "json_payload" field.</summary>
  105. public const int JsonPayloadFieldNumber = 2;
  106. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  107. public string JsonPayload {
  108. get { return payloadCase_ == PayloadOneofCase.JsonPayload ? (string) payload_ : ""; }
  109. set {
  110. payload_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  111. payloadCase_ = PayloadOneofCase.JsonPayload;
  112. }
  113. }
  114. /// <summary>Field number for the "requested_output_format" field.</summary>
  115. public const int RequestedOutputFormatFieldNumber = 3;
  116. private global::Conformance.WireFormat requestedOutputFormat_ = 0;
  117. /// <summary>
  118. /// Which format should the testee serialize its message to?
  119. /// </summary>
  120. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  121. public global::Conformance.WireFormat RequestedOutputFormat {
  122. get { return requestedOutputFormat_; }
  123. set {
  124. requestedOutputFormat_ = value;
  125. }
  126. }
  127. /// <summary>Field number for the "message_type" field.</summary>
  128. public const int MessageTypeFieldNumber = 4;
  129. private string messageType_ = "";
  130. /// <summary>
  131. /// The full name for the test message to use; for the moment, either:
  132. /// protobuf_test_messages.proto3.TestAllTypesProto3 or
  133. /// protobuf_test_messages.proto2.TestAllTypesProto2.
  134. /// </summary>
  135. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  136. public string MessageType {
  137. get { return messageType_; }
  138. set {
  139. messageType_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  140. }
  141. }
  142. private object payload_;
  143. /// <summary>Enum of possible cases for the "payload" oneof.</summary>
  144. public enum PayloadOneofCase {
  145. None = 0,
  146. ProtobufPayload = 1,
  147. JsonPayload = 2,
  148. }
  149. private PayloadOneofCase payloadCase_ = PayloadOneofCase.None;
  150. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  151. public PayloadOneofCase PayloadCase {
  152. get { return payloadCase_; }
  153. }
  154. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  155. public void ClearPayload() {
  156. payloadCase_ = PayloadOneofCase.None;
  157. payload_ = null;
  158. }
  159. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  160. public override bool Equals(object other) {
  161. return Equals(other as ConformanceRequest);
  162. }
  163. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  164. public bool Equals(ConformanceRequest other) {
  165. if (ReferenceEquals(other, null)) {
  166. return false;
  167. }
  168. if (ReferenceEquals(other, this)) {
  169. return true;
  170. }
  171. if (ProtobufPayload != other.ProtobufPayload) return false;
  172. if (JsonPayload != other.JsonPayload) return false;
  173. if (RequestedOutputFormat != other.RequestedOutputFormat) return false;
  174. if (MessageType != other.MessageType) return false;
  175. if (PayloadCase != other.PayloadCase) return false;
  176. return Equals(_unknownFields, other._unknownFields);
  177. }
  178. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  179. public override int GetHashCode() {
  180. int hash = 1;
  181. if (payloadCase_ == PayloadOneofCase.ProtobufPayload) hash ^= ProtobufPayload.GetHashCode();
  182. if (payloadCase_ == PayloadOneofCase.JsonPayload) hash ^= JsonPayload.GetHashCode();
  183. if (RequestedOutputFormat != 0) hash ^= RequestedOutputFormat.GetHashCode();
  184. if (MessageType.Length != 0) hash ^= MessageType.GetHashCode();
  185. hash ^= (int) payloadCase_;
  186. if (_unknownFields != null) {
  187. hash ^= _unknownFields.GetHashCode();
  188. }
  189. return hash;
  190. }
  191. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  192. public override string ToString() {
  193. return pb::JsonFormatter.ToDiagnosticString(this);
  194. }
  195. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  196. public void WriteTo(pb::CodedOutputStream output) {
  197. if (payloadCase_ == PayloadOneofCase.ProtobufPayload) {
  198. output.WriteRawTag(10);
  199. output.WriteBytes(ProtobufPayload);
  200. }
  201. if (payloadCase_ == PayloadOneofCase.JsonPayload) {
  202. output.WriteRawTag(18);
  203. output.WriteString(JsonPayload);
  204. }
  205. if (RequestedOutputFormat != 0) {
  206. output.WriteRawTag(24);
  207. output.WriteEnum((int) RequestedOutputFormat);
  208. }
  209. if (MessageType.Length != 0) {
  210. output.WriteRawTag(34);
  211. output.WriteString(MessageType);
  212. }
  213. if (_unknownFields != null) {
  214. _unknownFields.WriteTo(output);
  215. }
  216. }
  217. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  218. public int CalculateSize() {
  219. int size = 0;
  220. if (payloadCase_ == PayloadOneofCase.ProtobufPayload) {
  221. size += 1 + pb::CodedOutputStream.ComputeBytesSize(ProtobufPayload);
  222. }
  223. if (payloadCase_ == PayloadOneofCase.JsonPayload) {
  224. size += 1 + pb::CodedOutputStream.ComputeStringSize(JsonPayload);
  225. }
  226. if (RequestedOutputFormat != 0) {
  227. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) RequestedOutputFormat);
  228. }
  229. if (MessageType.Length != 0) {
  230. size += 1 + pb::CodedOutputStream.ComputeStringSize(MessageType);
  231. }
  232. if (_unknownFields != null) {
  233. size += _unknownFields.CalculateSize();
  234. }
  235. return size;
  236. }
  237. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  238. public void MergeFrom(ConformanceRequest other) {
  239. if (other == null) {
  240. return;
  241. }
  242. if (other.RequestedOutputFormat != 0) {
  243. RequestedOutputFormat = other.RequestedOutputFormat;
  244. }
  245. if (other.MessageType.Length != 0) {
  246. MessageType = other.MessageType;
  247. }
  248. switch (other.PayloadCase) {
  249. case PayloadOneofCase.ProtobufPayload:
  250. ProtobufPayload = other.ProtobufPayload;
  251. break;
  252. case PayloadOneofCase.JsonPayload:
  253. JsonPayload = other.JsonPayload;
  254. break;
  255. }
  256. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  257. }
  258. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  259. public void MergeFrom(pb::CodedInputStream input) {
  260. uint tag;
  261. while ((tag = input.ReadTag()) != 0) {
  262. switch(tag) {
  263. default:
  264. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  265. break;
  266. case 10: {
  267. ProtobufPayload = input.ReadBytes();
  268. break;
  269. }
  270. case 18: {
  271. JsonPayload = input.ReadString();
  272. break;
  273. }
  274. case 24: {
  275. requestedOutputFormat_ = (global::Conformance.WireFormat) input.ReadEnum();
  276. break;
  277. }
  278. case 34: {
  279. MessageType = input.ReadString();
  280. break;
  281. }
  282. }
  283. }
  284. }
  285. }
  286. /// <summary>
  287. /// Represents a single test case's output.
  288. /// </summary>
  289. public sealed partial class ConformanceResponse : pb::IMessage<ConformanceResponse> {
  290. private static readonly pb::MessageParser<ConformanceResponse> _parser = new pb::MessageParser<ConformanceResponse>(() => new ConformanceResponse());
  291. private pb::UnknownFieldSet _unknownFields;
  292. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  293. public static pb::MessageParser<ConformanceResponse> Parser { get { return _parser; } }
  294. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  295. public static pbr::MessageDescriptor Descriptor {
  296. get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[1]; }
  297. }
  298. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  299. pbr::MessageDescriptor pb::IMessage.Descriptor {
  300. get { return Descriptor; }
  301. }
  302. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  303. public ConformanceResponse() {
  304. OnConstruction();
  305. }
  306. partial void OnConstruction();
  307. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  308. public ConformanceResponse(ConformanceResponse other) : this() {
  309. switch (other.ResultCase) {
  310. case ResultOneofCase.ParseError:
  311. ParseError = other.ParseError;
  312. break;
  313. case ResultOneofCase.SerializeError:
  314. SerializeError = other.SerializeError;
  315. break;
  316. case ResultOneofCase.RuntimeError:
  317. RuntimeError = other.RuntimeError;
  318. break;
  319. case ResultOneofCase.ProtobufPayload:
  320. ProtobufPayload = other.ProtobufPayload;
  321. break;
  322. case ResultOneofCase.JsonPayload:
  323. JsonPayload = other.JsonPayload;
  324. break;
  325. case ResultOneofCase.Skipped:
  326. Skipped = other.Skipped;
  327. break;
  328. }
  329. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  330. }
  331. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  332. public ConformanceResponse Clone() {
  333. return new ConformanceResponse(this);
  334. }
  335. /// <summary>Field number for the "parse_error" field.</summary>
  336. public const int ParseErrorFieldNumber = 1;
  337. /// <summary>
  338. /// This string should be set to indicate parsing failed. The string can
  339. /// provide more information about the parse error if it is available.
  340. ///
  341. /// Setting this string does not necessarily mean the testee failed the
  342. /// test. Some of the test cases are intentionally invalid input.
  343. /// </summary>
  344. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  345. public string ParseError {
  346. get { return resultCase_ == ResultOneofCase.ParseError ? (string) result_ : ""; }
  347. set {
  348. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  349. resultCase_ = ResultOneofCase.ParseError;
  350. }
  351. }
  352. /// <summary>Field number for the "serialize_error" field.</summary>
  353. public const int SerializeErrorFieldNumber = 6;
  354. /// <summary>
  355. /// If the input was successfully parsed but errors occurred when
  356. /// serializing it to the requested output format, set the error message in
  357. /// this field.
  358. /// </summary>
  359. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  360. public string SerializeError {
  361. get { return resultCase_ == ResultOneofCase.SerializeError ? (string) result_ : ""; }
  362. set {
  363. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  364. resultCase_ = ResultOneofCase.SerializeError;
  365. }
  366. }
  367. /// <summary>Field number for the "runtime_error" field.</summary>
  368. public const int RuntimeErrorFieldNumber = 2;
  369. /// <summary>
  370. /// This should be set if some other error occurred. This will always
  371. /// indicate that the test failed. The string can provide more information
  372. /// about the failure.
  373. /// </summary>
  374. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  375. public string RuntimeError {
  376. get { return resultCase_ == ResultOneofCase.RuntimeError ? (string) result_ : ""; }
  377. set {
  378. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  379. resultCase_ = ResultOneofCase.RuntimeError;
  380. }
  381. }
  382. /// <summary>Field number for the "protobuf_payload" field.</summary>
  383. public const int ProtobufPayloadFieldNumber = 3;
  384. /// <summary>
  385. /// If the input was successfully parsed and the requested output was
  386. /// protobuf, serialize it to protobuf and set it in this field.
  387. /// </summary>
  388. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  389. public pb::ByteString ProtobufPayload {
  390. get { return resultCase_ == ResultOneofCase.ProtobufPayload ? (pb::ByteString) result_ : pb::ByteString.Empty; }
  391. set {
  392. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  393. resultCase_ = ResultOneofCase.ProtobufPayload;
  394. }
  395. }
  396. /// <summary>Field number for the "json_payload" field.</summary>
  397. public const int JsonPayloadFieldNumber = 4;
  398. /// <summary>
  399. /// If the input was successfully parsed and the requested output was JSON,
  400. /// serialize to JSON and set it in this field.
  401. /// </summary>
  402. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  403. public string JsonPayload {
  404. get { return resultCase_ == ResultOneofCase.JsonPayload ? (string) result_ : ""; }
  405. set {
  406. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  407. resultCase_ = ResultOneofCase.JsonPayload;
  408. }
  409. }
  410. /// <summary>Field number for the "skipped" field.</summary>
  411. public const int SkippedFieldNumber = 5;
  412. /// <summary>
  413. /// For when the testee skipped the test, likely because a certain feature
  414. /// wasn't supported, like JSON input/output.
  415. /// </summary>
  416. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  417. public string Skipped {
  418. get { return resultCase_ == ResultOneofCase.Skipped ? (string) result_ : ""; }
  419. set {
  420. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  421. resultCase_ = ResultOneofCase.Skipped;
  422. }
  423. }
  424. private object result_;
  425. /// <summary>Enum of possible cases for the "result" oneof.</summary>
  426. public enum ResultOneofCase {
  427. None = 0,
  428. ParseError = 1,
  429. SerializeError = 6,
  430. RuntimeError = 2,
  431. ProtobufPayload = 3,
  432. JsonPayload = 4,
  433. Skipped = 5,
  434. }
  435. private ResultOneofCase resultCase_ = ResultOneofCase.None;
  436. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  437. public ResultOneofCase ResultCase {
  438. get { return resultCase_; }
  439. }
  440. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  441. public void ClearResult() {
  442. resultCase_ = ResultOneofCase.None;
  443. result_ = null;
  444. }
  445. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  446. public override bool Equals(object other) {
  447. return Equals(other as ConformanceResponse);
  448. }
  449. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  450. public bool Equals(ConformanceResponse other) {
  451. if (ReferenceEquals(other, null)) {
  452. return false;
  453. }
  454. if (ReferenceEquals(other, this)) {
  455. return true;
  456. }
  457. if (ParseError != other.ParseError) return false;
  458. if (SerializeError != other.SerializeError) return false;
  459. if (RuntimeError != other.RuntimeError) return false;
  460. if (ProtobufPayload != other.ProtobufPayload) return false;
  461. if (JsonPayload != other.JsonPayload) return false;
  462. if (Skipped != other.Skipped) return false;
  463. if (ResultCase != other.ResultCase) return false;
  464. return Equals(_unknownFields, other._unknownFields);
  465. }
  466. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  467. public override int GetHashCode() {
  468. int hash = 1;
  469. if (resultCase_ == ResultOneofCase.ParseError) hash ^= ParseError.GetHashCode();
  470. if (resultCase_ == ResultOneofCase.SerializeError) hash ^= SerializeError.GetHashCode();
  471. if (resultCase_ == ResultOneofCase.RuntimeError) hash ^= RuntimeError.GetHashCode();
  472. if (resultCase_ == ResultOneofCase.ProtobufPayload) hash ^= ProtobufPayload.GetHashCode();
  473. if (resultCase_ == ResultOneofCase.JsonPayload) hash ^= JsonPayload.GetHashCode();
  474. if (resultCase_ == ResultOneofCase.Skipped) hash ^= Skipped.GetHashCode();
  475. hash ^= (int) resultCase_;
  476. if (_unknownFields != null) {
  477. hash ^= _unknownFields.GetHashCode();
  478. }
  479. return hash;
  480. }
  481. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  482. public override string ToString() {
  483. return pb::JsonFormatter.ToDiagnosticString(this);
  484. }
  485. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  486. public void WriteTo(pb::CodedOutputStream output) {
  487. if (resultCase_ == ResultOneofCase.ParseError) {
  488. output.WriteRawTag(10);
  489. output.WriteString(ParseError);
  490. }
  491. if (resultCase_ == ResultOneofCase.RuntimeError) {
  492. output.WriteRawTag(18);
  493. output.WriteString(RuntimeError);
  494. }
  495. if (resultCase_ == ResultOneofCase.ProtobufPayload) {
  496. output.WriteRawTag(26);
  497. output.WriteBytes(ProtobufPayload);
  498. }
  499. if (resultCase_ == ResultOneofCase.JsonPayload) {
  500. output.WriteRawTag(34);
  501. output.WriteString(JsonPayload);
  502. }
  503. if (resultCase_ == ResultOneofCase.Skipped) {
  504. output.WriteRawTag(42);
  505. output.WriteString(Skipped);
  506. }
  507. if (resultCase_ == ResultOneofCase.SerializeError) {
  508. output.WriteRawTag(50);
  509. output.WriteString(SerializeError);
  510. }
  511. if (_unknownFields != null) {
  512. _unknownFields.WriteTo(output);
  513. }
  514. }
  515. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  516. public int CalculateSize() {
  517. int size = 0;
  518. if (resultCase_ == ResultOneofCase.ParseError) {
  519. size += 1 + pb::CodedOutputStream.ComputeStringSize(ParseError);
  520. }
  521. if (resultCase_ == ResultOneofCase.SerializeError) {
  522. size += 1 + pb::CodedOutputStream.ComputeStringSize(SerializeError);
  523. }
  524. if (resultCase_ == ResultOneofCase.RuntimeError) {
  525. size += 1 + pb::CodedOutputStream.ComputeStringSize(RuntimeError);
  526. }
  527. if (resultCase_ == ResultOneofCase.ProtobufPayload) {
  528. size += 1 + pb::CodedOutputStream.ComputeBytesSize(ProtobufPayload);
  529. }
  530. if (resultCase_ == ResultOneofCase.JsonPayload) {
  531. size += 1 + pb::CodedOutputStream.ComputeStringSize(JsonPayload);
  532. }
  533. if (resultCase_ == ResultOneofCase.Skipped) {
  534. size += 1 + pb::CodedOutputStream.ComputeStringSize(Skipped);
  535. }
  536. if (_unknownFields != null) {
  537. size += _unknownFields.CalculateSize();
  538. }
  539. return size;
  540. }
  541. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  542. public void MergeFrom(ConformanceResponse other) {
  543. if (other == null) {
  544. return;
  545. }
  546. switch (other.ResultCase) {
  547. case ResultOneofCase.ParseError:
  548. ParseError = other.ParseError;
  549. break;
  550. case ResultOneofCase.SerializeError:
  551. SerializeError = other.SerializeError;
  552. break;
  553. case ResultOneofCase.RuntimeError:
  554. RuntimeError = other.RuntimeError;
  555. break;
  556. case ResultOneofCase.ProtobufPayload:
  557. ProtobufPayload = other.ProtobufPayload;
  558. break;
  559. case ResultOneofCase.JsonPayload:
  560. JsonPayload = other.JsonPayload;
  561. break;
  562. case ResultOneofCase.Skipped:
  563. Skipped = other.Skipped;
  564. break;
  565. }
  566. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  567. }
  568. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  569. public void MergeFrom(pb::CodedInputStream input) {
  570. uint tag;
  571. while ((tag = input.ReadTag()) != 0) {
  572. switch(tag) {
  573. default:
  574. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  575. break;
  576. case 10: {
  577. ParseError = input.ReadString();
  578. break;
  579. }
  580. case 18: {
  581. RuntimeError = input.ReadString();
  582. break;
  583. }
  584. case 26: {
  585. ProtobufPayload = input.ReadBytes();
  586. break;
  587. }
  588. case 34: {
  589. JsonPayload = input.ReadString();
  590. break;
  591. }
  592. case 42: {
  593. Skipped = input.ReadString();
  594. break;
  595. }
  596. case 50: {
  597. SerializeError = input.ReadString();
  598. break;
  599. }
  600. }
  601. }
  602. }
  603. }
  604. #endregion
  605. }
  606. #endregion Designer generated code