/**
 * 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 Facebook.FB303.Test
{
  public partial class FacebookService
  {
    /// <summary>
    /// Standard base service
    /// </summary>
    [ServiceContract(Namespace="")]
    public interface IAsync
    {
      /// <summary>
      /// Returns a descriptive name of the service
      /// </summary>
      [OperationContract]
      global::System.Threading.Tasks.Task<string> getNameAsync(CancellationToken cancellationToken = default);

      /// <summary>
      /// Returns the version of the service
      /// </summary>
      [OperationContract]
      global::System.Threading.Tasks.Task<string> getVersionAsync(CancellationToken cancellationToken = default);

      /// <summary>
      /// Gets the status of this service
      /// </summary>
      [OperationContract]
      global::System.Threading.Tasks.Task<global::Facebook.FB303.Test.fb_status> getStatusAsync(CancellationToken cancellationToken = default);

      /// <summary>
      /// User friendly description of status, such as why the service is in
      /// the dead or warning state, or what is being started or stopped.
      /// </summary>
      [OperationContract]
      global::System.Threading.Tasks.Task<string> getStatusDetailsAsync(CancellationToken cancellationToken = default);

      /// <summary>
      /// Gets the counters for this service
      /// </summary>
      [OperationContract]
      global::System.Threading.Tasks.Task<Dictionary<string, long>> getCountersAsync(CancellationToken cancellationToken = default);

      /// <summary>
      /// Gets the value of a single counter
      /// </summary>
      /// <param name="key"></param>
      [OperationContract]
      global::System.Threading.Tasks.Task<long> getCounterAsync(string key, CancellationToken cancellationToken = default);

      /// <summary>
      /// Sets an option
      /// </summary>
      /// <param name="key"></param>
      /// <param name="value"></param>
      [OperationContract]
      global::System.Threading.Tasks.Task setOptionAsync(string key, string @value, CancellationToken cancellationToken = default);

      /// <summary>
      /// Gets an option
      /// </summary>
      /// <param name="key"></param>
      [OperationContract]
      global::System.Threading.Tasks.Task<string> getOptionAsync(string key, CancellationToken cancellationToken = default);

      /// <summary>
      /// Gets all options
      /// </summary>
      [OperationContract]
      global::System.Threading.Tasks.Task<Dictionary<string, string>> getOptionsAsync(CancellationToken cancellationToken = default);

      /// <summary>
      /// Returns a CPU profile over the given time interval (client and server
      /// must agree on the profile format).
      /// </summary>
      /// <param name="profileDurationInSec"></param>
      [OperationContract]
      global::System.Threading.Tasks.Task<string> getCpuProfileAsync(int profileDurationInSec, CancellationToken cancellationToken = default);

      /// <summary>
      /// Returns the unix time that the server has been running since
      /// </summary>
      [OperationContract]
      global::System.Threading.Tasks.Task<long> aliveSinceAsync(CancellationToken cancellationToken = default);

      /// <summary>
      /// Tell the server to reload its configuration, reopen log files, etc
      /// </summary>
      [OperationContract]
      global::System.Threading.Tasks.Task reinitializeAsync(CancellationToken cancellationToken = default);

      /// <summary>
      /// Suggest a shutdown to the server
      /// </summary>
      [OperationContract]
      global::System.Threading.Tasks.Task shutdownAsync(CancellationToken cancellationToken = default);

    }


    /// <summary>
    /// Standard base service
    /// </summary>
    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<string> getNameAsync(CancellationToken cancellationToken = default)
      {
        await OutputProtocol.WriteMessageBeginAsync(new TMessage("getName", TMessageType.Call, SeqId), cancellationToken);
        
        var args = new InternalStructs.getNameArgs() {
        };
        
        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.getNameResult();
        await result.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        if (result.__isset.success)
        {
          return result.Success;
        }
        throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getName failed: unknown result");
      }

      public async global::System.Threading.Tasks.Task<string> getVersionAsync(CancellationToken cancellationToken = default)
      {
        await OutputProtocol.WriteMessageBeginAsync(new TMessage("getVersion", TMessageType.Call, SeqId), cancellationToken);
        
        var args = new InternalStructs.getVersionArgs() {
        };
        
        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.getVersionResult();
        await result.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        if (result.__isset.success)
        {
          return result.Success;
        }
        throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getVersion failed: unknown result");
      }

      public async global::System.Threading.Tasks.Task<global::Facebook.FB303.Test.fb_status> getStatusAsync(CancellationToken cancellationToken = default)
      {
        await OutputProtocol.WriteMessageBeginAsync(new TMessage("getStatus", TMessageType.Call, SeqId), cancellationToken);
        
        var args = new InternalStructs.getStatusArgs() {
        };
        
        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.getStatusResult();
        await result.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        if (result.__isset.success)
        {
          return result.Success;
        }
        throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getStatus failed: unknown result");
      }

      public async global::System.Threading.Tasks.Task<string> getStatusDetailsAsync(CancellationToken cancellationToken = default)
      {
        await OutputProtocol.WriteMessageBeginAsync(new TMessage("getStatusDetails", TMessageType.Call, SeqId), cancellationToken);
        
        var args = new InternalStructs.getStatusDetailsArgs() {
        };
        
        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.getStatusDetailsResult();
        await result.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        if (result.__isset.success)
        {
          return result.Success;
        }
        throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getStatusDetails failed: unknown result");
      }

      public async global::System.Threading.Tasks.Task<Dictionary<string, long>> getCountersAsync(CancellationToken cancellationToken = default)
      {
        await OutputProtocol.WriteMessageBeginAsync(new TMessage("getCounters", TMessageType.Call, SeqId), cancellationToken);
        
        var args = new InternalStructs.getCountersArgs() {
        };
        
        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.getCountersResult();
        await result.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        if (result.__isset.success)
        {
          return result.Success;
        }
        throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getCounters failed: unknown result");
      }

      public async global::System.Threading.Tasks.Task<long> getCounterAsync(string key, CancellationToken cancellationToken = default)
      {
        await OutputProtocol.WriteMessageBeginAsync(new TMessage("getCounter", TMessageType.Call, SeqId), cancellationToken);
        
        var args = new InternalStructs.getCounterArgs() {
          Key = key,
        };
        
        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.getCounterResult();
        await result.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        if (result.__isset.success)
        {
          return result.Success;
        }
        throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getCounter failed: unknown result");
      }

      public async global::System.Threading.Tasks.Task setOptionAsync(string key, string @value, CancellationToken cancellationToken = default)
      {
        await OutputProtocol.WriteMessageBeginAsync(new TMessage("setOption", TMessageType.Call, SeqId), cancellationToken);
        
        var args = new InternalStructs.setOptionArgs() {
          Key = key,
          Value = @value,
        };
        
        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.setOptionResult();
        await result.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        return;
      }

      public async global::System.Threading.Tasks.Task<string> getOptionAsync(string key, CancellationToken cancellationToken = default)
      {
        await OutputProtocol.WriteMessageBeginAsync(new TMessage("getOption", TMessageType.Call, SeqId), cancellationToken);
        
        var args = new InternalStructs.getOptionArgs() {
          Key = key,
        };
        
        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.getOptionResult();
        await result.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        if (result.__isset.success)
        {
          return result.Success;
        }
        throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getOption failed: unknown result");
      }

      public async global::System.Threading.Tasks.Task<Dictionary<string, string>> getOptionsAsync(CancellationToken cancellationToken = default)
      {
        await OutputProtocol.WriteMessageBeginAsync(new TMessage("getOptions", TMessageType.Call, SeqId), cancellationToken);
        
        var args = new InternalStructs.getOptionsArgs() {
        };
        
        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.getOptionsResult();
        await result.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        if (result.__isset.success)
        {
          return result.Success;
        }
        throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getOptions failed: unknown result");
      }

      public async global::System.Threading.Tasks.Task<string> getCpuProfileAsync(int profileDurationInSec, CancellationToken cancellationToken = default)
      {
        await OutputProtocol.WriteMessageBeginAsync(new TMessage("getCpuProfile", TMessageType.Call, SeqId), cancellationToken);
        
        var args = new InternalStructs.getCpuProfileArgs() {
          ProfileDurationInSec = profileDurationInSec,
        };
        
        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.getCpuProfileResult();
        await result.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        if (result.__isset.success)
        {
          return result.Success;
        }
        throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getCpuProfile failed: unknown result");
      }

      public async global::System.Threading.Tasks.Task<long> aliveSinceAsync(CancellationToken cancellationToken = default)
      {
        await OutputProtocol.WriteMessageBeginAsync(new TMessage("aliveSince", TMessageType.Call, SeqId), cancellationToken);
        
        var args = new InternalStructs.aliveSinceArgs() {
        };
        
        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.aliveSinceResult();
        await result.ReadAsync(InputProtocol, cancellationToken);
        await InputProtocol.ReadMessageEndAsync(cancellationToken);
        if (result.__isset.success)
        {
          return result.Success;
        }
        throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "aliveSince failed: unknown result");
      }

      public async global::System.Threading.Tasks.Task reinitializeAsync(CancellationToken cancellationToken = default)
      {
        await OutputProtocol.WriteMessageBeginAsync(new TMessage("reinitialize", TMessageType.Oneway, SeqId), cancellationToken);
        
        var args = new InternalStructs.reinitializeArgs() {
        };
        
        await args.WriteAsync(OutputProtocol, cancellationToken);
        await OutputProtocol.WriteMessageEndAsync(cancellationToken);
        await OutputProtocol.Transport.FlushAsync(cancellationToken);
      }
      public async global::System.Threading.Tasks.Task shutdownAsync(CancellationToken cancellationToken = default)
      {
        await OutputProtocol.WriteMessageBeginAsync(new TMessage("shutdown", TMessageType.Oneway, SeqId), cancellationToken);
        
        var args = new InternalStructs.shutdownArgs() {
        };
        
        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_["getName"] = getName_ProcessAsync;
        processMap_["getVersion"] = getVersion_ProcessAsync;
        processMap_["getStatus"] = getStatus_ProcessAsync;
        processMap_["getStatusDetails"] = getStatusDetails_ProcessAsync;
        processMap_["getCounters"] = getCounters_ProcessAsync;
        processMap_["getCounter"] = getCounter_ProcessAsync;
        processMap_["setOption"] = setOption_ProcessAsync;
        processMap_["getOption"] = getOption_ProcessAsync;
        processMap_["getOptions"] = getOptions_ProcessAsync;
        processMap_["getCpuProfile"] = getCpuProfile_ProcessAsync;
        processMap_["aliveSince"] = aliveSince_ProcessAsync;
        processMap_["reinitialize"] = reinitialize_ProcessAsync;
        processMap_["shutdown"] = shutdown_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 getName_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
      {
        var args = new InternalStructs.getNameArgs();
        await args.ReadAsync(iprot, cancellationToken);
        await iprot.ReadMessageEndAsync(cancellationToken);
        var result = new InternalStructs.getNameResult();
        try
        {
          result.Success = await _iAsync.getNameAsync(cancellationToken);
          await oprot.WriteMessageBeginAsync(new TMessage("getName", 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("getName", 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 getVersion_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
      {
        var args = new InternalStructs.getVersionArgs();
        await args.ReadAsync(iprot, cancellationToken);
        await iprot.ReadMessageEndAsync(cancellationToken);
        var result = new InternalStructs.getVersionResult();
        try
        {
          result.Success = await _iAsync.getVersionAsync(cancellationToken);
          await oprot.WriteMessageBeginAsync(new TMessage("getVersion", 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("getVersion", 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 getStatus_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
      {
        var args = new InternalStructs.getStatusArgs();
        await args.ReadAsync(iprot, cancellationToken);
        await iprot.ReadMessageEndAsync(cancellationToken);
        var result = new InternalStructs.getStatusResult();
        try
        {
          result.Success = await _iAsync.getStatusAsync(cancellationToken);
          await oprot.WriteMessageBeginAsync(new TMessage("getStatus", 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("getStatus", 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 getStatusDetails_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
      {
        var args = new InternalStructs.getStatusDetailsArgs();
        await args.ReadAsync(iprot, cancellationToken);
        await iprot.ReadMessageEndAsync(cancellationToken);
        var result = new InternalStructs.getStatusDetailsResult();
        try
        {
          result.Success = await _iAsync.getStatusDetailsAsync(cancellationToken);
          await oprot.WriteMessageBeginAsync(new TMessage("getStatusDetails", 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("getStatusDetails", 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 getCounters_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
      {
        var args = new InternalStructs.getCountersArgs();
        await args.ReadAsync(iprot, cancellationToken);
        await iprot.ReadMessageEndAsync(cancellationToken);
        var result = new InternalStructs.getCountersResult();
        try
        {
          result.Success = await _iAsync.getCountersAsync(cancellationToken);
          await oprot.WriteMessageBeginAsync(new TMessage("getCounters", 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("getCounters", 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 getCounter_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
      {
        var args = new InternalStructs.getCounterArgs();
        await args.ReadAsync(iprot, cancellationToken);
        await iprot.ReadMessageEndAsync(cancellationToken);
        var result = new InternalStructs.getCounterResult();
        try
        {
          result.Success = await _iAsync.getCounterAsync(args.Key, cancellationToken);
          await oprot.WriteMessageBeginAsync(new TMessage("getCounter", 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("getCounter", 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 setOption_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
      {
        var args = new InternalStructs.setOptionArgs();
        await args.ReadAsync(iprot, cancellationToken);
        await iprot.ReadMessageEndAsync(cancellationToken);
        var result = new InternalStructs.setOptionResult();
        try
        {
          await _iAsync.setOptionAsync(args.Key, args.Value, cancellationToken);
          await oprot.WriteMessageBeginAsync(new TMessage("setOption", 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("setOption", 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 getOption_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
      {
        var args = new InternalStructs.getOptionArgs();
        await args.ReadAsync(iprot, cancellationToken);
        await iprot.ReadMessageEndAsync(cancellationToken);
        var result = new InternalStructs.getOptionResult();
        try
        {
          result.Success = await _iAsync.getOptionAsync(args.Key, cancellationToken);
          await oprot.WriteMessageBeginAsync(new TMessage("getOption", 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("getOption", 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 getOptions_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
      {
        var args = new InternalStructs.getOptionsArgs();
        await args.ReadAsync(iprot, cancellationToken);
        await iprot.ReadMessageEndAsync(cancellationToken);
        var result = new InternalStructs.getOptionsResult();
        try
        {
          result.Success = await _iAsync.getOptionsAsync(cancellationToken);
          await oprot.WriteMessageBeginAsync(new TMessage("getOptions", 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("getOptions", 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 getCpuProfile_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
      {
        var args = new InternalStructs.getCpuProfileArgs();
        await args.ReadAsync(iprot, cancellationToken);
        await iprot.ReadMessageEndAsync(cancellationToken);
        var result = new InternalStructs.getCpuProfileResult();
        try
        {
          result.Success = await _iAsync.getCpuProfileAsync(args.ProfileDurationInSec, cancellationToken);
          await oprot.WriteMessageBeginAsync(new TMessage("getCpuProfile", 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("getCpuProfile", 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 aliveSince_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
      {
        var args = new InternalStructs.aliveSinceArgs();
        await args.ReadAsync(iprot, cancellationToken);
        await iprot.ReadMessageEndAsync(cancellationToken);
        var result = new InternalStructs.aliveSinceResult();
        try
        {
          result.Success = await _iAsync.aliveSinceAsync(cancellationToken);
          await oprot.WriteMessageBeginAsync(new TMessage("aliveSince", 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("aliveSince", 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 reinitialize_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
      {
        var args = new InternalStructs.reinitializeArgs();
        await args.ReadAsync(iprot, cancellationToken);
        await iprot.ReadMessageEndAsync(cancellationToken);
        try
        {
          await _iAsync.reinitializeAsync(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 async global::System.Threading.Tasks.Task shutdown_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken)
      {
        var args = new InternalStructs.shutdownArgs();
        await args.ReadAsync(iprot, cancellationToken);
        await iprot.ReadMessageEndAsync(cancellationToken);
        try
        {
          await _iAsync.shutdownAsync(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 getNameArgs : TBase
      {

        public getNameArgs()
        {
        }

        public getNameArgs DeepCopy()
        {
          var tmp0 = new getNameArgs();
          return tmp0;
        }

        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("getName_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 getNameArgs 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("getName_args(");
          sb.Append(')');
          return sb.ToString();
        }
      }


      [DataContract(Namespace="")]
      public partial class getNameResult : 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 getNameResult()
        {
        }

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

        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("getName_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 getNameResult 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("getName_result(");
          int tmp3 = 0;
          if((Success != null) && __isset.success)
          {
            if(0 < tmp3++) { sb.Append(", "); }
            sb.Append("Success: ");
            Success.ToString(sb);
          }
          sb.Append(')');
          return sb.ToString();
        }
      }


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

        public getVersionArgs()
        {
        }

        public getVersionArgs DeepCopy()
        {
          var tmp4 = new getVersionArgs();
          return tmp4;
        }

        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("getVersion_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 getVersionArgs 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("getVersion_args(");
          sb.Append(')');
          return sb.ToString();
        }
      }


      [DataContract(Namespace="")]
      public partial class getVersionResult : 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 getVersionResult()
        {
        }

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

        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("getVersion_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 getVersionResult 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("getVersion_result(");
          int tmp7 = 0;
          if((Success != null) && __isset.success)
          {
            if(0 < tmp7++) { sb.Append(", "); }
            sb.Append("Success: ");
            Success.ToString(sb);
          }
          sb.Append(')');
          return sb.ToString();
        }
      }


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

        public getStatusArgs()
        {
        }

        public getStatusArgs DeepCopy()
        {
          var tmp8 = new getStatusArgs();
          return tmp8;
        }

        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("getStatus_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 getStatusArgs 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("getStatus_args(");
          sb.Append(')');
          return sb.ToString();
        }
      }


      [DataContract(Namespace="")]
      public partial class getStatusResult : TBase
      {
        private global::Facebook.FB303.Test.fb_status _success;

        /// <summary>
        /// 
        /// <seealso cref="global::Facebook.FB303.Test.fb_status"/>
        /// </summary>
        [DataMember(Order = 0)]
        public global::Facebook.FB303.Test.fb_status 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 getStatusResult()
        {
        }

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

        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::Facebook.FB303.Test.fb_status)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("getStatus_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 getStatusResult 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("getStatus_result(");
          int tmp11 = 0;
          if(__isset.success)
          {
            if(0 < tmp11++) { sb.Append(", "); }
            sb.Append("Success: ");
            Success.ToString(sb);
          }
          sb.Append(')');
          return sb.ToString();
        }
      }


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

        public getStatusDetailsArgs()
        {
        }

        public getStatusDetailsArgs DeepCopy()
        {
          var tmp12 = new getStatusDetailsArgs();
          return tmp12;
        }

        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("getStatusDetails_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 getStatusDetailsArgs 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("getStatusDetails_args(");
          sb.Append(')');
          return sb.ToString();
        }
      }


      [DataContract(Namespace="")]
      public partial class getStatusDetailsResult : 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 getStatusDetailsResult()
        {
        }

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

        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("getStatusDetails_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 getStatusDetailsResult 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("getStatusDetails_result(");
          int tmp15 = 0;
          if((Success != null) && __isset.success)
          {
            if(0 < tmp15++) { sb.Append(", "); }
            sb.Append("Success: ");
            Success.ToString(sb);
          }
          sb.Append(')');
          return sb.ToString();
        }
      }


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

        public getCountersArgs()
        {
        }

        public getCountersArgs DeepCopy()
        {
          var tmp16 = new getCountersArgs();
          return tmp16;
        }

        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("getCounters_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 getCountersArgs 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("getCounters_args(");
          sb.Append(')');
          return sb.ToString();
        }
      }


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

        [DataMember(Order = 0)]
        public Dictionary<string, 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 getCountersResult()
        {
        }

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

        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 _map19 = await iprot.ReadMapBeginAsync(cancellationToken);
                      Success = new Dictionary<string, long>(_map19.Count);
                      for(int _i20 = 0; _i20 < _map19.Count; ++_i20)
                      {
                        string _key21;
                        long _val22;
                        _key21 = await iprot.ReadStringAsync(cancellationToken);
                        _val22 = await iprot.ReadI64Async(cancellationToken);
                        Success[_key21] = _val22;
                      }
                      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("getCounters_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.I64, Success.Count), cancellationToken);
                  foreach (string _iter23 in Success.Keys)
                  {
                    await oprot.WriteStringAsync(_iter23, cancellationToken);
                    await oprot.WriteI64Async(Success[_iter23], 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 getCountersResult 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("getCounters_result(");
          int tmp24 = 0;
          if((Success != null) && __isset.success)
          {
            if(0 < tmp24++) { sb.Append(", "); }
            sb.Append("Success: ");
            Success.ToString(sb);
          }
          sb.Append(')');
          return sb.ToString();
        }
      }


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

        [DataMember(Order = 0)]
        public string Key
        {
          get
          {
            return _key;
          }
          set
          {
            __isset.key = true;
            this._key = value;
          }
        }


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

        #region XmlSerializer support

        public bool ShouldSerializeKey()
        {
          return __isset.key;
        }

        #endregion XmlSerializer support

        public getCounterArgs()
        {
        }

        public getCounterArgs DeepCopy()
        {
          var tmp25 = new getCounterArgs();
          if((Key != null) && __isset.key)
          {
            tmp25.Key = this.Key;
          }
          tmp25.__isset.key = this.__isset.key;
          return tmp25;
        }

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

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

        public override string ToString()
        {
          var sb = new StringBuilder("getCounter_args(");
          int tmp26 = 0;
          if((Key != null) && __isset.key)
          {
            if(0 < tmp26++) { sb.Append(", "); }
            sb.Append("Key: ");
            Key.ToString(sb);
          }
          sb.Append(')');
          return sb.ToString();
        }
      }


      [DataContract(Namespace="")]
      public partial class getCounterResult : 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 getCounterResult()
        {
        }

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

        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("getCounter_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 getCounterResult 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("getCounter_result(");
          int tmp28 = 0;
          if(__isset.success)
          {
            if(0 < tmp28++) { sb.Append(", "); }
            sb.Append("Success: ");
            Success.ToString(sb);
          }
          sb.Append(')');
          return sb.ToString();
        }
      }


      [DataContract(Namespace="")]
      public partial class setOptionArgs : TBase
      {
        private string _key;
        private string _value;

        [DataMember(Order = 0)]
        public string Key
        {
          get
          {
            return _key;
          }
          set
          {
            __isset.key = true;
            this._key = value;
          }
        }

        [DataMember(Order = 0)]
        public string Value
        {
          get
          {
            return _value;
          }
          set
          {
            __isset.@value = true;
            this._value = value;
          }
        }


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

        #region XmlSerializer support

        public bool ShouldSerializeKey()
        {
          return __isset.key;
        }

        public bool ShouldSerializeValue()
        {
          return __isset.@value;
        }

        #endregion XmlSerializer support

        public setOptionArgs()
        {
        }

        public setOptionArgs DeepCopy()
        {
          var tmp29 = new setOptionArgs();
          if((Key != null) && __isset.key)
          {
            tmp29.Key = this.Key;
          }
          tmp29.__isset.key = this.__isset.key;
          if((Value != null) && __isset.@value)
          {
            tmp29.Value = this.Value;
          }
          tmp29.__isset.@value = this.__isset.@value;
          return tmp29;
        }

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

        public override int GetHashCode() {
          int hashcode = 157;
          unchecked {
            if((Key != null) && __isset.key)
            {
              hashcode = (hashcode * 397) + Key.GetHashCode();
            }
            if((Value != null) && __isset.@value)
            {
              hashcode = (hashcode * 397) + Value.GetHashCode();
            }
          }
          return hashcode;
        }

        public override string ToString()
        {
          var sb = new StringBuilder("setOption_args(");
          int tmp30 = 0;
          if((Key != null) && __isset.key)
          {
            if(0 < tmp30++) { sb.Append(", "); }
            sb.Append("Key: ");
            Key.ToString(sb);
          }
          if((Value != null) && __isset.@value)
          {
            if(0 < tmp30++) { sb.Append(", "); }
            sb.Append("Value: ");
            Value.ToString(sb);
          }
          sb.Append(')');
          return sb.ToString();
        }
      }


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

        public setOptionResult()
        {
        }

        public setOptionResult DeepCopy()
        {
          var tmp31 = new setOptionResult();
          return tmp31;
        }

        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("setOption_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 setOptionResult 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("setOption_result(");
          sb.Append(')');
          return sb.ToString();
        }
      }


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

        [DataMember(Order = 0)]
        public string Key
        {
          get
          {
            return _key;
          }
          set
          {
            __isset.key = true;
            this._key = value;
          }
        }


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

        #region XmlSerializer support

        public bool ShouldSerializeKey()
        {
          return __isset.key;
        }

        #endregion XmlSerializer support

        public getOptionArgs()
        {
        }

        public getOptionArgs DeepCopy()
        {
          var tmp33 = new getOptionArgs();
          if((Key != null) && __isset.key)
          {
            tmp33.Key = this.Key;
          }
          tmp33.__isset.key = this.__isset.key;
          return tmp33;
        }

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

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

        public override string ToString()
        {
          var sb = new StringBuilder("getOption_args(");
          int tmp34 = 0;
          if((Key != null) && __isset.key)
          {
            if(0 < tmp34++) { sb.Append(", "); }
            sb.Append("Key: ");
            Key.ToString(sb);
          }
          sb.Append(')');
          return sb.ToString();
        }
      }


      [DataContract(Namespace="")]
      public partial class getOptionResult : 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 getOptionResult()
        {
        }

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

        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("getOption_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 getOptionResult 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("getOption_result(");
          int tmp36 = 0;
          if((Success != null) && __isset.success)
          {
            if(0 < tmp36++) { sb.Append(", "); }
            sb.Append("Success: ");
            Success.ToString(sb);
          }
          sb.Append(')');
          return sb.ToString();
        }
      }


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

        public getOptionsArgs()
        {
        }

        public getOptionsArgs DeepCopy()
        {
          var tmp37 = new getOptionsArgs();
          return tmp37;
        }

        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("getOptions_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 getOptionsArgs 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("getOptions_args(");
          sb.Append(')');
          return sb.ToString();
        }
      }


      [DataContract(Namespace="")]
      public partial class getOptionsResult : 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 getOptionsResult()
        {
        }

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

        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 _map40 = await iprot.ReadMapBeginAsync(cancellationToken);
                      Success = new Dictionary<string, string>(_map40.Count);
                      for(int _i41 = 0; _i41 < _map40.Count; ++_i41)
                      {
                        string _key42;
                        string _val43;
                        _key42 = await iprot.ReadStringAsync(cancellationToken);
                        _val43 = await iprot.ReadStringAsync(cancellationToken);
                        Success[_key42] = _val43;
                      }
                      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("getOptions_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 _iter44 in Success.Keys)
                  {
                    await oprot.WriteStringAsync(_iter44, cancellationToken);
                    await oprot.WriteStringAsync(Success[_iter44], 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 getOptionsResult 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("getOptions_result(");
          int tmp45 = 0;
          if((Success != null) && __isset.success)
          {
            if(0 < tmp45++) { sb.Append(", "); }
            sb.Append("Success: ");
            Success.ToString(sb);
          }
          sb.Append(')');
          return sb.ToString();
        }
      }


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

        [DataMember(Order = 0)]
        public int ProfileDurationInSec
        {
          get
          {
            return _profileDurationInSec;
          }
          set
          {
            __isset.profileDurationInSec = true;
            this._profileDurationInSec = value;
          }
        }


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

        #region XmlSerializer support

        public bool ShouldSerializeProfileDurationInSec()
        {
          return __isset.profileDurationInSec;
        }

        #endregion XmlSerializer support

        public getCpuProfileArgs()
        {
        }

        public getCpuProfileArgs DeepCopy()
        {
          var tmp46 = new getCpuProfileArgs();
          if(__isset.profileDurationInSec)
          {
            tmp46.ProfileDurationInSec = this.ProfileDurationInSec;
          }
          tmp46.__isset.profileDurationInSec = this.__isset.profileDurationInSec;
          return tmp46;
        }

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

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

        public override string ToString()
        {
          var sb = new StringBuilder("getCpuProfile_args(");
          int tmp47 = 0;
          if(__isset.profileDurationInSec)
          {
            if(0 < tmp47++) { sb.Append(", "); }
            sb.Append("ProfileDurationInSec: ");
            ProfileDurationInSec.ToString(sb);
          }
          sb.Append(')');
          return sb.ToString();
        }
      }


      [DataContract(Namespace="")]
      public partial class getCpuProfileResult : 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 getCpuProfileResult()
        {
        }

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

        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("getCpuProfile_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 getCpuProfileResult 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("getCpuProfile_result(");
          int tmp49 = 0;
          if((Success != null) && __isset.success)
          {
            if(0 < tmp49++) { sb.Append(", "); }
            sb.Append("Success: ");
            Success.ToString(sb);
          }
          sb.Append(')');
          return sb.ToString();
        }
      }


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

        public aliveSinceArgs()
        {
        }

        public aliveSinceArgs DeepCopy()
        {
          var tmp50 = new aliveSinceArgs();
          return tmp50;
        }

        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("aliveSince_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 aliveSinceArgs 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("aliveSince_args(");
          sb.Append(')');
          return sb.ToString();
        }
      }


      [DataContract(Namespace="")]
      public partial class aliveSinceResult : 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 aliveSinceResult()
        {
        }

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

        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("aliveSince_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 aliveSinceResult 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("aliveSince_result(");
          int tmp53 = 0;
          if(__isset.success)
          {
            if(0 < tmp53++) { sb.Append(", "); }
            sb.Append("Success: ");
            Success.ToString(sb);
          }
          sb.Append(')');
          return sb.ToString();
        }
      }


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

        public reinitializeArgs()
        {
        }

        public reinitializeArgs DeepCopy()
        {
          var tmp54 = new reinitializeArgs();
          return tmp54;
        }

        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("reinitialize_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 reinitializeArgs 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("reinitialize_args(");
          sb.Append(')');
          return sb.ToString();
        }
      }


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

        public shutdownArgs()
        {
        }

        public shutdownArgs DeepCopy()
        {
          var tmp56 = new shutdownArgs();
          return tmp56;
        }

        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("shutdown_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 shutdownArgs 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("shutdown_args(");
          sb.Append(')');
          return sb.ToString();
        }
      }

    }

  }
}
