#
# 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 thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
  from thrift.protocol import fastbinary
except:
  fastbinary = None



class Moments:
  """
  Attributes:
   - m0
   - m1
   - m2
   - m3
   - m4
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'm0', None, None, ), # 1
    (2, TType.DOUBLE, 'm1', None, None, ), # 2
    (3, TType.DOUBLE, 'm2', None, None, ), # 3
    (4, TType.DOUBLE, 'm3', None, None, ), # 4
    (5, TType.DOUBLE, 'm4', None, None, ), # 5
  )

  def __init__(self, m0=None, m1=None, m2=None, m3=None, m4=None,):
    self.m0 = m0
    self.m1 = m1
    self.m2 = m2
    self.m3 = m3
    self.m4 = m4

  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.m0 = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.DOUBLE:
          self.m1 = iprot.readDouble();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.DOUBLE:
          self.m2 = iprot.readDouble();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.m3 = iprot.readDouble();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.DOUBLE:
          self.m4 = iprot.readDouble();
        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('Moments')
    if self.m0 is not None:
      oprot.writeFieldBegin('m0', TType.I64, 1)
      oprot.writeI64(self.m0)
      oprot.writeFieldEnd()
    if self.m1 is not None:
      oprot.writeFieldBegin('m1', TType.DOUBLE, 2)
      oprot.writeDouble(self.m1)
      oprot.writeFieldEnd()
    if self.m2 is not None:
      oprot.writeFieldBegin('m2', TType.DOUBLE, 3)
      oprot.writeDouble(self.m2)
      oprot.writeFieldEnd()
    if self.m3 is not None:
      oprot.writeFieldBegin('m3', TType.DOUBLE, 4)
      oprot.writeDouble(self.m3)
      oprot.writeFieldEnd()
    if self.m4 is not None:
      oprot.writeFieldBegin('m4', TType.DOUBLE, 5)
      oprot.writeDouble(self.m4)
      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 DependencyLink:
  """
  Attributes:
   - parent
   - child
   - duration_moments
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'parent', None, None, ), # 1
    (2, TType.STRING, 'child', None, None, ), # 2
    (3, TType.STRUCT, 'duration_moments', (Moments, Moments.thrift_spec), None, ), # 3
  )

  def __init__(self, parent=None, child=None, duration_moments=None,):
    self.parent = parent
    self.child = child
    self.duration_moments = duration_moments

  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.parent = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.child = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.duration_moments = Moments()
          self.duration_moments.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('DependencyLink')
    if self.parent is not None:
      oprot.writeFieldBegin('parent', TType.STRING, 1)
      oprot.writeString(self.parent)
      oprot.writeFieldEnd()
    if self.child is not None:
      oprot.writeFieldBegin('child', TType.STRING, 2)
      oprot.writeString(self.child)
      oprot.writeFieldEnd()
    if self.duration_moments is not None:
      oprot.writeFieldBegin('duration_moments', TType.STRUCT, 3)
      self.duration_moments.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 Dependencies:
  """
  Attributes:
   - start_time
   - end_time
   - links
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'start_time', None, None, ), # 1
    (2, TType.I64, 'end_time', None, None, ), # 2
    (3, TType.LIST, 'links', (TType.STRUCT,(DependencyLink, DependencyLink.thrift_spec)), None, ), # 3
  )

  def __init__(self, start_time=None, end_time=None, links=None,):
    self.start_time = start_time
    self.end_time = end_time
    self.links = links

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

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('Dependencies')
    if self.start_time is not None:
      oprot.writeFieldBegin('start_time', TType.I64, 1)
      oprot.writeI64(self.start_time)
      oprot.writeFieldEnd()
    if self.end_time is not None:
      oprot.writeFieldBegin('end_time', TType.I64, 2)
      oprot.writeI64(self.end_time)
      oprot.writeFieldEnd()
    if self.links is not None:
      oprot.writeFieldBegin('links', TType.LIST, 3)
      oprot.writeListBegin(TType.STRUCT, len(self.links))
      for iter6 in self.links:
        iter6.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


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

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

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