Payloads.cs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: test/proto/benchmarks/payloads.proto
  3. #pragma warning disable 1591, 0612, 3021
  4. #region Designer generated code
  5. using pb = global::Google.Protobuf;
  6. using pbc = global::Google.Protobuf.Collections;
  7. using pbr = global::Google.Protobuf.Reflection;
  8. using scg = global::System.Collections.Generic;
  9. namespace Grpc.Testing {
  10. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  11. public static partial class Payloads {
  12. #region Descriptor
  13. public static pbr::FileDescriptor Descriptor {
  14. get { return descriptor; }
  15. }
  16. private static pbr::FileDescriptor descriptor;
  17. static Payloads() {
  18. byte[] descriptorData = global::System.Convert.FromBase64String(
  19. string.Concat(
  20. "CiR0ZXN0L3Byb3RvL2JlbmNobWFya3MvcGF5bG9hZHMucHJvdG8SDGdycGMu",
  21. "dGVzdGluZyI3ChBCeXRlQnVmZmVyUGFyYW1zEhAKCHJlcV9zaXplGAEgASgF",
  22. "EhEKCXJlc3Bfc2l6ZRgCIAEoBSI4ChFTaW1wbGVQcm90b1BhcmFtcxIQCghy",
  23. "ZXFfc2l6ZRgBIAEoBRIRCglyZXNwX3NpemUYAiABKAUiFAoSQ29tcGxleFBy",
  24. "b3RvUGFyYW1zIsoBCg1QYXlsb2FkQ29uZmlnEjgKDmJ5dGVidWZfcGFyYW1z",
  25. "GAEgASgLMh4uZ3JwYy50ZXN0aW5nLkJ5dGVCdWZmZXJQYXJhbXNIABI4Cg1z",
  26. "aW1wbGVfcGFyYW1zGAIgASgLMh8uZ3JwYy50ZXN0aW5nLlNpbXBsZVByb3Rv",
  27. "UGFyYW1zSAASOgoOY29tcGxleF9wYXJhbXMYAyABKAsyIC5ncnBjLnRlc3Rp",
  28. "bmcuQ29tcGxleFByb3RvUGFyYW1zSABCCQoHcGF5bG9hZGIGcHJvdG8z"));
  29. descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
  30. new pbr::FileDescriptor[] { },
  31. new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] {
  32. new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ByteBufferParams), new[]{ "ReqSize", "RespSize" }, null, null, null),
  33. new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.SimpleProtoParams), new[]{ "ReqSize", "RespSize" }, null, null, null),
  34. new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ComplexProtoParams), null, null, null, null),
  35. new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.PayloadConfig), new[]{ "BytebufParams", "SimpleParams", "ComplexParams" }, new[]{ "Payload" }, null, null)
  36. }));
  37. }
  38. #endregion
  39. }
  40. #region Messages
  41. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  42. public sealed partial class ByteBufferParams : pb::IMessage<ByteBufferParams> {
  43. private static readonly pb::MessageParser<ByteBufferParams> _parser = new pb::MessageParser<ByteBufferParams>(() => new ByteBufferParams());
  44. public static pb::MessageParser<ByteBufferParams> Parser { get { return _parser; } }
  45. public static pbr::MessageDescriptor Descriptor {
  46. get { return global::Grpc.Testing.Payloads.Descriptor.MessageTypes[0]; }
  47. }
  48. pbr::MessageDescriptor pb::IMessage.Descriptor {
  49. get { return Descriptor; }
  50. }
  51. public ByteBufferParams() {
  52. OnConstruction();
  53. }
  54. partial void OnConstruction();
  55. public ByteBufferParams(ByteBufferParams other) : this() {
  56. reqSize_ = other.reqSize_;
  57. respSize_ = other.respSize_;
  58. }
  59. public ByteBufferParams Clone() {
  60. return new ByteBufferParams(this);
  61. }
  62. public const int ReqSizeFieldNumber = 1;
  63. private int reqSize_;
  64. public int ReqSize {
  65. get { return reqSize_; }
  66. set {
  67. reqSize_ = value;
  68. }
  69. }
  70. public const int RespSizeFieldNumber = 2;
  71. private int respSize_;
  72. public int RespSize {
  73. get { return respSize_; }
  74. set {
  75. respSize_ = value;
  76. }
  77. }
  78. public override bool Equals(object other) {
  79. return Equals(other as ByteBufferParams);
  80. }
  81. public bool Equals(ByteBufferParams other) {
  82. if (ReferenceEquals(other, null)) {
  83. return false;
  84. }
  85. if (ReferenceEquals(other, this)) {
  86. return true;
  87. }
  88. if (ReqSize != other.ReqSize) return false;
  89. if (RespSize != other.RespSize) return false;
  90. return true;
  91. }
  92. public override int GetHashCode() {
  93. int hash = 1;
  94. if (ReqSize != 0) hash ^= ReqSize.GetHashCode();
  95. if (RespSize != 0) hash ^= RespSize.GetHashCode();
  96. return hash;
  97. }
  98. public override string ToString() {
  99. return pb::JsonFormatter.Default.Format(this);
  100. }
  101. public void WriteTo(pb::CodedOutputStream output) {
  102. if (ReqSize != 0) {
  103. output.WriteRawTag(8);
  104. output.WriteInt32(ReqSize);
  105. }
  106. if (RespSize != 0) {
  107. output.WriteRawTag(16);
  108. output.WriteInt32(RespSize);
  109. }
  110. }
  111. public int CalculateSize() {
  112. int size = 0;
  113. if (ReqSize != 0) {
  114. size += 1 + pb::CodedOutputStream.ComputeInt32Size(ReqSize);
  115. }
  116. if (RespSize != 0) {
  117. size += 1 + pb::CodedOutputStream.ComputeInt32Size(RespSize);
  118. }
  119. return size;
  120. }
  121. public void MergeFrom(ByteBufferParams other) {
  122. if (other == null) {
  123. return;
  124. }
  125. if (other.ReqSize != 0) {
  126. ReqSize = other.ReqSize;
  127. }
  128. if (other.RespSize != 0) {
  129. RespSize = other.RespSize;
  130. }
  131. }
  132. public void MergeFrom(pb::CodedInputStream input) {
  133. uint tag;
  134. while ((tag = input.ReadTag()) != 0) {
  135. switch(tag) {
  136. default:
  137. input.SkipLastField();
  138. break;
  139. case 8: {
  140. ReqSize = input.ReadInt32();
  141. break;
  142. }
  143. case 16: {
  144. RespSize = input.ReadInt32();
  145. break;
  146. }
  147. }
  148. }
  149. }
  150. }
  151. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  152. public sealed partial class SimpleProtoParams : pb::IMessage<SimpleProtoParams> {
  153. private static readonly pb::MessageParser<SimpleProtoParams> _parser = new pb::MessageParser<SimpleProtoParams>(() => new SimpleProtoParams());
  154. public static pb::MessageParser<SimpleProtoParams> Parser { get { return _parser; } }
  155. public static pbr::MessageDescriptor Descriptor {
  156. get { return global::Grpc.Testing.Payloads.Descriptor.MessageTypes[1]; }
  157. }
  158. pbr::MessageDescriptor pb::IMessage.Descriptor {
  159. get { return Descriptor; }
  160. }
  161. public SimpleProtoParams() {
  162. OnConstruction();
  163. }
  164. partial void OnConstruction();
  165. public SimpleProtoParams(SimpleProtoParams other) : this() {
  166. reqSize_ = other.reqSize_;
  167. respSize_ = other.respSize_;
  168. }
  169. public SimpleProtoParams Clone() {
  170. return new SimpleProtoParams(this);
  171. }
  172. public const int ReqSizeFieldNumber = 1;
  173. private int reqSize_;
  174. public int ReqSize {
  175. get { return reqSize_; }
  176. set {
  177. reqSize_ = value;
  178. }
  179. }
  180. public const int RespSizeFieldNumber = 2;
  181. private int respSize_;
  182. public int RespSize {
  183. get { return respSize_; }
  184. set {
  185. respSize_ = value;
  186. }
  187. }
  188. public override bool Equals(object other) {
  189. return Equals(other as SimpleProtoParams);
  190. }
  191. public bool Equals(SimpleProtoParams other) {
  192. if (ReferenceEquals(other, null)) {
  193. return false;
  194. }
  195. if (ReferenceEquals(other, this)) {
  196. return true;
  197. }
  198. if (ReqSize != other.ReqSize) return false;
  199. if (RespSize != other.RespSize) return false;
  200. return true;
  201. }
  202. public override int GetHashCode() {
  203. int hash = 1;
  204. if (ReqSize != 0) hash ^= ReqSize.GetHashCode();
  205. if (RespSize != 0) hash ^= RespSize.GetHashCode();
  206. return hash;
  207. }
  208. public override string ToString() {
  209. return pb::JsonFormatter.Default.Format(this);
  210. }
  211. public void WriteTo(pb::CodedOutputStream output) {
  212. if (ReqSize != 0) {
  213. output.WriteRawTag(8);
  214. output.WriteInt32(ReqSize);
  215. }
  216. if (RespSize != 0) {
  217. output.WriteRawTag(16);
  218. output.WriteInt32(RespSize);
  219. }
  220. }
  221. public int CalculateSize() {
  222. int size = 0;
  223. if (ReqSize != 0) {
  224. size += 1 + pb::CodedOutputStream.ComputeInt32Size(ReqSize);
  225. }
  226. if (RespSize != 0) {
  227. size += 1 + pb::CodedOutputStream.ComputeInt32Size(RespSize);
  228. }
  229. return size;
  230. }
  231. public void MergeFrom(SimpleProtoParams other) {
  232. if (other == null) {
  233. return;
  234. }
  235. if (other.ReqSize != 0) {
  236. ReqSize = other.ReqSize;
  237. }
  238. if (other.RespSize != 0) {
  239. RespSize = other.RespSize;
  240. }
  241. }
  242. public void MergeFrom(pb::CodedInputStream input) {
  243. uint tag;
  244. while ((tag = input.ReadTag()) != 0) {
  245. switch(tag) {
  246. default:
  247. input.SkipLastField();
  248. break;
  249. case 8: {
  250. ReqSize = input.ReadInt32();
  251. break;
  252. }
  253. case 16: {
  254. RespSize = input.ReadInt32();
  255. break;
  256. }
  257. }
  258. }
  259. }
  260. }
  261. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  262. public sealed partial class ComplexProtoParams : pb::IMessage<ComplexProtoParams> {
  263. private static readonly pb::MessageParser<ComplexProtoParams> _parser = new pb::MessageParser<ComplexProtoParams>(() => new ComplexProtoParams());
  264. public static pb::MessageParser<ComplexProtoParams> Parser { get { return _parser; } }
  265. public static pbr::MessageDescriptor Descriptor {
  266. get { return global::Grpc.Testing.Payloads.Descriptor.MessageTypes[2]; }
  267. }
  268. pbr::MessageDescriptor pb::IMessage.Descriptor {
  269. get { return Descriptor; }
  270. }
  271. public ComplexProtoParams() {
  272. OnConstruction();
  273. }
  274. partial void OnConstruction();
  275. public ComplexProtoParams(ComplexProtoParams other) : this() {
  276. }
  277. public ComplexProtoParams Clone() {
  278. return new ComplexProtoParams(this);
  279. }
  280. public override bool Equals(object other) {
  281. return Equals(other as ComplexProtoParams);
  282. }
  283. public bool Equals(ComplexProtoParams other) {
  284. if (ReferenceEquals(other, null)) {
  285. return false;
  286. }
  287. if (ReferenceEquals(other, this)) {
  288. return true;
  289. }
  290. return true;
  291. }
  292. public override int GetHashCode() {
  293. int hash = 1;
  294. return hash;
  295. }
  296. public override string ToString() {
  297. return pb::JsonFormatter.Default.Format(this);
  298. }
  299. public void WriteTo(pb::CodedOutputStream output) {
  300. }
  301. public int CalculateSize() {
  302. int size = 0;
  303. return size;
  304. }
  305. public void MergeFrom(ComplexProtoParams other) {
  306. if (other == null) {
  307. return;
  308. }
  309. }
  310. public void MergeFrom(pb::CodedInputStream input) {
  311. uint tag;
  312. while ((tag = input.ReadTag()) != 0) {
  313. switch(tag) {
  314. default:
  315. input.SkipLastField();
  316. break;
  317. }
  318. }
  319. }
  320. }
  321. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  322. public sealed partial class PayloadConfig : pb::IMessage<PayloadConfig> {
  323. private static readonly pb::MessageParser<PayloadConfig> _parser = new pb::MessageParser<PayloadConfig>(() => new PayloadConfig());
  324. public static pb::MessageParser<PayloadConfig> Parser { get { return _parser; } }
  325. public static pbr::MessageDescriptor Descriptor {
  326. get { return global::Grpc.Testing.Payloads.Descriptor.MessageTypes[3]; }
  327. }
  328. pbr::MessageDescriptor pb::IMessage.Descriptor {
  329. get { return Descriptor; }
  330. }
  331. public PayloadConfig() {
  332. OnConstruction();
  333. }
  334. partial void OnConstruction();
  335. public PayloadConfig(PayloadConfig other) : this() {
  336. switch (other.PayloadCase) {
  337. case PayloadOneofCase.BytebufParams:
  338. BytebufParams = other.BytebufParams.Clone();
  339. break;
  340. case PayloadOneofCase.SimpleParams:
  341. SimpleParams = other.SimpleParams.Clone();
  342. break;
  343. case PayloadOneofCase.ComplexParams:
  344. ComplexParams = other.ComplexParams.Clone();
  345. break;
  346. }
  347. }
  348. public PayloadConfig Clone() {
  349. return new PayloadConfig(this);
  350. }
  351. public const int BytebufParamsFieldNumber = 1;
  352. public global::Grpc.Testing.ByteBufferParams BytebufParams {
  353. get { return payloadCase_ == PayloadOneofCase.BytebufParams ? (global::Grpc.Testing.ByteBufferParams) payload_ : null; }
  354. set {
  355. payload_ = value;
  356. payloadCase_ = value == null ? PayloadOneofCase.None : PayloadOneofCase.BytebufParams;
  357. }
  358. }
  359. public const int SimpleParamsFieldNumber = 2;
  360. public global::Grpc.Testing.SimpleProtoParams SimpleParams {
  361. get { return payloadCase_ == PayloadOneofCase.SimpleParams ? (global::Grpc.Testing.SimpleProtoParams) payload_ : null; }
  362. set {
  363. payload_ = value;
  364. payloadCase_ = value == null ? PayloadOneofCase.None : PayloadOneofCase.SimpleParams;
  365. }
  366. }
  367. public const int ComplexParamsFieldNumber = 3;
  368. public global::Grpc.Testing.ComplexProtoParams ComplexParams {
  369. get { return payloadCase_ == PayloadOneofCase.ComplexParams ? (global::Grpc.Testing.ComplexProtoParams) payload_ : null; }
  370. set {
  371. payload_ = value;
  372. payloadCase_ = value == null ? PayloadOneofCase.None : PayloadOneofCase.ComplexParams;
  373. }
  374. }
  375. private object payload_;
  376. public enum PayloadOneofCase {
  377. None = 0,
  378. BytebufParams = 1,
  379. SimpleParams = 2,
  380. ComplexParams = 3,
  381. }
  382. private PayloadOneofCase payloadCase_ = PayloadOneofCase.None;
  383. public PayloadOneofCase PayloadCase {
  384. get { return payloadCase_; }
  385. }
  386. public void ClearPayload() {
  387. payloadCase_ = PayloadOneofCase.None;
  388. payload_ = null;
  389. }
  390. public override bool Equals(object other) {
  391. return Equals(other as PayloadConfig);
  392. }
  393. public bool Equals(PayloadConfig other) {
  394. if (ReferenceEquals(other, null)) {
  395. return false;
  396. }
  397. if (ReferenceEquals(other, this)) {
  398. return true;
  399. }
  400. if (!object.Equals(BytebufParams, other.BytebufParams)) return false;
  401. if (!object.Equals(SimpleParams, other.SimpleParams)) return false;
  402. if (!object.Equals(ComplexParams, other.ComplexParams)) return false;
  403. return true;
  404. }
  405. public override int GetHashCode() {
  406. int hash = 1;
  407. if (payloadCase_ == PayloadOneofCase.BytebufParams) hash ^= BytebufParams.GetHashCode();
  408. if (payloadCase_ == PayloadOneofCase.SimpleParams) hash ^= SimpleParams.GetHashCode();
  409. if (payloadCase_ == PayloadOneofCase.ComplexParams) hash ^= ComplexParams.GetHashCode();
  410. return hash;
  411. }
  412. public override string ToString() {
  413. return pb::JsonFormatter.Default.Format(this);
  414. }
  415. public void WriteTo(pb::CodedOutputStream output) {
  416. if (payloadCase_ == PayloadOneofCase.BytebufParams) {
  417. output.WriteRawTag(10);
  418. output.WriteMessage(BytebufParams);
  419. }
  420. if (payloadCase_ == PayloadOneofCase.SimpleParams) {
  421. output.WriteRawTag(18);
  422. output.WriteMessage(SimpleParams);
  423. }
  424. if (payloadCase_ == PayloadOneofCase.ComplexParams) {
  425. output.WriteRawTag(26);
  426. output.WriteMessage(ComplexParams);
  427. }
  428. }
  429. public int CalculateSize() {
  430. int size = 0;
  431. if (payloadCase_ == PayloadOneofCase.BytebufParams) {
  432. size += 1 + pb::CodedOutputStream.ComputeMessageSize(BytebufParams);
  433. }
  434. if (payloadCase_ == PayloadOneofCase.SimpleParams) {
  435. size += 1 + pb::CodedOutputStream.ComputeMessageSize(SimpleParams);
  436. }
  437. if (payloadCase_ == PayloadOneofCase.ComplexParams) {
  438. size += 1 + pb::CodedOutputStream.ComputeMessageSize(ComplexParams);
  439. }
  440. return size;
  441. }
  442. public void MergeFrom(PayloadConfig other) {
  443. if (other == null) {
  444. return;
  445. }
  446. switch (other.PayloadCase) {
  447. case PayloadOneofCase.BytebufParams:
  448. BytebufParams = other.BytebufParams;
  449. break;
  450. case PayloadOneofCase.SimpleParams:
  451. SimpleParams = other.SimpleParams;
  452. break;
  453. case PayloadOneofCase.ComplexParams:
  454. ComplexParams = other.ComplexParams;
  455. break;
  456. }
  457. }
  458. public void MergeFrom(pb::CodedInputStream input) {
  459. uint tag;
  460. while ((tag = input.ReadTag()) != 0) {
  461. switch(tag) {
  462. default:
  463. input.SkipLastField();
  464. break;
  465. case 10: {
  466. global::Grpc.Testing.ByteBufferParams subBuilder = new global::Grpc.Testing.ByteBufferParams();
  467. if (payloadCase_ == PayloadOneofCase.BytebufParams) {
  468. subBuilder.MergeFrom(BytebufParams);
  469. }
  470. input.ReadMessage(subBuilder);
  471. BytebufParams = subBuilder;
  472. break;
  473. }
  474. case 18: {
  475. global::Grpc.Testing.SimpleProtoParams subBuilder = new global::Grpc.Testing.SimpleProtoParams();
  476. if (payloadCase_ == PayloadOneofCase.SimpleParams) {
  477. subBuilder.MergeFrom(SimpleParams);
  478. }
  479. input.ReadMessage(subBuilder);
  480. SimpleParams = subBuilder;
  481. break;
  482. }
  483. case 26: {
  484. global::Grpc.Testing.ComplexProtoParams subBuilder = new global::Grpc.Testing.ComplexProtoParams();
  485. if (payloadCase_ == PayloadOneofCase.ComplexParams) {
  486. subBuilder.MergeFrom(ComplexParams);
  487. }
  488. input.ReadMessage(subBuilder);
  489. ComplexParams = subBuilder;
  490. break;
  491. }
  492. }
  493. }
  494. }
  495. }
  496. #endregion
  497. }
  498. #endregion Designer generated code