/** * * Autogenerated by Thrift Compiler (0.19.0) * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * */ using System; using System.Collections; using System.Collections.Generic; using System.Text; using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Thrift; using Thrift.Collections; using Thrift.Protocol; using Thrift.Protocol.Entities; using Thrift.Protocol.Utilities; using Thrift.Transport; using Thrift.Transport.Client; using Thrift.Transport.Server; using Thrift.Processor; #pragma warning disable IDE0079 // remove unnecessary pragmas #pragma warning disable IDE0017 // object init can be simplified #pragma warning disable IDE0028 // collection init can be simplified #pragma warning disable IDE1006 // parts of the code use IDL spelling #pragma warning disable CA1822 // empty DeepCopy() methods still non-static #pragma warning disable IDE0083 // pattern matching "that is not SomeType" requires net5.0 but we still support earlier versions namespace Echo.ThriftModel { public partial class EchoService { public interface IAsync { global::System.Threading.Tasks.Task EchoBytes(byte[] @data, CancellationToken cancellationToken = default); global::System.Threading.Tasks.Task> EchoDocuments(List @docs, CancellationToken cancellationToken = default); global::System.Threading.Tasks.Task> EchoIntArray(List @array, CancellationToken cancellationToken = default); global::System.Threading.Tasks.Task> EchoStringArray(List @array, CancellationToken cancellationToken = default); global::System.Threading.Tasks.Task> EchoMap(Dictionary @map, CancellationToken cancellationToken = default); global::System.Threading.Tasks.Task> EchoEnumArray(List docTypes, CancellationToken cancellationToken = default); } public class Client : TBaseClient, IDisposable, IAsync { public Client(TProtocol protocol) : this(protocol, protocol) { } public Client(TProtocol inputProtocol, TProtocol outputProtocol) : base(inputProtocol, outputProtocol) { } public async global::System.Threading.Tasks.Task EchoBytes(byte[] @data, CancellationToken cancellationToken = default) { await send_EchoBytes(@data, cancellationToken); return await recv_EchoBytes(cancellationToken); } public async global::System.Threading.Tasks.Task send_EchoBytes(byte[] @data, CancellationToken cancellationToken = default) { await OutputProtocol.WriteMessageBeginAsync(new TMessage("EchoBytes", TMessageType.Call, SeqId), cancellationToken); var tmp76 = new InternalStructs.EchoBytes_args() { Data = @data, }; await tmp76.WriteAsync(OutputProtocol, cancellationToken); await OutputProtocol.WriteMessageEndAsync(cancellationToken); await OutputProtocol.Transport.FlushAsync(cancellationToken); } public async global::System.Threading.Tasks.Task recv_EchoBytes(CancellationToken cancellationToken = default) { var tmp77 = await InputProtocol.ReadMessageBeginAsync(cancellationToken); if (tmp77.Type == TMessageType.Exception) { var tmp78 = await TApplicationException.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); throw tmp78; } var tmp79 = new InternalStructs.EchoBytes_result(); await tmp79.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); if (tmp79.__isset.success) { return tmp79.Success; } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "EchoBytes failed: unknown result"); } public async global::System.Threading.Tasks.Task> EchoDocuments(List @docs, CancellationToken cancellationToken = default) { await send_EchoDocuments(@docs, cancellationToken); return await recv_EchoDocuments(cancellationToken); } public async global::System.Threading.Tasks.Task send_EchoDocuments(List @docs, CancellationToken cancellationToken = default) { await OutputProtocol.WriteMessageBeginAsync(new TMessage("EchoDocuments", TMessageType.Call, SeqId), cancellationToken); var tmp80 = new InternalStructs.EchoDocuments_args() { Docs = @docs, }; await tmp80.WriteAsync(OutputProtocol, cancellationToken); await OutputProtocol.WriteMessageEndAsync(cancellationToken); await OutputProtocol.Transport.FlushAsync(cancellationToken); } public async global::System.Threading.Tasks.Task> recv_EchoDocuments(CancellationToken cancellationToken = default) { var tmp81 = await InputProtocol.ReadMessageBeginAsync(cancellationToken); if (tmp81.Type == TMessageType.Exception) { var tmp82 = await TApplicationException.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); throw tmp82; } var tmp83 = new InternalStructs.EchoDocuments_result(); await tmp83.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); if (tmp83.__isset.success) { return tmp83.Success; } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "EchoDocuments failed: unknown result"); } public async global::System.Threading.Tasks.Task> EchoIntArray(List @array, CancellationToken cancellationToken = default) { await send_EchoIntArray(@array, cancellationToken); return await recv_EchoIntArray(cancellationToken); } public async global::System.Threading.Tasks.Task send_EchoIntArray(List @array, CancellationToken cancellationToken = default) { await OutputProtocol.WriteMessageBeginAsync(new TMessage("EchoIntArray", TMessageType.Call, SeqId), cancellationToken); var tmp84 = new InternalStructs.EchoIntArray_args() { Array = @array, }; await tmp84.WriteAsync(OutputProtocol, cancellationToken); await OutputProtocol.WriteMessageEndAsync(cancellationToken); await OutputProtocol.Transport.FlushAsync(cancellationToken); } public async global::System.Threading.Tasks.Task> recv_EchoIntArray(CancellationToken cancellationToken = default) { var tmp85 = await InputProtocol.ReadMessageBeginAsync(cancellationToken); if (tmp85.Type == TMessageType.Exception) { var tmp86 = await TApplicationException.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); throw tmp86; } var tmp87 = new InternalStructs.EchoIntArray_result(); await tmp87.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); if (tmp87.__isset.success) { return tmp87.Success; } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "EchoIntArray failed: unknown result"); } public async global::System.Threading.Tasks.Task> EchoStringArray(List @array, CancellationToken cancellationToken = default) { await send_EchoStringArray(@array, cancellationToken); return await recv_EchoStringArray(cancellationToken); } public async global::System.Threading.Tasks.Task send_EchoStringArray(List @array, CancellationToken cancellationToken = default) { await OutputProtocol.WriteMessageBeginAsync(new TMessage("EchoStringArray", TMessageType.Call, SeqId), cancellationToken); var tmp88 = new InternalStructs.EchoStringArray_args() { Array = @array, }; await tmp88.WriteAsync(OutputProtocol, cancellationToken); await OutputProtocol.WriteMessageEndAsync(cancellationToken); await OutputProtocol.Transport.FlushAsync(cancellationToken); } public async global::System.Threading.Tasks.Task> recv_EchoStringArray(CancellationToken cancellationToken = default) { var tmp89 = await InputProtocol.ReadMessageBeginAsync(cancellationToken); if (tmp89.Type == TMessageType.Exception) { var tmp90 = await TApplicationException.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); throw tmp90; } var tmp91 = new InternalStructs.EchoStringArray_result(); await tmp91.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); if (tmp91.__isset.success) { return tmp91.Success; } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "EchoStringArray failed: unknown result"); } public async global::System.Threading.Tasks.Task> EchoMap(Dictionary @map, CancellationToken cancellationToken = default) { await send_EchoMap(@map, cancellationToken); return await recv_EchoMap(cancellationToken); } public async global::System.Threading.Tasks.Task send_EchoMap(Dictionary @map, CancellationToken cancellationToken = default) { await OutputProtocol.WriteMessageBeginAsync(new TMessage("EchoMap", TMessageType.Call, SeqId), cancellationToken); var tmp92 = new InternalStructs.EchoMap_args() { Map = @map, }; await tmp92.WriteAsync(OutputProtocol, cancellationToken); await OutputProtocol.WriteMessageEndAsync(cancellationToken); await OutputProtocol.Transport.FlushAsync(cancellationToken); } public async global::System.Threading.Tasks.Task> recv_EchoMap(CancellationToken cancellationToken = default) { var tmp93 = await InputProtocol.ReadMessageBeginAsync(cancellationToken); if (tmp93.Type == TMessageType.Exception) { var tmp94 = await TApplicationException.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); throw tmp94; } var tmp95 = new InternalStructs.EchoMap_result(); await tmp95.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); if (tmp95.__isset.success) { return tmp95.Success; } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "EchoMap failed: unknown result"); } public async global::System.Threading.Tasks.Task> EchoEnumArray(List docTypes, CancellationToken cancellationToken = default) { await send_EchoEnumArray(docTypes, cancellationToken); return await recv_EchoEnumArray(cancellationToken); } public async global::System.Threading.Tasks.Task send_EchoEnumArray(List docTypes, CancellationToken cancellationToken = default) { await OutputProtocol.WriteMessageBeginAsync(new TMessage("EchoEnumArray", TMessageType.Call, SeqId), cancellationToken); var tmp96 = new InternalStructs.EchoEnumArray_args() { DocTypes = docTypes, }; await tmp96.WriteAsync(OutputProtocol, cancellationToken); await OutputProtocol.WriteMessageEndAsync(cancellationToken); await OutputProtocol.Transport.FlushAsync(cancellationToken); } public async global::System.Threading.Tasks.Task> recv_EchoEnumArray(CancellationToken cancellationToken = default) { var tmp97 = await InputProtocol.ReadMessageBeginAsync(cancellationToken); if (tmp97.Type == TMessageType.Exception) { var tmp98 = await TApplicationException.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); throw tmp98; } var tmp99 = new InternalStructs.EchoEnumArray_result(); await tmp99.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); if (tmp99.__isset.success) { return tmp99.Success; } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "EchoEnumArray failed: unknown result"); } } public class AsyncProcessor : ITAsyncProcessor { private readonly IAsync _iAsync; private readonly ILogger _logger; public AsyncProcessor(IAsync iAsync, ILogger logger = default) { _iAsync = iAsync ?? throw new ArgumentNullException(nameof(iAsync)); _logger = logger; processMap_["EchoBytes"] = EchoBytes_ProcessAsync; processMap_["EchoDocuments"] = EchoDocuments_ProcessAsync; processMap_["EchoIntArray"] = EchoIntArray_ProcessAsync; processMap_["EchoStringArray"] = EchoStringArray_ProcessAsync; processMap_["EchoMap"] = EchoMap_ProcessAsync; processMap_["EchoEnumArray"] = EchoEnumArray_ProcessAsync; } protected delegate global::System.Threading.Tasks.Task ProcessFunction(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken); protected Dictionary processMap_ = new Dictionary(); public async Task ProcessAsync(TProtocol iprot, TProtocol oprot) { return await ProcessAsync(iprot, oprot, CancellationToken.None); } public async Task ProcessAsync(TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken) { try { var msg = await iprot.ReadMessageBeginAsync(cancellationToken); processMap_.TryGetValue(msg.Name, out var fn); if (fn == null) { await TProtocolUtil.SkipAsync(iprot, TType.Struct, cancellationToken); await iprot.ReadMessageEndAsync(cancellationToken); var x = new TApplicationException (TApplicationException.ExceptionType.UnknownMethod, "Invalid method name: '" + msg.Name + "'"); await oprot.WriteMessageBeginAsync(new TMessage(msg.Name, TMessageType.Exception, msg.SeqID), cancellationToken); await x.WriteAsync(oprot, cancellationToken); await oprot.WriteMessageEndAsync(cancellationToken); await oprot.Transport.FlushAsync(cancellationToken); return true; } await fn(msg.SeqID, iprot, oprot, cancellationToken); } catch (IOException) { return false; } return true; } public async global::System.Threading.Tasks.Task EchoBytes_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken) { var tmp100 = new InternalStructs.EchoBytes_args(); await tmp100.ReadAsync(iprot, cancellationToken); await iprot.ReadMessageEndAsync(cancellationToken); var tmp101 = new InternalStructs.EchoBytes_result(); try { tmp101.Success = await _iAsync.EchoBytes(tmp100.Data, cancellationToken); await oprot.WriteMessageBeginAsync(new TMessage("EchoBytes", TMessageType.Reply, seqid), cancellationToken); await tmp101.WriteAsync(oprot, cancellationToken); } catch (TTransportException) { throw; } catch (Exception tmp102) { var tmp103 = $"Error occurred in {GetType().FullName}: {tmp102.Message}"; if(_logger != null) _logger.LogError("{Exception}, {Message}", tmp102, tmp103); else Console.Error.WriteLine(tmp103); var tmp104 = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error."); await oprot.WriteMessageBeginAsync(new TMessage("EchoBytes", TMessageType.Exception, seqid), cancellationToken); await tmp104.WriteAsync(oprot, cancellationToken); } await oprot.WriteMessageEndAsync(cancellationToken); await oprot.Transport.FlushAsync(cancellationToken); } public async global::System.Threading.Tasks.Task EchoDocuments_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken) { var tmp105 = new InternalStructs.EchoDocuments_args(); await tmp105.ReadAsync(iprot, cancellationToken); await iprot.ReadMessageEndAsync(cancellationToken); var tmp106 = new InternalStructs.EchoDocuments_result(); try { tmp106.Success = await _iAsync.EchoDocuments(tmp105.Docs, cancellationToken); await oprot.WriteMessageBeginAsync(new TMessage("EchoDocuments", TMessageType.Reply, seqid), cancellationToken); await tmp106.WriteAsync(oprot, cancellationToken); } catch (TTransportException) { throw; } catch (Exception tmp107) { var tmp108 = $"Error occurred in {GetType().FullName}: {tmp107.Message}"; if(_logger != null) _logger.LogError("{Exception}, {Message}", tmp107, tmp108); else Console.Error.WriteLine(tmp108); var tmp109 = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error."); await oprot.WriteMessageBeginAsync(new TMessage("EchoDocuments", TMessageType.Exception, seqid), cancellationToken); await tmp109.WriteAsync(oprot, cancellationToken); } await oprot.WriteMessageEndAsync(cancellationToken); await oprot.Transport.FlushAsync(cancellationToken); } public async global::System.Threading.Tasks.Task EchoIntArray_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken) { var tmp110 = new InternalStructs.EchoIntArray_args(); await tmp110.ReadAsync(iprot, cancellationToken); await iprot.ReadMessageEndAsync(cancellationToken); var tmp111 = new InternalStructs.EchoIntArray_result(); try { tmp111.Success = await _iAsync.EchoIntArray(tmp110.Array, cancellationToken); await oprot.WriteMessageBeginAsync(new TMessage("EchoIntArray", TMessageType.Reply, seqid), cancellationToken); await tmp111.WriteAsync(oprot, cancellationToken); } catch (TTransportException) { throw; } catch (Exception tmp112) { var tmp113 = $"Error occurred in {GetType().FullName}: {tmp112.Message}"; if(_logger != null) _logger.LogError("{Exception}, {Message}", tmp112, tmp113); else Console.Error.WriteLine(tmp113); var tmp114 = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error."); await oprot.WriteMessageBeginAsync(new TMessage("EchoIntArray", TMessageType.Exception, seqid), cancellationToken); await tmp114.WriteAsync(oprot, cancellationToken); } await oprot.WriteMessageEndAsync(cancellationToken); await oprot.Transport.FlushAsync(cancellationToken); } public async global::System.Threading.Tasks.Task EchoStringArray_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken) { var tmp115 = new InternalStructs.EchoStringArray_args(); await tmp115.ReadAsync(iprot, cancellationToken); await iprot.ReadMessageEndAsync(cancellationToken); var tmp116 = new InternalStructs.EchoStringArray_result(); try { tmp116.Success = await _iAsync.EchoStringArray(tmp115.Array, cancellationToken); await oprot.WriteMessageBeginAsync(new TMessage("EchoStringArray", TMessageType.Reply, seqid), cancellationToken); await tmp116.WriteAsync(oprot, cancellationToken); } catch (TTransportException) { throw; } catch (Exception tmp117) { var tmp118 = $"Error occurred in {GetType().FullName}: {tmp117.Message}"; if(_logger != null) _logger.LogError("{Exception}, {Message}", tmp117, tmp118); else Console.Error.WriteLine(tmp118); var tmp119 = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error."); await oprot.WriteMessageBeginAsync(new TMessage("EchoStringArray", TMessageType.Exception, seqid), cancellationToken); await tmp119.WriteAsync(oprot, cancellationToken); } await oprot.WriteMessageEndAsync(cancellationToken); await oprot.Transport.FlushAsync(cancellationToken); } public async global::System.Threading.Tasks.Task EchoMap_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken) { var tmp120 = new InternalStructs.EchoMap_args(); await tmp120.ReadAsync(iprot, cancellationToken); await iprot.ReadMessageEndAsync(cancellationToken); var tmp121 = new InternalStructs.EchoMap_result(); try { tmp121.Success = await _iAsync.EchoMap(tmp120.Map, cancellationToken); await oprot.WriteMessageBeginAsync(new TMessage("EchoMap", TMessageType.Reply, seqid), cancellationToken); await tmp121.WriteAsync(oprot, cancellationToken); } catch (TTransportException) { throw; } catch (Exception tmp122) { var tmp123 = $"Error occurred in {GetType().FullName}: {tmp122.Message}"; if(_logger != null) _logger.LogError("{Exception}, {Message}", tmp122, tmp123); else Console.Error.WriteLine(tmp123); var tmp124 = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error."); await oprot.WriteMessageBeginAsync(new TMessage("EchoMap", TMessageType.Exception, seqid), cancellationToken); await tmp124.WriteAsync(oprot, cancellationToken); } await oprot.WriteMessageEndAsync(cancellationToken); await oprot.Transport.FlushAsync(cancellationToken); } public async global::System.Threading.Tasks.Task EchoEnumArray_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken) { var tmp125 = new InternalStructs.EchoEnumArray_args(); await tmp125.ReadAsync(iprot, cancellationToken); await iprot.ReadMessageEndAsync(cancellationToken); var tmp126 = new InternalStructs.EchoEnumArray_result(); try { tmp126.Success = await _iAsync.EchoEnumArray(tmp125.DocTypes, cancellationToken); await oprot.WriteMessageBeginAsync(new TMessage("EchoEnumArray", TMessageType.Reply, seqid), cancellationToken); await tmp126.WriteAsync(oprot, cancellationToken); } catch (TTransportException) { throw; } catch (Exception tmp127) { var tmp128 = $"Error occurred in {GetType().FullName}: {tmp127.Message}"; if(_logger != null) _logger.LogError("{Exception}, {Message}", tmp127, tmp128); else Console.Error.WriteLine(tmp128); var tmp129 = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error."); await oprot.WriteMessageBeginAsync(new TMessage("EchoEnumArray", TMessageType.Exception, seqid), cancellationToken); await tmp129.WriteAsync(oprot, cancellationToken); } await oprot.WriteMessageEndAsync(cancellationToken); await oprot.Transport.FlushAsync(cancellationToken); } } public class InternalStructs { public partial class EchoBytes_args : TBase { private byte[] _data; public byte[] Data { get { return _data; } set { __isset.@data = true; this._data = value; } } public Isset __isset; public struct Isset { public bool @data; } public EchoBytes_args() { } public EchoBytes_args DeepCopy() { var tmp130 = new EchoBytes_args(); if((Data != null) && __isset.@data) { tmp130.Data = this.Data.ToArray(); } tmp130.__isset.@data = this.__isset.@data; return tmp130; } public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); try { TField field; await iprot.ReadStructBeginAsync(cancellationToken); while (true) { field = await iprot.ReadFieldBeginAsync(cancellationToken); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.String) { Data = await iprot.ReadBinaryAsync(cancellationToken); } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; } await iprot.ReadFieldEndAsync(cancellationToken); } await iprot.ReadStructEndAsync(cancellationToken); } finally { iprot.DecrementRecursionDepth(); } } public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) { oprot.IncrementRecursionDepth(); try { var tmp131 = new TStruct("EchoBytes_args"); await oprot.WriteStructBeginAsync(tmp131, cancellationToken); var tmp132 = new TField(); if((Data != null) && __isset.@data) { tmp132.Name = "data"; tmp132.Type = TType.String; tmp132.ID = 1; await oprot.WriteFieldBeginAsync(tmp132, cancellationToken); await oprot.WriteBinaryAsync(Data, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } finally { oprot.DecrementRecursionDepth(); } } public override bool Equals(object that) { if (!(that is EchoBytes_args other)) return false; if (ReferenceEquals(this, other)) return true; return ((__isset.@data == other.__isset.@data) && ((!__isset.@data) || (TCollections.Equals(Data, other.Data)))); } public override int GetHashCode() { int hashcode = 157; unchecked { if((Data != null) && __isset.@data) { hashcode = (hashcode * 397) + Data.GetHashCode(); } } return hashcode; } public override string ToString() { var tmp133 = new StringBuilder("EchoBytes_args("); int tmp134 = 0; if((Data != null) && __isset.@data) { if(0 < tmp134++) { tmp133.Append(", "); } tmp133.Append("Data: "); Data.ToString(tmp133); } tmp133.Append(')'); return tmp133.ToString(); } } public partial class EchoBytes_result : TBase { private byte[] _success; public byte[] Success { get { return _success; } set { __isset.@success = true; this._success = value; } } public Isset __isset; public struct Isset { public bool @success; } public EchoBytes_result() { } public EchoBytes_result DeepCopy() { var tmp135 = new EchoBytes_result(); if((Success != null) && __isset.@success) { tmp135.Success = this.Success.ToArray(); } tmp135.__isset.@success = this.__isset.@success; return tmp135; } public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); try { TField field; await iprot.ReadStructBeginAsync(cancellationToken); while (true) { field = await iprot.ReadFieldBeginAsync(cancellationToken); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 0: if (field.Type == TType.String) { Success = await iprot.ReadBinaryAsync(cancellationToken); } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; } await iprot.ReadFieldEndAsync(cancellationToken); } await iprot.ReadStructEndAsync(cancellationToken); } finally { iprot.DecrementRecursionDepth(); } } public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) { oprot.IncrementRecursionDepth(); try { var tmp136 = new TStruct("EchoBytes_result"); await oprot.WriteStructBeginAsync(tmp136, cancellationToken); var tmp137 = new TField(); if(this.__isset.@success) { if (Success != null) { tmp137.Name = "Success"; tmp137.Type = TType.String; tmp137.ID = 0; await oprot.WriteFieldBeginAsync(tmp137, cancellationToken); await oprot.WriteBinaryAsync(Success, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } finally { oprot.DecrementRecursionDepth(); } } public override bool Equals(object that) { if (!(that is EchoBytes_result other)) return false; if (ReferenceEquals(this, other)) return true; return ((__isset.@success == other.__isset.@success) && ((!__isset.@success) || (TCollections.Equals(Success, other.Success)))); } public override int GetHashCode() { int hashcode = 157; unchecked { if((Success != null) && __isset.@success) { hashcode = (hashcode * 397) + Success.GetHashCode(); } } return hashcode; } public override string ToString() { var tmp138 = new StringBuilder("EchoBytes_result("); int tmp139 = 0; if((Success != null) && __isset.@success) { if(0 < tmp139++) { tmp138.Append(", "); } tmp138.Append("Success: "); Success.ToString(tmp138); } tmp138.Append(')'); return tmp138.ToString(); } } public partial class EchoDocuments_args : TBase { private List _docs; public List Docs { get { return _docs; } set { __isset.@docs = true; this._docs = value; } } public Isset __isset; public struct Isset { public bool @docs; } public EchoDocuments_args() { } public EchoDocuments_args DeepCopy() { var tmp140 = new EchoDocuments_args(); if((Docs != null) && __isset.@docs) { tmp140.Docs = this.Docs.DeepCopy(); } tmp140.__isset.@docs = this.__isset.@docs; return tmp140; } public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); try { TField field; await iprot.ReadStructBeginAsync(cancellationToken); while (true) { field = await iprot.ReadFieldBeginAsync(cancellationToken); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.List) { { var _list141 = await iprot.ReadListBeginAsync(cancellationToken); Docs = new List(_list141.Count); for(int _i142 = 0; _i142 < _list141.Count; ++_i142) { global::Echo.ThriftModel.BusinessDocument _elem143; _elem143 = new global::Echo.ThriftModel.BusinessDocument(); await _elem143.ReadAsync(iprot, cancellationToken); Docs.Add(_elem143); } await iprot.ReadListEndAsync(cancellationToken); } } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; } await iprot.ReadFieldEndAsync(cancellationToken); } await iprot.ReadStructEndAsync(cancellationToken); } finally { iprot.DecrementRecursionDepth(); } } public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) { oprot.IncrementRecursionDepth(); try { var tmp144 = new TStruct("EchoDocuments_args"); await oprot.WriteStructBeginAsync(tmp144, cancellationToken); var tmp145 = new TField(); if((Docs != null) && __isset.@docs) { tmp145.Name = "docs"; tmp145.Type = TType.List; tmp145.ID = 1; await oprot.WriteFieldBeginAsync(tmp145, cancellationToken); await oprot.WriteListBeginAsync(new TList(TType.Struct, Docs.Count), cancellationToken); foreach (global::Echo.ThriftModel.BusinessDocument _iter146 in Docs) { await _iter146.WriteAsync(oprot, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } finally { oprot.DecrementRecursionDepth(); } } public override bool Equals(object that) { if (!(that is EchoDocuments_args other)) return false; if (ReferenceEquals(this, other)) return true; return ((__isset.@docs == other.__isset.@docs) && ((!__isset.@docs) || (TCollections.Equals(Docs, other.Docs)))); } public override int GetHashCode() { int hashcode = 157; unchecked { if((Docs != null) && __isset.@docs) { hashcode = (hashcode * 397) + TCollections.GetHashCode(Docs); } } return hashcode; } public override string ToString() { var tmp147 = new StringBuilder("EchoDocuments_args("); int tmp148 = 0; if((Docs != null) && __isset.@docs) { if(0 < tmp148++) { tmp147.Append(", "); } tmp147.Append("Docs: "); Docs.ToString(tmp147); } tmp147.Append(')'); return tmp147.ToString(); } } public partial class EchoDocuments_result : TBase { private List _success; public List Success { get { return _success; } set { __isset.@success = true; this._success = value; } } public Isset __isset; public struct Isset { public bool @success; } public EchoDocuments_result() { } public EchoDocuments_result DeepCopy() { var tmp149 = new EchoDocuments_result(); if((Success != null) && __isset.@success) { tmp149.Success = this.Success.DeepCopy(); } tmp149.__isset.@success = this.__isset.@success; return tmp149; } public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); try { TField field; await iprot.ReadStructBeginAsync(cancellationToken); while (true) { field = await iprot.ReadFieldBeginAsync(cancellationToken); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 0: if (field.Type == TType.List) { { var _list150 = await iprot.ReadListBeginAsync(cancellationToken); Success = new List(_list150.Count); for(int _i151 = 0; _i151 < _list150.Count; ++_i151) { global::Echo.ThriftModel.BusinessDocument _elem152; _elem152 = new global::Echo.ThriftModel.BusinessDocument(); await _elem152.ReadAsync(iprot, cancellationToken); Success.Add(_elem152); } await iprot.ReadListEndAsync(cancellationToken); } } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; } await iprot.ReadFieldEndAsync(cancellationToken); } await iprot.ReadStructEndAsync(cancellationToken); } finally { iprot.DecrementRecursionDepth(); } } public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) { oprot.IncrementRecursionDepth(); try { var tmp153 = new TStruct("EchoDocuments_result"); await oprot.WriteStructBeginAsync(tmp153, cancellationToken); var tmp154 = new TField(); if(this.__isset.@success) { if (Success != null) { tmp154.Name = "Success"; tmp154.Type = TType.List; tmp154.ID = 0; await oprot.WriteFieldBeginAsync(tmp154, cancellationToken); await oprot.WriteListBeginAsync(new TList(TType.Struct, Success.Count), cancellationToken); foreach (global::Echo.ThriftModel.BusinessDocument _iter155 in Success) { await _iter155.WriteAsync(oprot, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } finally { oprot.DecrementRecursionDepth(); } } public override bool Equals(object that) { if (!(that is EchoDocuments_result other)) return false; if (ReferenceEquals(this, other)) return true; return ((__isset.@success == other.__isset.@success) && ((!__isset.@success) || (TCollections.Equals(Success, other.Success)))); } public override int GetHashCode() { int hashcode = 157; unchecked { if((Success != null) && __isset.@success) { hashcode = (hashcode * 397) + TCollections.GetHashCode(Success); } } return hashcode; } public override string ToString() { var tmp156 = new StringBuilder("EchoDocuments_result("); int tmp157 = 0; if((Success != null) && __isset.@success) { if(0 < tmp157++) { tmp156.Append(", "); } tmp156.Append("Success: "); Success.ToString(tmp156); } tmp156.Append(')'); return tmp156.ToString(); } } public partial class EchoIntArray_args : TBase { private List _array; public List Array { get { return _array; } set { __isset.@array = true; this._array = value; } } public Isset __isset; public struct Isset { public bool @array; } public EchoIntArray_args() { } public EchoIntArray_args DeepCopy() { var tmp158 = new EchoIntArray_args(); if((Array != null) && __isset.@array) { tmp158.Array = this.Array.DeepCopy(); } tmp158.__isset.@array = this.__isset.@array; return tmp158; } public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); try { TField field; await iprot.ReadStructBeginAsync(cancellationToken); while (true) { field = await iprot.ReadFieldBeginAsync(cancellationToken); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.List) { { var _list159 = await iprot.ReadListBeginAsync(cancellationToken); Array = new List(_list159.Count); for(int _i160 = 0; _i160 < _list159.Count; ++_i160) { int _elem161; _elem161 = await iprot.ReadI32Async(cancellationToken); Array.Add(_elem161); } await iprot.ReadListEndAsync(cancellationToken); } } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; } await iprot.ReadFieldEndAsync(cancellationToken); } await iprot.ReadStructEndAsync(cancellationToken); } finally { iprot.DecrementRecursionDepth(); } } public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) { oprot.IncrementRecursionDepth(); try { var tmp162 = new TStruct("EchoIntArray_args"); await oprot.WriteStructBeginAsync(tmp162, cancellationToken); var tmp163 = new TField(); if((Array != null) && __isset.@array) { tmp163.Name = "array"; tmp163.Type = TType.List; tmp163.ID = 1; await oprot.WriteFieldBeginAsync(tmp163, cancellationToken); await oprot.WriteListBeginAsync(new TList(TType.I32, Array.Count), cancellationToken); foreach (int _iter164 in Array) { await oprot.WriteI32Async(_iter164, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } finally { oprot.DecrementRecursionDepth(); } } public override bool Equals(object that) { if (!(that is EchoIntArray_args other)) return false; if (ReferenceEquals(this, other)) return true; return ((__isset.@array == other.__isset.@array) && ((!__isset.@array) || (TCollections.Equals(Array, other.Array)))); } public override int GetHashCode() { int hashcode = 157; unchecked { if((Array != null) && __isset.@array) { hashcode = (hashcode * 397) + TCollections.GetHashCode(Array); } } return hashcode; } public override string ToString() { var tmp165 = new StringBuilder("EchoIntArray_args("); int tmp166 = 0; if((Array != null) && __isset.@array) { if(0 < tmp166++) { tmp165.Append(", "); } tmp165.Append("Array: "); Array.ToString(tmp165); } tmp165.Append(')'); return tmp165.ToString(); } } public partial class EchoIntArray_result : TBase { private List _success; public List Success { get { return _success; } set { __isset.@success = true; this._success = value; } } public Isset __isset; public struct Isset { public bool @success; } public EchoIntArray_result() { } public EchoIntArray_result DeepCopy() { var tmp167 = new EchoIntArray_result(); if((Success != null) && __isset.@success) { tmp167.Success = this.Success.DeepCopy(); } tmp167.__isset.@success = this.__isset.@success; return tmp167; } public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); try { TField field; await iprot.ReadStructBeginAsync(cancellationToken); while (true) { field = await iprot.ReadFieldBeginAsync(cancellationToken); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 0: if (field.Type == TType.List) { { var _list168 = await iprot.ReadListBeginAsync(cancellationToken); Success = new List(_list168.Count); for(int _i169 = 0; _i169 < _list168.Count; ++_i169) { int _elem170; _elem170 = await iprot.ReadI32Async(cancellationToken); Success.Add(_elem170); } await iprot.ReadListEndAsync(cancellationToken); } } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; } await iprot.ReadFieldEndAsync(cancellationToken); } await iprot.ReadStructEndAsync(cancellationToken); } finally { iprot.DecrementRecursionDepth(); } } public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) { oprot.IncrementRecursionDepth(); try { var tmp171 = new TStruct("EchoIntArray_result"); await oprot.WriteStructBeginAsync(tmp171, cancellationToken); var tmp172 = new TField(); if(this.__isset.@success) { if (Success != null) { tmp172.Name = "Success"; tmp172.Type = TType.List; tmp172.ID = 0; await oprot.WriteFieldBeginAsync(tmp172, cancellationToken); await oprot.WriteListBeginAsync(new TList(TType.I32, Success.Count), cancellationToken); foreach (int _iter173 in Success) { await oprot.WriteI32Async(_iter173, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } finally { oprot.DecrementRecursionDepth(); } } public override bool Equals(object that) { if (!(that is EchoIntArray_result other)) return false; if (ReferenceEquals(this, other)) return true; return ((__isset.@success == other.__isset.@success) && ((!__isset.@success) || (TCollections.Equals(Success, other.Success)))); } public override int GetHashCode() { int hashcode = 157; unchecked { if((Success != null) && __isset.@success) { hashcode = (hashcode * 397) + TCollections.GetHashCode(Success); } } return hashcode; } public override string ToString() { var tmp174 = new StringBuilder("EchoIntArray_result("); int tmp175 = 0; if((Success != null) && __isset.@success) { if(0 < tmp175++) { tmp174.Append(", "); } tmp174.Append("Success: "); Success.ToString(tmp174); } tmp174.Append(')'); return tmp174.ToString(); } } public partial class EchoStringArray_args : TBase { private List _array; public List Array { get { return _array; } set { __isset.@array = true; this._array = value; } } public Isset __isset; public struct Isset { public bool @array; } public EchoStringArray_args() { } public EchoStringArray_args DeepCopy() { var tmp176 = new EchoStringArray_args(); if((Array != null) && __isset.@array) { tmp176.Array = this.Array.DeepCopy(); } tmp176.__isset.@array = this.__isset.@array; return tmp176; } public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); try { TField field; await iprot.ReadStructBeginAsync(cancellationToken); while (true) { field = await iprot.ReadFieldBeginAsync(cancellationToken); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.List) { { var _list177 = await iprot.ReadListBeginAsync(cancellationToken); Array = new List(_list177.Count); for(int _i178 = 0; _i178 < _list177.Count; ++_i178) { string _elem179; _elem179 = await iprot.ReadStringAsync(cancellationToken); Array.Add(_elem179); } await iprot.ReadListEndAsync(cancellationToken); } } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; } await iprot.ReadFieldEndAsync(cancellationToken); } await iprot.ReadStructEndAsync(cancellationToken); } finally { iprot.DecrementRecursionDepth(); } } public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) { oprot.IncrementRecursionDepth(); try { var tmp180 = new TStruct("EchoStringArray_args"); await oprot.WriteStructBeginAsync(tmp180, cancellationToken); var tmp181 = new TField(); if((Array != null) && __isset.@array) { tmp181.Name = "array"; tmp181.Type = TType.List; tmp181.ID = 1; await oprot.WriteFieldBeginAsync(tmp181, cancellationToken); await oprot.WriteListBeginAsync(new TList(TType.String, Array.Count), cancellationToken); foreach (string _iter182 in Array) { await oprot.WriteStringAsync(_iter182, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } finally { oprot.DecrementRecursionDepth(); } } public override bool Equals(object that) { if (!(that is EchoStringArray_args other)) return false; if (ReferenceEquals(this, other)) return true; return ((__isset.@array == other.__isset.@array) && ((!__isset.@array) || (TCollections.Equals(Array, other.Array)))); } public override int GetHashCode() { int hashcode = 157; unchecked { if((Array != null) && __isset.@array) { hashcode = (hashcode * 397) + TCollections.GetHashCode(Array); } } return hashcode; } public override string ToString() { var tmp183 = new StringBuilder("EchoStringArray_args("); int tmp184 = 0; if((Array != null) && __isset.@array) { if(0 < tmp184++) { tmp183.Append(", "); } tmp183.Append("Array: "); Array.ToString(tmp183); } tmp183.Append(')'); return tmp183.ToString(); } } public partial class EchoStringArray_result : TBase { private List _success; public List Success { get { return _success; } set { __isset.@success = true; this._success = value; } } public Isset __isset; public struct Isset { public bool @success; } public EchoStringArray_result() { } public EchoStringArray_result DeepCopy() { var tmp185 = new EchoStringArray_result(); if((Success != null) && __isset.@success) { tmp185.Success = this.Success.DeepCopy(); } tmp185.__isset.@success = this.__isset.@success; return tmp185; } public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); try { TField field; await iprot.ReadStructBeginAsync(cancellationToken); while (true) { field = await iprot.ReadFieldBeginAsync(cancellationToken); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 0: if (field.Type == TType.List) { { var _list186 = await iprot.ReadListBeginAsync(cancellationToken); Success = new List(_list186.Count); for(int _i187 = 0; _i187 < _list186.Count; ++_i187) { string _elem188; _elem188 = await iprot.ReadStringAsync(cancellationToken); Success.Add(_elem188); } await iprot.ReadListEndAsync(cancellationToken); } } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; } await iprot.ReadFieldEndAsync(cancellationToken); } await iprot.ReadStructEndAsync(cancellationToken); } finally { iprot.DecrementRecursionDepth(); } } public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) { oprot.IncrementRecursionDepth(); try { var tmp189 = new TStruct("EchoStringArray_result"); await oprot.WriteStructBeginAsync(tmp189, cancellationToken); var tmp190 = new TField(); if(this.__isset.@success) { if (Success != null) { tmp190.Name = "Success"; tmp190.Type = TType.List; tmp190.ID = 0; await oprot.WriteFieldBeginAsync(tmp190, cancellationToken); await oprot.WriteListBeginAsync(new TList(TType.String, Success.Count), cancellationToken); foreach (string _iter191 in Success) { await oprot.WriteStringAsync(_iter191, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } finally { oprot.DecrementRecursionDepth(); } } public override bool Equals(object that) { if (!(that is EchoStringArray_result other)) return false; if (ReferenceEquals(this, other)) return true; return ((__isset.@success == other.__isset.@success) && ((!__isset.@success) || (TCollections.Equals(Success, other.Success)))); } public override int GetHashCode() { int hashcode = 157; unchecked { if((Success != null) && __isset.@success) { hashcode = (hashcode * 397) + TCollections.GetHashCode(Success); } } return hashcode; } public override string ToString() { var tmp192 = new StringBuilder("EchoStringArray_result("); int tmp193 = 0; if((Success != null) && __isset.@success) { if(0 < tmp193++) { tmp192.Append(", "); } tmp192.Append("Success: "); Success.ToString(tmp192); } tmp192.Append(')'); return tmp192.ToString(); } } public partial class EchoMap_args : TBase { private Dictionary _map; public Dictionary Map { get { return _map; } set { __isset.@map = true; this._map = value; } } public Isset __isset; public struct Isset { public bool @map; } public EchoMap_args() { } public EchoMap_args DeepCopy() { var tmp194 = new EchoMap_args(); if((Map != null) && __isset.@map) { tmp194.Map = this.Map.DeepCopy(); } tmp194.__isset.@map = this.__isset.@map; return tmp194; } public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); try { TField field; await iprot.ReadStructBeginAsync(cancellationToken); while (true) { field = await iprot.ReadFieldBeginAsync(cancellationToken); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.Map) { { var _map195 = await iprot.ReadMapBeginAsync(cancellationToken); Map = new Dictionary(_map195.Count); for(int _i196 = 0; _i196 < _map195.Count; ++_i196) { string _key197; global::Echo.ThriftModel.BusinessDocument _val198; _key197 = await iprot.ReadStringAsync(cancellationToken); _val198 = new global::Echo.ThriftModel.BusinessDocument(); await _val198.ReadAsync(iprot, cancellationToken); Map[_key197] = _val198; } await iprot.ReadMapEndAsync(cancellationToken); } } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; } await iprot.ReadFieldEndAsync(cancellationToken); } await iprot.ReadStructEndAsync(cancellationToken); } finally { iprot.DecrementRecursionDepth(); } } public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) { oprot.IncrementRecursionDepth(); try { var tmp199 = new TStruct("EchoMap_args"); await oprot.WriteStructBeginAsync(tmp199, cancellationToken); var tmp200 = new TField(); if((Map != null) && __isset.@map) { tmp200.Name = "map"; tmp200.Type = TType.Map; tmp200.ID = 1; await oprot.WriteFieldBeginAsync(tmp200, cancellationToken); await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.Struct, Map.Count), cancellationToken); foreach (string _iter201 in Map.Keys) { await oprot.WriteStringAsync(_iter201, cancellationToken); await Map[_iter201].WriteAsync(oprot, cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } finally { oprot.DecrementRecursionDepth(); } } public override bool Equals(object that) { if (!(that is EchoMap_args other)) return false; if (ReferenceEquals(this, other)) return true; return ((__isset.@map == other.__isset.@map) && ((!__isset.@map) || (TCollections.Equals(Map, other.Map)))); } public override int GetHashCode() { int hashcode = 157; unchecked { if((Map != null) && __isset.@map) { hashcode = (hashcode * 397) + TCollections.GetHashCode(Map); } } return hashcode; } public override string ToString() { var tmp202 = new StringBuilder("EchoMap_args("); int tmp203 = 0; if((Map != null) && __isset.@map) { if(0 < tmp203++) { tmp202.Append(", "); } tmp202.Append("Map: "); Map.ToString(tmp202); } tmp202.Append(')'); return tmp202.ToString(); } } public partial class EchoMap_result : TBase { private Dictionary _success; public Dictionary Success { get { return _success; } set { __isset.@success = true; this._success = value; } } public Isset __isset; public struct Isset { public bool @success; } public EchoMap_result() { } public EchoMap_result DeepCopy() { var tmp204 = new EchoMap_result(); if((Success != null) && __isset.@success) { tmp204.Success = this.Success.DeepCopy(); } tmp204.__isset.@success = this.__isset.@success; return tmp204; } public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); try { TField field; await iprot.ReadStructBeginAsync(cancellationToken); while (true) { field = await iprot.ReadFieldBeginAsync(cancellationToken); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 0: if (field.Type == TType.Map) { { var _map205 = await iprot.ReadMapBeginAsync(cancellationToken); Success = new Dictionary(_map205.Count); for(int _i206 = 0; _i206 < _map205.Count; ++_i206) { string _key207; global::Echo.ThriftModel.BusinessDocument _val208; _key207 = await iprot.ReadStringAsync(cancellationToken); _val208 = new global::Echo.ThriftModel.BusinessDocument(); await _val208.ReadAsync(iprot, cancellationToken); Success[_key207] = _val208; } await iprot.ReadMapEndAsync(cancellationToken); } } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; } await iprot.ReadFieldEndAsync(cancellationToken); } await iprot.ReadStructEndAsync(cancellationToken); } finally { iprot.DecrementRecursionDepth(); } } public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) { oprot.IncrementRecursionDepth(); try { var tmp209 = new TStruct("EchoMap_result"); await oprot.WriteStructBeginAsync(tmp209, cancellationToken); var tmp210 = new TField(); if(this.__isset.@success) { if (Success != null) { tmp210.Name = "Success"; tmp210.Type = TType.Map; tmp210.ID = 0; await oprot.WriteFieldBeginAsync(tmp210, cancellationToken); await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.Struct, Success.Count), cancellationToken); foreach (string _iter211 in Success.Keys) { await oprot.WriteStringAsync(_iter211, cancellationToken); await Success[_iter211].WriteAsync(oprot, cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } finally { oprot.DecrementRecursionDepth(); } } public override bool Equals(object that) { if (!(that is EchoMap_result other)) return false; if (ReferenceEquals(this, other)) return true; return ((__isset.@success == other.__isset.@success) && ((!__isset.@success) || (TCollections.Equals(Success, other.Success)))); } public override int GetHashCode() { int hashcode = 157; unchecked { if((Success != null) && __isset.@success) { hashcode = (hashcode * 397) + TCollections.GetHashCode(Success); } } return hashcode; } public override string ToString() { var tmp212 = new StringBuilder("EchoMap_result("); int tmp213 = 0; if((Success != null) && __isset.@success) { if(0 < tmp213++) { tmp212.Append(", "); } tmp212.Append("Success: "); Success.ToString(tmp212); } tmp212.Append(')'); return tmp212.ToString(); } } public partial class EchoEnumArray_args : TBase { private List _docTypes; public List DocTypes { get { return _docTypes; } set { __isset.docTypes = true; this._docTypes = value; } } public Isset __isset; public struct Isset { public bool docTypes; } public EchoEnumArray_args() { } public EchoEnumArray_args DeepCopy() { var tmp214 = new EchoEnumArray_args(); if((DocTypes != null) && __isset.docTypes) { tmp214.DocTypes = this.DocTypes.DeepCopy(); } tmp214.__isset.docTypes = this.__isset.docTypes; return tmp214; } public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); try { TField field; await iprot.ReadStructBeginAsync(cancellationToken); while (true) { field = await iprot.ReadFieldBeginAsync(cancellationToken); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.List) { { var _list215 = await iprot.ReadListBeginAsync(cancellationToken); DocTypes = new List(_list215.Count); for(int _i216 = 0; _i216 < _list215.Count; ++_i216) { global::Echo.ThriftModel.DocType _elem217; _elem217 = (global::Echo.ThriftModel.DocType)await iprot.ReadI32Async(cancellationToken); DocTypes.Add(_elem217); } await iprot.ReadListEndAsync(cancellationToken); } } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; } await iprot.ReadFieldEndAsync(cancellationToken); } await iprot.ReadStructEndAsync(cancellationToken); } finally { iprot.DecrementRecursionDepth(); } } public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) { oprot.IncrementRecursionDepth(); try { var tmp218 = new TStruct("EchoEnumArray_args"); await oprot.WriteStructBeginAsync(tmp218, cancellationToken); var tmp219 = new TField(); if((DocTypes != null) && __isset.docTypes) { tmp219.Name = "docTypes"; tmp219.Type = TType.List; tmp219.ID = 1; await oprot.WriteFieldBeginAsync(tmp219, cancellationToken); await oprot.WriteListBeginAsync(new TList(TType.I32, DocTypes.Count), cancellationToken); foreach (global::Echo.ThriftModel.DocType _iter220 in DocTypes) { await oprot.WriteI32Async((int)_iter220, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } finally { oprot.DecrementRecursionDepth(); } } public override bool Equals(object that) { if (!(that is EchoEnumArray_args other)) return false; if (ReferenceEquals(this, other)) return true; return ((__isset.docTypes == other.__isset.docTypes) && ((!__isset.docTypes) || (TCollections.Equals(DocTypes, other.DocTypes)))); } public override int GetHashCode() { int hashcode = 157; unchecked { if((DocTypes != null) && __isset.docTypes) { hashcode = (hashcode * 397) + TCollections.GetHashCode(DocTypes); } } return hashcode; } public override string ToString() { var tmp221 = new StringBuilder("EchoEnumArray_args("); int tmp222 = 0; if((DocTypes != null) && __isset.docTypes) { if(0 < tmp222++) { tmp221.Append(", "); } tmp221.Append("DocTypes: "); DocTypes.ToString(tmp221); } tmp221.Append(')'); return tmp221.ToString(); } } public partial class EchoEnumArray_result : TBase { private List _success; public List Success { get { return _success; } set { __isset.@success = true; this._success = value; } } public Isset __isset; public struct Isset { public bool @success; } public EchoEnumArray_result() { } public EchoEnumArray_result DeepCopy() { var tmp223 = new EchoEnumArray_result(); if((Success != null) && __isset.@success) { tmp223.Success = this.Success.DeepCopy(); } tmp223.__isset.@success = this.__isset.@success; return tmp223; } public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); try { TField field; await iprot.ReadStructBeginAsync(cancellationToken); while (true) { field = await iprot.ReadFieldBeginAsync(cancellationToken); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 0: if (field.Type == TType.List) { { var _list224 = await iprot.ReadListBeginAsync(cancellationToken); Success = new List(_list224.Count); for(int _i225 = 0; _i225 < _list224.Count; ++_i225) { global::Echo.ThriftModel.DocType _elem226; _elem226 = (global::Echo.ThriftModel.DocType)await iprot.ReadI32Async(cancellationToken); Success.Add(_elem226); } await iprot.ReadListEndAsync(cancellationToken); } } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; } await iprot.ReadFieldEndAsync(cancellationToken); } await iprot.ReadStructEndAsync(cancellationToken); } finally { iprot.DecrementRecursionDepth(); } } public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) { oprot.IncrementRecursionDepth(); try { var tmp227 = new TStruct("EchoEnumArray_result"); await oprot.WriteStructBeginAsync(tmp227, cancellationToken); var tmp228 = new TField(); if(this.__isset.@success) { if (Success != null) { tmp228.Name = "Success"; tmp228.Type = TType.List; tmp228.ID = 0; await oprot.WriteFieldBeginAsync(tmp228, cancellationToken); await oprot.WriteListBeginAsync(new TList(TType.I32, Success.Count), cancellationToken); foreach (global::Echo.ThriftModel.DocType _iter229 in Success) { await oprot.WriteI32Async((int)_iter229, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } finally { oprot.DecrementRecursionDepth(); } } public override bool Equals(object that) { if (!(that is EchoEnumArray_result other)) return false; if (ReferenceEquals(this, other)) return true; return ((__isset.@success == other.__isset.@success) && ((!__isset.@success) || (TCollections.Equals(Success, other.Success)))); } public override int GetHashCode() { int hashcode = 157; unchecked { if((Success != null) && __isset.@success) { hashcode = (hashcode * 397) + TCollections.GetHashCode(Success); } } return hashcode; } public override string ToString() { var tmp230 = new StringBuilder("EchoEnumArray_result("); int tmp231 = 0; if((Success != null) && __isset.@success) { if(0 < tmp231++) { tmp230.Append(", "); } tmp230.Append("Success: "); Success.ToString(tmp230); } tmp230.Append(')'); return tmp230.ToString(); } } } } }