/**
 * 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 NoteEmailParameters : TBase
  {
    private string _guid;
    private Evernote.EDAM.Type.Note _note;
    private List<string> _toAddresses;
    private List<string> _ccAddresses;
    private string _subject;
    private string _message;

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

    public Evernote.EDAM.Type.Note Note
    {
      get
      {
        return _note;
      }
      set
      {
        __isset.note = true;
        this._note = value;
      }
    }

    public List<string> ToAddresses
    {
      get
      {
        return _toAddresses;
      }
      set
      {
        __isset.toAddresses = true;
        this._toAddresses = value;
      }
    }

    public List<string> CcAddresses
    {
      get
      {
        return _ccAddresses;
      }
      set
      {
        __isset.ccAddresses = true;
        this._ccAddresses = value;
      }
    }

    public string Subject
    {
      get
      {
        return _subject;
      }
      set
      {
        __isset.subject = true;
        this._subject = value;
      }
    }

    public string Message
    {
      get
      {
        return _message;
      }
      set
      {
        __isset.message = true;
        this._message = value;
      }
    }


    public Isset __isset;
    #if !SILVERLIGHT && !NETFX_CORE
    [Serializable]
    #endif
    public struct Isset {
      public bool guid;
      public bool note;
      public bool toAddresses;
      public bool ccAddresses;
      public bool subject;
      public bool message;
    }

    public NoteEmailParameters() {
    }

    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.Struct) {
              Note = new Evernote.EDAM.Type.Note();
              Note.Read(iprot);
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 3:
            if (field.Type == TType.List) {
              {
                ToAddresses = new List<string>();
                TList _list86 = iprot.ReadListBegin();
                for( int _i87 = 0; _i87 < _list86.Count; ++_i87)
                {
                  string _elem88 = null;
                  _elem88 = iprot.ReadString();
                  ToAddresses.Add(_elem88);
                }
                iprot.ReadListEnd();
              }
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 4:
            if (field.Type == TType.List) {
              {
                CcAddresses = new List<string>();
                TList _list89 = iprot.ReadListBegin();
                for( int _i90 = 0; _i90 < _list89.Count; ++_i90)
                {
                  string _elem91 = null;
                  _elem91 = iprot.ReadString();
                  CcAddresses.Add(_elem91);
                }
                iprot.ReadListEnd();
              }
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 5:
            if (field.Type == TType.String) {
              Subject = iprot.ReadString();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 6:
            if (field.Type == TType.String) {
              Message = iprot.ReadString();
            } 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("NoteEmailParameters");
      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 (Note != null && __isset.note) {
        field.Name = "note";
        field.Type = TType.Struct;
        field.ID = 2;
        oprot.WriteFieldBegin(field);
        Note.Write(oprot);
        oprot.WriteFieldEnd();
      }
      if (ToAddresses != null && __isset.toAddresses) {
        field.Name = "toAddresses";
        field.Type = TType.List;
        field.ID = 3;
        oprot.WriteFieldBegin(field);
        {
          oprot.WriteListBegin(new TList(TType.String, ToAddresses.Count));
          foreach (string _iter92 in ToAddresses)
          {
            oprot.WriteString(_iter92);
            oprot.WriteListEnd();
          }
        }
        oprot.WriteFieldEnd();
      }
      if (CcAddresses != null && __isset.ccAddresses) {
        field.Name = "ccAddresses";
        field.Type = TType.List;
        field.ID = 4;
        oprot.WriteFieldBegin(field);
        {
          oprot.WriteListBegin(new TList(TType.String, CcAddresses.Count));
          foreach (string _iter93 in CcAddresses)
          {
            oprot.WriteString(_iter93);
            oprot.WriteListEnd();
          }
        }
        oprot.WriteFieldEnd();
      }
      if (Subject != null && __isset.subject) {
        field.Name = "subject";
        field.Type = TType.String;
        field.ID = 5;
        oprot.WriteFieldBegin(field);
        oprot.WriteString(Subject);
        oprot.WriteFieldEnd();
      }
      if (Message != null && __isset.message) {
        field.Name = "message";
        field.Type = TType.String;
        field.ID = 6;
        oprot.WriteFieldBegin(field);
        oprot.WriteString(Message);
        oprot.WriteFieldEnd();
      }
      oprot.WriteFieldStop();
      oprot.WriteStructEnd();
    }

    public override string ToString() {
      StringBuilder sb = new StringBuilder("NoteEmailParameters(");
      sb.Append("Guid: ");
      sb.Append(Guid);
      sb.Append(",Note: ");
      sb.Append(Note== null ? "<null>" : Note.ToString());
      sb.Append(",ToAddresses: ");
      sb.Append(ToAddresses);
      sb.Append(",CcAddresses: ");
      sb.Append(CcAddresses);
      sb.Append(",Subject: ");
      sb.Append(Subject);
      sb.Append(",Message: ");
      sb.Append(Message);
      sb.Append(")");
      return sb.ToString();
    }

  }

}
