/**
 * 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 BusinessNotebook : TBase
  {
    private string _notebookDescription;
    private SharedNotebookPrivilegeLevel _privilege;
    private bool _recommended;

    public string NotebookDescription
    {
      get
      {
        return _notebookDescription;
      }
      set
      {
        __isset.notebookDescription = true;
        this._notebookDescription = value;
      }
    }

    public SharedNotebookPrivilegeLevel Privilege
    {
      get
      {
        return _privilege;
      }
      set
      {
        __isset.privilege = true;
        this._privilege = value;
      }
    }

    public bool Recommended
    {
      get
      {
        return _recommended;
      }
      set
      {
        __isset.recommended = true;
        this._recommended = value;
      }
    }


    public Isset __isset;
    #if !SILVERLIGHT && !NETFX_CORE
    [Serializable]
    #endif
    public struct Isset {
      public bool notebookDescription;
      public bool privilege;
      public bool recommended;
    }

    public BusinessNotebook() {
    }

    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) {
              NotebookDescription = iprot.ReadString();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 2:
            if (field.Type == TType.I32) {
              Privilege = (SharedNotebookPrivilegeLevel)iprot.ReadI32();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 3:
            if (field.Type == TType.Bool) {
              Recommended = iprot.ReadBool();
            } 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("BusinessNotebook");
      oprot.WriteStructBegin(struc);
      TField field = new TField();
      if (NotebookDescription != null && __isset.notebookDescription) {
        field.Name = "notebookDescription";
        field.Type = TType.String;
        field.ID = 1;
        oprot.WriteFieldBegin(field);
        oprot.WriteString(NotebookDescription);
        oprot.WriteFieldEnd();
      }
      if (__isset.privilege) {
        field.Name = "privilege";
        field.Type = TType.I32;
        field.ID = 2;
        oprot.WriteFieldBegin(field);
        oprot.WriteI32((int)Privilege);
        oprot.WriteFieldEnd();
      }
      if (__isset.recommended) {
        field.Name = "recommended";
        field.Type = TType.Bool;
        field.ID = 3;
        oprot.WriteFieldBegin(field);
        oprot.WriteBool(Recommended);
        oprot.WriteFieldEnd();
      }
      oprot.WriteFieldStop();
      oprot.WriteStructEnd();
    }

    public override string ToString() {
      StringBuilder sb = new StringBuilder("BusinessNotebook(");
      sb.Append("NotebookDescription: ");
      sb.Append(NotebookDescription);
      sb.Append(",Privilege: ");
      sb.Append(Privilege);
      sb.Append(",Recommended: ");
      sb.Append(Recommended);
      sb.Append(")");
      return sb.ToString();
    }

  }

}
