/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;
using Thrift;
using Thrift.Collections;
using Thrift.Protocol;
using Thrift.Transport;
namespace Evernote.EDAM.NoteStore
{

  #if !SILVERLIGHT && !NETFX_CORE
  [Serializable]
  #endif
  public partial class SyncState : TBase
  {
    private long _currentTime;
    private long _fullSyncBefore;
    private int _updateCount;
    private long _uploaded;

    public long CurrentTime
    {
      get
      {
        return _currentTime;
      }
      set
      {
        __isset.currentTime = true;
        this._currentTime = value;
      }
    }

    public long FullSyncBefore
    {
      get
      {
        return _fullSyncBefore;
      }
      set
      {
        __isset.fullSyncBefore = true;
        this._fullSyncBefore = value;
      }
    }

    public int UpdateCount
    {
      get
      {
        return _updateCount;
      }
      set
      {
        __isset.updateCount = true;
        this._updateCount = value;
      }
    }

    public long Uploaded
    {
      get
      {
        return _uploaded;
      }
      set
      {
        __isset.uploaded = true;
        this._uploaded = value;
      }
    }


    public Isset __isset;
    #if !SILVERLIGHT && !NETFX_CORE
    [Serializable]
    #endif
    public struct Isset {
      public bool currentTime;
      public bool fullSyncBefore;
      public bool updateCount;
      public bool uploaded;
    }

    public SyncState() {
    }

    public void Read (TProtocol iprot)
    {
      TField field;
      iprot.ReadStructBegin();
      while (true)
      {
        field = iprot.ReadFieldBegin();
        if (field.Type == TType.Stop) { 
          break;
        }
        switch (field.ID)
        {
          case 1:
            if (field.Type == TType.I64) {
              CurrentTime = iprot.ReadI64();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 2:
            if (field.Type == TType.I64) {
              FullSyncBefore = iprot.ReadI64();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 3:
            if (field.Type == TType.I32) {
              UpdateCount = iprot.ReadI32();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 4:
            if (field.Type == TType.I64) {
              Uploaded = iprot.ReadI64();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          default: 
            TProtocolUtil.Skip(iprot, field.Type);
            break;
        }
        iprot.ReadFieldEnd();
      }
      iprot.ReadStructEnd();
    }

    public void Write(TProtocol oprot) {
      TStruct struc = new TStruct("SyncState");
      oprot.WriteStructBegin(struc);
      TField field = new TField();
      if (__isset.currentTime) {
        field.Name = "currentTime";
        field.Type = TType.I64;
        field.ID = 1;
        oprot.WriteFieldBegin(field);
        oprot.WriteI64(CurrentTime);
        oprot.WriteFieldEnd();
      }
      if (__isset.fullSyncBefore) {
        field.Name = "fullSyncBefore";
        field.Type = TType.I64;
        field.ID = 2;
        oprot.WriteFieldBegin(field);
        oprot.WriteI64(FullSyncBefore);
        oprot.WriteFieldEnd();
      }
      if (__isset.updateCount) {
        field.Name = "updateCount";
        field.Type = TType.I32;
        field.ID = 3;
        oprot.WriteFieldBegin(field);
        oprot.WriteI32(UpdateCount);
        oprot.WriteFieldEnd();
      }
      if (__isset.uploaded) {
        field.Name = "uploaded";
        field.Type = TType.I64;
        field.ID = 4;
        oprot.WriteFieldBegin(field);
        oprot.WriteI64(Uploaded);
        oprot.WriteFieldEnd();
      }
      oprot.WriteFieldStop();
      oprot.WriteStructEnd();
    }

    public override string ToString() {
      StringBuilder sb = new StringBuilder("SyncState(");
      sb.Append("CurrentTime: ");
      sb.Append(CurrentTime);
      sb.Append(",FullSyncBefore: ");
      sb.Append(FullSyncBefore);
      sb.Append(",UpdateCount: ");
      sb.Append(UpdateCount);
      sb.Append(",Uploaded: ");
      sb.Append(Uploaded);
      sb.Append(")");
      return sb.ToString();
    }

  }

}
