/**
 * 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 NoteMetadata : TBase
  {
    private string _guid;
    private string _title;
    private int _contentLength;
    private long _created;
    private long _updated;
    private long _deleted;
    private int _updateSequenceNum;
    private string _notebookGuid;
    private List<string> _tagGuids;
    private Evernote.EDAM.Type.NoteAttributes _attributes;
    private string _largestResourceMime;
    private int _largestResourceSize;

    public string Guid
    {
      get
      {
        return _guid;
      }
      set
      {
        __isset.guid = true;
        this._guid = value;
      }
    }

    public string Title
    {
      get
      {
        return _title;
      }
      set
      {
        __isset.title = true;
        this._title = value;
      }
    }

    public int ContentLength
    {
      get
      {
        return _contentLength;
      }
      set
      {
        __isset.contentLength = true;
        this._contentLength = value;
      }
    }

    public long Created
    {
      get
      {
        return _created;
      }
      set
      {
        __isset.created = true;
        this._created = value;
      }
    }

    public long Updated
    {
      get
      {
        return _updated;
      }
      set
      {
        __isset.updated = true;
        this._updated = value;
      }
    }

    public long Deleted
    {
      get
      {
        return _deleted;
      }
      set
      {
        __isset.deleted = true;
        this._deleted = value;
      }
    }

    public int UpdateSequenceNum
    {
      get
      {
        return _updateSequenceNum;
      }
      set
      {
        __isset.updateSequenceNum = true;
        this._updateSequenceNum = value;
      }
    }

    public string NotebookGuid
    {
      get
      {
        return _notebookGuid;
      }
      set
      {
        __isset.notebookGuid = true;
        this._notebookGuid = value;
      }
    }

    public List<string> TagGuids
    {
      get
      {
        return _tagGuids;
      }
      set
      {
        __isset.tagGuids = true;
        this._tagGuids = value;
      }
    }

    public Evernote.EDAM.Type.NoteAttributes Attributes
    {
      get
      {
        return _attributes;
      }
      set
      {
        __isset.attributes = true;
        this._attributes = value;
      }
    }

    public string LargestResourceMime
    {
      get
      {
        return _largestResourceMime;
      }
      set
      {
        __isset.largestResourceMime = true;
        this._largestResourceMime = value;
      }
    }

    public int LargestResourceSize
    {
      get
      {
        return _largestResourceSize;
      }
      set
      {
        __isset.largestResourceSize = true;
        this._largestResourceSize = value;
      }
    }


    public Isset __isset;
    #if !SILVERLIGHT && !NETFX_CORE
    [Serializable]
    #endif
    public struct Isset {
      public bool guid;
      public bool title;
      public bool contentLength;
      public bool created;
      public bool updated;
      public bool deleted;
      public bool updateSequenceNum;
      public bool notebookGuid;
      public bool tagGuids;
      public bool attributes;
      public bool largestResourceMime;
      public bool largestResourceSize;
    }

    public NoteMetadata() {
    }

    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.String) {
              Guid = iprot.ReadString();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 2:
            if (field.Type == TType.String) {
              Title = iprot.ReadString();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 5:
            if (field.Type == TType.I32) {
              ContentLength = iprot.ReadI32();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 6:
            if (field.Type == TType.I64) {
              Created = iprot.ReadI64();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 7:
            if (field.Type == TType.I64) {
              Updated = iprot.ReadI64();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 8:
            if (field.Type == TType.I64) {
              Deleted = iprot.ReadI64();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 10:
            if (field.Type == TType.I32) {
              UpdateSequenceNum = iprot.ReadI32();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 11:
            if (field.Type == TType.String) {
              NotebookGuid = iprot.ReadString();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 12:
            if (field.Type == TType.List) {
              {
                TagGuids = new List<string>();
                TList _list60 = iprot.ReadListBegin();
                for( int _i61 = 0; _i61 < _list60.Count; ++_i61)
                {
                  string _elem62 = null;
                  _elem62 = iprot.ReadString();
                  TagGuids.Add(_elem62);
                }
                iprot.ReadListEnd();
              }
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 14:
            if (field.Type == TType.Struct) {
              Attributes = new Evernote.EDAM.Type.NoteAttributes();
              Attributes.Read(iprot);
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 20:
            if (field.Type == TType.String) {
              LargestResourceMime = iprot.ReadString();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 21:
            if (field.Type == TType.I32) {
              LargestResourceSize = iprot.ReadI32();
            } 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("NoteMetadata");
      oprot.WriteStructBegin(struc);
      TField field = new TField();
      if (Guid != null && __isset.guid) {
        field.Name = "guid";
        field.Type = TType.String;
        field.ID = 1;
        oprot.WriteFieldBegin(field);
        oprot.WriteString(Guid);
        oprot.WriteFieldEnd();
      }
      if (Title != null && __isset.title) {
        field.Name = "title";
        field.Type = TType.String;
        field.ID = 2;
        oprot.WriteFieldBegin(field);
        oprot.WriteString(Title);
        oprot.WriteFieldEnd();
      }
      if (__isset.contentLength) {
        field.Name = "contentLength";
        field.Type = TType.I32;
        field.ID = 5;
        oprot.WriteFieldBegin(field);
        oprot.WriteI32(ContentLength);
        oprot.WriteFieldEnd();
      }
      if (__isset.created) {
        field.Name = "created";
        field.Type = TType.I64;
        field.ID = 6;
        oprot.WriteFieldBegin(field);
        oprot.WriteI64(Created);
        oprot.WriteFieldEnd();
      }
      if (__isset.updated) {
        field.Name = "updated";
        field.Type = TType.I64;
        field.ID = 7;
        oprot.WriteFieldBegin(field);
        oprot.WriteI64(Updated);
        oprot.WriteFieldEnd();
      }
      if (__isset.deleted) {
        field.Name = "deleted";
        field.Type = TType.I64;
        field.ID = 8;
        oprot.WriteFieldBegin(field);
        oprot.WriteI64(Deleted);
        oprot.WriteFieldEnd();
      }
      if (__isset.updateSequenceNum) {
        field.Name = "updateSequenceNum";
        field.Type = TType.I32;
        field.ID = 10;
        oprot.WriteFieldBegin(field);
        oprot.WriteI32(UpdateSequenceNum);
        oprot.WriteFieldEnd();
      }
      if (NotebookGuid != null && __isset.notebookGuid) {
        field.Name = "notebookGuid";
        field.Type = TType.String;
        field.ID = 11;
        oprot.WriteFieldBegin(field);
        oprot.WriteString(NotebookGuid);
        oprot.WriteFieldEnd();
      }
      if (TagGuids != null && __isset.tagGuids) {
        field.Name = "tagGuids";
        field.Type = TType.List;
        field.ID = 12;
        oprot.WriteFieldBegin(field);
        {
          oprot.WriteListBegin(new TList(TType.String, TagGuids.Count));
          foreach (string _iter63 in TagGuids)
          {
            oprot.WriteString(_iter63);
            oprot.WriteListEnd();
          }
        }
        oprot.WriteFieldEnd();
      }
      if (Attributes != null && __isset.attributes) {
        field.Name = "attributes";
        field.Type = TType.Struct;
        field.ID = 14;
        oprot.WriteFieldBegin(field);
        Attributes.Write(oprot);
        oprot.WriteFieldEnd();
      }
      if (LargestResourceMime != null && __isset.largestResourceMime) {
        field.Name = "largestResourceMime";
        field.Type = TType.String;
        field.ID = 20;
        oprot.WriteFieldBegin(field);
        oprot.WriteString(LargestResourceMime);
        oprot.WriteFieldEnd();
      }
      if (__isset.largestResourceSize) {
        field.Name = "largestResourceSize";
        field.Type = TType.I32;
        field.ID = 21;
        oprot.WriteFieldBegin(field);
        oprot.WriteI32(LargestResourceSize);
        oprot.WriteFieldEnd();
      }
      oprot.WriteFieldStop();
      oprot.WriteStructEnd();
    }

    public override string ToString() {
      StringBuilder sb = new StringBuilder("NoteMetadata(");
      sb.Append("Guid: ");
      sb.Append(Guid);
      sb.Append(",Title: ");
      sb.Append(Title);
      sb.Append(",ContentLength: ");
      sb.Append(ContentLength);
      sb.Append(",Created: ");
      sb.Append(Created);
      sb.Append(",Updated: ");
      sb.Append(Updated);
      sb.Append(",Deleted: ");
      sb.Append(Deleted);
      sb.Append(",UpdateSequenceNum: ");
      sb.Append(UpdateSequenceNum);
      sb.Append(",NotebookGuid: ");
      sb.Append(NotebookGuid);
      sb.Append(",TagGuids: ");
      sb.Append(TagGuids);
      sb.Append(",Attributes: ");
      sb.Append(Attributes== null ? "<null>" : Attributes.ToString());
      sb.Append(",LargestResourceMime: ");
      sb.Append(LargestResourceMime);
      sb.Append(",LargestResourceSize: ");
      sb.Append(LargestResourceSize);
      sb.Append(")");
      return sb.ToString();
    }

  }

}
