#
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#

from thrift.Thrift import *

from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
  from thrift.protocol import fastbinary
except:
  fastbinary = None


class DownloadStatus:
  Finished = 0
  Offline = 1
  Online = 2
  Queued = 3
  Skipped = 4
  Waiting = 5
  TempOffline = 6
  Starting = 7
  Failed = 8
  Aborted = 9
  Decrypting = 10
  Custom = 11
  Downloading = 12
  Processing = 13
  Unknown = 14

  _VALUES_TO_NAMES = {
    0: "Finished",
    1: "Offline",
    2: "Online",
    3: "Queued",
    4: "Skipped",
    5: "Waiting",
    6: "TempOffline",
    7: "Starting",
    8: "Failed",
    9: "Aborted",
    10: "Decrypting",
    11: "Custom",
    12: "Downloading",
    13: "Processing",
    14: "Unknown",
  }

  _NAMES_TO_VALUES = {
    "Finished": 0,
    "Offline": 1,
    "Online": 2,
    "Queued": 3,
    "Skipped": 4,
    "Waiting": 5,
    "TempOffline": 6,
    "Starting": 7,
    "Failed": 8,
    "Aborted": 9,
    "Decrypting": 10,
    "Custom": 11,
    "Downloading": 12,
    "Processing": 13,
    "Unknown": 14,
  }

class Destination:
  Queue = 0
  Collector = 1

  _VALUES_TO_NAMES = {
    0: "Queue",
    1: "Collector",
  }

  _NAMES_TO_VALUES = {
    "Queue": 0,
    "Collector": 1,
  }

class ElementType:
  Package = 0
  File = 1

  _VALUES_TO_NAMES = {
    0: "Package",
    1: "File",
  }

  _NAMES_TO_VALUES = {
    "Package": 0,
    "File": 1,
  }


class DownloadInfo:
  """
  Attributes:
   - fid
   - name
   - speed
   - eta
   - format_eta
   - bleft
   - size
   - format_size
   - percent
   - status
   - statusmsg
   - format_wait
   - wait_until
   - packageID
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'fid', None, None, ), # 1
    (2, TType.STRING, 'name', None, None, ), # 2
    (3, TType.I64, 'speed', None, None, ), # 3
    (4, TType.I32, 'eta', None, None, ), # 4
    (5, TType.STRING, 'format_eta', None, None, ), # 5
    (6, TType.I64, 'bleft', None, None, ), # 6
    (7, TType.I64, 'size', None, None, ), # 7
    (8, TType.STRING, 'format_size', None, None, ), # 8
    (9, TType.BYTE, 'percent', None, None, ), # 9
    (10, TType.I32, 'status', None, None, ), # 10
    (11, TType.STRING, 'statusmsg', None, None, ), # 11
    (12, TType.STRING, 'format_wait', None, None, ), # 12
    (13, TType.I64, 'wait_until', None, None, ), # 13
    (14, TType.I32, 'packageID', None, None, ), # 14
  )

  def __init__(self, fid=None, name=None, speed=None, eta=None, format_eta=None, bleft=None, size=None, format_size=None, percent=None, status=None, statusmsg=None, format_wait=None, wait_until=None, packageID=None,):
    self.fid = fid
    self.name = name
    self.speed = speed
    self.eta = eta
    self.format_eta = format_eta
    self.bleft = bleft
    self.size = size
    self.format_size = format_size
    self.percent = percent
    self.status = status
    self.statusmsg = statusmsg
    self.format_wait = format_wait
    self.wait_until = wait_until
    self.packageID = packageID

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I32:
          self.fid = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.speed = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I32:
          self.eta = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.format_eta = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I64:
          self.bleft = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.I64:
          self.size = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.STRING:
          self.format_size = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.BYTE:
          self.percent = iprot.readByte();
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.I32:
          self.status = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.STRING:
          self.statusmsg = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.STRING:
          self.format_wait = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.I64:
          self.wait_until = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.I32:
          self.packageID = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('DownloadInfo')
    if self.fid != None:
      oprot.writeFieldBegin('fid', TType.I32, 1)
      oprot.writeI32(self.fid)
      oprot.writeFieldEnd()
    if self.name != None:
      oprot.writeFieldBegin('name', TType.STRING, 2)
      oprot.writeString(self.name)
      oprot.writeFieldEnd()
    if self.speed != None:
      oprot.writeFieldBegin('speed', TType.I64, 3)
      oprot.writeI64(self.speed)
      oprot.writeFieldEnd()
    if self.eta != None:
      oprot.writeFieldBegin('eta', TType.I32, 4)
      oprot.writeI32(self.eta)
      oprot.writeFieldEnd()
    if self.format_eta != None:
      oprot.writeFieldBegin('format_eta', TType.STRING, 5)
      oprot.writeString(self.format_eta)
      oprot.writeFieldEnd()
    if self.bleft != None:
      oprot.writeFieldBegin('bleft', TType.I64, 6)
      oprot.writeI64(self.bleft)
      oprot.writeFieldEnd()
    if self.size != None:
      oprot.writeFieldBegin('size', TType.I64, 7)
      oprot.writeI64(self.size)
      oprot.writeFieldEnd()
    if self.format_size != None:
      oprot.writeFieldBegin('format_size', TType.STRING, 8)
      oprot.writeString(self.format_size)
      oprot.writeFieldEnd()
    if self.percent != None:
      oprot.writeFieldBegin('percent', TType.BYTE, 9)
      oprot.writeByte(self.percent)
      oprot.writeFieldEnd()
    if self.status != None:
      oprot.writeFieldBegin('status', TType.I32, 10)
      oprot.writeI32(self.status)
      oprot.writeFieldEnd()
    if self.statusmsg != None:
      oprot.writeFieldBegin('statusmsg', TType.STRING, 11)
      oprot.writeString(self.statusmsg)
      oprot.writeFieldEnd()
    if self.format_wait != None:
      oprot.writeFieldBegin('format_wait', TType.STRING, 12)
      oprot.writeString(self.format_wait)
      oprot.writeFieldEnd()
    if self.wait_until != None:
      oprot.writeFieldBegin('wait_until', TType.I64, 13)
      oprot.writeI64(self.wait_until)
      oprot.writeFieldEnd()
    if self.packageID != None:
      oprot.writeFieldBegin('packageID', TType.I32, 14)
      oprot.writeI32(self.packageID)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()
    def validate(self):
      return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class ServerStatus:
  """
  Attributes:
   - pause
   - active
   - queue
   - total
   - speed
   - download
   - reconnect
  """

  thrift_spec = (
    None, # 0
    (1, TType.BOOL, 'pause', None, None, ), # 1
    (2, TType.I16, 'active', None, None, ), # 2
    (3, TType.I16, 'queue', None, None, ), # 3
    (4, TType.I16, 'total', None, None, ), # 4
    (5, TType.I32, 'speed', None, None, ), # 5
    (6, TType.BOOL, 'download', None, None, ), # 6
    (7, TType.BOOL, 'reconnect', None, None, ), # 7
  )

  def __init__(self, pause=None, active=None, queue=None, total=None, speed=None, download=None, reconnect=None,):
    self.pause = pause
    self.active = active
    self.queue = queue
    self.total = total
    self.speed = speed
    self.download = download
    self.reconnect = reconnect

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.BOOL:
          self.pause = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I16:
          self.active = iprot.readI16();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I16:
          self.queue = iprot.readI16();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I16:
          self.total = iprot.readI16();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I32:
          self.speed = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.BOOL:
          self.download = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.BOOL:
          self.reconnect = iprot.readBool();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('ServerStatus')
    if self.pause != None:
      oprot.writeFieldBegin('pause', TType.BOOL, 1)
      oprot.writeBool(self.pause)
      oprot.writeFieldEnd()
    if self.active != None:
      oprot.writeFieldBegin('active', TType.I16, 2)
      oprot.writeI16(self.active)
      oprot.writeFieldEnd()
    if self.queue != None:
      oprot.writeFieldBegin('queue', TType.I16, 3)
      oprot.writeI16(self.queue)
      oprot.writeFieldEnd()
    if self.total != None:
      oprot.writeFieldBegin('total', TType.I16, 4)
      oprot.writeI16(self.total)
      oprot.writeFieldEnd()
    if self.speed != None:
      oprot.writeFieldBegin('speed', TType.I32, 5)
      oprot.writeI32(self.speed)
      oprot.writeFieldEnd()
    if self.download != None:
      oprot.writeFieldBegin('download', TType.BOOL, 6)
      oprot.writeBool(self.download)
      oprot.writeFieldEnd()
    if self.reconnect != None:
      oprot.writeFieldBegin('reconnect', TType.BOOL, 7)
      oprot.writeBool(self.reconnect)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()
    def validate(self):
      return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class ConfigItem:
  """
  Attributes:
   - name
   - description
   - value
   - type
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'name', None, None, ), # 1
    (2, TType.STRING, 'description', None, None, ), # 2
    (3, TType.STRING, 'value', None, None, ), # 3
    (4, TType.STRING, 'type', None, None, ), # 4
  )

  def __init__(self, name=None, description=None, value=None, type=None,):
    self.name = name
    self.description = description
    self.value = value
    self.type = type

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.description = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.value = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.type = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('ConfigItem')
    if self.name != None:
      oprot.writeFieldBegin('name', TType.STRING, 1)
      oprot.writeString(self.name)
      oprot.writeFieldEnd()
    if self.description != None:
      oprot.writeFieldBegin('description', TType.STRING, 2)
      oprot.writeString(self.description)
      oprot.writeFieldEnd()
    if self.value != None:
      oprot.writeFieldBegin('value', TType.STRING, 3)
      oprot.writeString(self.value)
      oprot.writeFieldEnd()
    if self.type != None:
      oprot.writeFieldBegin('type', TType.STRING, 4)
      oprot.writeString(self.type)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()
    def validate(self):
      return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class ConfigSection:
  """
  Attributes:
   - name
   - description
   - items
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'name', None, None, ), # 1
    (2, TType.STRING, 'description', None, None, ), # 2
    (3, TType.LIST, 'items', (TType.STRUCT,(ConfigItem, ConfigItem.thrift_spec)), None, ), # 3
  )

  def __init__(self, name=None, description=None, items=None,):
    self.name = name
    self.description = description
    self.items = items

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.description = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.LIST:
          self.items = []
          (_etype3, _size0) = iprot.readListBegin()
          for _i4 in xrange(_size0):
            _elem5 = ConfigItem()
            _elem5.read(iprot)
            self.items.append(_elem5)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('ConfigSection')
    if self.name != None:
      oprot.writeFieldBegin('name', TType.STRING, 1)
      oprot.writeString(self.name)
      oprot.writeFieldEnd()
    if self.description != None:
      oprot.writeFieldBegin('description', TType.STRING, 2)
      oprot.writeString(self.description)
      oprot.writeFieldEnd()
    if self.items != None:
      oprot.writeFieldBegin('items', TType.LIST, 3)
      oprot.writeListBegin(TType.STRUCT, len(self.items))
      for iter6 in self.items:
        iter6.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()
    def validate(self):
      return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class FileData:
  """
  Attributes:
   - fid
   - url
   - name
   - plugin
   - size
   - format_size
   - status
   - statusmsg
   - packageID
   - error
   - order
   - progress
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'fid', None, None, ), # 1
    (2, TType.STRING, 'url', None, None, ), # 2
    (3, TType.STRING, 'name', None, None, ), # 3
    (4, TType.STRING, 'plugin', None, None, ), # 4
    (5, TType.I64, 'size', None, None, ), # 5
    (6, TType.STRING, 'format_size', None, None, ), # 6
    (7, TType.I32, 'status', None, None, ), # 7
    (8, TType.STRING, 'statusmsg', None, None, ), # 8
    (9, TType.I32, 'packageID', None, None, ), # 9
    (10, TType.STRING, 'error', None, None, ), # 10
    (11, TType.I16, 'order', None, None, ), # 11
    (12, TType.BYTE, 'progress', None, None, ), # 12
  )

  def __init__(self, fid=None, url=None, name=None, plugin=None, size=None, format_size=None, status=None, statusmsg=None, packageID=None, error=None, order=None, progress=None,):
    self.fid = fid
    self.url = url
    self.name = name
    self.plugin = plugin
    self.size = size
    self.format_size = format_size
    self.status = status
    self.statusmsg = statusmsg
    self.packageID = packageID
    self.error = error
    self.order = order
    self.progress = progress

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I32:
          self.fid = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.url = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.plugin = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I64:
          self.size = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRING:
          self.format_size = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.I32:
          self.status = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.STRING:
          self.statusmsg = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.I32:
          self.packageID = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.STRING:
          self.error = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.I16:
          self.order = iprot.readI16();
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.BYTE:
          self.progress = iprot.readByte();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('FileData')
    if self.fid != None:
      oprot.writeFieldBegin('fid', TType.I32, 1)
      oprot.writeI32(self.fid)
      oprot.writeFieldEnd()
    if self.url != None:
      oprot.writeFieldBegin('url', TType.STRING, 2)
      oprot.writeString(self.url)
      oprot.writeFieldEnd()
    if self.name != None:
      oprot.writeFieldBegin('name', TType.STRING, 3)
      oprot.writeString(self.name)
      oprot.writeFieldEnd()
    if self.plugin != None:
      oprot.writeFieldBegin('plugin', TType.STRING, 4)
      oprot.writeString(self.plugin)
      oprot.writeFieldEnd()
    if self.size != None:
      oprot.writeFieldBegin('size', TType.I64, 5)
      oprot.writeI64(self.size)
      oprot.writeFieldEnd()
    if self.format_size != None:
      oprot.writeFieldBegin('format_size', TType.STRING, 6)
      oprot.writeString(self.format_size)
      oprot.writeFieldEnd()
    if self.status != None:
      oprot.writeFieldBegin('status', TType.I32, 7)
      oprot.writeI32(self.status)
      oprot.writeFieldEnd()
    if self.statusmsg != None:
      oprot.writeFieldBegin('statusmsg', TType.STRING, 8)
      oprot.writeString(self.statusmsg)
      oprot.writeFieldEnd()
    if self.packageID != None:
      oprot.writeFieldBegin('packageID', TType.I32, 9)
      oprot.writeI32(self.packageID)
      oprot.writeFieldEnd()
    if self.error != None:
      oprot.writeFieldBegin('error', TType.STRING, 10)
      oprot.writeString(self.error)
      oprot.writeFieldEnd()
    if self.order != None:
      oprot.writeFieldBegin('order', TType.I16, 11)
      oprot.writeI16(self.order)
      oprot.writeFieldEnd()
    if self.progress != None:
      oprot.writeFieldBegin('progress', TType.BYTE, 12)
      oprot.writeByte(self.progress)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()
    def validate(self):
      return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class PackageData:
  """
  Attributes:
   - pid
   - name
   - folder
   - site
   - password
   - dest
   - order
   - priority
   - links
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'pid', None, None, ), # 1
    (2, TType.STRING, 'name', None, None, ), # 2
    (3, TType.STRING, 'folder', None, None, ), # 3
    (4, TType.STRING, 'site', None, None, ), # 4
    (5, TType.STRING, 'password', None, None, ), # 5
    (6, TType.I32, 'dest', None, None, ), # 6
    (7, TType.I16, 'order', None, None, ), # 7
    (8, TType.BYTE, 'priority', None, None, ), # 8
    (9, TType.LIST, 'links', (TType.STRUCT,(FileData, FileData.thrift_spec)), None, ), # 9
  )

  def __init__(self, pid=None, name=None, folder=None, site=None, password=None, dest=None, order=None, priority=None, links=None,):
    self.pid = pid
    self.name = name
    self.folder = folder
    self.site = site
    self.password = password
    self.dest = dest
    self.order = order
    self.priority = priority
    self.links = links

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I32:
          self.pid = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.folder = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.site = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.password = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I32:
          self.dest = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.I16:
          self.order = iprot.readI16();
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.BYTE:
          self.priority = iprot.readByte();
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.LIST:
          self.links = []
          (_etype10, _size7) = iprot.readListBegin()
          for _i11 in xrange(_size7):
            _elem12 = FileData()
            _elem12.read(iprot)
            self.links.append(_elem12)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('PackageData')
    if self.pid != None:
      oprot.writeFieldBegin('pid', TType.I32, 1)
      oprot.writeI32(self.pid)
      oprot.writeFieldEnd()
    if self.name != None:
      oprot.writeFieldBegin('name', TType.STRING, 2)
      oprot.writeString(self.name)
      oprot.writeFieldEnd()
    if self.folder != None:
      oprot.writeFieldBegin('folder', TType.STRING, 3)
      oprot.writeString(self.folder)
      oprot.writeFieldEnd()
    if self.site != None:
      oprot.writeFieldBegin('site', TType.STRING, 4)
      oprot.writeString(self.site)
      oprot.writeFieldEnd()
    if self.password != None:
      oprot.writeFieldBegin('password', TType.STRING, 5)
      oprot.writeString(self.password)
      oprot.writeFieldEnd()
    if self.dest != None:
      oprot.writeFieldBegin('dest', TType.I32, 6)
      oprot.writeI32(self.dest)
      oprot.writeFieldEnd()
    if self.order != None:
      oprot.writeFieldBegin('order', TType.I16, 7)
      oprot.writeI16(self.order)
      oprot.writeFieldEnd()
    if self.priority != None:
      oprot.writeFieldBegin('priority', TType.BYTE, 8)
      oprot.writeByte(self.priority)
      oprot.writeFieldEnd()
    if self.links != None:
      oprot.writeFieldBegin('links', TType.LIST, 9)
      oprot.writeListBegin(TType.STRUCT, len(self.links))
      for iter13 in self.links:
        iter13.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()
    def validate(self):
      return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class PackageInfo:
  """
  Attributes:
   - pid
   - name
   - folder
   - site
   - password
   - dest
   - order
   - priority
   - links
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'pid', None, None, ), # 1
    (2, TType.STRING, 'name', None, None, ), # 2
    (3, TType.STRING, 'folder', None, None, ), # 3
    (4, TType.STRING, 'site', None, None, ), # 4
    (5, TType.STRING, 'password', None, None, ), # 5
    (6, TType.I32, 'dest', None, None, ), # 6
    (7, TType.I16, 'order', None, None, ), # 7
    (8, TType.BYTE, 'priority', None, None, ), # 8
    (9, TType.LIST, 'links', (TType.I32,None), None, ), # 9
  )

  def __init__(self, pid=None, name=None, folder=None, site=None, password=None, dest=None, order=None, priority=None, links=None,):
    self.pid = pid
    self.name = name
    self.folder = folder
    self.site = site
    self.password = password
    self.dest = dest
    self.order = order
    self.priority = priority
    self.links = links

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I32:
          self.pid = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.folder = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.site = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.password = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I32:
          self.dest = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.I16:
          self.order = iprot.readI16();
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.BYTE:
          self.priority = iprot.readByte();
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.LIST:
          self.links = []
          (_etype17, _size14) = iprot.readListBegin()
          for _i18 in xrange(_size14):
            _elem19 = iprot.readI32();
            self.links.append(_elem19)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('PackageInfo')
    if self.pid != None:
      oprot.writeFieldBegin('pid', TType.I32, 1)
      oprot.writeI32(self.pid)
      oprot.writeFieldEnd()
    if self.name != None:
      oprot.writeFieldBegin('name', TType.STRING, 2)
      oprot.writeString(self.name)
      oprot.writeFieldEnd()
    if self.folder != None:
      oprot.writeFieldBegin('folder', TType.STRING, 3)
      oprot.writeString(self.folder)
      oprot.writeFieldEnd()
    if self.site != None:
      oprot.writeFieldBegin('site', TType.STRING, 4)
      oprot.writeString(self.site)
      oprot.writeFieldEnd()
    if self.password != None:
      oprot.writeFieldBegin('password', TType.STRING, 5)
      oprot.writeString(self.password)
      oprot.writeFieldEnd()
    if self.dest != None:
      oprot.writeFieldBegin('dest', TType.I32, 6)
      oprot.writeI32(self.dest)
      oprot.writeFieldEnd()
    if self.order != None:
      oprot.writeFieldBegin('order', TType.I16, 7)
      oprot.writeI16(self.order)
      oprot.writeFieldEnd()
    if self.priority != None:
      oprot.writeFieldBegin('priority', TType.BYTE, 8)
      oprot.writeByte(self.priority)
      oprot.writeFieldEnd()
    if self.links != None:
      oprot.writeFieldBegin('links', TType.LIST, 9)
      oprot.writeListBegin(TType.I32, len(self.links))
      for iter20 in self.links:
        oprot.writeI32(iter20)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()
    def validate(self):
      return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class CaptchaTask:
  """
  Attributes:
   - tid
   - data
   - type
   - resultType
  """

  thrift_spec = (
    None, # 0
    (1, TType.I16, 'tid', None, None, ), # 1
    (2, TType.STRING, 'data', None, None, ), # 2
    (3, TType.STRING, 'type', None, None, ), # 3
    (4, TType.STRING, 'resultType', None, None, ), # 4
  )

  def __init__(self, tid=None, data=None, type=None, resultType=None,):
    self.tid = tid
    self.data = data
    self.type = type
    self.resultType = resultType

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I16:
          self.tid = iprot.readI16();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.data = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.type = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.resultType = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('CaptchaTask')
    if self.tid != None:
      oprot.writeFieldBegin('tid', TType.I16, 1)
      oprot.writeI16(self.tid)
      oprot.writeFieldEnd()
    if self.data != None:
      oprot.writeFieldBegin('data', TType.STRING, 2)
      oprot.writeString(self.data)
      oprot.writeFieldEnd()
    if self.type != None:
      oprot.writeFieldBegin('type', TType.STRING, 3)
      oprot.writeString(self.type)
      oprot.writeFieldEnd()
    if self.resultType != None:
      oprot.writeFieldBegin('resultType', TType.STRING, 4)
      oprot.writeString(self.resultType)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()
    def validate(self):
      return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class Event:
  """
  Attributes:
   - event
   - id
   - type
   - destination
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'event', None, None, ), # 1
    (2, TType.I32, 'id', None, None, ), # 2
    (3, TType.I32, 'type', None, None, ), # 3
    (4, TType.I32, 'destination', None, None, ), # 4
  )

  def __init__(self, event=None, id=None, type=None, destination=None,):
    self.event = event
    self.id = id
    self.type = type
    self.destination = destination

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.event = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.id = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I32:
          self.type = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I32:
          self.destination = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('Event')
    if self.event != None:
      oprot.writeFieldBegin('event', TType.STRING, 1)
      oprot.writeString(self.event)
      oprot.writeFieldEnd()
    if self.id != None:
      oprot.writeFieldBegin('id', TType.I32, 2)
      oprot.writeI32(self.id)
      oprot.writeFieldEnd()
    if self.type != None:
      oprot.writeFieldBegin('type', TType.I32, 3)
      oprot.writeI32(self.type)
      oprot.writeFieldEnd()
    if self.destination != None:
      oprot.writeFieldBegin('destination', TType.I32, 4)
      oprot.writeI32(self.destination)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()
    def validate(self):
      return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class UserData:
  """
  Attributes:
   - name
   - email
   - role
   - permission
   - template
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'name', None, None, ), # 1
    (2, TType.STRING, 'email', None, None, ), # 2
    (3, TType.I32, 'role', None, None, ), # 3
    (4, TType.I32, 'permission', None, None, ), # 4
    (5, TType.STRING, 'template', None, None, ), # 5
  )

  def __init__(self, name=None, email=None, role=None, permission=None, template=None,):
    self.name = name
    self.email = email
    self.role = role
    self.permission = permission
    self.template = template

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.email = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I32:
          self.role = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I32:
          self.permission = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.template = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('UserData')
    if self.name != None:
      oprot.writeFieldBegin('name', TType.STRING, 1)
      oprot.writeString(self.name)
      oprot.writeFieldEnd()
    if self.email != None:
      oprot.writeFieldBegin('email', TType.STRING, 2)
      oprot.writeString(self.email)
      oprot.writeFieldEnd()
    if self.role != None:
      oprot.writeFieldBegin('role', TType.I32, 3)
      oprot.writeI32(self.role)
      oprot.writeFieldEnd()
    if self.permission != None:
      oprot.writeFieldBegin('permission', TType.I32, 4)
      oprot.writeI32(self.permission)
      oprot.writeFieldEnd()
    if self.template != None:
      oprot.writeFieldBegin('template', TType.STRING, 5)
      oprot.writeString(self.template)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()
    def validate(self):
      return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class AccountInfo:
  """
  Attributes:
   - validuntil
   - login
   - options
   - valid
   - trafficleft
   - maxtraffic
   - premium
   - type
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'validuntil', None, None, ), # 1
    (2, TType.STRING, 'login', None, None, ), # 2
    (3, TType.MAP, 'options', (TType.STRING,None,TType.STRING,None), None, ), # 3
    (4, TType.BOOL, 'valid', None, None, ), # 4
    (5, TType.I64, 'trafficleft', None, None, ), # 5
    (6, TType.I64, 'maxtraffic', None, None, ), # 6
    (7, TType.BOOL, 'premium', None, None, ), # 7
    (8, TType.STRING, 'type', None, None, ), # 8
  )

  def __init__(self, validuntil=None, login=None, options=None, valid=None, trafficleft=None, maxtraffic=None, premium=None, type=None,):
    self.validuntil = validuntil
    self.login = login
    self.options = options
    self.valid = valid
    self.trafficleft = trafficleft
    self.maxtraffic = maxtraffic
    self.premium = premium
    self.type = type

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.validuntil = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.login = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.MAP:
          self.options = {}
          (_ktype22, _vtype23, _size21 ) = iprot.readMapBegin() 
          for _i25 in xrange(_size21):
            _key26 = iprot.readString();
            _val27 = iprot.readString();
            self.options[_key26] = _val27
          iprot.readMapEnd()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.BOOL:
          self.valid = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I64:
          self.trafficleft = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I64:
          self.maxtraffic = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.BOOL:
          self.premium = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.STRING:
          self.type = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('AccountInfo')
    if self.validuntil != None:
      oprot.writeFieldBegin('validuntil', TType.I64, 1)
      oprot.writeI64(self.validuntil)
      oprot.writeFieldEnd()
    if self.login != None:
      oprot.writeFieldBegin('login', TType.STRING, 2)
      oprot.writeString(self.login)
      oprot.writeFieldEnd()
    if self.options != None:
      oprot.writeFieldBegin('options', TType.MAP, 3)
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.options))
      for kiter28,viter29 in self.options.items():
        oprot.writeString(kiter28)
        oprot.writeString(viter29)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    if self.valid != None:
      oprot.writeFieldBegin('valid', TType.BOOL, 4)
      oprot.writeBool(self.valid)
      oprot.writeFieldEnd()
    if self.trafficleft != None:
      oprot.writeFieldBegin('trafficleft', TType.I64, 5)
      oprot.writeI64(self.trafficleft)
      oprot.writeFieldEnd()
    if self.maxtraffic != None:
      oprot.writeFieldBegin('maxtraffic', TType.I64, 6)
      oprot.writeI64(self.maxtraffic)
      oprot.writeFieldEnd()
    if self.premium != None:
      oprot.writeFieldBegin('premium', TType.BOOL, 7)
      oprot.writeBool(self.premium)
      oprot.writeFieldEnd()
    if self.type != None:
      oprot.writeFieldBegin('type', TType.STRING, 8)
      oprot.writeString(self.type)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()
    def validate(self):
      return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class AccountData:
  """
  Attributes:
   - type
   - login
   - password
   - options
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'type', None, None, ), # 1
    (2, TType.STRING, 'login', None, None, ), # 2
    (3, TType.STRING, 'password', None, None, ), # 3
    (4, TType.MAP, 'options', (TType.STRING,None,TType.STRING,None), None, ), # 4
  )

  def __init__(self, type=None, login=None, password=None, options=None,):
    self.type = type
    self.login = login
    self.password = password
    self.options = options

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.type = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.login = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.password = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.MAP:
          self.options = {}
          (_ktype31, _vtype32, _size30 ) = iprot.readMapBegin() 
          for _i34 in xrange(_size30):
            _key35 = iprot.readString();
            _val36 = iprot.readString();
            self.options[_key35] = _val36
          iprot.readMapEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('AccountData')
    if self.type != None:
      oprot.writeFieldBegin('type', TType.STRING, 1)
      oprot.writeString(self.type)
      oprot.writeFieldEnd()
    if self.login != None:
      oprot.writeFieldBegin('login', TType.STRING, 2)
      oprot.writeString(self.login)
      oprot.writeFieldEnd()
    if self.password != None:
      oprot.writeFieldBegin('password', TType.STRING, 3)
      oprot.writeString(self.password)
      oprot.writeFieldEnd()
    if self.options != None:
      oprot.writeFieldBegin('options', TType.MAP, 4)
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.options))
      for kiter37,viter38 in self.options.items():
        oprot.writeString(kiter37)
        oprot.writeString(viter38)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()
    def validate(self):
      return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class ServiceInfo:
  """
  Attributes:
   - funcs
  """

  thrift_spec = (
    None, # 0
    (1, TType.MAP, 'funcs', (TType.STRING,None,TType.STRING,None), None, ), # 1
  )

  def __init__(self, funcs=None,):
    self.funcs = funcs

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.MAP:
          self.funcs = {}
          (_ktype40, _vtype41, _size39 ) = iprot.readMapBegin() 
          for _i43 in xrange(_size39):
            _key44 = iprot.readString();
            _val45 = iprot.readString();
            self.funcs[_key44] = _val45
          iprot.readMapEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('ServiceInfo')
    if self.funcs != None:
      oprot.writeFieldBegin('funcs', TType.MAP, 1)
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.funcs))
      for kiter46,viter47 in self.funcs.items():
        oprot.writeString(kiter46)
        oprot.writeString(viter47)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()
    def validate(self):
      return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class ServiceCall:
  """
  Attributes:
   - plugin
   - func
   - arguments
   - parseArguments
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'plugin', None, None, ), # 1
    (2, TType.STRING, 'func', None, None, ), # 2
    (3, TType.LIST, 'arguments', (TType.STRING,None), None, ), # 3
    (4, TType.BOOL, 'parseArguments', None, None, ), # 4
  )

  def __init__(self, plugin=None, func=None, arguments=None, parseArguments=None,):
    self.plugin = plugin
    self.func = func
    self.arguments = arguments
    self.parseArguments = parseArguments

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.plugin = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.func = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.LIST:
          self.arguments = []
          (_etype51, _size48) = iprot.readListBegin()
          for _i52 in xrange(_size48):
            _elem53 = iprot.readString();
            self.arguments.append(_elem53)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.BOOL:
          self.parseArguments = iprot.readBool();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('ServiceCall')
    if self.plugin != None:
      oprot.writeFieldBegin('plugin', TType.STRING, 1)
      oprot.writeString(self.plugin)
      oprot.writeFieldEnd()
    if self.func != None:
      oprot.writeFieldBegin('func', TType.STRING, 2)
      oprot.writeString(self.func)
      oprot.writeFieldEnd()
    if self.arguments != None:
      oprot.writeFieldBegin('arguments', TType.LIST, 3)
      oprot.writeListBegin(TType.STRING, len(self.arguments))
      for iter54 in self.arguments:
        oprot.writeString(iter54)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.parseArguments != None:
      oprot.writeFieldBegin('parseArguments', TType.BOOL, 4)
      oprot.writeBool(self.parseArguments)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()
    def validate(self):
      return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class PackageDoesNotExists(Exception):
  """
  Attributes:
   - pid
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'pid', None, None, ), # 1
  )

  def __init__(self, pid=None,):
    self.pid = pid

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I32:
          self.pid = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('PackageDoesNotExists')
    if self.pid != None:
      oprot.writeFieldBegin('pid', TType.I32, 1)
      oprot.writeI32(self.pid)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()
    def validate(self):
      return


  def __str__(self):
    return repr(self)

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class FileDoesNotExists(Exception):
  """
  Attributes:
   - fid
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'fid', None, None, ), # 1
  )

  def __init__(self, fid=None,):
    self.fid = fid

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I32:
          self.fid = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('FileDoesNotExists')
    if self.fid != None:
      oprot.writeFieldBegin('fid', TType.I32, 1)
      oprot.writeI32(self.fid)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()
    def validate(self):
      return


  def __str__(self):
    return repr(self)

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class ServiceDoesNotExists(Exception):
  """
  Attributes:
   - plugin
   - func
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'plugin', None, None, ), # 1
    (2, TType.STRING, 'func', None, None, ), # 2
  )

  def __init__(self, plugin=None, func=None,):
    self.plugin = plugin
    self.func = func

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.plugin = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.func = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('ServiceDoesNotExists')
    if self.plugin != None:
      oprot.writeFieldBegin('plugin', TType.STRING, 1)
      oprot.writeString(self.plugin)
      oprot.writeFieldEnd()
    if self.func != None:
      oprot.writeFieldBegin('func', TType.STRING, 2)
      oprot.writeString(self.func)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()
    def validate(self):
      return


  def __str__(self):
    return repr(self)

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class ServiceException(Exception):
  """
  Attributes:
   - msg
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'msg', None, None, ), # 1
  )

  def __init__(self, msg=None,):
    self.msg = msg

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.msg = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('ServiceException')
    if self.msg != None:
      oprot.writeFieldBegin('msg', TType.STRING, 1)
      oprot.writeString(self.msg)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()
    def validate(self):
      return


  def __str__(self):
    return repr(self)

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)
