Subversion Repositories SmartDukaan

Rev

Rev 3896 | Blame | Compare with Previous | Last modification | View Log | RSS feed

#
# Autogenerated by Thrift Compiler (0.7.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#

from thrift.Thrift import *
import shop2020.thriftpy.generic.ttypes


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



class ContentServiceException(Exception):
  """
  Attributes:
   - id
   - message
  """

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

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

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

  def validate(self):
    return


  def __str__(self):
    return repr(self)

  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 BulkContentUpload:
  """
  Attributes:
   - new_entity_id
   - category_id
   - compatibility
   - battery_type
   - battery_capacity
   - summary
   - existing_entity_id
   - brand
   - model_name
   - model_number
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'new_entity_id', None, None, ), # 1
    (2, TType.I64, 'category_id', None, None, ), # 2
    (3, TType.STRING, 'compatibility', None, None, ), # 3
    (4, TType.I32, 'battery_type', None, None, ), # 4
    (5, TType.STRING, 'battery_capacity', None, None, ), # 5
    (6, TType.STRING, 'summary', None, None, ), # 6
    (7, TType.I64, 'existing_entity_id', None, None, ), # 7
    (8, TType.STRING, 'brand', None, None, ), # 8
    (9, TType.STRING, 'model_name', None, None, ), # 9
    (10, TType.STRING, 'model_number', None, None, ), # 10
  )

  def __init__(self, new_entity_id=None, category_id=None, compatibility=None, battery_type=None, battery_capacity=None, summary=None, existing_entity_id=None, brand=None, model_name=None, model_number=None,):
    self.new_entity_id = new_entity_id
    self.category_id = category_id
    self.compatibility = compatibility
    self.battery_type = battery_type
    self.battery_capacity = battery_capacity
    self.summary = summary
    self.existing_entity_id = existing_entity_id
    self.brand = brand
    self.model_name = model_name
    self.model_number = model_number

  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.new_entity_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.category_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.compatibility = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I32:
          self.battery_type = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.battery_capacity = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRING:
          self.summary = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.I64:
          self.existing_entity_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.STRING:
          self.brand = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.STRING:
          self.model_name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.STRING:
          self.model_number = 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('BulkContentUpload')
    if self.new_entity_id is not None:
      oprot.writeFieldBegin('new_entity_id', TType.I64, 1)
      oprot.writeI64(self.new_entity_id)
      oprot.writeFieldEnd()
    if self.category_id is not None:
      oprot.writeFieldBegin('category_id', TType.I64, 2)
      oprot.writeI64(self.category_id)
      oprot.writeFieldEnd()
    if self.compatibility is not None:
      oprot.writeFieldBegin('compatibility', TType.STRING, 3)
      oprot.writeString(self.compatibility)
      oprot.writeFieldEnd()
    if self.battery_type is not None:
      oprot.writeFieldBegin('battery_type', TType.I32, 4)
      oprot.writeI32(self.battery_type)
      oprot.writeFieldEnd()
    if self.battery_capacity is not None:
      oprot.writeFieldBegin('battery_capacity', TType.STRING, 5)
      oprot.writeString(self.battery_capacity)
      oprot.writeFieldEnd()
    if self.summary is not None:
      oprot.writeFieldBegin('summary', TType.STRING, 6)
      oprot.writeString(self.summary)
      oprot.writeFieldEnd()
    if self.existing_entity_id is not None:
      oprot.writeFieldBegin('existing_entity_id', TType.I64, 7)
      oprot.writeI64(self.existing_entity_id)
      oprot.writeFieldEnd()
    if self.brand is not None:
      oprot.writeFieldBegin('brand', TType.STRING, 8)
      oprot.writeString(self.brand)
      oprot.writeFieldEnd()
    if self.model_name is not None:
      oprot.writeFieldBegin('model_name', TType.STRING, 9)
      oprot.writeString(self.model_name)
      oprot.writeFieldEnd()
    if self.model_number is not None:
      oprot.writeFieldBegin('model_number', TType.STRING, 10)
      oprot.writeString(self.model_number)
      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 BulkContentUploadResult:
  """
  Attributes:
   - entity_id
   - message
  """

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

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

  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.entity_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.message = 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('BulkContentUploadResult')
    if self.entity_id is not None:
      oprot.writeFieldBegin('entity_id', TType.I64, 1)
      oprot.writeI64(self.entity_id)
      oprot.writeFieldEnd()
    if self.message is not None:
      oprot.writeFieldBegin('message', TType.STRING, 2)
      oprot.writeString(self.message)
      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)