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

from thrift.Thrift import TType, TMessageType, TException, TApplicationException

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



class ServiceException(TException):
  """
  Attributes:
   - message: Readable message desribing the error condition.
   - stacktrace: Program stack trace
   - inputs: Optional mapping
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'message', None, None, ), # 1
    (2, TType.STRING, 'stacktrace', None, None, ), # 2
    (3, TType.MAP, 'inputs', (TType.STRING,None,TType.STRING,None), None, ), # 3
  )

  def __init__(self, message=None, stacktrace=None, inputs=None,):
    self.message = message
    self.stacktrace = stacktrace
    self.inputs = inputs

  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.message = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.stacktrace = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.MAP:
          self.inputs = {}
          (_ktype1, _vtype2, _size0 ) = iprot.readMapBegin()
          for _i4 in xrange(_size0):
            _key5 = iprot.readString();
            _val6 = iprot.readString();
            self.inputs[_key5] = _val6
          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('ServiceException')
    if self.message is not None:
      oprot.writeFieldBegin('message', TType.STRING, 1)
      oprot.writeString(self.message)
      oprot.writeFieldEnd()
    if self.stacktrace is not None:
      oprot.writeFieldBegin('stacktrace', TType.STRING, 2)
      oprot.writeString(self.stacktrace)
      oprot.writeFieldEnd()
    if self.inputs is not None:
      oprot.writeFieldBegin('inputs', TType.MAP, 3)
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.inputs))
      for kiter7,viter8 in self.inputs.items():
        oprot.writeString(kiter7)
        oprot.writeString(viter8)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.message is None:
      raise TProtocol.TProtocolException(message='Required field message is unset!')
    return


  def __str__(self):
    return repr(self)

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.message)
    value = (value * 31) ^ hash(self.stacktrace)
    value = (value * 31) ^ hash(self.inputs)
    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 AuthorizationException(TException):
  """
  Attributes:
   - message: Readable message desribing the error condition.
   - stacktrace: Program stack trace
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'message', None, None, ), # 1
    (2, TType.STRING, 'stacktrace', None, None, ), # 2
  )

  def __init__(self, message=None, stacktrace=None,):
    self.message = message
    self.stacktrace = stacktrace

  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.message = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.stacktrace = 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('AuthorizationException')
    if self.message is not None:
      oprot.writeFieldBegin('message', TType.STRING, 1)
      oprot.writeString(self.message)
      oprot.writeFieldEnd()
    if self.stacktrace is not None:
      oprot.writeFieldBegin('stacktrace', TType.STRING, 2)
      oprot.writeString(self.stacktrace)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.message is None:
      raise TProtocol.TProtocolException(message='Required field message is unset!')
    return


  def __str__(self):
    return repr(self)

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.message)
    value = (value * 31) ^ hash(self.stacktrace)
    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 AuthenticationException(TException):
  """
  Attributes:
   - message: Readable message desribing the error condition.
   - stacktrace: Program stack trace
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'message', None, None, ), # 1
    (2, TType.STRING, 'stacktrace', None, None, ), # 2
  )

  def __init__(self, message=None, stacktrace=None,):
    self.message = message
    self.stacktrace = stacktrace

  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.message = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.stacktrace = 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('AuthenticationException')
    if self.message is not None:
      oprot.writeFieldBegin('message', TType.STRING, 1)
      oprot.writeString(self.message)
      oprot.writeFieldEnd()
    if self.stacktrace is not None:
      oprot.writeFieldBegin('stacktrace', TType.STRING, 2)
      oprot.writeString(self.stacktrace)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.message is None:
      raise TProtocol.TProtocolException(message='Required field message is unset!')
    return


  def __str__(self):
    return repr(self)

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.message)
    value = (value * 31) ^ hash(self.stacktrace)
    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 ObjectReferenceException(TException):
  """
  Attributes:
   - message: Readable message desribing the error condition.
   - stacktrace: Program stack trace
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'message', None, None, ), # 1
    (2, TType.STRING, 'stacktrace', None, None, ), # 2
  )

  def __init__(self, message=None, stacktrace=None,):
    self.message = message
    self.stacktrace = stacktrace

  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.message = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.stacktrace = 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('ObjectReferenceException')
    if self.message is not None:
      oprot.writeFieldBegin('message', TType.STRING, 1)
      oprot.writeString(self.message)
      oprot.writeFieldEnd()
    if self.stacktrace is not None:
      oprot.writeFieldBegin('stacktrace', TType.STRING, 2)
      oprot.writeString(self.stacktrace)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.message is None:
      raise TProtocol.TProtocolException(message='Required field message is unset!')
    return


  def __str__(self):
    return repr(self)

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.message)
    value = (value * 31) ^ hash(self.stacktrace)
    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 AttributeException(TException):
  """
  Attributes:
   - message: Readable message desribing the error condition.
   - stacktrace: Program stack trace
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'message', None, None, ), # 1
    (2, TType.STRING, 'stacktrace', None, None, ), # 2
  )

  def __init__(self, message=None, stacktrace=None,):
    self.message = message
    self.stacktrace = stacktrace

  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.message = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.stacktrace = 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('AttributeException')
    if self.message is not None:
      oprot.writeFieldBegin('message', TType.STRING, 1)
      oprot.writeString(self.message)
      oprot.writeFieldEnd()
    if self.stacktrace is not None:
      oprot.writeFieldBegin('stacktrace', TType.STRING, 2)
      oprot.writeString(self.stacktrace)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.message is None:
      raise TProtocol.TProtocolException(message='Required field message is unset!')
    return


  def __str__(self):
    return repr(self)

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.message)
    value = (value * 31) ^ hash(self.stacktrace)
    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 TypeException(TException):
  """
  Attributes:
   - message: Readable message desribing the error condition.
   - stacktrace: Program stack trace
   - valid_types: List of types that would have been acceptable.
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'message', None, None, ), # 1
    (2, TType.STRING, 'stacktrace', None, None, ), # 2
    (3, TType.LIST, 'valid_types', (TType.STRING,None), None, ), # 3
  )

  def __init__(self, message=None, stacktrace=None, valid_types=None,):
    self.message = message
    self.stacktrace = stacktrace
    self.valid_types = valid_types

  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.message = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.stacktrace = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.LIST:
          self.valid_types = []
          (_etype12, _size9) = iprot.readListBegin()
          for _i13 in xrange(_size9):
            _elem14 = iprot.readString();
            self.valid_types.append(_elem14)
          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('TypeException')
    if self.message is not None:
      oprot.writeFieldBegin('message', TType.STRING, 1)
      oprot.writeString(self.message)
      oprot.writeFieldEnd()
    if self.stacktrace is not None:
      oprot.writeFieldBegin('stacktrace', TType.STRING, 2)
      oprot.writeString(self.stacktrace)
      oprot.writeFieldEnd()
    if self.valid_types is not None:
      oprot.writeFieldBegin('valid_types', TType.LIST, 3)
      oprot.writeListBegin(TType.STRING, len(self.valid_types))
      for iter15 in self.valid_types:
        oprot.writeString(iter15)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.message is None:
      raise TProtocol.TProtocolException(message='Required field message is unset!')
    return


  def __str__(self):
    return repr(self)

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.message)
    value = (value * 31) ^ hash(self.stacktrace)
    value = (value * 31) ^ hash(self.valid_types)
    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 ObjectInfo(object):
  """
  Attributes:
   - object_id
   - object_name
   - object_reference
   - object_reference_versioned
   - type_string
   - save_date
   - version
   - saved_by
   - workspace_id
   - workspace_name
   - object_checksum
   - object_size
   - object_metadata
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'object_id', None, None, ), # 1
    (2, TType.STRING, 'object_name', None, None, ), # 2
    (3, TType.STRING, 'object_reference', None, None, ), # 3
    (4, TType.STRING, 'object_reference_versioned', None, None, ), # 4
    (5, TType.STRING, 'type_string', None, None, ), # 5
    (6, TType.STRING, 'save_date', None, None, ), # 6
    (7, TType.I64, 'version', None, None, ), # 7
    (8, TType.STRING, 'saved_by', None, None, ), # 8
    (9, TType.I64, 'workspace_id', None, None, ), # 9
    (10, TType.STRING, 'workspace_name', None, None, ), # 10
    (11, TType.STRING, 'object_checksum', None, None, ), # 11
    (12, TType.I64, 'object_size', None, None, ), # 12
    (13, TType.MAP, 'object_metadata', (TType.STRING,None,TType.STRING,None), None, ), # 13
  )

  def __init__(self, object_id=None, object_name=None, object_reference=None, object_reference_versioned=None, type_string=None, save_date=None, version=None, saved_by=None, workspace_id=None, workspace_name=None, object_checksum=None, object_size=None, object_metadata=None,):
    self.object_id = object_id
    self.object_name = object_name
    self.object_reference = object_reference
    self.object_reference_versioned = object_reference_versioned
    self.type_string = type_string
    self.save_date = save_date
    self.version = version
    self.saved_by = saved_by
    self.workspace_id = workspace_id
    self.workspace_name = workspace_name
    self.object_checksum = object_checksum
    self.object_size = object_size
    self.object_metadata = object_metadata

  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.object_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.object_name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.object_reference = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.object_reference_versioned = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.type_string = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRING:
          self.save_date = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.I64:
          self.version = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.STRING:
          self.saved_by = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.I64:
          self.workspace_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.STRING:
          self.workspace_name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.STRING:
          self.object_checksum = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.I64:
          self.object_size = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.MAP:
          self.object_metadata = {}
          (_ktype17, _vtype18, _size16 ) = iprot.readMapBegin()
          for _i20 in xrange(_size16):
            _key21 = iprot.readString();
            _val22 = iprot.readString();
            self.object_metadata[_key21] = _val22
          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('ObjectInfo')
    if self.object_id is not None:
      oprot.writeFieldBegin('object_id', TType.I64, 1)
      oprot.writeI64(self.object_id)
      oprot.writeFieldEnd()
    if self.object_name is not None:
      oprot.writeFieldBegin('object_name', TType.STRING, 2)
      oprot.writeString(self.object_name)
      oprot.writeFieldEnd()
    if self.object_reference is not None:
      oprot.writeFieldBegin('object_reference', TType.STRING, 3)
      oprot.writeString(self.object_reference)
      oprot.writeFieldEnd()
    if self.object_reference_versioned is not None:
      oprot.writeFieldBegin('object_reference_versioned', TType.STRING, 4)
      oprot.writeString(self.object_reference_versioned)
      oprot.writeFieldEnd()
    if self.type_string is not None:
      oprot.writeFieldBegin('type_string', TType.STRING, 5)
      oprot.writeString(self.type_string)
      oprot.writeFieldEnd()
    if self.save_date is not None:
      oprot.writeFieldBegin('save_date', TType.STRING, 6)
      oprot.writeString(self.save_date)
      oprot.writeFieldEnd()
    if self.version is not None:
      oprot.writeFieldBegin('version', TType.I64, 7)
      oprot.writeI64(self.version)
      oprot.writeFieldEnd()
    if self.saved_by is not None:
      oprot.writeFieldBegin('saved_by', TType.STRING, 8)
      oprot.writeString(self.saved_by)
      oprot.writeFieldEnd()
    if self.workspace_id is not None:
      oprot.writeFieldBegin('workspace_id', TType.I64, 9)
      oprot.writeI64(self.workspace_id)
      oprot.writeFieldEnd()
    if self.workspace_name is not None:
      oprot.writeFieldBegin('workspace_name', TType.STRING, 10)
      oprot.writeString(self.workspace_name)
      oprot.writeFieldEnd()
    if self.object_checksum is not None:
      oprot.writeFieldBegin('object_checksum', TType.STRING, 11)
      oprot.writeString(self.object_checksum)
      oprot.writeFieldEnd()
    if self.object_size is not None:
      oprot.writeFieldBegin('object_size', TType.I64, 12)
      oprot.writeI64(self.object_size)
      oprot.writeFieldEnd()
    if self.object_metadata is not None:
      oprot.writeFieldBegin('object_metadata', TType.MAP, 13)
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.object_metadata))
      for kiter23,viter24 in self.object_metadata.items():
        oprot.writeString(kiter23)
        oprot.writeString(viter24)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.object_id)
    value = (value * 31) ^ hash(self.object_name)
    value = (value * 31) ^ hash(self.object_reference)
    value = (value * 31) ^ hash(self.object_reference_versioned)
    value = (value * 31) ^ hash(self.type_string)
    value = (value * 31) ^ hash(self.save_date)
    value = (value * 31) ^ hash(self.version)
    value = (value * 31) ^ hash(self.saved_by)
    value = (value * 31) ^ hash(self.workspace_id)
    value = (value * 31) ^ hash(self.workspace_name)
    value = (value * 31) ^ hash(self.object_checksum)
    value = (value * 31) ^ hash(self.object_size)
    value = (value * 31) ^ hash(self.object_metadata)
    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 ExternalDataUnit(object):
  """
  Attributes:
   - resource_name
   - resource_url
   - resource_version
   - resource_release_date
   - data_url
   - data_id
   - description
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'resource_name', None, None, ), # 1
    (2, TType.STRING, 'resource_url', None, None, ), # 2
    (3, TType.STRING, 'resource_version', None, None, ), # 3
    (4, TType.STRING, 'resource_release_date', None, None, ), # 4
    (5, TType.STRING, 'data_url', None, None, ), # 5
    (6, TType.STRING, 'data_id', None, None, ), # 6
    (7, TType.STRING, 'description', None, None, ), # 7
  )

  def __init__(self, resource_name=None, resource_url=None, resource_version=None, resource_release_date=None, data_url=None, data_id=None, description=None,):
    self.resource_name = resource_name
    self.resource_url = resource_url
    self.resource_version = resource_version
    self.resource_release_date = resource_release_date
    self.data_url = data_url
    self.data_id = data_id
    self.description = description

  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.resource_name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.resource_url = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.resource_version = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.resource_release_date = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.data_url = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRING:
          self.data_id = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.STRING:
          self.description = 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('ExternalDataUnit')
    if self.resource_name is not None:
      oprot.writeFieldBegin('resource_name', TType.STRING, 1)
      oprot.writeString(self.resource_name)
      oprot.writeFieldEnd()
    if self.resource_url is not None:
      oprot.writeFieldBegin('resource_url', TType.STRING, 2)
      oprot.writeString(self.resource_url)
      oprot.writeFieldEnd()
    if self.resource_version is not None:
      oprot.writeFieldBegin('resource_version', TType.STRING, 3)
      oprot.writeString(self.resource_version)
      oprot.writeFieldEnd()
    if self.resource_release_date is not None:
      oprot.writeFieldBegin('resource_release_date', TType.STRING, 4)
      oprot.writeString(self.resource_release_date)
      oprot.writeFieldEnd()
    if self.data_url is not None:
      oprot.writeFieldBegin('data_url', TType.STRING, 5)
      oprot.writeString(self.data_url)
      oprot.writeFieldEnd()
    if self.data_id is not None:
      oprot.writeFieldBegin('data_id', TType.STRING, 6)
      oprot.writeString(self.data_id)
      oprot.writeFieldEnd()
    if self.description is not None:
      oprot.writeFieldBegin('description', TType.STRING, 7)
      oprot.writeString(self.description)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.resource_name)
    value = (value * 31) ^ hash(self.resource_url)
    value = (value * 31) ^ hash(self.resource_version)
    value = (value * 31) ^ hash(self.resource_release_date)
    value = (value * 31) ^ hash(self.data_url)
    value = (value * 31) ^ hash(self.data_id)
    value = (value * 31) ^ hash(self.description)
    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 ObjectProvenanceAction(object):
  """
  Attributes:
   - time
   - service_name
   - service_version
   - service_method
   - method_parameters
   - script_name
   - script_version
   - script_command_line
   - input_object_references
   - validated_object_references
   - intermediate_input_ids
   - intermediate_output_ids
   - external_data
   - description
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'time', None, None, ), # 1
    (2, TType.STRING, 'service_name', None, None, ), # 2
    (3, TType.STRING, 'service_version', None, None, ), # 3
    (4, TType.STRING, 'service_method', None, None, ), # 4
    (5, TType.LIST, 'method_parameters', (TType.STRING,None), None, ), # 5
    (6, TType.STRING, 'script_name', None, None, ), # 6
    (7, TType.STRING, 'script_version', None, None, ), # 7
    (8, TType.STRING, 'script_command_line', None, None, ), # 8
    (9, TType.LIST, 'input_object_references', (TType.STRING,None), None, ), # 9
    (10, TType.LIST, 'validated_object_references', (TType.STRING,None), None, ), # 10
    (11, TType.LIST, 'intermediate_input_ids', (TType.STRING,None), None, ), # 11
    (12, TType.LIST, 'intermediate_output_ids', (TType.STRING,None), None, ), # 12
    (13, TType.LIST, 'external_data', (TType.STRUCT,(ExternalDataUnit, ExternalDataUnit.thrift_spec)), None, ), # 13
    (14, TType.STRING, 'description', None, None, ), # 14
  )

  def __init__(self, time=None, service_name=None, service_version=None, service_method=None, method_parameters=None, script_name=None, script_version=None, script_command_line=None, input_object_references=None, validated_object_references=None, intermediate_input_ids=None, intermediate_output_ids=None, external_data=None, description=None,):
    self.time = time
    self.service_name = service_name
    self.service_version = service_version
    self.service_method = service_method
    self.method_parameters = method_parameters
    self.script_name = script_name
    self.script_version = script_version
    self.script_command_line = script_command_line
    self.input_object_references = input_object_references
    self.validated_object_references = validated_object_references
    self.intermediate_input_ids = intermediate_input_ids
    self.intermediate_output_ids = intermediate_output_ids
    self.external_data = external_data
    self.description = description

  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.time = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.service_name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.service_version = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.service_method = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.LIST:
          self.method_parameters = []
          (_etype28, _size25) = iprot.readListBegin()
          for _i29 in xrange(_size25):
            _elem30 = iprot.readString();
            self.method_parameters.append(_elem30)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRING:
          self.script_name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.STRING:
          self.script_version = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.STRING:
          self.script_command_line = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.LIST:
          self.input_object_references = []
          (_etype34, _size31) = iprot.readListBegin()
          for _i35 in xrange(_size31):
            _elem36 = iprot.readString();
            self.input_object_references.append(_elem36)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.LIST:
          self.validated_object_references = []
          (_etype40, _size37) = iprot.readListBegin()
          for _i41 in xrange(_size37):
            _elem42 = iprot.readString();
            self.validated_object_references.append(_elem42)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.LIST:
          self.intermediate_input_ids = []
          (_etype46, _size43) = iprot.readListBegin()
          for _i47 in xrange(_size43):
            _elem48 = iprot.readString();
            self.intermediate_input_ids.append(_elem48)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.LIST:
          self.intermediate_output_ids = []
          (_etype52, _size49) = iprot.readListBegin()
          for _i53 in xrange(_size49):
            _elem54 = iprot.readString();
            self.intermediate_output_ids.append(_elem54)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.LIST:
          self.external_data = []
          (_etype58, _size55) = iprot.readListBegin()
          for _i59 in xrange(_size55):
            _elem60 = ExternalDataUnit()
            _elem60.read(iprot)
            self.external_data.append(_elem60)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.STRING:
          self.description = 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('ObjectProvenanceAction')
    if self.time is not None:
      oprot.writeFieldBegin('time', TType.STRING, 1)
      oprot.writeString(self.time)
      oprot.writeFieldEnd()
    if self.service_name is not None:
      oprot.writeFieldBegin('service_name', TType.STRING, 2)
      oprot.writeString(self.service_name)
      oprot.writeFieldEnd()
    if self.service_version is not None:
      oprot.writeFieldBegin('service_version', TType.STRING, 3)
      oprot.writeString(self.service_version)
      oprot.writeFieldEnd()
    if self.service_method is not None:
      oprot.writeFieldBegin('service_method', TType.STRING, 4)
      oprot.writeString(self.service_method)
      oprot.writeFieldEnd()
    if self.method_parameters is not None:
      oprot.writeFieldBegin('method_parameters', TType.LIST, 5)
      oprot.writeListBegin(TType.STRING, len(self.method_parameters))
      for iter61 in self.method_parameters:
        oprot.writeString(iter61)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.script_name is not None:
      oprot.writeFieldBegin('script_name', TType.STRING, 6)
      oprot.writeString(self.script_name)
      oprot.writeFieldEnd()
    if self.script_version is not None:
      oprot.writeFieldBegin('script_version', TType.STRING, 7)
      oprot.writeString(self.script_version)
      oprot.writeFieldEnd()
    if self.script_command_line is not None:
      oprot.writeFieldBegin('script_command_line', TType.STRING, 8)
      oprot.writeString(self.script_command_line)
      oprot.writeFieldEnd()
    if self.input_object_references is not None:
      oprot.writeFieldBegin('input_object_references', TType.LIST, 9)
      oprot.writeListBegin(TType.STRING, len(self.input_object_references))
      for iter62 in self.input_object_references:
        oprot.writeString(iter62)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.validated_object_references is not None:
      oprot.writeFieldBegin('validated_object_references', TType.LIST, 10)
      oprot.writeListBegin(TType.STRING, len(self.validated_object_references))
      for iter63 in self.validated_object_references:
        oprot.writeString(iter63)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.intermediate_input_ids is not None:
      oprot.writeFieldBegin('intermediate_input_ids', TType.LIST, 11)
      oprot.writeListBegin(TType.STRING, len(self.intermediate_input_ids))
      for iter64 in self.intermediate_input_ids:
        oprot.writeString(iter64)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.intermediate_output_ids is not None:
      oprot.writeFieldBegin('intermediate_output_ids', TType.LIST, 12)
      oprot.writeListBegin(TType.STRING, len(self.intermediate_output_ids))
      for iter65 in self.intermediate_output_ids:
        oprot.writeString(iter65)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.external_data is not None:
      oprot.writeFieldBegin('external_data', TType.LIST, 13)
      oprot.writeListBegin(TType.STRUCT, len(self.external_data))
      for iter66 in self.external_data:
        iter66.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.description is not None:
      oprot.writeFieldBegin('description', TType.STRING, 14)
      oprot.writeString(self.description)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.time)
    value = (value * 31) ^ hash(self.service_name)
    value = (value * 31) ^ hash(self.service_version)
    value = (value * 31) ^ hash(self.service_method)
    value = (value * 31) ^ hash(self.method_parameters)
    value = (value * 31) ^ hash(self.script_name)
    value = (value * 31) ^ hash(self.script_version)
    value = (value * 31) ^ hash(self.script_command_line)
    value = (value * 31) ^ hash(self.input_object_references)
    value = (value * 31) ^ hash(self.validated_object_references)
    value = (value * 31) ^ hash(self.intermediate_input_ids)
    value = (value * 31) ^ hash(self.intermediate_output_ids)
    value = (value * 31) ^ hash(self.external_data)
    value = (value * 31) ^ hash(self.description)
    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)
