/**
 * Autogenerated by Thrift Compiler (0.14.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
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 System.ServiceModel;
using System.Runtime.Serialization;

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 IDE1006  // parts of the code use IDL spelling

namespace ThriftTest
{
public partial class ThriftTest
{
  [ServiceContract(Namespace="")]
  public interface IAsync
  {
    /// <summary>
    /// Prints "testVoid()" and returns nothing.
    /// </summary>
    [OperationContract]
    global::System.Threading.Tasks.Task testVoidAsync(CancellationToken cancellationToken = default);

    /// <summary>
    /// Prints 'testString("%s")' with thing as '%s'
    /// @param string thing - the string to print
    /// @return string - returns the string 'thing'
    /// </summary>
    /// <param name="thing"></param>
    [OperationContract]
    global::System.Threading.Tasks.Task<string> testStringAsync(string thing, CancellationToken cancellationToken = default);

    /// <summary>
    /// Prints 'testBool("%s")' where '%s' with thing as 'true' or 'false'
    /// @param bool  thing - the bool data to print
    /// @return bool  - returns the bool 'thing'
    /// </summary>
    /// <param name="thing"></param>
    [OperationContract]
    global::System.Threading.Tasks.Task<bool> testBoolAsync(bool thing, CancellationToken cancellationToken = default);

    /// <summary>
    /// Prints 'testByte("%d")' with thing as '%d'
    /// The types i8 and byte are synonyms, use of i8 is encouraged, byte still exists for the sake of compatibility.
    /// @param byte thing - the i8/byte to print
    /// @return i8 - returns the i8/byte 'thing'
    /// </summary>
    /// <param name="thing"></param>
    [OperationContract]
    global::System.Threading.Tasks.Task<sbyte> testByteAsync(sbyte thing, CancellationToken cancellationToken = default);

    /// <summary>
    /// Prints 'testI32("%d")' with thing as '%d'
    /// @param i32 thing - the i32 to print
    /// @return i32 - returns the i32 'thing'
    /// </summary>
    /// <param name="thing"></param>
    [OperationContract]
    global::System.Threading.Tasks.Task<int> testI32Async(int thing, CancellationToken cancellationToken = default);

    /// <summary>
    /// Prints 'testI64("%d")' with thing as '%d'
    /// @param i64 thing - the i64 to print
    /// @return i64 - returns the i64 'thing'
    /// </summary>
    /// <param name="thing"></param>
    [OperationContract]
    global::System.Threading.Tasks.Task<long> testI64Async(long thing, CancellationToken cancellationToken = default);

    /// <summary>
    /// Prints 'testDouble("%f")' with thing as '%f'
    /// @param double thing - the double to print
    /// @return double - returns the double 'thing'
    /// </summary>
    /// <param name="thing"></param>
    [OperationContract]
    global::System.Threading.Tasks.Task<double> testDoubleAsync(double thing, CancellationToken cancellationToken = default);

    /// <summary>
    /// Prints 'testBinary("%s")' where '%s' is a hex-formatted string of thing's data
    /// @param binary  thing - the binary data to print
    /// @return binary  - returns the binary 'thing'
    /// </summary>
    /// <param name="thing"></param>
    [OperationContract]
    global::System.Threading.Tasks.Task<byte[]> testBinaryAsync(byte[] thing, CancellationToken cancellationToken = default);

    /// <summary>
    /// Prints 'testStruct("{%s}")' where thing has been formatted into a string of comma separated values
    /// @param Xtruct thing - the Xtruct to print
    /// @return Xtruct - returns the Xtruct 'thing'
    /// </summary>
    /// <param name="thing"></param>
    [OperationContract]
    global::System.Threading.Tasks.Task<global::ThriftTest.Xtruct> testStructAsync(global::ThriftTest.Xtruct thing, CancellationToken cancellationToken = default);

    /// <summary>
    /// Prints 'testNest("{%s}")' where thing has been formatted into a string of the nested struct
    /// @param Xtruct2 thing - the Xtruct2 to print
    /// @return Xtruct2 - returns the Xtruct2 'thing'
    /// </summary>
    /// <param name="thing"></param>
    [OperationContract]
    global::System.Threading.Tasks.Task<global::ThriftTest.Xtruct2> testNestAsync(global::ThriftTest.Xtruct2 thing, CancellationToken cancellationToken = default);

    /// <summary>
    /// Prints 'testMap("{%s")' where thing has been formatted into a string of 'key => value' pairs
    ///  separated by commas and new lines
    /// @param map<i32,i32> thing - the map<i32,i32> to print
    /// @return map<i32,i32> - returns the map<i32,i32> 'thing'
    /// </summary>
    /// <param name="thing"></param>
    [OperationContract]
    global::System.Threading.Tasks.Task<Dictionary<int, int>> testMapAsync(Dictionary<int, int> thing, CancellationToken cancellationToken = default);

    /// <summary>
    /// Prints 'testStringMap("{%s}")' where thing has been formatted into a string of 'key => value' pairs
    ///  separated by commas and new lines
    /// @param map<string,string> thing - the map<string,string> to print
    /// @return map<string,string> - returns the map<string,string> 'thing'
    /// </summary>
    /// <param name="thing"></param>
    [OperationContract]
    global::System.Threading.Tasks.Task<Dictionary<string, string>> testStringMapAsync(Dictionary<string, string> thing, CancellationToken cancellationToken = default);

    /// <summary>
    /// Prints 'testSet("{%s}")' where thing has been formatted into a string of values
    ///  separated by commas and new lines
    /// @param set<i32> thing - the set<i32> to print
    /// @return set<i32> - returns the set<i32> 'thing'
    /// </summary>
    /// <param name="thing"></param>
    [OperationContract]
    global::System.Threading.Tasks.Task<THashSet<int>> testSetAsync(THashSet<int> thing, CancellationToken cancellationToken = default);

    /// <summary>
    /// Prints 'testList("{%s}")' where thing has been formatted into a string of values
    ///  separated by commas and new lines
    /// @param list<i32> thing - the list<i32> to print
    /// @return list<i32> - returns the list<i32> 'thing'
    /// </summary>
    /// <param name="thing"></param>
    [OperationContract]
    global::System.Threading.Tasks.Task<List<int>> testListAsync(List<int> thing, CancellationToken cancellationToken = default);

    /// <summary>
    /// Prints 'testEnum("%d")' where thing has been formatted into its numeric value
    /// @param Numberz thing - the Numberz to print
    /// @return Numberz - returns the Numberz 'thing'
    /// </summary>
    /// <param name="thing"></param>
    [OperationContract]
    global::System.Threading.Tasks.Task<global::ThriftTest.Numberz> testEnumAsync(global::ThriftTest.Numberz thing, CancellationToken cancellationToken = default);

    /// <summary>
    /// Prints 'testTypedef("%d")' with thing as '%d'
    /// @param UserId thing - the UserId to print
    /// @return UserId - returns the UserId 'thing'
    /// </summary>
    /// <param name="thing"></param>
    [OperationContract]
    global::System.Threading.Tasks.Task<long> testTypedefAsync(long thing, CancellationToken cancellationToken = default);

    /// <summary>
    /// Prints 'testMapMap("%d")' with hello as '%d'
    /// @param i32 hello - the i32 to print
    /// @return map<i32,map<i32,i32>> - returns a dictionary with these values:
    ///   {-4 => {-4 => -4, -3 => -3, -2 => -2, -1 => -1, }, 4 => {1 => 1, 2 => 2, 3 => 3, 4 => 4, }, }
    /// </summary>
    /// <param name="hello"></param>
    [OperationContract]
    global::System.Threading.Tasks.Task<Dictionary<int, Dictionary<int, int>>> testMapMapAsync(int hello, CancellationToken cancellationToken = default);

    /// <summary>
    /// So you think you've got this all worked out, eh?
    /// 
    /// Creates a map with these values and prints it out:
    ///   { 1 => { 2 => argument,
    ///            3 => argument,
    ///          },
    ///     2 => { 6 => <empty Insanity struct>, },
    ///   }
    /// @return map<UserId, map<Numberz,Insanity>> - a map with the above values
    /// </summary>
    /// <param name="argument"></param>
    [OperationContract]
    global::System.Threading.Tasks.Task<Dictionary<long, Dictionary<global::ThriftTest.Numberz, global::ThriftTest.Insanity>>> testInsanityAsync(global::ThriftTest.Insanity argument, CancellationToken cancellationToken = default);

    /// <summary>
    /// Prints 'testMulti()'
    /// @param i8 arg0 -
    /// @param i32 arg1 -
    /// @param i64 arg2 -
    /// @param map<i16, string> arg3 -
    /// @param Numberz arg4 -
    /// @param UserId arg5 -
    /// @return Xtruct - returns an Xtruct with string_thing = "Hello2, byte_thing = arg0, i32_thing = arg1
    ///    and i64_thing = arg2
    /// </summary>
    /// <param name="arg0"></param>
    /// <param name="arg1"></param>
    /// <param name="arg2"></param>
    /// <param name="arg3"></param>
    /// <param name="arg4"></param>
    /// <param name="arg5"></param>
    [OperationContract]
    global::System.Threading.Tasks.Task<global::ThriftTest.Xtruct> testMultiAsync(sbyte arg0, int arg1, long arg2, Dictionary<short, string> arg3, global::ThriftTest.Numberz arg4, long arg5, CancellationToken cancellationToken = default);

    /// <summary>
    /// Print 'testException(%s)' with arg as '%s'
    /// @param string arg - a string indication what type of exception to throw
    /// if arg == "Xception" throw Xception with errorCode = 1001 and message = arg
    /// else if arg == "TException" throw TException
    /// else do not throw anything
    /// </summary>
    /// <param name="arg"></param>
    [OperationContract]
    [FaultContract(typeof(global::ThriftTest.XceptionFault))]
    global::System.Threading.Tasks.Task testExceptionAsync(string arg, CancellationToken cancellationToken = default);

    /// <summary>
    /// Print 'testMultiException(%s, %s)' with arg0 as '%s' and arg1 as '%s'
    /// @param string arg - a string indicating what type of exception to throw
    /// if arg0 == "Xception" throw Xception with errorCode = 1001 and message = "This is an Xception"
    /// else if arg0 == "Xception2" throw Xception2 with errorCode = 2002 and struct_thing.string_thing = "This is an Xception2"
    /// else do not throw anything
    /// @return Xtruct - an Xtruct with string_thing = arg1
    /// </summary>
    /// <param name="arg0"></param>
    /// <param name="arg1"></param>
    [OperationContract]
    [FaultContract(typeof(global::ThriftTest.XceptionFault))]
    [FaultContract(typeof(global::ThriftTest.Xception2Fault))]
    global::System.Threading.Tasks.Task<global::ThriftTest.Xtruct> testMultiExceptionAsync(string arg0, string arg1, CancellationToken cancellationToken = default);

    /// <summary>
    /// Print 'testOneway(%d): Sleeping...' with secondsToSleep as '%d'
    /// sleep 'secondsToSleep'
    /// Print 'testOneway(%d): done sleeping!' with secondsToSleep as '%d'
    /// @param i32 secondsToSleep - the number of seconds to sleep
    /// </summary>
    /// <param name="secondsToSleep"></param>
    [OperationContract]
    global::System.Threading.Tasks.Task testOnewayAsync(int secondsToSleep, 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 testVoidAsync(CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testVoid", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testVoidArgs() {
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testVoidResult();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      return;
    }

    public async global::System.Threading.Tasks.Task<string> testStringAsync(string thing, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testString", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testStringArgs() {
        Thing = thing,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testStringResult();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.success)
      {
        return result.Success;
      }
      throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testString failed: unknown result");
    }

    public async global::System.Threading.Tasks.Task<bool> testBoolAsync(bool thing, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testBool", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testBoolArgs() {
        Thing = thing,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testBoolResult();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.success)
      {
        return result.Success;
      }
      throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testBool failed: unknown result");
    }

    public async global::System.Threading.Tasks.Task<sbyte> testByteAsync(sbyte thing, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testByte", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testByteArgs() {
        Thing = thing,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testByteResult();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.success)
      {
        return result.Success;
      }
      throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testByte failed: unknown result");
    }

    public async global::System.Threading.Tasks.Task<int> testI32Async(int thing, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testI32", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testI32Args() {
        Thing = thing,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testI32Result();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.success)
      {
        return result.Success;
      }
      throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testI32 failed: unknown result");
    }

    public async global::System.Threading.Tasks.Task<long> testI64Async(long thing, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testI64", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testI64Args() {
        Thing = thing,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testI64Result();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.success)
      {
        return result.Success;
      }
      throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testI64 failed: unknown result");
    }

    public async global::System.Threading.Tasks.Task<double> testDoubleAsync(double thing, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testDouble", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testDoubleArgs() {
        Thing = thing,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testDoubleResult();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.success)
      {
        return result.Success;
      }
      throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testDouble failed: unknown result");
    }

    public async global::System.Threading.Tasks.Task<byte[]> testBinaryAsync(byte[] thing, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testBinary", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testBinaryArgs() {
        Thing = thing,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testBinaryResult();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.success)
      {
        return result.Success;
      }
      throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testBinary failed: unknown result");
    }

    public async global::System.Threading.Tasks.Task<global::ThriftTest.Xtruct> testStructAsync(global::ThriftTest.Xtruct thing, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testStruct", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testStructArgs() {
        Thing = thing,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testStructResult();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.success)
      {
        return result.Success;
      }
      throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testStruct failed: unknown result");
    }

    public async global::System.Threading.Tasks.Task<global::ThriftTest.Xtruct2> testNestAsync(global::ThriftTest.Xtruct2 thing, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testNest", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testNestArgs() {
        Thing = thing,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testNestResult();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.success)
      {
        return result.Success;
      }
      throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testNest failed: unknown result");
    }

    public async global::System.Threading.Tasks.Task<Dictionary<int, int>> testMapAsync(Dictionary<int, int> thing, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testMap", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testMapArgs() {
        Thing = thing,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testMapResult();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.success)
      {
        return result.Success;
      }
      throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testMap failed: unknown result");
    }

    public async global::System.Threading.Tasks.Task<Dictionary<string, string>> testStringMapAsync(Dictionary<string, string> thing, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testStringMap", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testStringMapArgs() {
        Thing = thing,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testStringMapResult();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.success)
      {
        return result.Success;
      }
      throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testStringMap failed: unknown result");
    }

    public async global::System.Threading.Tasks.Task<THashSet<int>> testSetAsync(THashSet<int> thing, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testSet", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testSetArgs() {
        Thing = thing,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testSetResult();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.success)
      {
        return result.Success;
      }
      throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testSet failed: unknown result");
    }

    public async global::System.Threading.Tasks.Task<List<int>> testListAsync(List<int> thing, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testList", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testListArgs() {
        Thing = thing,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testListResult();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.success)
      {
        return result.Success;
      }
      throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testList failed: unknown result");
    }

    public async global::System.Threading.Tasks.Task<global::ThriftTest.Numberz> testEnumAsync(global::ThriftTest.Numberz thing, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testEnum", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testEnumArgs() {
        Thing = thing,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testEnumResult();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.success)
      {
        return result.Success;
      }
      throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testEnum failed: unknown result");
    }

    public async global::System.Threading.Tasks.Task<long> testTypedefAsync(long thing, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testTypedef", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testTypedefArgs() {
        Thing = thing,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testTypedefResult();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.success)
      {
        return result.Success;
      }
      throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testTypedef failed: unknown result");
    }

    public async global::System.Threading.Tasks.Task<Dictionary<int, Dictionary<int, int>>> testMapMapAsync(int hello, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testMapMap", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testMapMapArgs() {
        Hello = hello,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testMapMapResult();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.success)
      {
        return result.Success;
      }
      throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testMapMap failed: unknown result");
    }

    public async global::System.Threading.Tasks.Task<Dictionary<long, Dictionary<global::ThriftTest.Numberz, global::ThriftTest.Insanity>>> testInsanityAsync(global::ThriftTest.Insanity argument, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testInsanity", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testInsanityArgs() {
        Argument = argument,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testInsanityResult();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.success)
      {
        return result.Success;
      }
      throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testInsanity failed: unknown result");
    }

    public async global::System.Threading.Tasks.Task<global::ThriftTest.Xtruct> testMultiAsync(sbyte arg0, int arg1, long arg2, Dictionary<short, string> arg3, global::ThriftTest.Numberz arg4, long arg5, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testMulti", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testMultiArgs() {
        Arg0 = arg0,
        Arg1 = arg1,
        Arg2 = arg2,
        Arg3 = arg3,
        Arg4 = arg4,
        Arg5 = arg5,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testMultiResult();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.success)
      {
        return result.Success;
      }
      throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testMulti failed: unknown result");
    }

    public async global::System.Threading.Tasks.Task testExceptionAsync(string arg, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testException", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testExceptionArgs() {
        Arg = arg,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testExceptionResult();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.err1)
      {
        throw result.Err1;
      }
      return;
    }

    public async global::System.Threading.Tasks.Task<global::ThriftTest.Xtruct> testMultiExceptionAsync(string arg0, string arg1, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testMultiException", TMessageType.Call, SeqId), cancellationToken);
      
      var args = new InternalStructs.testMultiExceptionArgs() {
        Arg0 = arg0,
        Arg1 = arg1,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
      
      var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);
      if (msg.Type == TMessageType.Exception)
      {
        var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        throw x;
      }

      var result = new InternalStructs.testMultiExceptionResult();
      await result.ReadAsync(InputProtocol, cancellationToken);
      await InputProtocol.ReadMessageEndAsync(cancellationToken);
      if (result.__isset.success)
      {
        return result.Success;
      }
      if (result.__isset.err1)
      {
        throw result.Err1;
      }
      if (result.__isset.err2)
      {
        throw result.Err2;
      }
      throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "testMultiException failed: unknown result");
    }

    public async global::System.Threading.Tasks.Task testOnewayAsync(int secondsToSleep, CancellationToken cancellationToken = default)
    {
      await OutputProtocol.WriteMessageBeginAsync(new TMessage("testOneway", TMessageType.Oneway, SeqId), cancellationToken);
      
      var args = new InternalStructs.testOnewayArgs() {
        SecondsToSleep = secondsToSleep,
      };
      
      await args.WriteAsync(OutputProtocol, cancellationToken);
      await OutputProtocol.WriteMessageEndAsync(cancellationToken);
      await OutputProtocol.Transport.FlushAsync(cancellationToken);
    }
  }

  public class AsyncProcessor : ITAsyncProcessor
  {
    private readonly IAsync _iAsync;
    private readonly ILogger<AsyncProcessor> _logger;

    public AsyncProcessor(IAsync iAsync, ILogger<AsyncProcessor> logger = default)
    {
      _iAsync = iAsync ?? throw new ArgumentNullException(nameof(iAsync));
      _logger = logger;
      processMap_["testVoid"] = testVoid_ProcessAsync;
      processMap_["testString"] = testString_ProcessAsync;
      processMap_["testBool"] = testBool_ProcessAsync;
      processMap_["testByte"] = testByte_ProcessAsync;
      processMap_["testI32"] = testI32_ProcessAsync;
      processMap_["testI64"] = testI64_ProcessAsync;
      processMap_["testDouble"] = testDouble_ProcessAsync;
      processMap_["testBinary"] = testBinary_ProcessAsync;
      processMap_["testStruct"] = testStruct_ProcessAsync;
      processMap_["testNest"] = testNest_ProcessAsync;
      processMap_["testMap"] = testMap_ProcessAsync;
      processMap_["testStringMap"] = testStringMap_ProcessAsync;
      processMap_["testSet"] = testSet_ProcessAsync;
      processMap_["testList"] = testList_ProcessAsync;
      processMap_["testEnum"] = testEnum_ProcessAsync;
      processMap_["testTypedef"] = testTypedef_ProcessAsync;
      processMap_["testMapMap"] = testMapMap_ProcessAsync;
      processMap_["testInsanity"] = testInsanity_ProcessAsync;
      processMap_["testMulti"] = testMulti_ProcessAsync;
      processMap_["testException"] = testException_ProcessAsync;
      processMap_["testMultiException"] = testMultiException_ProcessAsync;
      processMap_["testOneway"] = testOneway_ProcessAsync;
    }

    protected delegate global::System.Threading.Tasks.Task ProcessFunction(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken);
    protected Dictionary<string, ProcessFunction> processMap_ = new Dictionary<string, ProcessFunction>();

    public async Task<bool> ProcessAsync(TProtocol iprot, TProtocol oprot)
    {
      return await ProcessAsync(iprot, oprot, CancellationToken.None);
    }

    public async Task<bool> ProcessAsync(TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      try
      {
        var msg = await iprot.ReadMessageBeginAsync(cancellationToken);

        processMap_.TryGetValue(msg.Name, out ProcessFunction 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 testVoid_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testVoidArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testVoidResult();
      try
      {
        await _iAsync.testVoidAsync(cancellationToken);
        await oprot.WriteMessageBeginAsync(new TMessage("testVoid", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testVoid", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testString_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testStringArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testStringResult();
      try
      {
        result.Success = await _iAsync.testStringAsync(args.Thing, cancellationToken);
        await oprot.WriteMessageBeginAsync(new TMessage("testString", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testString", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testBool_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testBoolArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testBoolResult();
      try
      {
        result.Success = await _iAsync.testBoolAsync(args.Thing, cancellationToken);
        await oprot.WriteMessageBeginAsync(new TMessage("testBool", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testBool", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testByte_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testByteArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testByteResult();
      try
      {
        result.Success = await _iAsync.testByteAsync(args.Thing, cancellationToken);
        await oprot.WriteMessageBeginAsync(new TMessage("testByte", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testByte", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testI32_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testI32Args();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testI32Result();
      try
      {
        result.Success = await _iAsync.testI32Async(args.Thing, cancellationToken);
        await oprot.WriteMessageBeginAsync(new TMessage("testI32", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testI32", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testI64_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testI64Args();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testI64Result();
      try
      {
        result.Success = await _iAsync.testI64Async(args.Thing, cancellationToken);
        await oprot.WriteMessageBeginAsync(new TMessage("testI64", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testI64", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testDouble_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testDoubleArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testDoubleResult();
      try
      {
        result.Success = await _iAsync.testDoubleAsync(args.Thing, cancellationToken);
        await oprot.WriteMessageBeginAsync(new TMessage("testDouble", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testDouble", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testBinary_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testBinaryArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testBinaryResult();
      try
      {
        result.Success = await _iAsync.testBinaryAsync(args.Thing, cancellationToken);
        await oprot.WriteMessageBeginAsync(new TMessage("testBinary", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testBinary", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testStruct_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testStructArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testStructResult();
      try
      {
        result.Success = await _iAsync.testStructAsync(args.Thing, cancellationToken);
        await oprot.WriteMessageBeginAsync(new TMessage("testStruct", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testStruct", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testNest_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testNestArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testNestResult();
      try
      {
        result.Success = await _iAsync.testNestAsync(args.Thing, cancellationToken);
        await oprot.WriteMessageBeginAsync(new TMessage("testNest", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testNest", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testMap_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testMapArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testMapResult();
      try
      {
        result.Success = await _iAsync.testMapAsync(args.Thing, cancellationToken);
        await oprot.WriteMessageBeginAsync(new TMessage("testMap", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testMap", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testStringMap_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testStringMapArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testStringMapResult();
      try
      {
        result.Success = await _iAsync.testStringMapAsync(args.Thing, cancellationToken);
        await oprot.WriteMessageBeginAsync(new TMessage("testStringMap", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testStringMap", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testSet_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testSetArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testSetResult();
      try
      {
        result.Success = await _iAsync.testSetAsync(args.Thing, cancellationToken);
        await oprot.WriteMessageBeginAsync(new TMessage("testSet", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testSet", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testList_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testListArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testListResult();
      try
      {
        result.Success = await _iAsync.testListAsync(args.Thing, cancellationToken);
        await oprot.WriteMessageBeginAsync(new TMessage("testList", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testList", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testEnum_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testEnumArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testEnumResult();
      try
      {
        result.Success = await _iAsync.testEnumAsync(args.Thing, cancellationToken);
        await oprot.WriteMessageBeginAsync(new TMessage("testEnum", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testEnum", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testTypedef_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testTypedefArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testTypedefResult();
      try
      {
        result.Success = await _iAsync.testTypedefAsync(args.Thing, cancellationToken);
        await oprot.WriteMessageBeginAsync(new TMessage("testTypedef", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testTypedef", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testMapMap_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testMapMapArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testMapMapResult();
      try
      {
        result.Success = await _iAsync.testMapMapAsync(args.Hello, cancellationToken);
        await oprot.WriteMessageBeginAsync(new TMessage("testMapMap", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testMapMap", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testInsanity_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testInsanityArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testInsanityResult();
      try
      {
        result.Success = await _iAsync.testInsanityAsync(args.Argument, cancellationToken);
        await oprot.WriteMessageBeginAsync(new TMessage("testInsanity", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testInsanity", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testMulti_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testMultiArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testMultiResult();
      try
      {
        result.Success = await _iAsync.testMultiAsync(args.Arg0, args.Arg1, args.Arg2, args.Arg3, args.Arg4, args.Arg5, cancellationToken);
        await oprot.WriteMessageBeginAsync(new TMessage("testMulti", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testMulti", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testException_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testExceptionArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testExceptionResult();
      try
      {
        try
        {
          await _iAsync.testExceptionAsync(args.Arg, cancellationToken);
        }
        catch (global::ThriftTest.Xception err1)
        {
          result.Err1 = err1;
        }
        await oprot.WriteMessageBeginAsync(new TMessage("testException", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testException", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testMultiException_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testMultiExceptionArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      var result = new InternalStructs.testMultiExceptionResult();
      try
      {
        try
        {
          result.Success = await _iAsync.testMultiExceptionAsync(args.Arg0, args.Arg1, cancellationToken);
        }
        catch (global::ThriftTest.Xception err1)
        {
          result.Err1 = err1;
        }
        catch (global::ThriftTest.Xception2 err2)
        {
          result.Err2 = err2;
        }
        await oprot.WriteMessageBeginAsync(new TMessage("testMultiException", TMessageType.Reply, seqid), cancellationToken); 
        await result.WriteAsync(oprot, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
        var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error.");
        await oprot.WriteMessageBeginAsync(new TMessage("testMultiException", TMessageType.Exception, seqid), cancellationToken);
        await x.WriteAsync(oprot, cancellationToken);
      }
      await oprot.WriteMessageEndAsync(cancellationToken);
      await oprot.Transport.FlushAsync(cancellationToken);
    }

    public async global::System.Threading.Tasks.Task testOneway_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
    {
      var args = new InternalStructs.testOnewayArgs();
      await args.ReadAsync(iprot, cancellationToken);
      await iprot.ReadMessageEndAsync(cancellationToken);
      try
      {
        await _iAsync.testOnewayAsync(args.SecondsToSleep, cancellationToken);
      }
      catch (TTransportException)
      {
        throw;
      }
      catch (Exception ex)
      {
        var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}";
        if(_logger != null)
          _logger.LogError(ex, sErr);
        else
          Console.Error.WriteLine(sErr);
      }
    }

  }

  public class InternalStructs
  {

    [DataContract(Namespace="")]
    public partial class testVoidArgs : TBase
    {

      public testVoidArgs()
      {
      }

      public testVoidArgs DeepCopy()
      {
        var tmp205 = new testVoidArgs();
        return tmp205;
      }

      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)
            {
              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 struc = new TStruct("testVoid_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          await oprot.WriteFieldStopAsync(cancellationToken);
          await oprot.WriteStructEndAsync(cancellationToken);
        }
        finally
        {
          oprot.DecrementRecursionDepth();
        }
      }

      public override bool Equals(object that)
      {
        if (!(that is testVoidArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return true;
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testVoid_args(");
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testVoidResult : TBase
    {

      public testVoidResult()
      {
      }

      public testVoidResult DeepCopy()
      {
        var tmp207 = new testVoidResult();
        return tmp207;
      }

      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)
            {
              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 struc = new TStruct("testVoid_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          await oprot.WriteFieldStopAsync(cancellationToken);
          await oprot.WriteStructEndAsync(cancellationToken);
        }
        finally
        {
          oprot.DecrementRecursionDepth();
        }
      }

      public override bool Equals(object that)
      {
        if (!(that is testVoidResult other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return true;
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testVoid_result(");
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testStringArgs : TBase
    {
      private string _thing;

      [DataMember(Order = 0)]
      public string Thing
      {
        get
        {
          return _thing;
        }
        set
        {
          __isset.thing = true;
          this._thing = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool thing;
      }

      #region XmlSerializer support

      public bool ShouldSerializeThing()
      {
        return __isset.thing;
      }

      #endregion XmlSerializer support

      public testStringArgs()
      {
      }

      public testStringArgs DeepCopy()
      {
        var tmp209 = new testStringArgs();
        if((Thing != null) && __isset.thing)
        {
          tmp209.Thing = this.Thing;
        }
        tmp209.__isset.thing = this.__isset.thing;
        return tmp209;
      }

      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)
                {
                  Thing = await iprot.ReadStringAsync(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 struc = new TStruct("testString_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if((Thing != null) && __isset.thing)
          {
            field.Name = "thing";
            field.Type = TType.String;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteStringAsync(Thing, 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 testStringArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.thing == other.__isset.thing) && ((!__isset.thing) || (System.Object.Equals(Thing, other.Thing))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if((Thing != null) && __isset.thing)
          {
            hashcode = (hashcode * 397) + Thing.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testString_args(");
        int tmp210 = 0;
        if((Thing != null) && __isset.thing)
        {
          if(0 < tmp210++) { sb.Append(", "); }
          sb.Append("Thing: ");
          Thing.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testStringResult : TBase
    {
      private string _success;

      [DataMember(Order = 0)]
      public string Success
      {
        get
        {
          return _success;
        }
        set
        {
          __isset.success = true;
          this._success = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool success;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSuccess()
      {
        return __isset.success;
      }

      #endregion XmlSerializer support

      public testStringResult()
      {
      }

      public testStringResult DeepCopy()
      {
        var tmp211 = new testStringResult();
        if((Success != null) && __isset.success)
        {
          tmp211.Success = this.Success;
        }
        tmp211.__isset.success = this.__isset.success;
        return tmp211;
      }

      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.ReadStringAsync(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 struc = new TStruct("testString_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.success)
          {
            if (Success != null)
            {
              field.Name = "Success";
              field.Type = TType.String;
              field.ID = 0;
              await oprot.WriteFieldBeginAsync(field, cancellationToken);
              await oprot.WriteStringAsync(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 testStringResult other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.success == other.__isset.success) && ((!__isset.success) || (System.Object.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 sb = new StringBuilder("testString_result(");
        int tmp212 = 0;
        if((Success != null) && __isset.success)
        {
          if(0 < tmp212++) { sb.Append(", "); }
          sb.Append("Success: ");
          Success.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testBoolArgs : TBase
    {
      private bool _thing;

      [DataMember(Order = 0)]
      public bool Thing
      {
        get
        {
          return _thing;
        }
        set
        {
          __isset.thing = true;
          this._thing = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool thing;
      }

      #region XmlSerializer support

      public bool ShouldSerializeThing()
      {
        return __isset.thing;
      }

      #endregion XmlSerializer support

      public testBoolArgs()
      {
      }

      public testBoolArgs DeepCopy()
      {
        var tmp213 = new testBoolArgs();
        if(__isset.thing)
        {
          tmp213.Thing = this.Thing;
        }
        tmp213.__isset.thing = this.__isset.thing;
        return tmp213;
      }

      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.Bool)
                {
                  Thing = await iprot.ReadBoolAsync(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 struc = new TStruct("testBool_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if(__isset.thing)
          {
            field.Name = "thing";
            field.Type = TType.Bool;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteBoolAsync(Thing, 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 testBoolArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.thing == other.__isset.thing) && ((!__isset.thing) || (System.Object.Equals(Thing, other.Thing))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if(__isset.thing)
          {
            hashcode = (hashcode * 397) + Thing.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testBool_args(");
        int tmp214 = 0;
        if(__isset.thing)
        {
          if(0 < tmp214++) { sb.Append(", "); }
          sb.Append("Thing: ");
          Thing.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testBoolResult : TBase
    {
      private bool _success;

      [DataMember(Order = 0)]
      public bool Success
      {
        get
        {
          return _success;
        }
        set
        {
          __isset.success = true;
          this._success = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool success;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSuccess()
      {
        return __isset.success;
      }

      #endregion XmlSerializer support

      public testBoolResult()
      {
      }

      public testBoolResult DeepCopy()
      {
        var tmp215 = new testBoolResult();
        if(__isset.success)
        {
          tmp215.Success = this.Success;
        }
        tmp215.__isset.success = this.__isset.success;
        return tmp215;
      }

      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.Bool)
                {
                  Success = await iprot.ReadBoolAsync(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 struc = new TStruct("testBool_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.success)
          {
            field.Name = "Success";
            field.Type = TType.Bool;
            field.ID = 0;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteBoolAsync(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 testBoolResult other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.success == other.__isset.success) && ((!__isset.success) || (System.Object.Equals(Success, other.Success))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if(__isset.success)
          {
            hashcode = (hashcode * 397) + Success.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testBool_result(");
        int tmp216 = 0;
        if(__isset.success)
        {
          if(0 < tmp216++) { sb.Append(", "); }
          sb.Append("Success: ");
          Success.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testByteArgs : TBase
    {
      private sbyte _thing;

      [DataMember(Order = 0)]
      public sbyte Thing
      {
        get
        {
          return _thing;
        }
        set
        {
          __isset.thing = true;
          this._thing = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool thing;
      }

      #region XmlSerializer support

      public bool ShouldSerializeThing()
      {
        return __isset.thing;
      }

      #endregion XmlSerializer support

      public testByteArgs()
      {
      }

      public testByteArgs DeepCopy()
      {
        var tmp217 = new testByteArgs();
        if(__isset.thing)
        {
          tmp217.Thing = this.Thing;
        }
        tmp217.__isset.thing = this.__isset.thing;
        return tmp217;
      }

      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.Byte)
                {
                  Thing = await iprot.ReadByteAsync(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 struc = new TStruct("testByte_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if(__isset.thing)
          {
            field.Name = "thing";
            field.Type = TType.Byte;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteByteAsync(Thing, 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 testByteArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.thing == other.__isset.thing) && ((!__isset.thing) || (System.Object.Equals(Thing, other.Thing))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if(__isset.thing)
          {
            hashcode = (hashcode * 397) + Thing.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testByte_args(");
        int tmp218 = 0;
        if(__isset.thing)
        {
          if(0 < tmp218++) { sb.Append(", "); }
          sb.Append("Thing: ");
          Thing.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testByteResult : TBase
    {
      private sbyte _success;

      [DataMember(Order = 0)]
      public sbyte Success
      {
        get
        {
          return _success;
        }
        set
        {
          __isset.success = true;
          this._success = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool success;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSuccess()
      {
        return __isset.success;
      }

      #endregion XmlSerializer support

      public testByteResult()
      {
      }

      public testByteResult DeepCopy()
      {
        var tmp219 = new testByteResult();
        if(__isset.success)
        {
          tmp219.Success = this.Success;
        }
        tmp219.__isset.success = this.__isset.success;
        return tmp219;
      }

      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.Byte)
                {
                  Success = await iprot.ReadByteAsync(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 struc = new TStruct("testByte_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.success)
          {
            field.Name = "Success";
            field.Type = TType.Byte;
            field.ID = 0;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteByteAsync(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 testByteResult other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.success == other.__isset.success) && ((!__isset.success) || (System.Object.Equals(Success, other.Success))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if(__isset.success)
          {
            hashcode = (hashcode * 397) + Success.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testByte_result(");
        int tmp220 = 0;
        if(__isset.success)
        {
          if(0 < tmp220++) { sb.Append(", "); }
          sb.Append("Success: ");
          Success.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testI32Args : TBase
    {
      private int _thing;

      [DataMember(Order = 0)]
      public int Thing
      {
        get
        {
          return _thing;
        }
        set
        {
          __isset.thing = true;
          this._thing = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool thing;
      }

      #region XmlSerializer support

      public bool ShouldSerializeThing()
      {
        return __isset.thing;
      }

      #endregion XmlSerializer support

      public testI32Args()
      {
      }

      public testI32Args DeepCopy()
      {
        var tmp221 = new testI32Args();
        if(__isset.thing)
        {
          tmp221.Thing = this.Thing;
        }
        tmp221.__isset.thing = this.__isset.thing;
        return tmp221;
      }

      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.I32)
                {
                  Thing = await iprot.ReadI32Async(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 struc = new TStruct("testI32_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if(__isset.thing)
          {
            field.Name = "thing";
            field.Type = TType.I32;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteI32Async(Thing, 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 testI32Args other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.thing == other.__isset.thing) && ((!__isset.thing) || (System.Object.Equals(Thing, other.Thing))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if(__isset.thing)
          {
            hashcode = (hashcode * 397) + Thing.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testI32_args(");
        int tmp222 = 0;
        if(__isset.thing)
        {
          if(0 < tmp222++) { sb.Append(", "); }
          sb.Append("Thing: ");
          Thing.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testI32Result : TBase
    {
      private int _success;

      [DataMember(Order = 0)]
      public int Success
      {
        get
        {
          return _success;
        }
        set
        {
          __isset.success = true;
          this._success = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool success;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSuccess()
      {
        return __isset.success;
      }

      #endregion XmlSerializer support

      public testI32Result()
      {
      }

      public testI32Result DeepCopy()
      {
        var tmp223 = new testI32Result();
        if(__isset.success)
        {
          tmp223.Success = this.Success;
        }
        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.I32)
                {
                  Success = await iprot.ReadI32Async(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 struc = new TStruct("testI32_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.success)
          {
            field.Name = "Success";
            field.Type = TType.I32;
            field.ID = 0;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteI32Async(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 testI32Result other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.success == other.__isset.success) && ((!__isset.success) || (System.Object.Equals(Success, other.Success))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if(__isset.success)
          {
            hashcode = (hashcode * 397) + Success.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testI32_result(");
        int tmp224 = 0;
        if(__isset.success)
        {
          if(0 < tmp224++) { sb.Append(", "); }
          sb.Append("Success: ");
          Success.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testI64Args : TBase
    {
      private long _thing;

      [DataMember(Order = 0)]
      public long Thing
      {
        get
        {
          return _thing;
        }
        set
        {
          __isset.thing = true;
          this._thing = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool thing;
      }

      #region XmlSerializer support

      public bool ShouldSerializeThing()
      {
        return __isset.thing;
      }

      #endregion XmlSerializer support

      public testI64Args()
      {
      }

      public testI64Args DeepCopy()
      {
        var tmp225 = new testI64Args();
        if(__isset.thing)
        {
          tmp225.Thing = this.Thing;
        }
        tmp225.__isset.thing = this.__isset.thing;
        return tmp225;
      }

      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.I64)
                {
                  Thing = await iprot.ReadI64Async(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 struc = new TStruct("testI64_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if(__isset.thing)
          {
            field.Name = "thing";
            field.Type = TType.I64;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteI64Async(Thing, 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 testI64Args other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.thing == other.__isset.thing) && ((!__isset.thing) || (System.Object.Equals(Thing, other.Thing))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if(__isset.thing)
          {
            hashcode = (hashcode * 397) + Thing.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testI64_args(");
        int tmp226 = 0;
        if(__isset.thing)
        {
          if(0 < tmp226++) { sb.Append(", "); }
          sb.Append("Thing: ");
          Thing.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testI64Result : TBase
    {
      private long _success;

      [DataMember(Order = 0)]
      public long Success
      {
        get
        {
          return _success;
        }
        set
        {
          __isset.success = true;
          this._success = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool success;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSuccess()
      {
        return __isset.success;
      }

      #endregion XmlSerializer support

      public testI64Result()
      {
      }

      public testI64Result DeepCopy()
      {
        var tmp227 = new testI64Result();
        if(__isset.success)
        {
          tmp227.Success = this.Success;
        }
        tmp227.__isset.success = this.__isset.success;
        return tmp227;
      }

      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.I64)
                {
                  Success = await iprot.ReadI64Async(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 struc = new TStruct("testI64_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.success)
          {
            field.Name = "Success";
            field.Type = TType.I64;
            field.ID = 0;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteI64Async(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 testI64Result other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.success == other.__isset.success) && ((!__isset.success) || (System.Object.Equals(Success, other.Success))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if(__isset.success)
          {
            hashcode = (hashcode * 397) + Success.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testI64_result(");
        int tmp228 = 0;
        if(__isset.success)
        {
          if(0 < tmp228++) { sb.Append(", "); }
          sb.Append("Success: ");
          Success.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testDoubleArgs : TBase
    {
      private double _thing;

      [DataMember(Order = 0)]
      public double Thing
      {
        get
        {
          return _thing;
        }
        set
        {
          __isset.thing = true;
          this._thing = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool thing;
      }

      #region XmlSerializer support

      public bool ShouldSerializeThing()
      {
        return __isset.thing;
      }

      #endregion XmlSerializer support

      public testDoubleArgs()
      {
      }

      public testDoubleArgs DeepCopy()
      {
        var tmp229 = new testDoubleArgs();
        if(__isset.thing)
        {
          tmp229.Thing = this.Thing;
        }
        tmp229.__isset.thing = this.__isset.thing;
        return tmp229;
      }

      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.Double)
                {
                  Thing = await iprot.ReadDoubleAsync(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 struc = new TStruct("testDouble_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if(__isset.thing)
          {
            field.Name = "thing";
            field.Type = TType.Double;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteDoubleAsync(Thing, 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 testDoubleArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.thing == other.__isset.thing) && ((!__isset.thing) || (System.Object.Equals(Thing, other.Thing))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if(__isset.thing)
          {
            hashcode = (hashcode * 397) + Thing.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testDouble_args(");
        int tmp230 = 0;
        if(__isset.thing)
        {
          if(0 < tmp230++) { sb.Append(", "); }
          sb.Append("Thing: ");
          Thing.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testDoubleResult : TBase
    {
      private double _success;

      [DataMember(Order = 0)]
      public double Success
      {
        get
        {
          return _success;
        }
        set
        {
          __isset.success = true;
          this._success = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool success;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSuccess()
      {
        return __isset.success;
      }

      #endregion XmlSerializer support

      public testDoubleResult()
      {
      }

      public testDoubleResult DeepCopy()
      {
        var tmp231 = new testDoubleResult();
        if(__isset.success)
        {
          tmp231.Success = this.Success;
        }
        tmp231.__isset.success = this.__isset.success;
        return tmp231;
      }

      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.Double)
                {
                  Success = await iprot.ReadDoubleAsync(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 struc = new TStruct("testDouble_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.success)
          {
            field.Name = "Success";
            field.Type = TType.Double;
            field.ID = 0;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteDoubleAsync(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 testDoubleResult other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.success == other.__isset.success) && ((!__isset.success) || (System.Object.Equals(Success, other.Success))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if(__isset.success)
          {
            hashcode = (hashcode * 397) + Success.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testDouble_result(");
        int tmp232 = 0;
        if(__isset.success)
        {
          if(0 < tmp232++) { sb.Append(", "); }
          sb.Append("Success: ");
          Success.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testBinaryArgs : TBase
    {
      private byte[] _thing;

      [DataMember(Order = 0)]
      public byte[] Thing
      {
        get
        {
          return _thing;
        }
        set
        {
          __isset.thing = true;
          this._thing = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool thing;
      }

      #region XmlSerializer support

      public bool ShouldSerializeThing()
      {
        return __isset.thing;
      }

      #endregion XmlSerializer support

      public testBinaryArgs()
      {
      }

      public testBinaryArgs DeepCopy()
      {
        var tmp233 = new testBinaryArgs();
        if((Thing != null) && __isset.thing)
        {
          tmp233.Thing = this.Thing.ToArray();
        }
        tmp233.__isset.thing = this.__isset.thing;
        return tmp233;
      }

      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)
                {
                  Thing = 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 struc = new TStruct("testBinary_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if((Thing != null) && __isset.thing)
          {
            field.Name = "thing";
            field.Type = TType.String;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteBinaryAsync(Thing, 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 testBinaryArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.thing == other.__isset.thing) && ((!__isset.thing) || (TCollections.Equals(Thing, other.Thing))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if((Thing != null) && __isset.thing)
          {
            hashcode = (hashcode * 397) + Thing.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testBinary_args(");
        int tmp234 = 0;
        if((Thing != null) && __isset.thing)
        {
          if(0 < tmp234++) { sb.Append(", "); }
          sb.Append("Thing: ");
          Thing.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testBinaryResult : TBase
    {
      private byte[] _success;

      [DataMember(Order = 0)]
      public byte[] Success
      {
        get
        {
          return _success;
        }
        set
        {
          __isset.success = true;
          this._success = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool success;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSuccess()
      {
        return __isset.success;
      }

      #endregion XmlSerializer support

      public testBinaryResult()
      {
      }

      public testBinaryResult DeepCopy()
      {
        var tmp235 = new testBinaryResult();
        if((Success != null) && __isset.success)
        {
          tmp235.Success = this.Success.ToArray();
        }
        tmp235.__isset.success = this.__isset.success;
        return tmp235;
      }

      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 struc = new TStruct("testBinary_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.success)
          {
            if (Success != null)
            {
              field.Name = "Success";
              field.Type = TType.String;
              field.ID = 0;
              await oprot.WriteFieldBeginAsync(field, 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 testBinaryResult 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 sb = new StringBuilder("testBinary_result(");
        int tmp236 = 0;
        if((Success != null) && __isset.success)
        {
          if(0 < tmp236++) { sb.Append(", "); }
          sb.Append("Success: ");
          Success.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testStructArgs : TBase
    {
      private global::ThriftTest.Xtruct _thing;

      [DataMember(Order = 0)]
      public global::ThriftTest.Xtruct Thing
      {
        get
        {
          return _thing;
        }
        set
        {
          __isset.thing = true;
          this._thing = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool thing;
      }

      #region XmlSerializer support

      public bool ShouldSerializeThing()
      {
        return __isset.thing;
      }

      #endregion XmlSerializer support

      public testStructArgs()
      {
      }

      public testStructArgs DeepCopy()
      {
        var tmp237 = new testStructArgs();
        if((Thing != null) && __isset.thing)
        {
          tmp237.Thing = (global::ThriftTest.Xtruct)this.Thing.DeepCopy();
        }
        tmp237.__isset.thing = this.__isset.thing;
        return tmp237;
      }

      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.Struct)
                {
                  Thing = new global::ThriftTest.Xtruct();
                  await Thing.ReadAsync(iprot, 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 struc = new TStruct("testStruct_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if((Thing != null) && __isset.thing)
          {
            field.Name = "thing";
            field.Type = TType.Struct;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await Thing.WriteAsync(oprot, 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 testStructArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.thing == other.__isset.thing) && ((!__isset.thing) || (System.Object.Equals(Thing, other.Thing))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if((Thing != null) && __isset.thing)
          {
            hashcode = (hashcode * 397) + Thing.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testStruct_args(");
        int tmp238 = 0;
        if((Thing != null) && __isset.thing)
        {
          if(0 < tmp238++) { sb.Append(", "); }
          sb.Append("Thing: ");
          Thing.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testStructResult : TBase
    {
      private global::ThriftTest.Xtruct _success;

      [DataMember(Order = 0)]
      public global::ThriftTest.Xtruct Success
      {
        get
        {
          return _success;
        }
        set
        {
          __isset.success = true;
          this._success = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool success;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSuccess()
      {
        return __isset.success;
      }

      #endregion XmlSerializer support

      public testStructResult()
      {
      }

      public testStructResult DeepCopy()
      {
        var tmp239 = new testStructResult();
        if((Success != null) && __isset.success)
        {
          tmp239.Success = (global::ThriftTest.Xtruct)this.Success.DeepCopy();
        }
        tmp239.__isset.success = this.__isset.success;
        return tmp239;
      }

      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.Struct)
                {
                  Success = new global::ThriftTest.Xtruct();
                  await Success.ReadAsync(iprot, 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 struc = new TStruct("testStruct_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.success)
          {
            if (Success != null)
            {
              field.Name = "Success";
              field.Type = TType.Struct;
              field.ID = 0;
              await oprot.WriteFieldBeginAsync(field, cancellationToken);
              await Success.WriteAsync(oprot, 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 testStructResult other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.success == other.__isset.success) && ((!__isset.success) || (System.Object.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 sb = new StringBuilder("testStruct_result(");
        int tmp240 = 0;
        if((Success != null) && __isset.success)
        {
          if(0 < tmp240++) { sb.Append(", "); }
          sb.Append("Success: ");
          Success.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testNestArgs : TBase
    {
      private global::ThriftTest.Xtruct2 _thing;

      [DataMember(Order = 0)]
      public global::ThriftTest.Xtruct2 Thing
      {
        get
        {
          return _thing;
        }
        set
        {
          __isset.thing = true;
          this._thing = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool thing;
      }

      #region XmlSerializer support

      public bool ShouldSerializeThing()
      {
        return __isset.thing;
      }

      #endregion XmlSerializer support

      public testNestArgs()
      {
      }

      public testNestArgs DeepCopy()
      {
        var tmp241 = new testNestArgs();
        if((Thing != null) && __isset.thing)
        {
          tmp241.Thing = (global::ThriftTest.Xtruct2)this.Thing.DeepCopy();
        }
        tmp241.__isset.thing = this.__isset.thing;
        return tmp241;
      }

      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.Struct)
                {
                  Thing = new global::ThriftTest.Xtruct2();
                  await Thing.ReadAsync(iprot, 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 struc = new TStruct("testNest_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if((Thing != null) && __isset.thing)
          {
            field.Name = "thing";
            field.Type = TType.Struct;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await Thing.WriteAsync(oprot, 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 testNestArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.thing == other.__isset.thing) && ((!__isset.thing) || (System.Object.Equals(Thing, other.Thing))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if((Thing != null) && __isset.thing)
          {
            hashcode = (hashcode * 397) + Thing.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testNest_args(");
        int tmp242 = 0;
        if((Thing != null) && __isset.thing)
        {
          if(0 < tmp242++) { sb.Append(", "); }
          sb.Append("Thing: ");
          Thing.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testNestResult : TBase
    {
      private global::ThriftTest.Xtruct2 _success;

      [DataMember(Order = 0)]
      public global::ThriftTest.Xtruct2 Success
      {
        get
        {
          return _success;
        }
        set
        {
          __isset.success = true;
          this._success = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool success;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSuccess()
      {
        return __isset.success;
      }

      #endregion XmlSerializer support

      public testNestResult()
      {
      }

      public testNestResult DeepCopy()
      {
        var tmp243 = new testNestResult();
        if((Success != null) && __isset.success)
        {
          tmp243.Success = (global::ThriftTest.Xtruct2)this.Success.DeepCopy();
        }
        tmp243.__isset.success = this.__isset.success;
        return tmp243;
      }

      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.Struct)
                {
                  Success = new global::ThriftTest.Xtruct2();
                  await Success.ReadAsync(iprot, 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 struc = new TStruct("testNest_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.success)
          {
            if (Success != null)
            {
              field.Name = "Success";
              field.Type = TType.Struct;
              field.ID = 0;
              await oprot.WriteFieldBeginAsync(field, cancellationToken);
              await Success.WriteAsync(oprot, 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 testNestResult other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.success == other.__isset.success) && ((!__isset.success) || (System.Object.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 sb = new StringBuilder("testNest_result(");
        int tmp244 = 0;
        if((Success != null) && __isset.success)
        {
          if(0 < tmp244++) { sb.Append(", "); }
          sb.Append("Success: ");
          Success.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testMapArgs : TBase
    {
      private Dictionary<int, int> _thing;

      [DataMember(Order = 0)]
      public Dictionary<int, int> Thing
      {
        get
        {
          return _thing;
        }
        set
        {
          __isset.thing = true;
          this._thing = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool thing;
      }

      #region XmlSerializer support

      public bool ShouldSerializeThing()
      {
        return __isset.thing;
      }

      #endregion XmlSerializer support

      public testMapArgs()
      {
      }

      public testMapArgs DeepCopy()
      {
        var tmp245 = new testMapArgs();
        if((Thing != null) && __isset.thing)
        {
          tmp245.Thing = this.Thing.DeepCopy();
        }
        tmp245.__isset.thing = this.__isset.thing;
        return tmp245;
      }

      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)
                {
                  {
                    TMap _map246 = await iprot.ReadMapBeginAsync(cancellationToken);
                    Thing = new Dictionary<int, int>(_map246.Count);
                    for(int _i247 = 0; _i247 < _map246.Count; ++_i247)
                    {
                      int _key248;
                      int _val249;
                      _key248 = await iprot.ReadI32Async(cancellationToken);
                      _val249 = await iprot.ReadI32Async(cancellationToken);
                      Thing[_key248] = _val249;
                    }
                    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 struc = new TStruct("testMap_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if((Thing != null) && __isset.thing)
          {
            field.Name = "thing";
            field.Type = TType.Map;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            {
              await oprot.WriteMapBeginAsync(new TMap(TType.I32, TType.I32, Thing.Count), cancellationToken);
              foreach (int _iter250 in Thing.Keys)
              {
                await oprot.WriteI32Async(_iter250, cancellationToken);
                await oprot.WriteI32Async(Thing[_iter250], 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 testMapArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.thing == other.__isset.thing) && ((!__isset.thing) || (TCollections.Equals(Thing, other.Thing))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if((Thing != null) && __isset.thing)
          {
            hashcode = (hashcode * 397) + TCollections.GetHashCode(Thing);
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testMap_args(");
        int tmp251 = 0;
        if((Thing != null) && __isset.thing)
        {
          if(0 < tmp251++) { sb.Append(", "); }
          sb.Append("Thing: ");
          Thing.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testMapResult : TBase
    {
      private Dictionary<int, int> _success;

      [DataMember(Order = 0)]
      public Dictionary<int, int> Success
      {
        get
        {
          return _success;
        }
        set
        {
          __isset.success = true;
          this._success = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool success;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSuccess()
      {
        return __isset.success;
      }

      #endregion XmlSerializer support

      public testMapResult()
      {
      }

      public testMapResult DeepCopy()
      {
        var tmp252 = new testMapResult();
        if((Success != null) && __isset.success)
        {
          tmp252.Success = this.Success.DeepCopy();
        }
        tmp252.__isset.success = this.__isset.success;
        return tmp252;
      }

      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)
                {
                  {
                    TMap _map253 = await iprot.ReadMapBeginAsync(cancellationToken);
                    Success = new Dictionary<int, int>(_map253.Count);
                    for(int _i254 = 0; _i254 < _map253.Count; ++_i254)
                    {
                      int _key255;
                      int _val256;
                      _key255 = await iprot.ReadI32Async(cancellationToken);
                      _val256 = await iprot.ReadI32Async(cancellationToken);
                      Success[_key255] = _val256;
                    }
                    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 struc = new TStruct("testMap_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.success)
          {
            if (Success != null)
            {
              field.Name = "Success";
              field.Type = TType.Map;
              field.ID = 0;
              await oprot.WriteFieldBeginAsync(field, cancellationToken);
              {
                await oprot.WriteMapBeginAsync(new TMap(TType.I32, TType.I32, Success.Count), cancellationToken);
                foreach (int _iter257 in Success.Keys)
                {
                  await oprot.WriteI32Async(_iter257, cancellationToken);
                  await oprot.WriteI32Async(Success[_iter257], 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 testMapResult 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 sb = new StringBuilder("testMap_result(");
        int tmp258 = 0;
        if((Success != null) && __isset.success)
        {
          if(0 < tmp258++) { sb.Append(", "); }
          sb.Append("Success: ");
          Success.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testStringMapArgs : TBase
    {
      private Dictionary<string, string> _thing;

      [DataMember(Order = 0)]
      public Dictionary<string, string> Thing
      {
        get
        {
          return _thing;
        }
        set
        {
          __isset.thing = true;
          this._thing = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool thing;
      }

      #region XmlSerializer support

      public bool ShouldSerializeThing()
      {
        return __isset.thing;
      }

      #endregion XmlSerializer support

      public testStringMapArgs()
      {
      }

      public testStringMapArgs DeepCopy()
      {
        var tmp259 = new testStringMapArgs();
        if((Thing != null) && __isset.thing)
        {
          tmp259.Thing = this.Thing.DeepCopy();
        }
        tmp259.__isset.thing = this.__isset.thing;
        return tmp259;
      }

      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)
                {
                  {
                    TMap _map260 = await iprot.ReadMapBeginAsync(cancellationToken);
                    Thing = new Dictionary<string, string>(_map260.Count);
                    for(int _i261 = 0; _i261 < _map260.Count; ++_i261)
                    {
                      string _key262;
                      string _val263;
                      _key262 = await iprot.ReadStringAsync(cancellationToken);
                      _val263 = await iprot.ReadStringAsync(cancellationToken);
                      Thing[_key262] = _val263;
                    }
                    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 struc = new TStruct("testStringMap_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if((Thing != null) && __isset.thing)
          {
            field.Name = "thing";
            field.Type = TType.Map;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            {
              await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, Thing.Count), cancellationToken);
              foreach (string _iter264 in Thing.Keys)
              {
                await oprot.WriteStringAsync(_iter264, cancellationToken);
                await oprot.WriteStringAsync(Thing[_iter264], 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 testStringMapArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.thing == other.__isset.thing) && ((!__isset.thing) || (TCollections.Equals(Thing, other.Thing))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if((Thing != null) && __isset.thing)
          {
            hashcode = (hashcode * 397) + TCollections.GetHashCode(Thing);
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testStringMap_args(");
        int tmp265 = 0;
        if((Thing != null) && __isset.thing)
        {
          if(0 < tmp265++) { sb.Append(", "); }
          sb.Append("Thing: ");
          Thing.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testStringMapResult : TBase
    {
      private Dictionary<string, string> _success;

      [DataMember(Order = 0)]
      public Dictionary<string, string> Success
      {
        get
        {
          return _success;
        }
        set
        {
          __isset.success = true;
          this._success = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool success;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSuccess()
      {
        return __isset.success;
      }

      #endregion XmlSerializer support

      public testStringMapResult()
      {
      }

      public testStringMapResult DeepCopy()
      {
        var tmp266 = new testStringMapResult();
        if((Success != null) && __isset.success)
        {
          tmp266.Success = this.Success.DeepCopy();
        }
        tmp266.__isset.success = this.__isset.success;
        return tmp266;
      }

      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)
                {
                  {
                    TMap _map267 = await iprot.ReadMapBeginAsync(cancellationToken);
                    Success = new Dictionary<string, string>(_map267.Count);
                    for(int _i268 = 0; _i268 < _map267.Count; ++_i268)
                    {
                      string _key269;
                      string _val270;
                      _key269 = await iprot.ReadStringAsync(cancellationToken);
                      _val270 = await iprot.ReadStringAsync(cancellationToken);
                      Success[_key269] = _val270;
                    }
                    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 struc = new TStruct("testStringMap_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.success)
          {
            if (Success != null)
            {
              field.Name = "Success";
              field.Type = TType.Map;
              field.ID = 0;
              await oprot.WriteFieldBeginAsync(field, cancellationToken);
              {
                await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, Success.Count), cancellationToken);
                foreach (string _iter271 in Success.Keys)
                {
                  await oprot.WriteStringAsync(_iter271, cancellationToken);
                  await oprot.WriteStringAsync(Success[_iter271], 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 testStringMapResult 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 sb = new StringBuilder("testStringMap_result(");
        int tmp272 = 0;
        if((Success != null) && __isset.success)
        {
          if(0 < tmp272++) { sb.Append(", "); }
          sb.Append("Success: ");
          Success.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testSetArgs : TBase
    {
      private THashSet<int> _thing;

      [DataMember(Order = 0)]
      public THashSet<int> Thing
      {
        get
        {
          return _thing;
        }
        set
        {
          __isset.thing = true;
          this._thing = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool thing;
      }

      #region XmlSerializer support

      public bool ShouldSerializeThing()
      {
        return __isset.thing;
      }

      #endregion XmlSerializer support

      public testSetArgs()
      {
      }

      public testSetArgs DeepCopy()
      {
        var tmp273 = new testSetArgs();
        if((Thing != null) && __isset.thing)
        {
          tmp273.Thing = this.Thing.DeepCopy();
        }
        tmp273.__isset.thing = this.__isset.thing;
        return tmp273;
      }

      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.Set)
                {
                  {
                    TSet _set274 = await iprot.ReadSetBeginAsync(cancellationToken);
                    Thing = new THashSet<int>(_set274.Count);
                    for(int _i275 = 0; _i275 < _set274.Count; ++_i275)
                    {
                      int _elem276;
                      _elem276 = await iprot.ReadI32Async(cancellationToken);
                      Thing.Add(_elem276);
                    }
                    await iprot.ReadSetEndAsync(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 struc = new TStruct("testSet_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if((Thing != null) && __isset.thing)
          {
            field.Name = "thing";
            field.Type = TType.Set;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            {
              await oprot.WriteSetBeginAsync(new TSet(TType.I32, Thing.Count), cancellationToken);
              foreach (int _iter277 in Thing)
              {
                await oprot.WriteI32Async(_iter277, cancellationToken);
              }
              await oprot.WriteSetEndAsync(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 testSetArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.thing == other.__isset.thing) && ((!__isset.thing) || (TCollections.Equals(Thing, other.Thing))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if((Thing != null) && __isset.thing)
          {
            hashcode = (hashcode * 397) + TCollections.GetHashCode(Thing);
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testSet_args(");
        int tmp278 = 0;
        if((Thing != null) && __isset.thing)
        {
          if(0 < tmp278++) { sb.Append(", "); }
          sb.Append("Thing: ");
          Thing.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testSetResult : TBase
    {
      private THashSet<int> _success;

      [DataMember(Order = 0)]
      public THashSet<int> Success
      {
        get
        {
          return _success;
        }
        set
        {
          __isset.success = true;
          this._success = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool success;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSuccess()
      {
        return __isset.success;
      }

      #endregion XmlSerializer support

      public testSetResult()
      {
      }

      public testSetResult DeepCopy()
      {
        var tmp279 = new testSetResult();
        if((Success != null) && __isset.success)
        {
          tmp279.Success = this.Success.DeepCopy();
        }
        tmp279.__isset.success = this.__isset.success;
        return tmp279;
      }

      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.Set)
                {
                  {
                    TSet _set280 = await iprot.ReadSetBeginAsync(cancellationToken);
                    Success = new THashSet<int>(_set280.Count);
                    for(int _i281 = 0; _i281 < _set280.Count; ++_i281)
                    {
                      int _elem282;
                      _elem282 = await iprot.ReadI32Async(cancellationToken);
                      Success.Add(_elem282);
                    }
                    await iprot.ReadSetEndAsync(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 struc = new TStruct("testSet_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.success)
          {
            if (Success != null)
            {
              field.Name = "Success";
              field.Type = TType.Set;
              field.ID = 0;
              await oprot.WriteFieldBeginAsync(field, cancellationToken);
              {
                await oprot.WriteSetBeginAsync(new TSet(TType.I32, Success.Count), cancellationToken);
                foreach (int _iter283 in Success)
                {
                  await oprot.WriteI32Async(_iter283, cancellationToken);
                }
                await oprot.WriteSetEndAsync(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 testSetResult 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 sb = new StringBuilder("testSet_result(");
        int tmp284 = 0;
        if((Success != null) && __isset.success)
        {
          if(0 < tmp284++) { sb.Append(", "); }
          sb.Append("Success: ");
          Success.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testListArgs : TBase
    {
      private List<int> _thing;

      [DataMember(Order = 0)]
      public List<int> Thing
      {
        get
        {
          return _thing;
        }
        set
        {
          __isset.thing = true;
          this._thing = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool thing;
      }

      #region XmlSerializer support

      public bool ShouldSerializeThing()
      {
        return __isset.thing;
      }

      #endregion XmlSerializer support

      public testListArgs()
      {
      }

      public testListArgs DeepCopy()
      {
        var tmp285 = new testListArgs();
        if((Thing != null) && __isset.thing)
        {
          tmp285.Thing = this.Thing.DeepCopy();
        }
        tmp285.__isset.thing = this.__isset.thing;
        return tmp285;
      }

      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)
                {
                  {
                    TList _list286 = await iprot.ReadListBeginAsync(cancellationToken);
                    Thing = new List<int>(_list286.Count);
                    for(int _i287 = 0; _i287 < _list286.Count; ++_i287)
                    {
                      int _elem288;
                      _elem288 = await iprot.ReadI32Async(cancellationToken);
                      Thing.Add(_elem288);
                    }
                    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 struc = new TStruct("testList_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if((Thing != null) && __isset.thing)
          {
            field.Name = "thing";
            field.Type = TType.List;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            {
              await oprot.WriteListBeginAsync(new TList(TType.I32, Thing.Count), cancellationToken);
              foreach (int _iter289 in Thing)
              {
                await oprot.WriteI32Async(_iter289, 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 testListArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.thing == other.__isset.thing) && ((!__isset.thing) || (TCollections.Equals(Thing, other.Thing))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if((Thing != null) && __isset.thing)
          {
            hashcode = (hashcode * 397) + TCollections.GetHashCode(Thing);
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testList_args(");
        int tmp290 = 0;
        if((Thing != null) && __isset.thing)
        {
          if(0 < tmp290++) { sb.Append(", "); }
          sb.Append("Thing: ");
          Thing.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testListResult : TBase
    {
      private List<int> _success;

      [DataMember(Order = 0)]
      public List<int> Success
      {
        get
        {
          return _success;
        }
        set
        {
          __isset.success = true;
          this._success = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool success;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSuccess()
      {
        return __isset.success;
      }

      #endregion XmlSerializer support

      public testListResult()
      {
      }

      public testListResult DeepCopy()
      {
        var tmp291 = new testListResult();
        if((Success != null) && __isset.success)
        {
          tmp291.Success = this.Success.DeepCopy();
        }
        tmp291.__isset.success = this.__isset.success;
        return tmp291;
      }

      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)
                {
                  {
                    TList _list292 = await iprot.ReadListBeginAsync(cancellationToken);
                    Success = new List<int>(_list292.Count);
                    for(int _i293 = 0; _i293 < _list292.Count; ++_i293)
                    {
                      int _elem294;
                      _elem294 = await iprot.ReadI32Async(cancellationToken);
                      Success.Add(_elem294);
                    }
                    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 struc = new TStruct("testList_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.success)
          {
            if (Success != null)
            {
              field.Name = "Success";
              field.Type = TType.List;
              field.ID = 0;
              await oprot.WriteFieldBeginAsync(field, cancellationToken);
              {
                await oprot.WriteListBeginAsync(new TList(TType.I32, Success.Count), cancellationToken);
                foreach (int _iter295 in Success)
                {
                  await oprot.WriteI32Async(_iter295, 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 testListResult 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 sb = new StringBuilder("testList_result(");
        int tmp296 = 0;
        if((Success != null) && __isset.success)
        {
          if(0 < tmp296++) { sb.Append(", "); }
          sb.Append("Success: ");
          Success.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testEnumArgs : TBase
    {
      private global::ThriftTest.Numberz _thing;

      /// <summary>
      /// 
      /// <seealso cref="global::ThriftTest.Numberz"/>
      /// </summary>
      [DataMember(Order = 0)]
      public global::ThriftTest.Numberz Thing
      {
        get
        {
          return _thing;
        }
        set
        {
          __isset.thing = true;
          this._thing = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool thing;
      }

      #region XmlSerializer support

      public bool ShouldSerializeThing()
      {
        return __isset.thing;
      }

      #endregion XmlSerializer support

      public testEnumArgs()
      {
      }

      public testEnumArgs DeepCopy()
      {
        var tmp297 = new testEnumArgs();
        if(__isset.thing)
        {
          tmp297.Thing = this.Thing;
        }
        tmp297.__isset.thing = this.__isset.thing;
        return tmp297;
      }

      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.I32)
                {
                  Thing = (global::ThriftTest.Numberz)await iprot.ReadI32Async(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 struc = new TStruct("testEnum_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if(__isset.thing)
          {
            field.Name = "thing";
            field.Type = TType.I32;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteI32Async((int)Thing, 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 testEnumArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.thing == other.__isset.thing) && ((!__isset.thing) || (System.Object.Equals(Thing, other.Thing))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if(__isset.thing)
          {
            hashcode = (hashcode * 397) + Thing.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testEnum_args(");
        int tmp298 = 0;
        if(__isset.thing)
        {
          if(0 < tmp298++) { sb.Append(", "); }
          sb.Append("Thing: ");
          Thing.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testEnumResult : TBase
    {
      private global::ThriftTest.Numberz _success;

      /// <summary>
      /// 
      /// <seealso cref="global::ThriftTest.Numberz"/>
      /// </summary>
      [DataMember(Order = 0)]
      public global::ThriftTest.Numberz Success
      {
        get
        {
          return _success;
        }
        set
        {
          __isset.success = true;
          this._success = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool success;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSuccess()
      {
        return __isset.success;
      }

      #endregion XmlSerializer support

      public testEnumResult()
      {
      }

      public testEnumResult DeepCopy()
      {
        var tmp299 = new testEnumResult();
        if(__isset.success)
        {
          tmp299.Success = this.Success;
        }
        tmp299.__isset.success = this.__isset.success;
        return tmp299;
      }

      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.I32)
                {
                  Success = (global::ThriftTest.Numberz)await iprot.ReadI32Async(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 struc = new TStruct("testEnum_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.success)
          {
            field.Name = "Success";
            field.Type = TType.I32;
            field.ID = 0;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteI32Async((int)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 testEnumResult other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.success == other.__isset.success) && ((!__isset.success) || (System.Object.Equals(Success, other.Success))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if(__isset.success)
          {
            hashcode = (hashcode * 397) + Success.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testEnum_result(");
        int tmp300 = 0;
        if(__isset.success)
        {
          if(0 < tmp300++) { sb.Append(", "); }
          sb.Append("Success: ");
          Success.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testTypedefArgs : TBase
    {
      private long _thing;

      [DataMember(Order = 0)]
      public long Thing
      {
        get
        {
          return _thing;
        }
        set
        {
          __isset.thing = true;
          this._thing = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool thing;
      }

      #region XmlSerializer support

      public bool ShouldSerializeThing()
      {
        return __isset.thing;
      }

      #endregion XmlSerializer support

      public testTypedefArgs()
      {
      }

      public testTypedefArgs DeepCopy()
      {
        var tmp301 = new testTypedefArgs();
        if(__isset.thing)
        {
          tmp301.Thing = this.Thing;
        }
        tmp301.__isset.thing = this.__isset.thing;
        return tmp301;
      }

      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.I64)
                {
                  Thing = await iprot.ReadI64Async(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 struc = new TStruct("testTypedef_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if(__isset.thing)
          {
            field.Name = "thing";
            field.Type = TType.I64;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteI64Async(Thing, 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 testTypedefArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.thing == other.__isset.thing) && ((!__isset.thing) || (System.Object.Equals(Thing, other.Thing))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if(__isset.thing)
          {
            hashcode = (hashcode * 397) + Thing.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testTypedef_args(");
        int tmp302 = 0;
        if(__isset.thing)
        {
          if(0 < tmp302++) { sb.Append(", "); }
          sb.Append("Thing: ");
          Thing.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testTypedefResult : TBase
    {
      private long _success;

      [DataMember(Order = 0)]
      public long Success
      {
        get
        {
          return _success;
        }
        set
        {
          __isset.success = true;
          this._success = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool success;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSuccess()
      {
        return __isset.success;
      }

      #endregion XmlSerializer support

      public testTypedefResult()
      {
      }

      public testTypedefResult DeepCopy()
      {
        var tmp303 = new testTypedefResult();
        if(__isset.success)
        {
          tmp303.Success = this.Success;
        }
        tmp303.__isset.success = this.__isset.success;
        return tmp303;
      }

      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.I64)
                {
                  Success = await iprot.ReadI64Async(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 struc = new TStruct("testTypedef_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.success)
          {
            field.Name = "Success";
            field.Type = TType.I64;
            field.ID = 0;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteI64Async(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 testTypedefResult other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.success == other.__isset.success) && ((!__isset.success) || (System.Object.Equals(Success, other.Success))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if(__isset.success)
          {
            hashcode = (hashcode * 397) + Success.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testTypedef_result(");
        int tmp304 = 0;
        if(__isset.success)
        {
          if(0 < tmp304++) { sb.Append(", "); }
          sb.Append("Success: ");
          Success.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testMapMapArgs : TBase
    {
      private int _hello;

      [DataMember(Order = 0)]
      public int Hello
      {
        get
        {
          return _hello;
        }
        set
        {
          __isset.hello = true;
          this._hello = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool hello;
      }

      #region XmlSerializer support

      public bool ShouldSerializeHello()
      {
        return __isset.hello;
      }

      #endregion XmlSerializer support

      public testMapMapArgs()
      {
      }

      public testMapMapArgs DeepCopy()
      {
        var tmp305 = new testMapMapArgs();
        if(__isset.hello)
        {
          tmp305.Hello = this.Hello;
        }
        tmp305.__isset.hello = this.__isset.hello;
        return tmp305;
      }

      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.I32)
                {
                  Hello = await iprot.ReadI32Async(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 struc = new TStruct("testMapMap_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if(__isset.hello)
          {
            field.Name = "hello";
            field.Type = TType.I32;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteI32Async(Hello, 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 testMapMapArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.hello == other.__isset.hello) && ((!__isset.hello) || (System.Object.Equals(Hello, other.Hello))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if(__isset.hello)
          {
            hashcode = (hashcode * 397) + Hello.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testMapMap_args(");
        int tmp306 = 0;
        if(__isset.hello)
        {
          if(0 < tmp306++) { sb.Append(", "); }
          sb.Append("Hello: ");
          Hello.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testMapMapResult : TBase
    {
      private Dictionary<int, Dictionary<int, int>> _success;

      [DataMember(Order = 0)]
      public Dictionary<int, Dictionary<int, int>> Success
      {
        get
        {
          return _success;
        }
        set
        {
          __isset.success = true;
          this._success = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool success;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSuccess()
      {
        return __isset.success;
      }

      #endregion XmlSerializer support

      public testMapMapResult()
      {
      }

      public testMapMapResult DeepCopy()
      {
        var tmp307 = new testMapMapResult();
        if((Success != null) && __isset.success)
        {
          tmp307.Success = this.Success.DeepCopy();
        }
        tmp307.__isset.success = this.__isset.success;
        return tmp307;
      }

      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)
                {
                  {
                    TMap _map308 = await iprot.ReadMapBeginAsync(cancellationToken);
                    Success = new Dictionary<int, Dictionary<int, int>>(_map308.Count);
                    for(int _i309 = 0; _i309 < _map308.Count; ++_i309)
                    {
                      int _key310;
                      Dictionary<int, int> _val311;
                      _key310 = await iprot.ReadI32Async(cancellationToken);
                      {
                        TMap _map312 = await iprot.ReadMapBeginAsync(cancellationToken);
                        _val311 = new Dictionary<int, int>(_map312.Count);
                        for(int _i313 = 0; _i313 < _map312.Count; ++_i313)
                        {
                          int _key314;
                          int _val315;
                          _key314 = await iprot.ReadI32Async(cancellationToken);
                          _val315 = await iprot.ReadI32Async(cancellationToken);
                          _val311[_key314] = _val315;
                        }
                        await iprot.ReadMapEndAsync(cancellationToken);
                      }
                      Success[_key310] = _val311;
                    }
                    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 struc = new TStruct("testMapMap_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.success)
          {
            if (Success != null)
            {
              field.Name = "Success";
              field.Type = TType.Map;
              field.ID = 0;
              await oprot.WriteFieldBeginAsync(field, cancellationToken);
              {
                await oprot.WriteMapBeginAsync(new TMap(TType.I32, TType.Map, Success.Count), cancellationToken);
                foreach (int _iter316 in Success.Keys)
                {
                  await oprot.WriteI32Async(_iter316, cancellationToken);
                  {
                    await oprot.WriteMapBeginAsync(new TMap(TType.I32, TType.I32, Success[_iter316].Count), cancellationToken);
                    foreach (int _iter317 in Success[_iter316].Keys)
                    {
                      await oprot.WriteI32Async(_iter317, cancellationToken);
                      await oprot.WriteI32Async(Success[_iter316][_iter317], cancellationToken);
                    }
                    await oprot.WriteMapEndAsync(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 testMapMapResult 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 sb = new StringBuilder("testMapMap_result(");
        int tmp318 = 0;
        if((Success != null) && __isset.success)
        {
          if(0 < tmp318++) { sb.Append(", "); }
          sb.Append("Success: ");
          Success.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testInsanityArgs : TBase
    {
      private global::ThriftTest.Insanity _argument;

      [DataMember(Order = 0)]
      public global::ThriftTest.Insanity Argument
      {
        get
        {
          return _argument;
        }
        set
        {
          __isset.argument = true;
          this._argument = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool argument;
      }

      #region XmlSerializer support

      public bool ShouldSerializeArgument()
      {
        return __isset.argument;
      }

      #endregion XmlSerializer support

      public testInsanityArgs()
      {
      }

      public testInsanityArgs DeepCopy()
      {
        var tmp319 = new testInsanityArgs();
        if((Argument != null) && __isset.argument)
        {
          tmp319.Argument = (global::ThriftTest.Insanity)this.Argument.DeepCopy();
        }
        tmp319.__isset.argument = this.__isset.argument;
        return tmp319;
      }

      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.Struct)
                {
                  Argument = new global::ThriftTest.Insanity();
                  await Argument.ReadAsync(iprot, 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 struc = new TStruct("testInsanity_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if((Argument != null) && __isset.argument)
          {
            field.Name = "argument";
            field.Type = TType.Struct;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await Argument.WriteAsync(oprot, 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 testInsanityArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.argument == other.__isset.argument) && ((!__isset.argument) || (System.Object.Equals(Argument, other.Argument))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if((Argument != null) && __isset.argument)
          {
            hashcode = (hashcode * 397) + Argument.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testInsanity_args(");
        int tmp320 = 0;
        if((Argument != null) && __isset.argument)
        {
          if(0 < tmp320++) { sb.Append(", "); }
          sb.Append("Argument: ");
          Argument.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testInsanityResult : TBase
    {
      private Dictionary<long, Dictionary<global::ThriftTest.Numberz, global::ThriftTest.Insanity>> _success;

      [DataMember(Order = 0)]
      public Dictionary<long, Dictionary<global::ThriftTest.Numberz, global::ThriftTest.Insanity>> Success
      {
        get
        {
          return _success;
        }
        set
        {
          __isset.success = true;
          this._success = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool success;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSuccess()
      {
        return __isset.success;
      }

      #endregion XmlSerializer support

      public testInsanityResult()
      {
      }

      public testInsanityResult DeepCopy()
      {
        var tmp321 = new testInsanityResult();
        if((Success != null) && __isset.success)
        {
          tmp321.Success = this.Success.DeepCopy();
        }
        tmp321.__isset.success = this.__isset.success;
        return tmp321;
      }

      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)
                {
                  {
                    TMap _map322 = await iprot.ReadMapBeginAsync(cancellationToken);
                    Success = new Dictionary<long, Dictionary<global::ThriftTest.Numberz, global::ThriftTest.Insanity>>(_map322.Count);
                    for(int _i323 = 0; _i323 < _map322.Count; ++_i323)
                    {
                      long _key324;
                      Dictionary<global::ThriftTest.Numberz, global::ThriftTest.Insanity> _val325;
                      _key324 = await iprot.ReadI64Async(cancellationToken);
                      {
                        TMap _map326 = await iprot.ReadMapBeginAsync(cancellationToken);
                        _val325 = new Dictionary<global::ThriftTest.Numberz, global::ThriftTest.Insanity>(_map326.Count);
                        for(int _i327 = 0; _i327 < _map326.Count; ++_i327)
                        {
                          global::ThriftTest.Numberz _key328;
                          global::ThriftTest.Insanity _val329;
                          _key328 = (global::ThriftTest.Numberz)await iprot.ReadI32Async(cancellationToken);
                          _val329 = new global::ThriftTest.Insanity();
                          await _val329.ReadAsync(iprot, cancellationToken);
                          _val325[_key328] = _val329;
                        }
                        await iprot.ReadMapEndAsync(cancellationToken);
                      }
                      Success[_key324] = _val325;
                    }
                    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 struc = new TStruct("testInsanity_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.success)
          {
            if (Success != null)
            {
              field.Name = "Success";
              field.Type = TType.Map;
              field.ID = 0;
              await oprot.WriteFieldBeginAsync(field, cancellationToken);
              {
                await oprot.WriteMapBeginAsync(new TMap(TType.I64, TType.Map, Success.Count), cancellationToken);
                foreach (long _iter330 in Success.Keys)
                {
                  await oprot.WriteI64Async(_iter330, cancellationToken);
                  {
                    await oprot.WriteMapBeginAsync(new TMap(TType.I32, TType.Struct, Success[_iter330].Count), cancellationToken);
                    foreach (global::ThriftTest.Numberz _iter331 in Success[_iter330].Keys)
                    {
                      await oprot.WriteI32Async((int)_iter331, cancellationToken);
                      await Success[_iter330][_iter331].WriteAsync(oprot, cancellationToken);
                    }
                    await oprot.WriteMapEndAsync(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 testInsanityResult 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 sb = new StringBuilder("testInsanity_result(");
        int tmp332 = 0;
        if((Success != null) && __isset.success)
        {
          if(0 < tmp332++) { sb.Append(", "); }
          sb.Append("Success: ");
          Success.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testMultiArgs : TBase
    {
      private sbyte _arg0;
      private int _arg1;
      private long _arg2;
      private Dictionary<short, string> _arg3;
      private global::ThriftTest.Numberz _arg4;
      private long _arg5;

      [DataMember(Order = 0)]
      public sbyte Arg0
      {
        get
        {
          return _arg0;
        }
        set
        {
          __isset.arg0 = true;
          this._arg0 = value;
        }
      }

      [DataMember(Order = 0)]
      public int Arg1
      {
        get
        {
          return _arg1;
        }
        set
        {
          __isset.arg1 = true;
          this._arg1 = value;
        }
      }

      [DataMember(Order = 0)]
      public long Arg2
      {
        get
        {
          return _arg2;
        }
        set
        {
          __isset.arg2 = true;
          this._arg2 = value;
        }
      }

      [DataMember(Order = 0)]
      public Dictionary<short, string> Arg3
      {
        get
        {
          return _arg3;
        }
        set
        {
          __isset.arg3 = true;
          this._arg3 = value;
        }
      }

      /// <summary>
      /// 
      /// <seealso cref="global::ThriftTest.Numberz"/>
      /// </summary>
      [DataMember(Order = 0)]
      public global::ThriftTest.Numberz Arg4
      {
        get
        {
          return _arg4;
        }
        set
        {
          __isset.arg4 = true;
          this._arg4 = value;
        }
      }

      [DataMember(Order = 0)]
      public long Arg5
      {
        get
        {
          return _arg5;
        }
        set
        {
          __isset.arg5 = true;
          this._arg5 = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool arg0;
        [DataMember]
        public bool arg1;
        [DataMember]
        public bool arg2;
        [DataMember]
        public bool arg3;
        [DataMember]
        public bool arg4;
        [DataMember]
        public bool arg5;
      }

      #region XmlSerializer support

      public bool ShouldSerializeArg0()
      {
        return __isset.arg0;
      }

      public bool ShouldSerializeArg1()
      {
        return __isset.arg1;
      }

      public bool ShouldSerializeArg2()
      {
        return __isset.arg2;
      }

      public bool ShouldSerializeArg3()
      {
        return __isset.arg3;
      }

      public bool ShouldSerializeArg4()
      {
        return __isset.arg4;
      }

      public bool ShouldSerializeArg5()
      {
        return __isset.arg5;
      }

      #endregion XmlSerializer support

      public testMultiArgs()
      {
      }

      public testMultiArgs DeepCopy()
      {
        var tmp333 = new testMultiArgs();
        if(__isset.arg0)
        {
          tmp333.Arg0 = this.Arg0;
        }
        tmp333.__isset.arg0 = this.__isset.arg0;
        if(__isset.arg1)
        {
          tmp333.Arg1 = this.Arg1;
        }
        tmp333.__isset.arg1 = this.__isset.arg1;
        if(__isset.arg2)
        {
          tmp333.Arg2 = this.Arg2;
        }
        tmp333.__isset.arg2 = this.__isset.arg2;
        if((Arg3 != null) && __isset.arg3)
        {
          tmp333.Arg3 = this.Arg3.DeepCopy();
        }
        tmp333.__isset.arg3 = this.__isset.arg3;
        if(__isset.arg4)
        {
          tmp333.Arg4 = this.Arg4;
        }
        tmp333.__isset.arg4 = this.__isset.arg4;
        if(__isset.arg5)
        {
          tmp333.Arg5 = this.Arg5;
        }
        tmp333.__isset.arg5 = this.__isset.arg5;
        return tmp333;
      }

      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.Byte)
                {
                  Arg0 = await iprot.ReadByteAsync(cancellationToken);
                }
                else
                {
                  await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                }
                break;
              case 2:
                if (field.Type == TType.I32)
                {
                  Arg1 = await iprot.ReadI32Async(cancellationToken);
                }
                else
                {
                  await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                }
                break;
              case 3:
                if (field.Type == TType.I64)
                {
                  Arg2 = await iprot.ReadI64Async(cancellationToken);
                }
                else
                {
                  await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                }
                break;
              case 4:
                if (field.Type == TType.Map)
                {
                  {
                    TMap _map334 = await iprot.ReadMapBeginAsync(cancellationToken);
                    Arg3 = new Dictionary<short, string>(_map334.Count);
                    for(int _i335 = 0; _i335 < _map334.Count; ++_i335)
                    {
                      short _key336;
                      string _val337;
                      _key336 = await iprot.ReadI16Async(cancellationToken);
                      _val337 = await iprot.ReadStringAsync(cancellationToken);
                      Arg3[_key336] = _val337;
                    }
                    await iprot.ReadMapEndAsync(cancellationToken);
                  }
                }
                else
                {
                  await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                }
                break;
              case 5:
                if (field.Type == TType.I32)
                {
                  Arg4 = (global::ThriftTest.Numberz)await iprot.ReadI32Async(cancellationToken);
                }
                else
                {
                  await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                }
                break;
              case 6:
                if (field.Type == TType.I64)
                {
                  Arg5 = await iprot.ReadI64Async(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 struc = new TStruct("testMulti_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if(__isset.arg0)
          {
            field.Name = "arg0";
            field.Type = TType.Byte;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteByteAsync(Arg0, cancellationToken);
            await oprot.WriteFieldEndAsync(cancellationToken);
          }
          if(__isset.arg1)
          {
            field.Name = "arg1";
            field.Type = TType.I32;
            field.ID = 2;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteI32Async(Arg1, cancellationToken);
            await oprot.WriteFieldEndAsync(cancellationToken);
          }
          if(__isset.arg2)
          {
            field.Name = "arg2";
            field.Type = TType.I64;
            field.ID = 3;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteI64Async(Arg2, cancellationToken);
            await oprot.WriteFieldEndAsync(cancellationToken);
          }
          if((Arg3 != null) && __isset.arg3)
          {
            field.Name = "arg3";
            field.Type = TType.Map;
            field.ID = 4;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            {
              await oprot.WriteMapBeginAsync(new TMap(TType.I16, TType.String, Arg3.Count), cancellationToken);
              foreach (short _iter338 in Arg3.Keys)
              {
                await oprot.WriteI16Async(_iter338, cancellationToken);
                await oprot.WriteStringAsync(Arg3[_iter338], cancellationToken);
              }
              await oprot.WriteMapEndAsync(cancellationToken);
            }
            await oprot.WriteFieldEndAsync(cancellationToken);
          }
          if(__isset.arg4)
          {
            field.Name = "arg4";
            field.Type = TType.I32;
            field.ID = 5;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteI32Async((int)Arg4, cancellationToken);
            await oprot.WriteFieldEndAsync(cancellationToken);
          }
          if(__isset.arg5)
          {
            field.Name = "arg5";
            field.Type = TType.I64;
            field.ID = 6;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteI64Async(Arg5, 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 testMultiArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.arg0 == other.__isset.arg0) && ((!__isset.arg0) || (System.Object.Equals(Arg0, other.Arg0))))
          && ((__isset.arg1 == other.__isset.arg1) && ((!__isset.arg1) || (System.Object.Equals(Arg1, other.Arg1))))
          && ((__isset.arg2 == other.__isset.arg2) && ((!__isset.arg2) || (System.Object.Equals(Arg2, other.Arg2))))
          && ((__isset.arg3 == other.__isset.arg3) && ((!__isset.arg3) || (TCollections.Equals(Arg3, other.Arg3))))
          && ((__isset.arg4 == other.__isset.arg4) && ((!__isset.arg4) || (System.Object.Equals(Arg4, other.Arg4))))
          && ((__isset.arg5 == other.__isset.arg5) && ((!__isset.arg5) || (System.Object.Equals(Arg5, other.Arg5))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if(__isset.arg0)
          {
            hashcode = (hashcode * 397) + Arg0.GetHashCode();
          }
          if(__isset.arg1)
          {
            hashcode = (hashcode * 397) + Arg1.GetHashCode();
          }
          if(__isset.arg2)
          {
            hashcode = (hashcode * 397) + Arg2.GetHashCode();
          }
          if((Arg3 != null) && __isset.arg3)
          {
            hashcode = (hashcode * 397) + TCollections.GetHashCode(Arg3);
          }
          if(__isset.arg4)
          {
            hashcode = (hashcode * 397) + Arg4.GetHashCode();
          }
          if(__isset.arg5)
          {
            hashcode = (hashcode * 397) + Arg5.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testMulti_args(");
        int tmp339 = 0;
        if(__isset.arg0)
        {
          if(0 < tmp339++) { sb.Append(", "); }
          sb.Append("Arg0: ");
          Arg0.ToString(sb);
        }
        if(__isset.arg1)
        {
          if(0 < tmp339++) { sb.Append(", "); }
          sb.Append("Arg1: ");
          Arg1.ToString(sb);
        }
        if(__isset.arg2)
        {
          if(0 < tmp339++) { sb.Append(", "); }
          sb.Append("Arg2: ");
          Arg2.ToString(sb);
        }
        if((Arg3 != null) && __isset.arg3)
        {
          if(0 < tmp339++) { sb.Append(", "); }
          sb.Append("Arg3: ");
          Arg3.ToString(sb);
        }
        if(__isset.arg4)
        {
          if(0 < tmp339++) { sb.Append(", "); }
          sb.Append("Arg4: ");
          Arg4.ToString(sb);
        }
        if(__isset.arg5)
        {
          if(0 < tmp339++) { sb.Append(", "); }
          sb.Append("Arg5: ");
          Arg5.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testMultiResult : TBase
    {
      private global::ThriftTest.Xtruct _success;

      [DataMember(Order = 0)]
      public global::ThriftTest.Xtruct Success
      {
        get
        {
          return _success;
        }
        set
        {
          __isset.success = true;
          this._success = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool success;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSuccess()
      {
        return __isset.success;
      }

      #endregion XmlSerializer support

      public testMultiResult()
      {
      }

      public testMultiResult DeepCopy()
      {
        var tmp340 = new testMultiResult();
        if((Success != null) && __isset.success)
        {
          tmp340.Success = (global::ThriftTest.Xtruct)this.Success.DeepCopy();
        }
        tmp340.__isset.success = this.__isset.success;
        return tmp340;
      }

      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.Struct)
                {
                  Success = new global::ThriftTest.Xtruct();
                  await Success.ReadAsync(iprot, 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 struc = new TStruct("testMulti_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.success)
          {
            if (Success != null)
            {
              field.Name = "Success";
              field.Type = TType.Struct;
              field.ID = 0;
              await oprot.WriteFieldBeginAsync(field, cancellationToken);
              await Success.WriteAsync(oprot, 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 testMultiResult other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.success == other.__isset.success) && ((!__isset.success) || (System.Object.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 sb = new StringBuilder("testMulti_result(");
        int tmp341 = 0;
        if((Success != null) && __isset.success)
        {
          if(0 < tmp341++) { sb.Append(", "); }
          sb.Append("Success: ");
          Success.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testExceptionArgs : TBase
    {
      private string _arg;

      [DataMember(Order = 0)]
      public string Arg
      {
        get
        {
          return _arg;
        }
        set
        {
          __isset.arg = true;
          this._arg = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool arg;
      }

      #region XmlSerializer support

      public bool ShouldSerializeArg()
      {
        return __isset.arg;
      }

      #endregion XmlSerializer support

      public testExceptionArgs()
      {
      }

      public testExceptionArgs DeepCopy()
      {
        var tmp342 = new testExceptionArgs();
        if((Arg != null) && __isset.arg)
        {
          tmp342.Arg = this.Arg;
        }
        tmp342.__isset.arg = this.__isset.arg;
        return tmp342;
      }

      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)
                {
                  Arg = await iprot.ReadStringAsync(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 struc = new TStruct("testException_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if((Arg != null) && __isset.arg)
          {
            field.Name = "arg";
            field.Type = TType.String;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteStringAsync(Arg, 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 testExceptionArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.arg == other.__isset.arg) && ((!__isset.arg) || (System.Object.Equals(Arg, other.Arg))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if((Arg != null) && __isset.arg)
          {
            hashcode = (hashcode * 397) + Arg.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testException_args(");
        int tmp343 = 0;
        if((Arg != null) && __isset.arg)
        {
          if(0 < tmp343++) { sb.Append(", "); }
          sb.Append("Arg: ");
          Arg.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testExceptionResult : TBase
    {
      private global::ThriftTest.Xception _err1;

      [DataMember(Order = 0)]
      public global::ThriftTest.Xception Err1
      {
        get
        {
          return _err1;
        }
        set
        {
          __isset.err1 = true;
          this._err1 = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool err1;
      }

      #region XmlSerializer support

      public bool ShouldSerializeErr1()
      {
        return __isset.err1;
      }

      #endregion XmlSerializer support

      public testExceptionResult()
      {
      }

      public testExceptionResult DeepCopy()
      {
        var tmp344 = new testExceptionResult();
        if((Err1 != null) && __isset.err1)
        {
          tmp344.Err1 = (global::ThriftTest.Xception)this.Err1.DeepCopy();
        }
        tmp344.__isset.err1 = this.__isset.err1;
        return tmp344;
      }

      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.Struct)
                {
                  Err1 = new global::ThriftTest.Xception();
                  await Err1.ReadAsync(iprot, 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 struc = new TStruct("testException_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.err1)
          {
            if (Err1 != null)
            {
              field.Name = "Err1";
              field.Type = TType.Struct;
              field.ID = 1;
              await oprot.WriteFieldBeginAsync(field, cancellationToken);
              await Err1.WriteAsync(oprot, 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 testExceptionResult other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.err1 == other.__isset.err1) && ((!__isset.err1) || (System.Object.Equals(Err1, other.Err1))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if((Err1 != null) && __isset.err1)
          {
            hashcode = (hashcode * 397) + Err1.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testException_result(");
        int tmp345 = 0;
        if((Err1 != null) && __isset.err1)
        {
          if(0 < tmp345++) { sb.Append(", "); }
          sb.Append("Err1: ");
          Err1.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testMultiExceptionArgs : TBase
    {
      private string _arg0;
      private string _arg1;

      [DataMember(Order = 0)]
      public string Arg0
      {
        get
        {
          return _arg0;
        }
        set
        {
          __isset.arg0 = true;
          this._arg0 = value;
        }
      }

      [DataMember(Order = 0)]
      public string Arg1
      {
        get
        {
          return _arg1;
        }
        set
        {
          __isset.arg1 = true;
          this._arg1 = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool arg0;
        [DataMember]
        public bool arg1;
      }

      #region XmlSerializer support

      public bool ShouldSerializeArg0()
      {
        return __isset.arg0;
      }

      public bool ShouldSerializeArg1()
      {
        return __isset.arg1;
      }

      #endregion XmlSerializer support

      public testMultiExceptionArgs()
      {
      }

      public testMultiExceptionArgs DeepCopy()
      {
        var tmp346 = new testMultiExceptionArgs();
        if((Arg0 != null) && __isset.arg0)
        {
          tmp346.Arg0 = this.Arg0;
        }
        tmp346.__isset.arg0 = this.__isset.arg0;
        if((Arg1 != null) && __isset.arg1)
        {
          tmp346.Arg1 = this.Arg1;
        }
        tmp346.__isset.arg1 = this.__isset.arg1;
        return tmp346;
      }

      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)
                {
                  Arg0 = await iprot.ReadStringAsync(cancellationToken);
                }
                else
                {
                  await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                }
                break;
              case 2:
                if (field.Type == TType.String)
                {
                  Arg1 = await iprot.ReadStringAsync(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 struc = new TStruct("testMultiException_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if((Arg0 != null) && __isset.arg0)
          {
            field.Name = "arg0";
            field.Type = TType.String;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteStringAsync(Arg0, cancellationToken);
            await oprot.WriteFieldEndAsync(cancellationToken);
          }
          if((Arg1 != null) && __isset.arg1)
          {
            field.Name = "arg1";
            field.Type = TType.String;
            field.ID = 2;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteStringAsync(Arg1, 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 testMultiExceptionArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.arg0 == other.__isset.arg0) && ((!__isset.arg0) || (System.Object.Equals(Arg0, other.Arg0))))
          && ((__isset.arg1 == other.__isset.arg1) && ((!__isset.arg1) || (System.Object.Equals(Arg1, other.Arg1))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if((Arg0 != null) && __isset.arg0)
          {
            hashcode = (hashcode * 397) + Arg0.GetHashCode();
          }
          if((Arg1 != null) && __isset.arg1)
          {
            hashcode = (hashcode * 397) + Arg1.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testMultiException_args(");
        int tmp347 = 0;
        if((Arg0 != null) && __isset.arg0)
        {
          if(0 < tmp347++) { sb.Append(", "); }
          sb.Append("Arg0: ");
          Arg0.ToString(sb);
        }
        if((Arg1 != null) && __isset.arg1)
        {
          if(0 < tmp347++) { sb.Append(", "); }
          sb.Append("Arg1: ");
          Arg1.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testMultiExceptionResult : TBase
    {
      private global::ThriftTest.Xtruct _success;
      private global::ThriftTest.Xception _err1;
      private global::ThriftTest.Xception2 _err2;

      [DataMember(Order = 0)]
      public global::ThriftTest.Xtruct Success
      {
        get
        {
          return _success;
        }
        set
        {
          __isset.success = true;
          this._success = value;
        }
      }

      [DataMember(Order = 0)]
      public global::ThriftTest.Xception Err1
      {
        get
        {
          return _err1;
        }
        set
        {
          __isset.err1 = true;
          this._err1 = value;
        }
      }

      [DataMember(Order = 0)]
      public global::ThriftTest.Xception2 Err2
      {
        get
        {
          return _err2;
        }
        set
        {
          __isset.err2 = true;
          this._err2 = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool success;
        [DataMember]
        public bool err1;
        [DataMember]
        public bool err2;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSuccess()
      {
        return __isset.success;
      }

      public bool ShouldSerializeErr1()
      {
        return __isset.err1;
      }

      public bool ShouldSerializeErr2()
      {
        return __isset.err2;
      }

      #endregion XmlSerializer support

      public testMultiExceptionResult()
      {
      }

      public testMultiExceptionResult DeepCopy()
      {
        var tmp348 = new testMultiExceptionResult();
        if((Success != null) && __isset.success)
        {
          tmp348.Success = (global::ThriftTest.Xtruct)this.Success.DeepCopy();
        }
        tmp348.__isset.success = this.__isset.success;
        if((Err1 != null) && __isset.err1)
        {
          tmp348.Err1 = (global::ThriftTest.Xception)this.Err1.DeepCopy();
        }
        tmp348.__isset.err1 = this.__isset.err1;
        if((Err2 != null) && __isset.err2)
        {
          tmp348.Err2 = (global::ThriftTest.Xception2)this.Err2.DeepCopy();
        }
        tmp348.__isset.err2 = this.__isset.err2;
        return tmp348;
      }

      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.Struct)
                {
                  Success = new global::ThriftTest.Xtruct();
                  await Success.ReadAsync(iprot, cancellationToken);
                }
                else
                {
                  await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                }
                break;
              case 1:
                if (field.Type == TType.Struct)
                {
                  Err1 = new global::ThriftTest.Xception();
                  await Err1.ReadAsync(iprot, cancellationToken);
                }
                else
                {
                  await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                }
                break;
              case 2:
                if (field.Type == TType.Struct)
                {
                  Err2 = new global::ThriftTest.Xception2();
                  await Err2.ReadAsync(iprot, 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 struc = new TStruct("testMultiException_result");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();

          if(this.__isset.success)
          {
            if (Success != null)
            {
              field.Name = "Success";
              field.Type = TType.Struct;
              field.ID = 0;
              await oprot.WriteFieldBeginAsync(field, cancellationToken);
              await Success.WriteAsync(oprot, cancellationToken);
              await oprot.WriteFieldEndAsync(cancellationToken);
            }
          }
          else if(this.__isset.err1)
          {
            if (Err1 != null)
            {
              field.Name = "Err1";
              field.Type = TType.Struct;
              field.ID = 1;
              await oprot.WriteFieldBeginAsync(field, cancellationToken);
              await Err1.WriteAsync(oprot, cancellationToken);
              await oprot.WriteFieldEndAsync(cancellationToken);
            }
          }
          else if(this.__isset.err2)
          {
            if (Err2 != null)
            {
              field.Name = "Err2";
              field.Type = TType.Struct;
              field.ID = 2;
              await oprot.WriteFieldBeginAsync(field, cancellationToken);
              await Err2.WriteAsync(oprot, 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 testMultiExceptionResult other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.success == other.__isset.success) && ((!__isset.success) || (System.Object.Equals(Success, other.Success))))
          && ((__isset.err1 == other.__isset.err1) && ((!__isset.err1) || (System.Object.Equals(Err1, other.Err1))))
          && ((__isset.err2 == other.__isset.err2) && ((!__isset.err2) || (System.Object.Equals(Err2, other.Err2))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if((Success != null) && __isset.success)
          {
            hashcode = (hashcode * 397) + Success.GetHashCode();
          }
          if((Err1 != null) && __isset.err1)
          {
            hashcode = (hashcode * 397) + Err1.GetHashCode();
          }
          if((Err2 != null) && __isset.err2)
          {
            hashcode = (hashcode * 397) + Err2.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testMultiException_result(");
        int tmp349 = 0;
        if((Success != null) && __isset.success)
        {
          if(0 < tmp349++) { sb.Append(", "); }
          sb.Append("Success: ");
          Success.ToString(sb);
        }
        if((Err1 != null) && __isset.err1)
        {
          if(0 < tmp349++) { sb.Append(", "); }
          sb.Append("Err1: ");
          Err1.ToString(sb);
        }
        if((Err2 != null) && __isset.err2)
        {
          if(0 < tmp349++) { sb.Append(", "); }
          sb.Append("Err2: ");
          Err2.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }


    [DataContract(Namespace="")]
    public partial class testOnewayArgs : TBase
    {
      private int _secondsToSleep;

      [DataMember(Order = 0)]
      public int SecondsToSleep
      {
        get
        {
          return _secondsToSleep;
        }
        set
        {
          __isset.secondsToSleep = true;
          this._secondsToSleep = value;
        }
      }


      [DataMember(Order = 1)]
      public Isset __isset;
      [DataContract]
      public struct Isset
      {
        [DataMember]
        public bool secondsToSleep;
      }

      #region XmlSerializer support

      public bool ShouldSerializeSecondsToSleep()
      {
        return __isset.secondsToSleep;
      }

      #endregion XmlSerializer support

      public testOnewayArgs()
      {
      }

      public testOnewayArgs DeepCopy()
      {
        var tmp350 = new testOnewayArgs();
        if(__isset.secondsToSleep)
        {
          tmp350.SecondsToSleep = this.SecondsToSleep;
        }
        tmp350.__isset.secondsToSleep = this.__isset.secondsToSleep;
        return tmp350;
      }

      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.I32)
                {
                  SecondsToSleep = await iprot.ReadI32Async(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 struc = new TStruct("testOneway_args");
          await oprot.WriteStructBeginAsync(struc, cancellationToken);
          var field = new TField();
          if(__isset.secondsToSleep)
          {
            field.Name = "secondsToSleep";
            field.Type = TType.I32;
            field.ID = 1;
            await oprot.WriteFieldBeginAsync(field, cancellationToken);
            await oprot.WriteI32Async(SecondsToSleep, 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 testOnewayArgs other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return ((__isset.secondsToSleep == other.__isset.secondsToSleep) && ((!__isset.secondsToSleep) || (System.Object.Equals(SecondsToSleep, other.SecondsToSleep))));
      }

      public override int GetHashCode() {
        int hashcode = 157;
        unchecked {
          if(__isset.secondsToSleep)
          {
            hashcode = (hashcode * 397) + SecondsToSleep.GetHashCode();
          }
        }
        return hashcode;
      }

      public override string ToString()
      {
        var sb = new StringBuilder("testOneway_args(");
        int tmp351 = 0;
        if(__isset.secondsToSleep)
        {
          if(0 < tmp351++) { sb.Append(", "); }
          sb.Append("SecondsToSleep: ");
          SecondsToSleep.ToString(sb);
        }
        sb.Append(')');
        return sb.ToString();
      }
    }

  }

}
}
