#
# Autogenerated by Thrift Compiler (0.9.3)
#
# 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
import logging
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 getHadoopSystemSettings(self, authInfo):
    """
    Parameters:
     - authInfo
    """
    pass

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

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

  def getVersionInfo(self):
    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 getHadoopSystemSettings(self, authInfo):
    """
    Parameters:
     - authInfo
    """
    self.send_getHadoopSystemSettings(authInfo)
    return self.recv_getHadoopSystemSettings()

  def send_getHadoopSystemSettings(self, authInfo):
    self._oprot.writeMessageBegin('getHadoopSystemSettings', TMessageType.CALL, self._seqid)
    args = getHadoopSystemSettings_args()
    args.authInfo = authInfo
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getHadoopSystemSettings(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = getHadoopSystemSettings_result()
    result.read(iprot)
    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, "getHadoopSystemSettings failed: unknown result")

  def listSecurityLabelParserDescriptions(self, authInfo):
    """
    Parameters:
     - authInfo
    """
    self.send_listSecurityLabelParserDescriptions(authInfo)
    return self.recv_listSecurityLabelParserDescriptions()

  def send_listSecurityLabelParserDescriptions(self, authInfo):
    self._oprot.writeMessageBegin('listSecurityLabelParserDescriptions', TMessageType.CALL, self._seqid)
    args = listSecurityLabelParserDescriptions_args()
    args.authInfo = authInfo
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_listSecurityLabelParserDescriptions(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = listSecurityLabelParserDescriptions_result()
    result.read(iprot)
    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, "listSecurityLabelParserDescriptions failed: unknown result")

  def getUsageMetricsReport(self, authInfo):
    """
    Parameters:
     - authInfo
    """
    self.send_getUsageMetricsReport(authInfo)
    return self.recv_getUsageMetricsReport()

  def send_getUsageMetricsReport(self, authInfo):
    self._oprot.writeMessageBegin('getUsageMetricsReport', TMessageType.CALL, self._seqid)
    args = getUsageMetricsReport_args()
    args.authInfo = authInfo
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getUsageMetricsReport(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = getUsageMetricsReport_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.ae is not None:
      raise result.ae
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getUsageMetricsReport failed: unknown result")

  def getVersionInfo(self):
    self.send_getVersionInfo()
    return self.recv_getVersionInfo()

  def send_getVersionInfo(self):
    self._oprot.writeMessageBegin('getVersionInfo', TMessageType.CALL, self._seqid)
    args = getVersionInfo_args()
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getVersionInfo(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = getVersionInfo_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getVersionInfo failed: unknown result")


class Processor(Iface, TProcessor):
  def __init__(self, handler):
    self._handler = handler
    self._processMap = {}
    self._processMap["getHadoopSystemSettings"] = Processor.process_getHadoopSystemSettings
    self._processMap["listSecurityLabelParserDescriptions"] = Processor.process_listSecurityLabelParserDescriptions
    self._processMap["getUsageMetricsReport"] = Processor.process_getUsageMetricsReport
    self._processMap["getVersionInfo"] = Processor.process_getVersionInfo

  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_getHadoopSystemSettings(self, seqid, iprot, oprot):
    args = getHadoopSystemSettings_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getHadoopSystemSettings_result()
    try:
      result.success = self._handler.getHadoopSystemSettings(args.authInfo)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException as ce:
      msg_type = TMessageType.REPLY
      result.ce = ce
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("getHadoopSystemSettings", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_listSecurityLabelParserDescriptions(self, seqid, iprot, oprot):
    args = listSecurityLabelParserDescriptions_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = listSecurityLabelParserDescriptions_result()
    try:
      result.success = self._handler.listSecurityLabelParserDescriptions(args.authInfo)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.ttypes.TKoverseException as ke:
      msg_type = TMessageType.REPLY
      result.ke = ke
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except koverse.thriftgen.security.ttypes.TCannotUseKoverseException as ce:
      msg_type = TMessageType.REPLY
      result.ce = ce
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("listSecurityLabelParserDescriptions", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getUsageMetricsReport(self, seqid, iprot, oprot):
    args = getUsageMetricsReport_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getUsageMetricsReport_result()
    try:
      result.success = self._handler.getUsageMetricsReport(args.authInfo)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except koverse.thriftgen.security.ttypes.TAuthorizationException as ae:
      msg_type = TMessageType.REPLY
      result.ae = ae
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("getUsageMetricsReport", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getVersionInfo(self, seqid, iprot, oprot):
    args = getVersionInfo_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getVersionInfo_result()
    try:
      result.success = self._handler.getVersionInfo()
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("getVersionInfo", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()


# HELPER FUNCTIONS AND STRUCTURES

class getHadoopSystemSettings_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('getHadoopSystemSettings_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 __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.authInfo)
    return value

  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 getHadoopSystemSettings_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - ce
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (TSystemSettings, TSystemSettings.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 = TSystemSettings()
          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('getHadoopSystemSettings_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 __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    value = (value * 31) ^ hash(self.ce)
    return value

  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 listSecurityLabelParserDescriptions_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('listSecurityLabelParserDescriptions_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 __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.authInfo)
    return value

  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 listSecurityLabelParserDescriptions_result:
  """
  Attributes:
   - success
   - ke
   - ae
   - ce
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(TSecurityLabelParserDescription, TSecurityLabelParserDescription.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.LIST:
          self.success = []
          (_etype143, _size140) = iprot.readListBegin()
          for _i144 in xrange(_size140):
            _elem145 = TSecurityLabelParserDescription()
            _elem145.read(iprot)
            self.success.append(_elem145)
          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('listSecurityLabelParserDescriptions_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter146 in self.success:
        iter146.write(oprot)
      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 __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ke)
    value = (value * 31) ^ hash(self.ae)
    value = (value * 31) ^ hash(self.ce)
    return value

  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 getUsageMetricsReport_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('getUsageMetricsReport_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 __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.authInfo)
    return value

  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 getUsageMetricsReport_result:
  """
  Attributes:
   - success
   - ae
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (TUsageMetricsReport, TUsageMetricsReport.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'ae', (koverse.thriftgen.security.ttypes.TAuthorizationException, koverse.thriftgen.security.ttypes.TAuthorizationException.thrift_spec), None, ), # 1
  )

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

  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 = TUsageMetricsReport()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.ae = koverse.thriftgen.security.ttypes.TAuthorizationException()
          self.ae.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('getUsageMetricsReport_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.ae is not None:
      oprot.writeFieldBegin('ae', TType.STRUCT, 1)
      self.ae.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.ae)
    return value

  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 getVersionInfo_args:

  thrift_spec = (
  )

  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
      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('getVersionInfo_args')
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    return value

  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 getVersionInfo_result:
  """
  Attributes:
   - success
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (TSystemVersionInfo, TSystemVersionInfo.thrift_spec), None, ), # 0
  )

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

  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 = TSystemVersionInfo()
          self.success.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('getVersionInfo_result')
    if self.success is not None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    return value

  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)
