/**
 * 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 PremiumInfo : TBase
  {
    private long _currentTime;
    private bool _premium;
    private bool _premiumRecurring;
    private long _premiumExpirationDate;
    private bool _premiumExtendable;
    private bool _premiumPending;
    private bool _premiumCancellationPending;
    private bool _canPurchaseUploadAllowance;
    private string _sponsoredGroupName;
    private SponsoredGroupRole _sponsoredGroupRole;
    private bool _premiumUpgradable;

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

    public bool Premium
    {
      get
      {
        return _premium;
      }
      set
      {
        __isset.premium = true;
        this._premium = value;
      }
    }

    public bool PremiumRecurring
    {
      get
      {
        return _premiumRecurring;
      }
      set
      {
        __isset.premiumRecurring = true;
        this._premiumRecurring = value;
      }
    }

    public long PremiumExpirationDate
    {
      get
      {
        return _premiumExpirationDate;
      }
      set
      {
        __isset.premiumExpirationDate = true;
        this._premiumExpirationDate = value;
      }
    }

    public bool PremiumExtendable
    {
      get
      {
        return _premiumExtendable;
      }
      set
      {
        __isset.premiumExtendable = true;
        this._premiumExtendable = value;
      }
    }

    public bool PremiumPending
    {
      get
      {
        return _premiumPending;
      }
      set
      {
        __isset.premiumPending = true;
        this._premiumPending = value;
      }
    }

    public bool PremiumCancellationPending
    {
      get
      {
        return _premiumCancellationPending;
      }
      set
      {
        __isset.premiumCancellationPending = true;
        this._premiumCancellationPending = value;
      }
    }

    public bool CanPurchaseUploadAllowance
    {
      get
      {
        return _canPurchaseUploadAllowance;
      }
      set
      {
        __isset.canPurchaseUploadAllowance = true;
        this._canPurchaseUploadAllowance = value;
      }
    }

    public string SponsoredGroupName
    {
      get
      {
        return _sponsoredGroupName;
      }
      set
      {
        __isset.sponsoredGroupName = true;
        this._sponsoredGroupName = value;
      }
    }

    public SponsoredGroupRole SponsoredGroupRole
    {
      get
      {
        return _sponsoredGroupRole;
      }
      set
      {
        __isset.sponsoredGroupRole = true;
        this._sponsoredGroupRole = value;
      }
    }

    public bool PremiumUpgradable
    {
      get
      {
        return _premiumUpgradable;
      }
      set
      {
        __isset.premiumUpgradable = true;
        this._premiumUpgradable = value;
      }
    }


    public Isset __isset;
    #if !SILVERLIGHT && !NETFX_CORE
    [Serializable]
    #endif
    public struct Isset {
      public bool currentTime;
      public bool premium;
      public bool premiumRecurring;
      public bool premiumExpirationDate;
      public bool premiumExtendable;
      public bool premiumPending;
      public bool premiumCancellationPending;
      public bool canPurchaseUploadAllowance;
      public bool sponsoredGroupName;
      public bool sponsoredGroupRole;
      public bool premiumUpgradable;
    }

    public PremiumInfo() {
    }

    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.Bool) {
              Premium = iprot.ReadBool();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 3:
            if (field.Type == TType.Bool) {
              PremiumRecurring = iprot.ReadBool();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 4:
            if (field.Type == TType.I64) {
              PremiumExpirationDate = iprot.ReadI64();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 5:
            if (field.Type == TType.Bool) {
              PremiumExtendable = iprot.ReadBool();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 6:
            if (field.Type == TType.Bool) {
              PremiumPending = iprot.ReadBool();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 7:
            if (field.Type == TType.Bool) {
              PremiumCancellationPending = iprot.ReadBool();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 8:
            if (field.Type == TType.Bool) {
              CanPurchaseUploadAllowance = iprot.ReadBool();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 9:
            if (field.Type == TType.String) {
              SponsoredGroupName = iprot.ReadString();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 10:
            if (field.Type == TType.I32) {
              SponsoredGroupRole = (SponsoredGroupRole)iprot.ReadI32();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 11:
            if (field.Type == TType.Bool) {
              PremiumUpgradable = 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("PremiumInfo");
      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.premium) {
        field.Name = "premium";
        field.Type = TType.Bool;
        field.ID = 2;
        oprot.WriteFieldBegin(field);
        oprot.WriteBool(Premium);
        oprot.WriteFieldEnd();
      }
      if (__isset.premiumRecurring) {
        field.Name = "premiumRecurring";
        field.Type = TType.Bool;
        field.ID = 3;
        oprot.WriteFieldBegin(field);
        oprot.WriteBool(PremiumRecurring);
        oprot.WriteFieldEnd();
      }
      if (__isset.premiumExpirationDate) {
        field.Name = "premiumExpirationDate";
        field.Type = TType.I64;
        field.ID = 4;
        oprot.WriteFieldBegin(field);
        oprot.WriteI64(PremiumExpirationDate);
        oprot.WriteFieldEnd();
      }
      if (__isset.premiumExtendable) {
        field.Name = "premiumExtendable";
        field.Type = TType.Bool;
        field.ID = 5;
        oprot.WriteFieldBegin(field);
        oprot.WriteBool(PremiumExtendable);
        oprot.WriteFieldEnd();
      }
      if (__isset.premiumPending) {
        field.Name = "premiumPending";
        field.Type = TType.Bool;
        field.ID = 6;
        oprot.WriteFieldBegin(field);
        oprot.WriteBool(PremiumPending);
        oprot.WriteFieldEnd();
      }
      if (__isset.premiumCancellationPending) {
        field.Name = "premiumCancellationPending";
        field.Type = TType.Bool;
        field.ID = 7;
        oprot.WriteFieldBegin(field);
        oprot.WriteBool(PremiumCancellationPending);
        oprot.WriteFieldEnd();
      }
      if (__isset.canPurchaseUploadAllowance) {
        field.Name = "canPurchaseUploadAllowance";
        field.Type = TType.Bool;
        field.ID = 8;
        oprot.WriteFieldBegin(field);
        oprot.WriteBool(CanPurchaseUploadAllowance);
        oprot.WriteFieldEnd();
      }
      if (SponsoredGroupName != null && __isset.sponsoredGroupName) {
        field.Name = "sponsoredGroupName";
        field.Type = TType.String;
        field.ID = 9;
        oprot.WriteFieldBegin(field);
        oprot.WriteString(SponsoredGroupName);
        oprot.WriteFieldEnd();
      }
      if (__isset.sponsoredGroupRole) {
        field.Name = "sponsoredGroupRole";
        field.Type = TType.I32;
        field.ID = 10;
        oprot.WriteFieldBegin(field);
        oprot.WriteI32((int)SponsoredGroupRole);
        oprot.WriteFieldEnd();
      }
      if (__isset.premiumUpgradable) {
        field.Name = "premiumUpgradable";
        field.Type = TType.Bool;
        field.ID = 11;
        oprot.WriteFieldBegin(field);
        oprot.WriteBool(PremiumUpgradable);
        oprot.WriteFieldEnd();
      }
      oprot.WriteFieldStop();
      oprot.WriteStructEnd();
    }

    public override string ToString() {
      StringBuilder sb = new StringBuilder("PremiumInfo(");
      sb.Append("CurrentTime: ");
      sb.Append(CurrentTime);
      sb.Append(",Premium: ");
      sb.Append(Premium);
      sb.Append(",PremiumRecurring: ");
      sb.Append(PremiumRecurring);
      sb.Append(",PremiumExpirationDate: ");
      sb.Append(PremiumExpirationDate);
      sb.Append(",PremiumExtendable: ");
      sb.Append(PremiumExtendable);
      sb.Append(",PremiumPending: ");
      sb.Append(PremiumPending);
      sb.Append(",PremiumCancellationPending: ");
      sb.Append(PremiumCancellationPending);
      sb.Append(",CanPurchaseUploadAllowance: ");
      sb.Append(CanPurchaseUploadAllowance);
      sb.Append(",SponsoredGroupName: ");
      sb.Append(SponsoredGroupName);
      sb.Append(",SponsoredGroupRole: ");
      sb.Append(SponsoredGroupRole);
      sb.Append(",PremiumUpgradable: ");
      sb.Append(PremiumUpgradable);
      sb.Append(")");
      return sb.ToString();
    }

  }

}
