#
# 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 Constraint:
  """
  Attributes:
   - LTarget
   - RTarget
   - Operand
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'LTarget', None, None, ), # 1
    (2, TType.STRING, 'RTarget', None, None, ), # 2
    (3, TType.STRING, 'Operand', None, None, ), # 3
  )

  def __init__(self, LTarget=None, RTarget=None, Operand=None,):
    self.LTarget = LTarget
    self.RTarget = RTarget
    self.Operand = Operand

  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.LTarget = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.RTarget = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.Operand = 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('Constraint')
    if self.LTarget is not None:
      oprot.writeFieldBegin('LTarget', TType.STRING, 1)
      oprot.writeString(self.LTarget)
      oprot.writeFieldEnd()
    if self.RTarget is not None:
      oprot.writeFieldBegin('RTarget', TType.STRING, 2)
      oprot.writeString(self.RTarget)
      oprot.writeFieldEnd()
    if self.Operand is not None:
      oprot.writeFieldBegin('Operand', TType.STRING, 3)
      oprot.writeString(self.Operand)
      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 ParamaterizedJob:

  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('ParamaterizedJob')
    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 Update:
  """
  Attributes:
   - MaxParallel
   - Stagger
   - HealthCheck
   - MinHealthyTime
   - HealthyDeadline
   - AutoRevert
   - Canary
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'MaxParallel', None, None, ), # 1
    (2, TType.I64, 'Stagger', None, None, ), # 2
    (3, TType.STRING, 'HealthCheck', None, None, ), # 3
    (4, TType.I64, 'MinHealthyTime', None, None, ), # 4
    (5, TType.I64, 'HealthyDeadline', None, None, ), # 5
    (6, TType.BOOL, 'AutoRevert', None, None, ), # 6
    (7, TType.I64, 'Canary', None, None, ), # 7
  )

  def __init__(self, MaxParallel=None, Stagger=None, HealthCheck=None, MinHealthyTime=None, HealthyDeadline=None, AutoRevert=None, Canary=None,):
    self.MaxParallel = MaxParallel
    self.Stagger = Stagger
    self.HealthCheck = HealthCheck
    self.MinHealthyTime = MinHealthyTime
    self.HealthyDeadline = HealthyDeadline
    self.AutoRevert = AutoRevert
    self.Canary = Canary

  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.MaxParallel = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.Stagger = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.HealthCheck = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.MinHealthyTime = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I64:
          self.HealthyDeadline = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.BOOL:
          self.AutoRevert = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.I64:
          self.Canary = 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('Update')
    if self.MaxParallel is not None:
      oprot.writeFieldBegin('MaxParallel', TType.I64, 1)
      oprot.writeI64(self.MaxParallel)
      oprot.writeFieldEnd()
    if self.Stagger is not None:
      oprot.writeFieldBegin('Stagger', TType.I64, 2)
      oprot.writeI64(self.Stagger)
      oprot.writeFieldEnd()
    if self.HealthCheck is not None:
      oprot.writeFieldBegin('HealthCheck', TType.STRING, 3)
      oprot.writeString(self.HealthCheck)
      oprot.writeFieldEnd()
    if self.MinHealthyTime is not None:
      oprot.writeFieldBegin('MinHealthyTime', TType.I64, 4)
      oprot.writeI64(self.MinHealthyTime)
      oprot.writeFieldEnd()
    if self.HealthyDeadline is not None:
      oprot.writeFieldBegin('HealthyDeadline', TType.I64, 5)
      oprot.writeI64(self.HealthyDeadline)
      oprot.writeFieldEnd()
    if self.AutoRevert is not None:
      oprot.writeFieldBegin('AutoRevert', TType.BOOL, 6)
      oprot.writeBool(self.AutoRevert)
      oprot.writeFieldEnd()
    if self.Canary is not None:
      oprot.writeFieldBegin('Canary', TType.I64, 7)
      oprot.writeI64(self.Canary)
      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 Periodic:
  """
  Attributes:
   - Enabled
   - SpecType
   - Spec
   - ProhibitOverlap
  """

  thrift_spec = (
    None, # 0
    (1, TType.BOOL, 'Enabled', None, None, ), # 1
    (2, TType.STRING, 'SpecType', None, None, ), # 2
    (3, TType.STRING, 'Spec', None, None, ), # 3
    (4, TType.BOOL, 'ProhibitOverlap', None, None, ), # 4
  )

  def __init__(self, Enabled=None, SpecType=None, Spec=None, ProhibitOverlap=None,):
    self.Enabled = Enabled
    self.SpecType = SpecType
    self.Spec = Spec
    self.ProhibitOverlap = ProhibitOverlap

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

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('Periodic')
    if self.Enabled is not None:
      oprot.writeFieldBegin('Enabled', TType.BOOL, 1)
      oprot.writeBool(self.Enabled)
      oprot.writeFieldEnd()
    if self.SpecType is not None:
      oprot.writeFieldBegin('SpecType', TType.STRING, 2)
      oprot.writeString(self.SpecType)
      oprot.writeFieldEnd()
    if self.Spec is not None:
      oprot.writeFieldBegin('Spec', TType.STRING, 3)
      oprot.writeString(self.Spec)
      oprot.writeFieldEnd()
    if self.ProhibitOverlap is not None:
      oprot.writeFieldBegin('ProhibitOverlap', TType.BOOL, 4)
      oprot.writeBool(self.ProhibitOverlap)
      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 RestartPolicy:
  """
  Attributes:
   - Attempts
   - Interval
   - Delay
   - Mode
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'Attempts', None, None, ), # 1
    (2, TType.I64, 'Interval', None, None, ), # 2
    (3, TType.I64, 'Delay', None, None, ), # 3
    (4, TType.STRING, 'Mode', None, None, ), # 4
  )

  def __init__(self, Attempts=None, Interval=None, Delay=None, Mode=None,):
    self.Attempts = Attempts
    self.Interval = Interval
    self.Delay = Delay
    self.Mode = Mode

  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.Attempts = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.Interval = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.Delay = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.Mode = 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('RestartPolicy')
    if self.Attempts is not None:
      oprot.writeFieldBegin('Attempts', TType.I64, 1)
      oprot.writeI64(self.Attempts)
      oprot.writeFieldEnd()
    if self.Interval is not None:
      oprot.writeFieldBegin('Interval', TType.I64, 2)
      oprot.writeI64(self.Interval)
      oprot.writeFieldEnd()
    if self.Delay is not None:
      oprot.writeFieldBegin('Delay', TType.I64, 3)
      oprot.writeI64(self.Delay)
      oprot.writeFieldEnd()
    if self.Mode is not None:
      oprot.writeFieldBegin('Mode', TType.STRING, 4)
      oprot.writeString(self.Mode)
      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 Artifact:
  """
  Attributes:
   - GetterSource
   - RetrivalDest
   - GetterOptions
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'GetterSource', None, None, ), # 1
    (2, TType.STRING, 'RetrivalDest', None, None, ), # 2
    (3, TType.MAP, 'GetterOptions', (TType.STRING,None,TType.STRING,None), None, ), # 3
  )

  def __init__(self, GetterSource=None, RetrivalDest=None, GetterOptions=None,):
    self.GetterSource = GetterSource
    self.RetrivalDest = RetrivalDest
    self.GetterOptions = GetterOptions

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

  def validate(self):
    if self.GetterSource is None:
      raise TProtocol.TProtocolException(message='Required field GetterSource is unset!')
    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 LogConfig:
  """
  Attributes:
   - MaxFiles
   - MaxFileSizeMB
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'MaxFiles', None, 3, ), # 1
    (2, TType.I32, 'MaxFileSizeMB', None, 10, ), # 2
  )

  def __init__(self, MaxFiles=thrift_spec[1][4], MaxFileSizeMB=thrift_spec[2][4],):
    self.MaxFiles = MaxFiles
    self.MaxFileSizeMB = MaxFileSizeMB

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I32:
          self.MaxFiles = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.MaxFileSizeMB = 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('LogConfig')
    if self.MaxFiles is not None:
      oprot.writeFieldBegin('MaxFiles', TType.I32, 1)
      oprot.writeI32(self.MaxFiles)
      oprot.writeFieldEnd()
    if self.MaxFileSizeMB is not None:
      oprot.writeFieldBegin('MaxFileSizeMB', TType.I32, 2)
      oprot.writeI32(self.MaxFileSizeMB)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.MaxFiles is None:
      raise TProtocol.TProtocolException(message='Required field MaxFiles is unset!')
    if self.MaxFileSizeMB is None:
      raise TProtocol.TProtocolException(message='Required field MaxFileSizeMB is unset!')
    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 Port:
  """
  Attributes:
   - Label
   - Value
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'Label', None, None, ), # 1
    (2, TType.I32, 'Value', None, None, ), # 2
  )

  def __init__(self, Label=None, Value=None,):
    self.Label = Label
    self.Value = Value

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

  def validate(self):
    if self.Label is None:
      raise TProtocol.TProtocolException(message='Required field Label is unset!')
    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 Network:
  """
  Attributes:
   - MBits
   - DynamicPorts
   - ReservedPorts
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'MBits', None, None, ), # 1
    (2, TType.LIST, 'DynamicPorts', (TType.STRUCT,(Port, Port.thrift_spec)), None, ), # 2
    (3, TType.LIST, 'ReservedPorts', (TType.STRUCT,(Port, Port.thrift_spec)), None, ), # 3
  )

  def __init__(self, MBits=None, DynamicPorts=None, ReservedPorts=None,):
    self.MBits = MBits
    self.DynamicPorts = DynamicPorts
    self.ReservedPorts = ReservedPorts

  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.MBits = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.LIST:
          self.DynamicPorts = []
          (_etype12, _size9) = iprot.readListBegin()
          for _i13 in xrange(_size9):
            _elem14 = Port()
            _elem14.read(iprot)
            self.DynamicPorts.append(_elem14)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.LIST:
          self.ReservedPorts = []
          (_etype18, _size15) = iprot.readListBegin()
          for _i19 in xrange(_size15):
            _elem20 = Port()
            _elem20.read(iprot)
            self.ReservedPorts.append(_elem20)
          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('Network')
    if self.MBits is not None:
      oprot.writeFieldBegin('MBits', TType.I64, 1)
      oprot.writeI64(self.MBits)
      oprot.writeFieldEnd()
    if self.DynamicPorts is not None:
      oprot.writeFieldBegin('DynamicPorts', TType.LIST, 2)
      oprot.writeListBegin(TType.STRUCT, len(self.DynamicPorts))
      for iter21 in self.DynamicPorts:
        iter21.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.ReservedPorts is not None:
      oprot.writeFieldBegin('ReservedPorts', TType.LIST, 3)
      oprot.writeListBegin(TType.STRUCT, len(self.ReservedPorts))
      for iter22 in self.ReservedPorts:
        iter22.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


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

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

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

class Resources:
  """
  Attributes:
   - CPU
   - DiskMB
   - IOPS
   - MemoryMB
   - Networks
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'CPU', None, None, ), # 1
    (2, TType.I64, 'DiskMB', None, None, ), # 2
    (3, TType.I16, 'IOPS', None, None, ), # 3
    (4, TType.I64, 'MemoryMB', None, None, ), # 4
    (5, TType.LIST, 'Networks', (TType.STRUCT,(Network, Network.thrift_spec)), None, ), # 5
  )

  def __init__(self, CPU=None, DiskMB=None, IOPS=None, MemoryMB=None, Networks=None,):
    self.CPU = CPU
    self.DiskMB = DiskMB
    self.IOPS = IOPS
    self.MemoryMB = MemoryMB
    self.Networks = Networks

  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.CPU = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.DiskMB = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I16:
          self.IOPS = iprot.readI16();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.MemoryMB = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.LIST:
          self.Networks = []
          (_etype26, _size23) = iprot.readListBegin()
          for _i27 in xrange(_size23):
            _elem28 = Network()
            _elem28.read(iprot)
            self.Networks.append(_elem28)
          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('Resources')
    if self.CPU is not None:
      oprot.writeFieldBegin('CPU', TType.I64, 1)
      oprot.writeI64(self.CPU)
      oprot.writeFieldEnd()
    if self.DiskMB is not None:
      oprot.writeFieldBegin('DiskMB', TType.I64, 2)
      oprot.writeI64(self.DiskMB)
      oprot.writeFieldEnd()
    if self.IOPS is not None:
      oprot.writeFieldBegin('IOPS', TType.I16, 3)
      oprot.writeI16(self.IOPS)
      oprot.writeFieldEnd()
    if self.MemoryMB is not None:
      oprot.writeFieldBegin('MemoryMB', TType.I64, 4)
      oprot.writeI64(self.MemoryMB)
      oprot.writeFieldEnd()
    if self.Networks is not None:
      oprot.writeFieldBegin('Networks', TType.LIST, 5)
      oprot.writeListBegin(TType.STRUCT, len(self.Networks))
      for iter29 in self.Networks:
        iter29.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


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

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

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

class Check:
  """
  Attributes:
   - Type
   - Name
   - Interval
   - Timeout
   - Path
   - Protocol
   - Command
   - Args
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'Type', None, None, ), # 1
    (2, TType.STRING, 'Name', None, None, ), # 2
    (3, TType.I64, 'Interval', None, None, ), # 3
    (4, TType.I64, 'Timeout', None, None, ), # 4
    (5, TType.STRING, 'Path', None, None, ), # 5
    (6, TType.STRING, 'Protocol', None, None, ), # 6
    (7, TType.STRING, 'Command', None, None, ), # 7
    (8, TType.LIST, 'Args', (TType.STRING,None), None, ), # 8
  )

  def __init__(self, Type=None, Name=None, Interval=None, Timeout=None, Path=None, Protocol=None, Command=None, Args=None,):
    self.Type = Type
    self.Name = Name
    self.Interval = Interval
    self.Timeout = Timeout
    self.Path = Path
    self.Protocol = Protocol
    self.Command = Command
    self.Args = Args

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.Type = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.Name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.Interval = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.Timeout = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.Path = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRING:
          self.Protocol = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.STRING:
          self.Command = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.LIST:
          self.Args = []
          (_etype33, _size30) = iprot.readListBegin()
          for _i34 in xrange(_size30):
            _elem35 = iprot.readString();
            self.Args.append(_elem35)
          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('Check')
    if self.Type is not None:
      oprot.writeFieldBegin('Type', TType.STRING, 1)
      oprot.writeString(self.Type)
      oprot.writeFieldEnd()
    if self.Name is not None:
      oprot.writeFieldBegin('Name', TType.STRING, 2)
      oprot.writeString(self.Name)
      oprot.writeFieldEnd()
    if self.Interval is not None:
      oprot.writeFieldBegin('Interval', TType.I64, 3)
      oprot.writeI64(self.Interval)
      oprot.writeFieldEnd()
    if self.Timeout is not None:
      oprot.writeFieldBegin('Timeout', TType.I64, 4)
      oprot.writeI64(self.Timeout)
      oprot.writeFieldEnd()
    if self.Path is not None:
      oprot.writeFieldBegin('Path', TType.STRING, 5)
      oprot.writeString(self.Path)
      oprot.writeFieldEnd()
    if self.Protocol is not None:
      oprot.writeFieldBegin('Protocol', TType.STRING, 6)
      oprot.writeString(self.Protocol)
      oprot.writeFieldEnd()
    if self.Command is not None:
      oprot.writeFieldBegin('Command', TType.STRING, 7)
      oprot.writeString(self.Command)
      oprot.writeFieldEnd()
    if self.Args is not None:
      oprot.writeFieldBegin('Args', TType.LIST, 8)
      oprot.writeListBegin(TType.STRING, len(self.Args))
      for iter36 in self.Args:
        oprot.writeString(iter36)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.Type is None:
      raise TProtocol.TProtocolException(message='Required field Type is unset!')
    if self.Name is None:
      raise TProtocol.TProtocolException(message='Required field Name is unset!')
    if self.Interval is None:
      raise TProtocol.TProtocolException(message='Required field Interval is unset!')
    if self.Timeout is None:
      raise TProtocol.TProtocolException(message='Required field Timeout is unset!')
    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 Service:
  """
  Attributes:
   - Name
   - Tags
   - PortLabel
   - Checks
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'Name', None, None, ), # 1
    (2, TType.LIST, 'Tags', (TType.STRING,None), None, ), # 2
    (3, TType.STRING, 'PortLabel', None, None, ), # 3
    (4, TType.LIST, 'Checks', (TType.STRUCT,(Check, Check.thrift_spec)), None, ), # 4
  )

  def __init__(self, Name=None, Tags=None, PortLabel=None, Checks=None,):
    self.Name = Name
    self.Tags = Tags
    self.PortLabel = PortLabel
    self.Checks = Checks

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.Name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.LIST:
          self.Tags = []
          (_etype40, _size37) = iprot.readListBegin()
          for _i41 in xrange(_size37):
            _elem42 = iprot.readString();
            self.Tags.append(_elem42)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.PortLabel = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.LIST:
          self.Checks = []
          (_etype46, _size43) = iprot.readListBegin()
          for _i47 in xrange(_size43):
            _elem48 = Check()
            _elem48.read(iprot)
            self.Checks.append(_elem48)
          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('Service')
    if self.Name is not None:
      oprot.writeFieldBegin('Name', TType.STRING, 1)
      oprot.writeString(self.Name)
      oprot.writeFieldEnd()
    if self.Tags is not None:
      oprot.writeFieldBegin('Tags', TType.LIST, 2)
      oprot.writeListBegin(TType.STRING, len(self.Tags))
      for iter49 in self.Tags:
        oprot.writeString(iter49)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.PortLabel is not None:
      oprot.writeFieldBegin('PortLabel', TType.STRING, 3)
      oprot.writeString(self.PortLabel)
      oprot.writeFieldEnd()
    if self.Checks is not None:
      oprot.writeFieldBegin('Checks', TType.LIST, 4)
      oprot.writeListBegin(TType.STRUCT, len(self.Checks))
      for iter50 in self.Checks:
        iter50.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.Name is None:
      raise TProtocol.TProtocolException(message='Required field Name is unset!')
    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 Template:
  """
  Attributes:
   - SourcePath
   - EmbeddedTmpl
   - DestPath
   - ChangeMode
   - ChangeSignal
   - Splay
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'SourcePath', None, None, ), # 1
    (2, TType.STRING, 'EmbeddedTmpl', None, None, ), # 2
    (3, TType.STRING, 'DestPath', None, None, ), # 3
    (4, TType.STRING, 'ChangeMode', None, None, ), # 4
    (5, TType.STRING, 'ChangeSignal', None, None, ), # 5
    (6, TType.I64, 'Splay', None, None, ), # 6
  )

  def __init__(self, SourcePath=None, EmbeddedTmpl=None, DestPath=None, ChangeMode=None, ChangeSignal=None, Splay=None,):
    self.SourcePath = SourcePath
    self.EmbeddedTmpl = EmbeddedTmpl
    self.DestPath = DestPath
    self.ChangeMode = ChangeMode
    self.ChangeSignal = ChangeSignal
    self.Splay = Splay

  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.SourcePath = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.EmbeddedTmpl = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.DestPath = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.ChangeMode = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.ChangeSignal = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I64:
          self.Splay = 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('Template')
    if self.SourcePath is not None:
      oprot.writeFieldBegin('SourcePath', TType.STRING, 1)
      oprot.writeString(self.SourcePath)
      oprot.writeFieldEnd()
    if self.EmbeddedTmpl is not None:
      oprot.writeFieldBegin('EmbeddedTmpl', TType.STRING, 2)
      oprot.writeString(self.EmbeddedTmpl)
      oprot.writeFieldEnd()
    if self.DestPath is not None:
      oprot.writeFieldBegin('DestPath', TType.STRING, 3)
      oprot.writeString(self.DestPath)
      oprot.writeFieldEnd()
    if self.ChangeMode is not None:
      oprot.writeFieldBegin('ChangeMode', TType.STRING, 4)
      oprot.writeString(self.ChangeMode)
      oprot.writeFieldEnd()
    if self.ChangeSignal is not None:
      oprot.writeFieldBegin('ChangeSignal', TType.STRING, 5)
      oprot.writeString(self.ChangeSignal)
      oprot.writeFieldEnd()
    if self.Splay is not None:
      oprot.writeFieldBegin('Splay', TType.I64, 6)
      oprot.writeI64(self.Splay)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.DestPath is None:
      raise TProtocol.TProtocolException(message='Required field DestPath is unset!')
    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 Config:
  """
  Attributes:
   - image
   - command
   - port_map
   - command_args
   - image_path
   - accelerator
   - volumes
   - dns_search_domains
   - dns_servers
   - extra_hosts
   - hostname
   - interactive
   - ipc_mode
   - ipv4_address
   - ipv6_address
   - labels
   - load
   - mac_address
   - network_aliases
   - network_mode
   - pid_mode
   - privileged
   - security_opt
   - shm_size
   - tty
   - uts_mode
   - userns_mode
   - volume_driver
   - work_dir
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'image', None, None, ), # 1
    (2, TType.STRING, 'command', None, None, ), # 2
    (3, TType.LIST, 'port_map', (TType.MAP,(TType.STRING,None,TType.STRING,None)), None, ), # 3
    (4, TType.LIST, 'command_args', (TType.STRING,None), None, ), # 4
    (5, TType.STRING, 'image_path', None, None, ), # 5
    (6, TType.STRING, 'accelerator', None, None, ), # 6
    (7, TType.LIST, 'volumes', (TType.STRING,None), None, ), # 7
    (8, TType.LIST, 'dns_search_domains', (TType.STRING,None), None, ), # 8
    (9, TType.LIST, 'dns_servers', (TType.STRING,None), None, ), # 9
    (10, TType.LIST, 'extra_hosts', (TType.STRING,None), None, ), # 10
    (11, TType.STRING, 'hostname', None, None, ), # 11
    (12, TType.BOOL, 'interactive', None, None, ), # 12
    (13, TType.STRING, 'ipc_mode', None, None, ), # 13
    (14, TType.STRING, 'ipv4_address', None, None, ), # 14
    (15, TType.STRING, 'ipv6_address', None, None, ), # 15
    (16, TType.MAP, 'labels', (TType.STRING,None,TType.STRING,None), None, ), # 16
    (17, TType.LIST, 'load', (TType.STRING,None), None, ), # 17
    (18, TType.STRING, 'mac_address', None, None, ), # 18
    (19, TType.LIST, 'network_aliases', (TType.STRING,None), None, ), # 19
    (20, TType.STRING, 'network_mode', None, None, ), # 20
    (21, TType.STRING, 'pid_mode', None, None, ), # 21
    (22, TType.BOOL, 'privileged', None, None, ), # 22
    (23, TType.LIST, 'security_opt', (TType.STRING,None), None, ), # 23
    (24, TType.I64, 'shm_size', None, None, ), # 24
    (25, TType.BOOL, 'tty', None, None, ), # 25
    (26, TType.STRING, 'uts_mode', None, None, ), # 26
    (27, TType.STRING, 'userns_mode', None, None, ), # 27
    (28, TType.STRING, 'volume_driver', None, None, ), # 28
    (29, TType.STRING, 'work_dir', None, None, ), # 29
  )

  def __init__(self, image=None, command=None, port_map=None, command_args=None, image_path=None, accelerator=None, volumes=None, dns_search_domains=None, dns_servers=None, extra_hosts=None, hostname=None, interactive=None, ipc_mode=None, ipv4_address=None, ipv6_address=None, labels=None, load=None, mac_address=None, network_aliases=None, network_mode=None, pid_mode=None, privileged=None, security_opt=None, shm_size=None, tty=None, uts_mode=None, userns_mode=None, volume_driver=None, work_dir=None,):
    self.image = image
    self.command = command
    self.port_map = port_map
    self.command_args = command_args
    self.image_path = image_path
    self.accelerator = accelerator
    self.volumes = volumes
    self.dns_search_domains = dns_search_domains
    self.dns_servers = dns_servers
    self.extra_hosts = extra_hosts
    self.hostname = hostname
    self.interactive = interactive
    self.ipc_mode = ipc_mode
    self.ipv4_address = ipv4_address
    self.ipv6_address = ipv6_address
    self.labels = labels
    self.load = load
    self.mac_address = mac_address
    self.network_aliases = network_aliases
    self.network_mode = network_mode
    self.pid_mode = pid_mode
    self.privileged = privileged
    self.security_opt = security_opt
    self.shm_size = shm_size
    self.tty = tty
    self.uts_mode = uts_mode
    self.userns_mode = userns_mode
    self.volume_driver = volume_driver
    self.work_dir = work_dir

  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.image = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.command = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.LIST:
          self.port_map = []
          (_etype54, _size51) = iprot.readListBegin()
          for _i55 in xrange(_size51):
            _elem56 = {}
            (_ktype58, _vtype59, _size57 ) = iprot.readMapBegin()
            for _i61 in xrange(_size57):
              _key62 = iprot.readString();
              _val63 = iprot.readString();
              _elem56[_key62] = _val63
            iprot.readMapEnd()
            self.port_map.append(_elem56)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.LIST:
          self.command_args = []
          (_etype67, _size64) = iprot.readListBegin()
          for _i68 in xrange(_size64):
            _elem69 = iprot.readString();
            self.command_args.append(_elem69)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.image_path = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRING:
          self.accelerator = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.LIST:
          self.volumes = []
          (_etype73, _size70) = iprot.readListBegin()
          for _i74 in xrange(_size70):
            _elem75 = iprot.readString();
            self.volumes.append(_elem75)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.LIST:
          self.dns_search_domains = []
          (_etype79, _size76) = iprot.readListBegin()
          for _i80 in xrange(_size76):
            _elem81 = iprot.readString();
            self.dns_search_domains.append(_elem81)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.LIST:
          self.dns_servers = []
          (_etype85, _size82) = iprot.readListBegin()
          for _i86 in xrange(_size82):
            _elem87 = iprot.readString();
            self.dns_servers.append(_elem87)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.LIST:
          self.extra_hosts = []
          (_etype91, _size88) = iprot.readListBegin()
          for _i92 in xrange(_size88):
            _elem93 = iprot.readString();
            self.extra_hosts.append(_elem93)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.STRING:
          self.hostname = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.BOOL:
          self.interactive = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.STRING:
          self.ipc_mode = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.STRING:
          self.ipv4_address = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.STRING:
          self.ipv6_address = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.MAP:
          self.labels = {}
          (_ktype95, _vtype96, _size94 ) = iprot.readMapBegin()
          for _i98 in xrange(_size94):
            _key99 = iprot.readString();
            _val100 = iprot.readString();
            self.labels[_key99] = _val100
          iprot.readMapEnd()
        else:
          iprot.skip(ftype)
      elif fid == 17:
        if ftype == TType.LIST:
          self.load = []
          (_etype104, _size101) = iprot.readListBegin()
          for _i105 in xrange(_size101):
            _elem106 = iprot.readString();
            self.load.append(_elem106)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 18:
        if ftype == TType.STRING:
          self.mac_address = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 19:
        if ftype == TType.LIST:
          self.network_aliases = []
          (_etype110, _size107) = iprot.readListBegin()
          for _i111 in xrange(_size107):
            _elem112 = iprot.readString();
            self.network_aliases.append(_elem112)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 20:
        if ftype == TType.STRING:
          self.network_mode = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 21:
        if ftype == TType.STRING:
          self.pid_mode = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 22:
        if ftype == TType.BOOL:
          self.privileged = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 23:
        if ftype == TType.LIST:
          self.security_opt = []
          (_etype116, _size113) = iprot.readListBegin()
          for _i117 in xrange(_size113):
            _elem118 = iprot.readString();
            self.security_opt.append(_elem118)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 24:
        if ftype == TType.I64:
          self.shm_size = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 25:
        if ftype == TType.BOOL:
          self.tty = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 26:
        if ftype == TType.STRING:
          self.uts_mode = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 27:
        if ftype == TType.STRING:
          self.userns_mode = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 28:
        if ftype == TType.STRING:
          self.volume_driver = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 29:
        if ftype == TType.STRING:
          self.work_dir = 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('Config')
    if self.image is not None:
      oprot.writeFieldBegin('image', TType.STRING, 1)
      oprot.writeString(self.image)
      oprot.writeFieldEnd()
    if self.command is not None:
      oprot.writeFieldBegin('command', TType.STRING, 2)
      oprot.writeString(self.command)
      oprot.writeFieldEnd()
    if self.port_map is not None:
      oprot.writeFieldBegin('port_map', TType.LIST, 3)
      oprot.writeListBegin(TType.MAP, len(self.port_map))
      for iter119 in self.port_map:
        oprot.writeMapBegin(TType.STRING, TType.STRING, len(iter119))
        for kiter120,viter121 in iter119.items():
          oprot.writeString(kiter120)
          oprot.writeString(viter121)
        oprot.writeMapEnd()
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.command_args is not None:
      oprot.writeFieldBegin('command_args', TType.LIST, 4)
      oprot.writeListBegin(TType.STRING, len(self.command_args))
      for iter122 in self.command_args:
        oprot.writeString(iter122)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.image_path is not None:
      oprot.writeFieldBegin('image_path', TType.STRING, 5)
      oprot.writeString(self.image_path)
      oprot.writeFieldEnd()
    if self.accelerator is not None:
      oprot.writeFieldBegin('accelerator', TType.STRING, 6)
      oprot.writeString(self.accelerator)
      oprot.writeFieldEnd()
    if self.volumes is not None:
      oprot.writeFieldBegin('volumes', TType.LIST, 7)
      oprot.writeListBegin(TType.STRING, len(self.volumes))
      for iter123 in self.volumes:
        oprot.writeString(iter123)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.dns_search_domains is not None:
      oprot.writeFieldBegin('dns_search_domains', TType.LIST, 8)
      oprot.writeListBegin(TType.STRING, len(self.dns_search_domains))
      for iter124 in self.dns_search_domains:
        oprot.writeString(iter124)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.dns_servers is not None:
      oprot.writeFieldBegin('dns_servers', TType.LIST, 9)
      oprot.writeListBegin(TType.STRING, len(self.dns_servers))
      for iter125 in self.dns_servers:
        oprot.writeString(iter125)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.extra_hosts is not None:
      oprot.writeFieldBegin('extra_hosts', TType.LIST, 10)
      oprot.writeListBegin(TType.STRING, len(self.extra_hosts))
      for iter126 in self.extra_hosts:
        oprot.writeString(iter126)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.hostname is not None:
      oprot.writeFieldBegin('hostname', TType.STRING, 11)
      oprot.writeString(self.hostname)
      oprot.writeFieldEnd()
    if self.interactive is not None:
      oprot.writeFieldBegin('interactive', TType.BOOL, 12)
      oprot.writeBool(self.interactive)
      oprot.writeFieldEnd()
    if self.ipc_mode is not None:
      oprot.writeFieldBegin('ipc_mode', TType.STRING, 13)
      oprot.writeString(self.ipc_mode)
      oprot.writeFieldEnd()
    if self.ipv4_address is not None:
      oprot.writeFieldBegin('ipv4_address', TType.STRING, 14)
      oprot.writeString(self.ipv4_address)
      oprot.writeFieldEnd()
    if self.ipv6_address is not None:
      oprot.writeFieldBegin('ipv6_address', TType.STRING, 15)
      oprot.writeString(self.ipv6_address)
      oprot.writeFieldEnd()
    if self.labels is not None:
      oprot.writeFieldBegin('labels', TType.MAP, 16)
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.labels))
      for kiter127,viter128 in self.labels.items():
        oprot.writeString(kiter127)
        oprot.writeString(viter128)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    if self.load is not None:
      oprot.writeFieldBegin('load', TType.LIST, 17)
      oprot.writeListBegin(TType.STRING, len(self.load))
      for iter129 in self.load:
        oprot.writeString(iter129)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.mac_address is not None:
      oprot.writeFieldBegin('mac_address', TType.STRING, 18)
      oprot.writeString(self.mac_address)
      oprot.writeFieldEnd()
    if self.network_aliases is not None:
      oprot.writeFieldBegin('network_aliases', TType.LIST, 19)
      oprot.writeListBegin(TType.STRING, len(self.network_aliases))
      for iter130 in self.network_aliases:
        oprot.writeString(iter130)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.network_mode is not None:
      oprot.writeFieldBegin('network_mode', TType.STRING, 20)
      oprot.writeString(self.network_mode)
      oprot.writeFieldEnd()
    if self.pid_mode is not None:
      oprot.writeFieldBegin('pid_mode', TType.STRING, 21)
      oprot.writeString(self.pid_mode)
      oprot.writeFieldEnd()
    if self.privileged is not None:
      oprot.writeFieldBegin('privileged', TType.BOOL, 22)
      oprot.writeBool(self.privileged)
      oprot.writeFieldEnd()
    if self.security_opt is not None:
      oprot.writeFieldBegin('security_opt', TType.LIST, 23)
      oprot.writeListBegin(TType.STRING, len(self.security_opt))
      for iter131 in self.security_opt:
        oprot.writeString(iter131)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.shm_size is not None:
      oprot.writeFieldBegin('shm_size', TType.I64, 24)
      oprot.writeI64(self.shm_size)
      oprot.writeFieldEnd()
    if self.tty is not None:
      oprot.writeFieldBegin('tty', TType.BOOL, 25)
      oprot.writeBool(self.tty)
      oprot.writeFieldEnd()
    if self.uts_mode is not None:
      oprot.writeFieldBegin('uts_mode', TType.STRING, 26)
      oprot.writeString(self.uts_mode)
      oprot.writeFieldEnd()
    if self.userns_mode is not None:
      oprot.writeFieldBegin('userns_mode', TType.STRING, 27)
      oprot.writeString(self.userns_mode)
      oprot.writeFieldEnd()
    if self.volume_driver is not None:
      oprot.writeFieldBegin('volume_driver', TType.STRING, 28)
      oprot.writeString(self.volume_driver)
      oprot.writeFieldEnd()
    if self.work_dir is not None:
      oprot.writeFieldBegin('work_dir', TType.STRING, 29)
      oprot.writeString(self.work_dir)
      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 Vault:
  """
  Attributes:
   - Policies
   - Env
   - ChangeMode
   - ChangeSignal
  """

  thrift_spec = (
    None, # 0
    (1, TType.LIST, 'Policies', (TType.STRING,None), None, ), # 1
    (2, TType.BOOL, 'Env', None, True, ), # 2
    (3, TType.STRING, 'ChangeMode', None, "noop", ), # 3
    (4, TType.STRING, 'ChangeSignal', None, None, ), # 4
  )

  def __init__(self, Policies=None, Env=thrift_spec[2][4], ChangeMode=thrift_spec[3][4], ChangeSignal=None,):
    self.Policies = Policies
    self.Env = Env
    self.ChangeMode = ChangeMode
    self.ChangeSignal = ChangeSignal

  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.LIST:
          self.Policies = []
          (_etype135, _size132) = iprot.readListBegin()
          for _i136 in xrange(_size132):
            _elem137 = iprot.readString();
            self.Policies.append(_elem137)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.BOOL:
          self.Env = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.ChangeMode = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.ChangeSignal = 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('Vault')
    if self.Policies is not None:
      oprot.writeFieldBegin('Policies', TType.LIST, 1)
      oprot.writeListBegin(TType.STRING, len(self.Policies))
      for iter138 in self.Policies:
        oprot.writeString(iter138)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.Env is not None:
      oprot.writeFieldBegin('Env', TType.BOOL, 2)
      oprot.writeBool(self.Env)
      oprot.writeFieldEnd()
    if self.ChangeMode is not None:
      oprot.writeFieldBegin('ChangeMode', TType.STRING, 3)
      oprot.writeString(self.ChangeMode)
      oprot.writeFieldEnd()
    if self.ChangeSignal is not None:
      oprot.writeFieldBegin('ChangeSignal', TType.STRING, 4)
      oprot.writeString(self.ChangeSignal)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.Policies is None:
      raise TProtocol.TProtocolException(message='Required field Policies is unset!')
    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 Task:
  """
  Attributes:
   - Artifacts
   - Config
   - Constraints
   - DispatchPayload
   - Driver
   - Env
   - KillTimeout
   - LogConfig
   - Meta
   - Name
   - Resources
   - Services
   - Templates
   - User
   - Vault
  """

  thrift_spec = (
    None, # 0
    (1, TType.LIST, 'Artifacts', (TType.STRUCT,(Artifact, Artifact.thrift_spec)), None, ), # 1
    (2, TType.STRUCT, 'Config', (Config, Config.thrift_spec), None, ), # 2
    (3, TType.LIST, 'Constraints', (TType.STRUCT,(Constraint, Constraint.thrift_spec)), None, ), # 3
    (4, TType.STRING, 'DispatchPayload', None, None, ), # 4
    (5, TType.STRING, 'Driver', None, None, ), # 5
    (6, TType.MAP, 'Env', (TType.STRING,None,TType.STRING,None), None, ), # 6
    (7, TType.I64, 'KillTimeout', None, None, ), # 7
    (8, TType.STRUCT, 'LogConfig', (LogConfig, LogConfig.thrift_spec), None, ), # 8
    (9, TType.MAP, 'Meta', (TType.STRING,None,TType.STRING,None), None, ), # 9
    (10, TType.STRING, 'Name', None, None, ), # 10
    (11, TType.STRUCT, 'Resources', (Resources, Resources.thrift_spec), None, ), # 11
    (12, TType.LIST, 'Services', (TType.STRUCT,(Service, Service.thrift_spec)), None, ), # 12
    (13, TType.LIST, 'Templates', (TType.STRUCT,(Template, Template.thrift_spec)), None, ), # 13
    (14, TType.STRING, 'User', None, None, ), # 14
    (15, TType.STRUCT, 'Vault', (Vault, Vault.thrift_spec), None, ), # 15
  )

  def __init__(self, Artifacts=None, Config=None, Constraints=None, DispatchPayload=None, Driver=None, Env=None, KillTimeout=None, LogConfig=None, Meta=None, Name=None, Resources=None, Services=None, Templates=None, User=None, Vault=None,):
    self.Artifacts = Artifacts
    self.Config = Config
    self.Constraints = Constraints
    self.DispatchPayload = DispatchPayload
    self.Driver = Driver
    self.Env = Env
    self.KillTimeout = KillTimeout
    self.LogConfig = LogConfig
    self.Meta = Meta
    self.Name = Name
    self.Resources = Resources
    self.Services = Services
    self.Templates = Templates
    self.User = User
    self.Vault = Vault

  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.LIST:
          self.Artifacts = []
          (_etype142, _size139) = iprot.readListBegin()
          for _i143 in xrange(_size139):
            _elem144 = Artifact()
            _elem144.read(iprot)
            self.Artifacts.append(_elem144)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.Config = Config()
          self.Config.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.LIST:
          self.Constraints = []
          (_etype148, _size145) = iprot.readListBegin()
          for _i149 in xrange(_size145):
            _elem150 = Constraint()
            _elem150.read(iprot)
            self.Constraints.append(_elem150)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.DispatchPayload = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.Driver = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.MAP:
          self.Env = {}
          (_ktype152, _vtype153, _size151 ) = iprot.readMapBegin()
          for _i155 in xrange(_size151):
            _key156 = iprot.readString();
            _val157 = iprot.readString();
            self.Env[_key156] = _val157
          iprot.readMapEnd()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.I64:
          self.KillTimeout = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.STRUCT:
          self.LogConfig = LogConfig()
          self.LogConfig.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.MAP:
          self.Meta = {}
          (_ktype159, _vtype160, _size158 ) = iprot.readMapBegin()
          for _i162 in xrange(_size158):
            _key163 = iprot.readString();
            _val164 = iprot.readString();
            self.Meta[_key163] = _val164
          iprot.readMapEnd()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.STRING:
          self.Name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.STRUCT:
          self.Resources = Resources()
          self.Resources.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.LIST:
          self.Services = []
          (_etype168, _size165) = iprot.readListBegin()
          for _i169 in xrange(_size165):
            _elem170 = Service()
            _elem170.read(iprot)
            self.Services.append(_elem170)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.LIST:
          self.Templates = []
          (_etype174, _size171) = iprot.readListBegin()
          for _i175 in xrange(_size171):
            _elem176 = Template()
            _elem176.read(iprot)
            self.Templates.append(_elem176)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.STRING:
          self.User = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.STRUCT:
          self.Vault = Vault()
          self.Vault.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('Task')
    if self.Artifacts is not None:
      oprot.writeFieldBegin('Artifacts', TType.LIST, 1)
      oprot.writeListBegin(TType.STRUCT, len(self.Artifacts))
      for iter177 in self.Artifacts:
        iter177.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.Config is not None:
      oprot.writeFieldBegin('Config', TType.STRUCT, 2)
      self.Config.write(oprot)
      oprot.writeFieldEnd()
    if self.Constraints is not None:
      oprot.writeFieldBegin('Constraints', TType.LIST, 3)
      oprot.writeListBegin(TType.STRUCT, len(self.Constraints))
      for iter178 in self.Constraints:
        iter178.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.DispatchPayload is not None:
      oprot.writeFieldBegin('DispatchPayload', TType.STRING, 4)
      oprot.writeString(self.DispatchPayload)
      oprot.writeFieldEnd()
    if self.Driver is not None:
      oprot.writeFieldBegin('Driver', TType.STRING, 5)
      oprot.writeString(self.Driver)
      oprot.writeFieldEnd()
    if self.Env is not None:
      oprot.writeFieldBegin('Env', TType.MAP, 6)
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.Env))
      for kiter179,viter180 in self.Env.items():
        oprot.writeString(kiter179)
        oprot.writeString(viter180)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    if self.KillTimeout is not None:
      oprot.writeFieldBegin('KillTimeout', TType.I64, 7)
      oprot.writeI64(self.KillTimeout)
      oprot.writeFieldEnd()
    if self.LogConfig is not None:
      oprot.writeFieldBegin('LogConfig', TType.STRUCT, 8)
      self.LogConfig.write(oprot)
      oprot.writeFieldEnd()
    if self.Meta is not None:
      oprot.writeFieldBegin('Meta', TType.MAP, 9)
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.Meta))
      for kiter181,viter182 in self.Meta.items():
        oprot.writeString(kiter181)
        oprot.writeString(viter182)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    if self.Name is not None:
      oprot.writeFieldBegin('Name', TType.STRING, 10)
      oprot.writeString(self.Name)
      oprot.writeFieldEnd()
    if self.Resources is not None:
      oprot.writeFieldBegin('Resources', TType.STRUCT, 11)
      self.Resources.write(oprot)
      oprot.writeFieldEnd()
    if self.Services is not None:
      oprot.writeFieldBegin('Services', TType.LIST, 12)
      oprot.writeListBegin(TType.STRUCT, len(self.Services))
      for iter183 in self.Services:
        iter183.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.Templates is not None:
      oprot.writeFieldBegin('Templates', TType.LIST, 13)
      oprot.writeListBegin(TType.STRUCT, len(self.Templates))
      for iter184 in self.Templates:
        iter184.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.User is not None:
      oprot.writeFieldBegin('User', TType.STRING, 14)
      oprot.writeString(self.User)
      oprot.writeFieldEnd()
    if self.Vault is not None:
      oprot.writeFieldBegin('Vault', TType.STRUCT, 15)
      self.Vault.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.Driver is None:
      raise TProtocol.TProtocolException(message='Required field Driver is unset!')
    if self.Name is None:
      raise TProtocol.TProtocolException(message='Required field Name is unset!')
    if self.Resources is None:
      raise TProtocol.TProtocolException(message='Required field Resources is unset!')
    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 EphemeralDisk:
  """
  Attributes:
   - SizeMB
   - Sticky
   - Migrate
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'SizeMB', None, None, ), # 1
    (2, TType.BOOL, 'Sticky', None, False, ), # 2
    (3, TType.BOOL, 'Migrate', None, False, ), # 3
  )

  def __init__(self, SizeMB=None, Sticky=thrift_spec[2][4], Migrate=thrift_spec[3][4],):
    self.SizeMB = SizeMB
    self.Sticky = Sticky
    self.Migrate = Migrate

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

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('EphemeralDisk')
    if self.SizeMB is not None:
      oprot.writeFieldBegin('SizeMB', TType.I32, 1)
      oprot.writeI32(self.SizeMB)
      oprot.writeFieldEnd()
    if self.Sticky is not None:
      oprot.writeFieldBegin('Sticky', TType.BOOL, 2)
      oprot.writeBool(self.Sticky)
      oprot.writeFieldEnd()
    if self.Migrate is not None:
      oprot.writeFieldBegin('Migrate', TType.BOOL, 3)
      oprot.writeBool(self.Migrate)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.SizeMB is None:
      raise TProtocol.TProtocolException(message='Required field SizeMB is unset!')
    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 TaskGroup:
  """
  Attributes:
   - Constraints
   - Count
   - Meta
   - Name
   - RestartPolicy
   - Tasks
   - EphemeralDisk
  """

  thrift_spec = (
    None, # 0
    (1, TType.LIST, 'Constraints', (TType.STRUCT,(Constraint, Constraint.thrift_spec)), None, ), # 1
    (2, TType.I64, 'Count', None, None, ), # 2
    (3, TType.MAP, 'Meta', (TType.STRING,None,TType.STRING,None), None, ), # 3
    (4, TType.STRING, 'Name', None, None, ), # 4
    (5, TType.STRUCT, 'RestartPolicy', (RestartPolicy, RestartPolicy.thrift_spec), None, ), # 5
    (6, TType.LIST, 'Tasks', (TType.STRUCT,(Task, Task.thrift_spec)), None, ), # 6
    (7, TType.STRUCT, 'EphemeralDisk', (EphemeralDisk, EphemeralDisk.thrift_spec), None, ), # 7
  )

  def __init__(self, Constraints=None, Count=None, Meta=None, Name=None, RestartPolicy=None, Tasks=None, EphemeralDisk=None,):
    self.Constraints = Constraints
    self.Count = Count
    self.Meta = Meta
    self.Name = Name
    self.RestartPolicy = RestartPolicy
    self.Tasks = Tasks
    self.EphemeralDisk = EphemeralDisk

  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.LIST:
          self.Constraints = []
          (_etype188, _size185) = iprot.readListBegin()
          for _i189 in xrange(_size185):
            _elem190 = Constraint()
            _elem190.read(iprot)
            self.Constraints.append(_elem190)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.Count = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.MAP:
          self.Meta = {}
          (_ktype192, _vtype193, _size191 ) = iprot.readMapBegin()
          for _i195 in xrange(_size191):
            _key196 = iprot.readString();
            _val197 = iprot.readString();
            self.Meta[_key196] = _val197
          iprot.readMapEnd()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.Name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRUCT:
          self.RestartPolicy = RestartPolicy()
          self.RestartPolicy.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.LIST:
          self.Tasks = []
          (_etype201, _size198) = iprot.readListBegin()
          for _i202 in xrange(_size198):
            _elem203 = Task()
            _elem203.read(iprot)
            self.Tasks.append(_elem203)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.STRUCT:
          self.EphemeralDisk = EphemeralDisk()
          self.EphemeralDisk.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('TaskGroup')
    if self.Constraints is not None:
      oprot.writeFieldBegin('Constraints', TType.LIST, 1)
      oprot.writeListBegin(TType.STRUCT, len(self.Constraints))
      for iter204 in self.Constraints:
        iter204.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.Count is not None:
      oprot.writeFieldBegin('Count', TType.I64, 2)
      oprot.writeI64(self.Count)
      oprot.writeFieldEnd()
    if self.Meta is not None:
      oprot.writeFieldBegin('Meta', TType.MAP, 3)
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.Meta))
      for kiter205,viter206 in self.Meta.items():
        oprot.writeString(kiter205)
        oprot.writeString(viter206)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    if self.Name is not None:
      oprot.writeFieldBegin('Name', TType.STRING, 4)
      oprot.writeString(self.Name)
      oprot.writeFieldEnd()
    if self.RestartPolicy is not None:
      oprot.writeFieldBegin('RestartPolicy', TType.STRUCT, 5)
      self.RestartPolicy.write(oprot)
      oprot.writeFieldEnd()
    if self.Tasks is not None:
      oprot.writeFieldBegin('Tasks', TType.LIST, 6)
      oprot.writeListBegin(TType.STRUCT, len(self.Tasks))
      for iter207 in self.Tasks:
        iter207.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.EphemeralDisk is not None:
      oprot.writeFieldBegin('EphemeralDisk', TType.STRUCT, 7)
      self.EphemeralDisk.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.Name is None:
      raise TProtocol.TProtocolException(message='Required field Name is unset!')
    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 Job:
  """
  Attributes:
   - AllAtOnce
   - Constraints
   - Datacenters
   - TaskGroups
   - Meta
   - ParamaterizedJob
   - Payload
   - Priority
   - Region
   - Type
   - Update
   - Periodic
   - Name
   - ID
  """

  thrift_spec = (
    None, # 0
    (1, TType.BOOL, 'AllAtOnce', None, None, ), # 1
    (2, TType.LIST, 'Constraints', (TType.STRUCT,(Constraint, Constraint.thrift_spec)), None, ), # 2
    (3, TType.LIST, 'Datacenters', (TType.STRING,None), None, ), # 3
    (4, TType.LIST, 'TaskGroups', (TType.STRUCT,(TaskGroup, TaskGroup.thrift_spec)), None, ), # 4
    (5, TType.MAP, 'Meta', (TType.STRING,None,TType.STRING,None), None, ), # 5
    (6, TType.STRUCT, 'ParamaterizedJob', (ParamaterizedJob, ParamaterizedJob.thrift_spec), None, ), # 6
    (7, TType.STRING, 'Payload', None, None, ), # 7
    (8, TType.I16, 'Priority', None, 50, ), # 8
    (9, TType.STRING, 'Region', None, None, ), # 9
    (10, TType.STRING, 'Type', None, None, ), # 10
    (11, TType.STRUCT, 'Update', (Update, Update.thrift_spec), None, ), # 11
    (12, TType.STRUCT, 'Periodic', (Periodic, Periodic.thrift_spec), None, ), # 12
    (13, TType.STRING, 'Name', None, None, ), # 13
    (14, TType.STRING, 'ID', None, None, ), # 14
  )

  def __init__(self, AllAtOnce=None, Constraints=None, Datacenters=None, TaskGroups=None, Meta=None, ParamaterizedJob=None, Payload=None, Priority=thrift_spec[8][4], Region=None, Type=None, Update=None, Periodic=None, Name=None, ID=None,):
    self.AllAtOnce = AllAtOnce
    self.Constraints = Constraints
    self.Datacenters = Datacenters
    self.TaskGroups = TaskGroups
    self.Meta = Meta
    self.ParamaterizedJob = ParamaterizedJob
    self.Payload = Payload
    self.Priority = Priority
    self.Region = Region
    self.Type = Type
    self.Update = Update
    self.Periodic = Periodic
    self.Name = Name
    self.ID = ID

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.BOOL:
          self.AllAtOnce = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.LIST:
          self.Constraints = []
          (_etype211, _size208) = iprot.readListBegin()
          for _i212 in xrange(_size208):
            _elem213 = Constraint()
            _elem213.read(iprot)
            self.Constraints.append(_elem213)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.LIST:
          self.Datacenters = []
          (_etype217, _size214) = iprot.readListBegin()
          for _i218 in xrange(_size214):
            _elem219 = iprot.readString();
            self.Datacenters.append(_elem219)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.LIST:
          self.TaskGroups = []
          (_etype223, _size220) = iprot.readListBegin()
          for _i224 in xrange(_size220):
            _elem225 = TaskGroup()
            _elem225.read(iprot)
            self.TaskGroups.append(_elem225)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.MAP:
          self.Meta = {}
          (_ktype227, _vtype228, _size226 ) = iprot.readMapBegin()
          for _i230 in xrange(_size226):
            _key231 = iprot.readString();
            _val232 = iprot.readString();
            self.Meta[_key231] = _val232
          iprot.readMapEnd()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRUCT:
          self.ParamaterizedJob = ParamaterizedJob()
          self.ParamaterizedJob.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.STRING:
          self.Payload = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.I16:
          self.Priority = iprot.readI16();
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.STRING:
          self.Region = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.STRING:
          self.Type = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.STRUCT:
          self.Update = Update()
          self.Update.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.STRUCT:
          self.Periodic = Periodic()
          self.Periodic.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.STRING:
          self.Name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.STRING:
          self.ID = 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('Job')
    if self.AllAtOnce is not None:
      oprot.writeFieldBegin('AllAtOnce', TType.BOOL, 1)
      oprot.writeBool(self.AllAtOnce)
      oprot.writeFieldEnd()
    if self.Constraints is not None:
      oprot.writeFieldBegin('Constraints', TType.LIST, 2)
      oprot.writeListBegin(TType.STRUCT, len(self.Constraints))
      for iter233 in self.Constraints:
        iter233.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.Datacenters is not None:
      oprot.writeFieldBegin('Datacenters', TType.LIST, 3)
      oprot.writeListBegin(TType.STRING, len(self.Datacenters))
      for iter234 in self.Datacenters:
        oprot.writeString(iter234)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.TaskGroups is not None:
      oprot.writeFieldBegin('TaskGroups', TType.LIST, 4)
      oprot.writeListBegin(TType.STRUCT, len(self.TaskGroups))
      for iter235 in self.TaskGroups:
        iter235.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.Meta is not None:
      oprot.writeFieldBegin('Meta', TType.MAP, 5)
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.Meta))
      for kiter236,viter237 in self.Meta.items():
        oprot.writeString(kiter236)
        oprot.writeString(viter237)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    if self.ParamaterizedJob is not None:
      oprot.writeFieldBegin('ParamaterizedJob', TType.STRUCT, 6)
      self.ParamaterizedJob.write(oprot)
      oprot.writeFieldEnd()
    if self.Payload is not None:
      oprot.writeFieldBegin('Payload', TType.STRING, 7)
      oprot.writeString(self.Payload)
      oprot.writeFieldEnd()
    if self.Priority is not None:
      oprot.writeFieldBegin('Priority', TType.I16, 8)
      oprot.writeI16(self.Priority)
      oprot.writeFieldEnd()
    if self.Region is not None:
      oprot.writeFieldBegin('Region', TType.STRING, 9)
      oprot.writeString(self.Region)
      oprot.writeFieldEnd()
    if self.Type is not None:
      oprot.writeFieldBegin('Type', TType.STRING, 10)
      oprot.writeString(self.Type)
      oprot.writeFieldEnd()
    if self.Update is not None:
      oprot.writeFieldBegin('Update', TType.STRUCT, 11)
      self.Update.write(oprot)
      oprot.writeFieldEnd()
    if self.Periodic is not None:
      oprot.writeFieldBegin('Periodic', TType.STRUCT, 12)
      self.Periodic.write(oprot)
      oprot.writeFieldEnd()
    if self.Name is not None:
      oprot.writeFieldBegin('Name', TType.STRING, 13)
      oprot.writeString(self.Name)
      oprot.writeFieldEnd()
    if self.ID is not None:
      oprot.writeFieldBegin('ID', TType.STRING, 14)
      oprot.writeString(self.ID)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.Name is None:
      raise TProtocol.TProtocolException(message='Required field Name is unset!')
    if self.ID is None:
      raise TProtocol.TProtocolException(message='Required field ID is unset!')
    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 NomadJob:
  """
  Attributes:
   - Job
   - Diff
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'Job', (Job, Job.thrift_spec), None, ), # 1
    (2, TType.BOOL, 'Diff', None, None, ), # 2
  )

  def __init__(self, Job=None, Diff=None,):
    self.Job = Job
    self.Diff = Diff

  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.Job = Job()
          self.Job.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.BOOL:
          self.Diff = iprot.readBool();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('NomadJob')
    if self.Job is not None:
      oprot.writeFieldBegin('Job', TType.STRUCT, 1)
      self.Job.write(oprot)
      oprot.writeFieldEnd()
    if self.Diff is not None:
      oprot.writeFieldBegin('Diff', TType.BOOL, 2)
      oprot.writeBool(self.Diff)
      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)
