/**
 * 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.Type
{

  #if !SILVERLIGHT && !NETFX_CORE
  [Serializable]
  #endif
  public partial class NotebookDescriptor : TBase
  {
    private string _guid;
    private string _notebookDisplayName;
    private string _contactName;
    private bool _hasSharedNotebook;
    private int _joinedUserCount;

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

    public string NotebookDisplayName
    {
      get
      {
        return _notebookDisplayName;
      }
      set
      {
        __isset.notebookDisplayName = true;
        this._notebookDisplayName = value;
      }
    }

    public string ContactName
    {
      get
      {
        return _contactName;
      }
      set
      {
        __isset.contactName = true;
        this._contactName = value;
      }
    }

    public bool HasSharedNotebook
    {
      get
      {
        return _hasSharedNotebook;
      }
      set
      {
        __isset.hasSharedNotebook = true;
        this._hasSharedNotebook = value;
      }
    }

    public int JoinedUserCount
    {
      get
      {
        return _joinedUserCount;
      }
      set
      {
        __isset.joinedUserCount = true;
        this._joinedUserCount = value;
      }
    }


    public Isset __isset;
    #if !SILVERLIGHT && !NETFX_CORE
    [Serializable]
    #endif
    public struct Isset {
      public bool guid;
      public bool notebookDisplayName;
      public bool contactName;
      public bool hasSharedNotebook;
      public bool joinedUserCount;
    }

    public NotebookDescriptor() {
    }

    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) {
              NotebookDisplayName = iprot.ReadString();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 3:
            if (field.Type == TType.String) {
              ContactName = iprot.ReadString();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 4:
            if (field.Type == TType.Bool) {
              HasSharedNotebook = iprot.ReadBool();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 5:
            if (field.Type == TType.I32) {
              JoinedUserCount = 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("NotebookDescriptor");
      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 (NotebookDisplayName != null && __isset.notebookDisplayName) {
        field.Name = "notebookDisplayName";
        field.Type = TType.String;
        field.ID = 2;
        oprot.WriteFieldBegin(field);
        oprot.WriteString(NotebookDisplayName);
        oprot.WriteFieldEnd();
      }
      if (ContactName != null && __isset.contactName) {
        field.Name = "contactName";
        field.Type = TType.String;
        field.ID = 3;
        oprot.WriteFieldBegin(field);
        oprot.WriteString(ContactName);
        oprot.WriteFieldEnd();
      }
      if (__isset.hasSharedNotebook) {
        field.Name = "hasSharedNotebook";
        field.Type = TType.Bool;
        field.ID = 4;
        oprot.WriteFieldBegin(field);
        oprot.WriteBool(HasSharedNotebook);
        oprot.WriteFieldEnd();
      }
      if (__isset.joinedUserCount) {
        field.Name = "joinedUserCount";
        field.Type = TType.I32;
        field.ID = 5;
        oprot.WriteFieldBegin(field);
        oprot.WriteI32(JoinedUserCount);
        oprot.WriteFieldEnd();
      }
      oprot.WriteFieldStop();
      oprot.WriteStructEnd();
    }

    public override string ToString() {
      StringBuilder sb = new StringBuilder("NotebookDescriptor(");
      sb.Append("Guid: ");
      sb.Append(Guid);
      sb.Append(",NotebookDisplayName: ");
      sb.Append(NotebookDisplayName);
      sb.Append(",ContactName: ");
      sb.Append(ContactName);
      sb.Append(",HasSharedNotebook: ");
      sb.Append(HasSharedNotebook);
      sb.Append(",JoinedUserCount: ");
      sb.Append(JoinedUserCount);
      sb.Append(")");
      return sb.ToString();
    }

  }

}
