/**
 * Autogenerated by Thrift Compiler (0.14.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Thrift;
using Thrift.Collections;
using System.ServiceModel;
using System.Runtime.Serialization;

using Thrift.Protocol;
using Thrift.Protocol.Entities;
using Thrift.Protocol.Utilities;
using Thrift.Transport;
using Thrift.Transport.Client;
using Thrift.Transport.Server;
using Thrift.Processor;


#pragma warning disable IDE0079  // remove unnecessary pragmas
#pragma warning disable IDE1006  // parts of the code use IDL spelling

namespace ThriftTest
{

[DataContract(Namespace="")]
public partial class LargeDeltas : TBase
{
  private global::ThriftTest.Bools _b1;
  private global::ThriftTest.Bools _b10;
  private global::ThriftTest.Bools _b100;
  private bool _check_true;
  private global::ThriftTest.Bools _b1000;
  private bool _check_false;
  private global::ThriftTest.VersioningTestV2 _vertwo2000;
  private THashSet<string> _a_set2500;
  private global::ThriftTest.VersioningTestV2 _vertwo3000;
  private List<int> _big_numbers;

  [DataMember(Order = 0)]
  public global::ThriftTest.Bools B1
  {
    get
    {
      return _b1;
    }
    set
    {
      __isset.b1 = true;
      this._b1 = value;
    }
  }

  [DataMember(Order = 0)]
  public global::ThriftTest.Bools B10
  {
    get
    {
      return _b10;
    }
    set
    {
      __isset.b10 = true;
      this._b10 = value;
    }
  }

  [DataMember(Order = 0)]
  public global::ThriftTest.Bools B100
  {
    get
    {
      return _b100;
    }
    set
    {
      __isset.b100 = true;
      this._b100 = value;
    }
  }

  [DataMember(Order = 0)]
  public bool Check_true
  {
    get
    {
      return _check_true;
    }
    set
    {
      __isset.check_true = true;
      this._check_true = value;
    }
  }

  [DataMember(Order = 0)]
  public global::ThriftTest.Bools B1000
  {
    get
    {
      return _b1000;
    }
    set
    {
      __isset.b1000 = true;
      this._b1000 = value;
    }
  }

  [DataMember(Order = 0)]
  public bool Check_false
  {
    get
    {
      return _check_false;
    }
    set
    {
      __isset.check_false = true;
      this._check_false = value;
    }
  }

  [DataMember(Order = 0)]
  public global::ThriftTest.VersioningTestV2 Vertwo2000
  {
    get
    {
      return _vertwo2000;
    }
    set
    {
      __isset.vertwo2000 = true;
      this._vertwo2000 = value;
    }
  }

  [DataMember(Order = 0)]
  public THashSet<string> A_set2500
  {
    get
    {
      return _a_set2500;
    }
    set
    {
      __isset.a_set2500 = true;
      this._a_set2500 = value;
    }
  }

  [DataMember(Order = 0)]
  public global::ThriftTest.VersioningTestV2 Vertwo3000
  {
    get
    {
      return _vertwo3000;
    }
    set
    {
      __isset.vertwo3000 = true;
      this._vertwo3000 = value;
    }
  }

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


  [DataMember(Order = 1)]
  public Isset __isset;
  [DataContract]
  public struct Isset
  {
    [DataMember]
    public bool b1;
    [DataMember]
    public bool b10;
    [DataMember]
    public bool b100;
    [DataMember]
    public bool check_true;
    [DataMember]
    public bool b1000;
    [DataMember]
    public bool check_false;
    [DataMember]
    public bool vertwo2000;
    [DataMember]
    public bool a_set2500;
    [DataMember]
    public bool vertwo3000;
    [DataMember]
    public bool big_numbers;
  }

  #region XmlSerializer support

  public bool ShouldSerializeB1()
  {
    return __isset.b1;
  }

  public bool ShouldSerializeB10()
  {
    return __isset.b10;
  }

  public bool ShouldSerializeB100()
  {
    return __isset.b100;
  }

  public bool ShouldSerializeCheck_true()
  {
    return __isset.check_true;
  }

  public bool ShouldSerializeB1000()
  {
    return __isset.b1000;
  }

  public bool ShouldSerializeCheck_false()
  {
    return __isset.check_false;
  }

  public bool ShouldSerializeVertwo2000()
  {
    return __isset.vertwo2000;
  }

  public bool ShouldSerializeA_set2500()
  {
    return __isset.a_set2500;
  }

  public bool ShouldSerializeVertwo3000()
  {
    return __isset.vertwo3000;
  }

  public bool ShouldSerializeBig_numbers()
  {
    return __isset.big_numbers;
  }

  #endregion XmlSerializer support

  public LargeDeltas()
  {
  }

  public LargeDeltas DeepCopy()
  {
    var tmp107 = new LargeDeltas();
    if((B1 != null) && __isset.b1)
    {
      tmp107.B1 = (global::ThriftTest.Bools)this.B1.DeepCopy();
    }
    tmp107.__isset.b1 = this.__isset.b1;
    if((B10 != null) && __isset.b10)
    {
      tmp107.B10 = (global::ThriftTest.Bools)this.B10.DeepCopy();
    }
    tmp107.__isset.b10 = this.__isset.b10;
    if((B100 != null) && __isset.b100)
    {
      tmp107.B100 = (global::ThriftTest.Bools)this.B100.DeepCopy();
    }
    tmp107.__isset.b100 = this.__isset.b100;
    if(__isset.check_true)
    {
      tmp107.Check_true = this.Check_true;
    }
    tmp107.__isset.check_true = this.__isset.check_true;
    if((B1000 != null) && __isset.b1000)
    {
      tmp107.B1000 = (global::ThriftTest.Bools)this.B1000.DeepCopy();
    }
    tmp107.__isset.b1000 = this.__isset.b1000;
    if(__isset.check_false)
    {
      tmp107.Check_false = this.Check_false;
    }
    tmp107.__isset.check_false = this.__isset.check_false;
    if((Vertwo2000 != null) && __isset.vertwo2000)
    {
      tmp107.Vertwo2000 = (global::ThriftTest.VersioningTestV2)this.Vertwo2000.DeepCopy();
    }
    tmp107.__isset.vertwo2000 = this.__isset.vertwo2000;
    if((A_set2500 != null) && __isset.a_set2500)
    {
      tmp107.A_set2500 = this.A_set2500.DeepCopy();
    }
    tmp107.__isset.a_set2500 = this.__isset.a_set2500;
    if((Vertwo3000 != null) && __isset.vertwo3000)
    {
      tmp107.Vertwo3000 = (global::ThriftTest.VersioningTestV2)this.Vertwo3000.DeepCopy();
    }
    tmp107.__isset.vertwo3000 = this.__isset.vertwo3000;
    if((Big_numbers != null) && __isset.big_numbers)
    {
      tmp107.Big_numbers = this.Big_numbers.DeepCopy();
    }
    tmp107.__isset.big_numbers = this.__isset.big_numbers;
    return tmp107;
  }

  public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
  {
    iprot.IncrementRecursionDepth();
    try
    {
      TField field;
      await iprot.ReadStructBeginAsync(cancellationToken);
      while (true)
      {
        field = await iprot.ReadFieldBeginAsync(cancellationToken);
        if (field.Type == TType.Stop)
        {
          break;
        }

        switch (field.ID)
        {
          case 1:
            if (field.Type == TType.Struct)
            {
              B1 = new global::ThriftTest.Bools();
              await B1.ReadAsync(iprot, cancellationToken);
            }
            else
            {
              await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
            }
            break;
          case 10:
            if (field.Type == TType.Struct)
            {
              B10 = new global::ThriftTest.Bools();
              await B10.ReadAsync(iprot, cancellationToken);
            }
            else
            {
              await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
            }
            break;
          case 100:
            if (field.Type == TType.Struct)
            {
              B100 = new global::ThriftTest.Bools();
              await B100.ReadAsync(iprot, cancellationToken);
            }
            else
            {
              await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
            }
            break;
          case 500:
            if (field.Type == TType.Bool)
            {
              Check_true = await iprot.ReadBoolAsync(cancellationToken);
            }
            else
            {
              await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
            }
            break;
          case 1000:
            if (field.Type == TType.Struct)
            {
              B1000 = new global::ThriftTest.Bools();
              await B1000.ReadAsync(iprot, cancellationToken);
            }
            else
            {
              await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
            }
            break;
          case 1500:
            if (field.Type == TType.Bool)
            {
              Check_false = await iprot.ReadBoolAsync(cancellationToken);
            }
            else
            {
              await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
            }
            break;
          case 2000:
            if (field.Type == TType.Struct)
            {
              Vertwo2000 = new global::ThriftTest.VersioningTestV2();
              await Vertwo2000.ReadAsync(iprot, cancellationToken);
            }
            else
            {
              await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
            }
            break;
          case 2500:
            if (field.Type == TType.Set)
            {
              {
                TSet _set108 = await iprot.ReadSetBeginAsync(cancellationToken);
                A_set2500 = new THashSet<string>(_set108.Count);
                for(int _i109 = 0; _i109 < _set108.Count; ++_i109)
                {
                  string _elem110;
                  _elem110 = await iprot.ReadStringAsync(cancellationToken);
                  A_set2500.Add(_elem110);
                }
                await iprot.ReadSetEndAsync(cancellationToken);
              }
            }
            else
            {
              await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
            }
            break;
          case 3000:
            if (field.Type == TType.Struct)
            {
              Vertwo3000 = new global::ThriftTest.VersioningTestV2();
              await Vertwo3000.ReadAsync(iprot, cancellationToken);
            }
            else
            {
              await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
            }
            break;
          case 4000:
            if (field.Type == TType.List)
            {
              {
                TList _list111 = await iprot.ReadListBeginAsync(cancellationToken);
                Big_numbers = new List<int>(_list111.Count);
                for(int _i112 = 0; _i112 < _list111.Count; ++_i112)
                {
                  int _elem113;
                  _elem113 = await iprot.ReadI32Async(cancellationToken);
                  Big_numbers.Add(_elem113);
                }
                await iprot.ReadListEndAsync(cancellationToken);
              }
            }
            else
            {
              await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
            }
            break;
          default: 
            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
            break;
        }

        await iprot.ReadFieldEndAsync(cancellationToken);
      }

      await iprot.ReadStructEndAsync(cancellationToken);
    }
    finally
    {
      iprot.DecrementRecursionDepth();
    }
  }

  public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken)
  {
    oprot.IncrementRecursionDepth();
    try
    {
      var struc = new TStruct("LargeDeltas");
      await oprot.WriteStructBeginAsync(struc, cancellationToken);
      var field = new TField();
      if((B1 != null) && __isset.b1)
      {
        field.Name = "b1";
        field.Type = TType.Struct;
        field.ID = 1;
        await oprot.WriteFieldBeginAsync(field, cancellationToken);
        await B1.WriteAsync(oprot, cancellationToken);
        await oprot.WriteFieldEndAsync(cancellationToken);
      }
      if((B10 != null) && __isset.b10)
      {
        field.Name = "b10";
        field.Type = TType.Struct;
        field.ID = 10;
        await oprot.WriteFieldBeginAsync(field, cancellationToken);
        await B10.WriteAsync(oprot, cancellationToken);
        await oprot.WriteFieldEndAsync(cancellationToken);
      }
      if((B100 != null) && __isset.b100)
      {
        field.Name = "b100";
        field.Type = TType.Struct;
        field.ID = 100;
        await oprot.WriteFieldBeginAsync(field, cancellationToken);
        await B100.WriteAsync(oprot, cancellationToken);
        await oprot.WriteFieldEndAsync(cancellationToken);
      }
      if(__isset.check_true)
      {
        field.Name = "check_true";
        field.Type = TType.Bool;
        field.ID = 500;
        await oprot.WriteFieldBeginAsync(field, cancellationToken);
        await oprot.WriteBoolAsync(Check_true, cancellationToken);
        await oprot.WriteFieldEndAsync(cancellationToken);
      }
      if((B1000 != null) && __isset.b1000)
      {
        field.Name = "b1000";
        field.Type = TType.Struct;
        field.ID = 1000;
        await oprot.WriteFieldBeginAsync(field, cancellationToken);
        await B1000.WriteAsync(oprot, cancellationToken);
        await oprot.WriteFieldEndAsync(cancellationToken);
      }
      if(__isset.check_false)
      {
        field.Name = "check_false";
        field.Type = TType.Bool;
        field.ID = 1500;
        await oprot.WriteFieldBeginAsync(field, cancellationToken);
        await oprot.WriteBoolAsync(Check_false, cancellationToken);
        await oprot.WriteFieldEndAsync(cancellationToken);
      }
      if((Vertwo2000 != null) && __isset.vertwo2000)
      {
        field.Name = "vertwo2000";
        field.Type = TType.Struct;
        field.ID = 2000;
        await oprot.WriteFieldBeginAsync(field, cancellationToken);
        await Vertwo2000.WriteAsync(oprot, cancellationToken);
        await oprot.WriteFieldEndAsync(cancellationToken);
      }
      if((A_set2500 != null) && __isset.a_set2500)
      {
        field.Name = "a_set2500";
        field.Type = TType.Set;
        field.ID = 2500;
        await oprot.WriteFieldBeginAsync(field, cancellationToken);
        {
          await oprot.WriteSetBeginAsync(new TSet(TType.String, A_set2500.Count), cancellationToken);
          foreach (string _iter114 in A_set2500)
          {
            await oprot.WriteStringAsync(_iter114, cancellationToken);
          }
          await oprot.WriteSetEndAsync(cancellationToken);
        }
        await oprot.WriteFieldEndAsync(cancellationToken);
      }
      if((Vertwo3000 != null) && __isset.vertwo3000)
      {
        field.Name = "vertwo3000";
        field.Type = TType.Struct;
        field.ID = 3000;
        await oprot.WriteFieldBeginAsync(field, cancellationToken);
        await Vertwo3000.WriteAsync(oprot, cancellationToken);
        await oprot.WriteFieldEndAsync(cancellationToken);
      }
      if((Big_numbers != null) && __isset.big_numbers)
      {
        field.Name = "big_numbers";
        field.Type = TType.List;
        field.ID = 4000;
        await oprot.WriteFieldBeginAsync(field, cancellationToken);
        {
          await oprot.WriteListBeginAsync(new TList(TType.I32, Big_numbers.Count), cancellationToken);
          foreach (int _iter115 in Big_numbers)
          {
            await oprot.WriteI32Async(_iter115, cancellationToken);
          }
          await oprot.WriteListEndAsync(cancellationToken);
        }
        await oprot.WriteFieldEndAsync(cancellationToken);
      }
      await oprot.WriteFieldStopAsync(cancellationToken);
      await oprot.WriteStructEndAsync(cancellationToken);
    }
    finally
    {
      oprot.DecrementRecursionDepth();
    }
  }

  public override bool Equals(object that)
  {
    if (!(that is LargeDeltas other)) return false;
    if (ReferenceEquals(this, other)) return true;
    return ((__isset.b1 == other.__isset.b1) && ((!__isset.b1) || (System.Object.Equals(B1, other.B1))))
      && ((__isset.b10 == other.__isset.b10) && ((!__isset.b10) || (System.Object.Equals(B10, other.B10))))
      && ((__isset.b100 == other.__isset.b100) && ((!__isset.b100) || (System.Object.Equals(B100, other.B100))))
      && ((__isset.check_true == other.__isset.check_true) && ((!__isset.check_true) || (System.Object.Equals(Check_true, other.Check_true))))
      && ((__isset.b1000 == other.__isset.b1000) && ((!__isset.b1000) || (System.Object.Equals(B1000, other.B1000))))
      && ((__isset.check_false == other.__isset.check_false) && ((!__isset.check_false) || (System.Object.Equals(Check_false, other.Check_false))))
      && ((__isset.vertwo2000 == other.__isset.vertwo2000) && ((!__isset.vertwo2000) || (System.Object.Equals(Vertwo2000, other.Vertwo2000))))
      && ((__isset.a_set2500 == other.__isset.a_set2500) && ((!__isset.a_set2500) || (TCollections.Equals(A_set2500, other.A_set2500))))
      && ((__isset.vertwo3000 == other.__isset.vertwo3000) && ((!__isset.vertwo3000) || (System.Object.Equals(Vertwo3000, other.Vertwo3000))))
      && ((__isset.big_numbers == other.__isset.big_numbers) && ((!__isset.big_numbers) || (TCollections.Equals(Big_numbers, other.Big_numbers))));
  }

  public override int GetHashCode() {
    int hashcode = 157;
    unchecked {
      if((B1 != null) && __isset.b1)
      {
        hashcode = (hashcode * 397) + B1.GetHashCode();
      }
      if((B10 != null) && __isset.b10)
      {
        hashcode = (hashcode * 397) + B10.GetHashCode();
      }
      if((B100 != null) && __isset.b100)
      {
        hashcode = (hashcode * 397) + B100.GetHashCode();
      }
      if(__isset.check_true)
      {
        hashcode = (hashcode * 397) + Check_true.GetHashCode();
      }
      if((B1000 != null) && __isset.b1000)
      {
        hashcode = (hashcode * 397) + B1000.GetHashCode();
      }
      if(__isset.check_false)
      {
        hashcode = (hashcode * 397) + Check_false.GetHashCode();
      }
      if((Vertwo2000 != null) && __isset.vertwo2000)
      {
        hashcode = (hashcode * 397) + Vertwo2000.GetHashCode();
      }
      if((A_set2500 != null) && __isset.a_set2500)
      {
        hashcode = (hashcode * 397) + TCollections.GetHashCode(A_set2500);
      }
      if((Vertwo3000 != null) && __isset.vertwo3000)
      {
        hashcode = (hashcode * 397) + Vertwo3000.GetHashCode();
      }
      if((Big_numbers != null) && __isset.big_numbers)
      {
        hashcode = (hashcode * 397) + TCollections.GetHashCode(Big_numbers);
      }
    }
    return hashcode;
  }

  public override string ToString()
  {
    var sb = new StringBuilder("LargeDeltas(");
    int tmp116 = 0;
    if((B1 != null) && __isset.b1)
    {
      if(0 < tmp116++) { sb.Append(", "); }
      sb.Append("B1: ");
      B1.ToString(sb);
    }
    if((B10 != null) && __isset.b10)
    {
      if(0 < tmp116++) { sb.Append(", "); }
      sb.Append("B10: ");
      B10.ToString(sb);
    }
    if((B100 != null) && __isset.b100)
    {
      if(0 < tmp116++) { sb.Append(", "); }
      sb.Append("B100: ");
      B100.ToString(sb);
    }
    if(__isset.check_true)
    {
      if(0 < tmp116++) { sb.Append(", "); }
      sb.Append("Check_true: ");
      Check_true.ToString(sb);
    }
    if((B1000 != null) && __isset.b1000)
    {
      if(0 < tmp116++) { sb.Append(", "); }
      sb.Append("B1000: ");
      B1000.ToString(sb);
    }
    if(__isset.check_false)
    {
      if(0 < tmp116++) { sb.Append(", "); }
      sb.Append("Check_false: ");
      Check_false.ToString(sb);
    }
    if((Vertwo2000 != null) && __isset.vertwo2000)
    {
      if(0 < tmp116++) { sb.Append(", "); }
      sb.Append("Vertwo2000: ");
      Vertwo2000.ToString(sb);
    }
    if((A_set2500 != null) && __isset.a_set2500)
    {
      if(0 < tmp116++) { sb.Append(", "); }
      sb.Append("A_set2500: ");
      A_set2500.ToString(sb);
    }
    if((Vertwo3000 != null) && __isset.vertwo3000)
    {
      if(0 < tmp116++) { sb.Append(", "); }
      sb.Append("Vertwo3000: ");
      Vertwo3000.ToString(sb);
    }
    if((Big_numbers != null) && __isset.big_numbers)
    {
      if(0 < tmp116++) { sb.Append(", "); }
      sb.Append("Big_numbers: ");
      Big_numbers.ToString(sb);
    }
    sb.Append(')');
    return sb.ToString();
  }
}

}
