#
# Autogenerated by Thrift Compiler (0.9.1)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
#  options string: py
#

from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
  from thrift.protocol import fastbinary
except:
  fastbinary = None


class Iface:
  def performBackup(self, authInfo):
    """
    Parameters:
     - authInfo
    """
    pass

  def getBackupIds(self, authInfo):
    """
    Parameters:
     - authInfo
    """
    pass

  def getBackup(self, authInfo, backupId):
    """
    Parameters:
     - authInfo
     - backupId
    """
    pass

  def getBackupData(self, authInfo, backup, offset, maximumSize):
    """
    Parameters:
     - authInfo
     - backup
     - offset
     - maximumSize
    """
    pass

  def deleteBackup(self, authInfo, backup):
    """
    Parameters:
     - authInfo
     - backup
    """
    pass


class Client(Iface):
  def __init__(self, iprot, oprot=None):
    self._iprot = self._oprot = iprot
    if oprot is not None:
      self._oprot = oprot
    self._seqid = 0

  def performBackup(self, authInfo):
    """
    Parameters:
     - authInfo
    """
    self.send_performBackup(authInfo)
    return self.recv_performBackup()

  def send_performBackup(self, authInfo):
    self._oprot.writeMessageBegin('performBackup', TMessageType.CALL, self._seqid)
    args = performBackup_args()
    args.authInfo = authInfo
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_performBackup(self):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = performBackup_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.ce is not None:
      raise result.ce
    raise TApplicationException(TApplicationException.MISSING_RESULT, "performBackup failed: unknown result");

  def getBackupIds(self, authInfo):
    """
    Parameters:
     - authInfo
    """
    self.send_getBackupIds(authInfo)
    return self.recv_getBackupIds()

  def send_getBackupIds(self, authInfo):
    self._oprot.writeMessageBegin('getBackupIds', TMessageType.CALL, self._seqid)
    args = getBackupIds_args()
    args.authInfo = authInfo
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getBackupIds(self):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getBackupIds_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.ce is not None:
      raise result.ce
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getBackupIds failed: unknown result");

  def getBackup(self, authInfo, backupId):
    """
    Parameters:
     - authInfo
     - backupId
    """
    self.send_getBackup(authInfo, backupId)
    return self.recv_getBackup()

  def send_getBackup(self, authInfo, backupId):
    self._oprot.writeMessageBegin('getBackup', TMessageType.CALL, self._seqid)
    args = getBackup_args()
    args.authInfo = authInfo
    args.backupId = backupId
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getBackup(self):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getBackup_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.ce is not None:
      raise result.ce
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getBackup failed: unknown result");

  def getBackupData(self, authInfo, backup, offset, maximumSize):
    """
    Parameters:
     - authInfo
     - backup
     - offset
     - maximumSize
    """
    self.send_getBackupData(authInfo, backup, offset, maximumSize)
    return self.recv_getBackupData()

  def send_getBackupData(self, authInfo, backup, offset, maximumSize):
    self._oprot.writeMessageBegin('getBackupData', TMessageType.CALL, self._seqid)
    args = getBackupData_args()
    args.authInfo = authInfo
    args.backup = backup
    args.offset = offset
    args.maximumSize = maximumSize
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getBackupData(self):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getBackupData_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.ce is not None:
      raise result.ce
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getBackupData failed: unknown result");

  def deleteBackup(self, authInfo, backup):
    """
    Parameters:
     - authInfo
     - backup
    """
    self.send_deleteBackup(authInfo, backup)
    self.recv_deleteBackup()

  def send_deleteBackup(self, authInfo, backup):
    self._oprot.writeMessageBegin('deleteBackup', TMessageType.CALL, self._seqid)
    args = deleteBackup_args()
    args.authInfo = authInfo
    args.backup = backup
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_deleteBackup(self):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = deleteBackup_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.ke is not None:
      raise result.ke
    if result.ae is not None:
      raise result.ae
    if result.ce is not None:
      raise result.ce
    return


class Processor(Iface, TProcessor):
  def __init__(self, handler):
    self._handler = handler
    self._processMap = {}
    self._processMap["performBackup"] = Processor.process_performBackup
    self._processMap["getBackupIds"] = Processor.process_getBackupIds
    self._processMap["getBackup"] = Processor.process_getBackup
    self._processMap["getBackupData"] = Processor.process_getBackupData
    self._processMap["deleteBackup"] = Processor.process_deleteBackup

  def process(self, iprot, oprot):
    (name, type, seqid) = iprot.readMessageBegin()
    if name not in self._processMap:
      iprot.skip(TType.STRUCT)
      iprot.readMessageEnd()
      x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
      oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
      x.write(oprot)
      oprot.writeMessageEnd()
      oprot.trans.flush()
      return
    else:
      self._processMap[name](self, seqid, iprot, oprot)
    return True

  def process_performBackup(self, seqid, iprot, oprot):
    args = performBackup_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = performBackup_result()
    try:
      result.success = self._handler.performBackup(args.authInfo)
    except koverse.thriftgen.ttypes.TKoverseException, ke:
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException, ae:
      result.ae = ae
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException, ce:
      result.ce = ce
    oprot.writeMessageBegin("performBackup", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getBackupIds(self, seqid, iprot, oprot):
    args = getBackupIds_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getBackupIds_result()
    try:
      result.success = self._handler.getBackupIds(args.authInfo)
    except koverse.thriftgen.ttypes.TKoverseException, ke:
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException, ae:
      result.ae = ae
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException, ce:
      result.ce = ce
    oprot.writeMessageBegin("getBackupIds", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getBackup(self, seqid, iprot, oprot):
    args = getBackup_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getBackup_result()
    try:
      result.success = self._handler.getBackup(args.authInfo, args.backupId)
    except koverse.thriftgen.ttypes.TKoverseException, ke:
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException, ae:
      result.ae = ae
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException, ce:
      result.ce = ce
    oprot.writeMessageBegin("getBackup", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getBackupData(self, seqid, iprot, oprot):
    args = getBackupData_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getBackupData_result()
    try:
      result.success = self._handler.getBackupData(args.authInfo, args.backup, args.offset, args.maximumSize)
    except koverse.thriftgen.ttypes.TKoverseException, ke:
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException, ae:
      result.ae = ae
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException, ce:
      result.ce = ce
    oprot.writeMessageBegin("getBackupData", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_deleteBackup(self, seqid, iprot, oprot):
    args = deleteBackup_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = deleteBackup_result()
    try:
      self._handler.deleteBackup(args.authInfo, args.backup)
    except koverse.thriftgen.ttypes.TKoverseException, ke:
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException, ae:
      result.ae = ae
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException, ce:
      result.ce = ce
    oprot.writeMessageBegin("deleteBackup", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()


# HELPER FUNCTIONS AND STRUCTURES

class performBackup_args:
  """
  Attributes:
   - authInfo
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'authInfo', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
  )

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

  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.STRUCT:
          self.authInfo = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.authInfo.read(iprot)
        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('performBackup_args')
    if self.authInfo is not None:
      oprot.writeFieldBegin('authInfo', TType.STRUCT, 1)
      self.authInfo.write(oprot)
      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 performBackup_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - ce
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (TBackup, TBackup.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 3
  )

  def __init__(self, success=None, ke=None, ae=None, ce=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.ce = ce

  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 == 0:
        if ftype == TType.STRUCT:
          self.success = TBackup()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        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('performBackup_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 3)
      self.ce.write(oprot)
      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 getBackupIds_args:
  """
  Attributes:
   - authInfo
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'authInfo', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
  )

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

  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.STRUCT:
          self.authInfo = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.authInfo.read(iprot)
        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('getBackupIds_args')
    if self.authInfo is not None:
      oprot.writeFieldBegin('authInfo', TType.STRUCT, 1)
      self.authInfo.write(oprot)
      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 getBackupIds_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - ce
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.I64,None), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 3
  )

  def __init__(self, success=None, ke=None, ae=None, ce=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.ce = ce

  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 == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype3, _size0) = iprot.readListBegin()
          for _i4 in xrange(_size0):
            _elem5 = iprot.readI64();
            self.success.append(_elem5)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        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('getBackupIds_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.I64, len(self.success))
      for iter6 in self.success:
        oprot.writeI64(iter6)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 3)
      self.ce.write(oprot)
      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 getBackup_args:
  """
  Attributes:
   - authInfo
   - backupId
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'authInfo', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.I64, 'backupId', None, None, ), # 2
  )

  def __init__(self, authInfo=None, backupId=None,):
    self.authInfo = authInfo
    self.backupId = backupId

  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.STRUCT:
          self.authInfo = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.authInfo.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.backupId = iprot.readI64();
        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('getBackup_args')
    if self.authInfo is not None:
      oprot.writeFieldBegin('authInfo', TType.STRUCT, 1)
      self.authInfo.write(oprot)
      oprot.writeFieldEnd()
    if self.backupId is not None:
      oprot.writeFieldBegin('backupId', TType.I64, 2)
      oprot.writeI64(self.backupId)
      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 getBackup_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - ce
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (TBackup, TBackup.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 3
  )

  def __init__(self, success=None, ke=None, ae=None, ce=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.ce = ce

  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 == 0:
        if ftype == TType.STRUCT:
          self.success = TBackup()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        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('getBackup_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 3)
      self.ce.write(oprot)
      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 getBackupData_args:
  """
  Attributes:
   - authInfo
   - backup
   - offset
   - maximumSize
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'authInfo', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'backup', (TBackup, TBackup.thrift_spec), None, ), # 2
    (3, TType.I64, 'offset', None, None, ), # 3
    (4, TType.I32, 'maximumSize', None, None, ), # 4
  )

  def __init__(self, authInfo=None, backup=None, offset=None, maximumSize=None,):
    self.authInfo = authInfo
    self.backup = backup
    self.offset = offset
    self.maximumSize = maximumSize

  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.STRUCT:
          self.authInfo = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.authInfo.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.backup = TBackup()
          self.backup.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.offset = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I32:
          self.maximumSize = 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('getBackupData_args')
    if self.authInfo is not None:
      oprot.writeFieldBegin('authInfo', TType.STRUCT, 1)
      self.authInfo.write(oprot)
      oprot.writeFieldEnd()
    if self.backup is not None:
      oprot.writeFieldBegin('backup', TType.STRUCT, 2)
      self.backup.write(oprot)
      oprot.writeFieldEnd()
    if self.offset is not None:
      oprot.writeFieldBegin('offset', TType.I64, 3)
      oprot.writeI64(self.offset)
      oprot.writeFieldEnd()
    if self.maximumSize is not None:
      oprot.writeFieldBegin('maximumSize', TType.I32, 4)
      oprot.writeI32(self.maximumSize)
      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 getBackupData_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - ce
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (TBackupData, TBackupData.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 3
  )

  def __init__(self, success=None, ke=None, ae=None, ce=None,):
    self.success = success
    self.ke = ke
    self.ae = ae
    self.ce = ce

  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 == 0:
        if ftype == TType.STRUCT:
          self.success = TBackupData()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        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('getBackupData_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 3)
      self.ce.write(oprot)
      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 deleteBackup_args:
  """
  Attributes:
   - authInfo
   - backup
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'authInfo', (koverse.thriftgen.security.ttypes.TAuthInfo, koverse.thriftgen.security.ttypes.TAuthInfo.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'backup', (TBackup, TBackup.thrift_spec), None, ), # 2
  )

  def __init__(self, authInfo=None, backup=None,):
    self.authInfo = authInfo
    self.backup = backup

  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.STRUCT:
          self.authInfo = koverse.thriftgen.security.ttypes.TAuthInfo()
          self.authInfo.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.backup = TBackup()
          self.backup.read(iprot)
        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('deleteBackup_args')
    if self.authInfo is not None:
      oprot.writeFieldBegin('authInfo', TType.STRUCT, 1)
      self.authInfo.write(oprot)
      oprot.writeFieldEnd()
    if self.backup is not None:
      oprot.writeFieldBegin('backup', TType.STRUCT, 2)
      self.backup.write(oprot)
      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 deleteBackup_result:
  """
  Attributes:
   - ke
   - ae
   - ce
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'ke', (koverse.thriftgen.ttypes.TKoverseException, koverse.thriftgen.ttypes.TKoverseException.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 2
    (3, TType.STRUCT, 'ce', (koverse.thriftgen.security.ttypes.TCannotUseKoverseException, koverse.thriftgen.security.ttypes.TCannotUseKoverseException.thrift_spec), None, ), # 3
  )

  def __init__(self, ke=None, ae=None, ce=None,):
    self.ke = ke
    self.ae = ae
    self.ce = ce

  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.STRUCT:
          self.ke = koverse.thriftgen.ttypes.TKoverseException()
          self.ke.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.ce = koverse.thriftgen.security.ttypes.TCannotUseKoverseException()
          self.ce.read(iprot)
        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('deleteBackup_result')
    if self.ke is not None:
      oprot.writeFieldBegin('ke', TType.STRUCT, 1)
      self.ke.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 2)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    if self.ce is not None:
      oprot.writeFieldBegin('ce', TType.STRUCT, 3)
      self.ce.write(oprot)
      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)
