Subversion Repositories SmartDukaan

Rev

Rev 19594 | 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 LivePricing:
  """
  Objects

  Attributes:
   - _id
   - available_price
   - marketPlaceUrl
   - in_stock
   - source_id
   - source_product_name
   - thumbnail
   - cash_back_type
   - cash_back
   - coupon
   - codAvailable
   - tagline
   - offer
   - gross_price
   - cheapestBulkPrice
   - packQuantity
   - netPriceAfterCashBack
   - showNetPrice
   - category_id
   - subCategoryId
   - identifier
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, '_id', None, None, ), # 1
    (2, TType.DOUBLE, 'available_price', None, None, ), # 2
    (3, TType.STRING, 'marketPlaceUrl', None, None, ), # 3
    (4, TType.I64, 'in_stock', None, None, ), # 4
    (5, TType.I64, 'source_id', None, None, ), # 5
    (6, TType.STRING, 'source_product_name', None, None, ), # 6
    (7, TType.STRING, 'thumbnail', None, None, ), # 7
    (8, TType.I64, 'cash_back_type', None, None, ), # 8
    (9, TType.DOUBLE, 'cash_back', None, None, ), # 9
    (10, TType.STRING, 'coupon', None, None, ), # 10
    (11, TType.I64, 'codAvailable', None, None, ), # 11
    (12, TType.STRING, 'tagline', None, None, ), # 12
    (13, TType.STRING, 'offer', None, None, ), # 13
    (14, TType.DOUBLE, 'gross_price', None, None, ), # 14
    (15, TType.DOUBLE, 'cheapestBulkPrice', None, None, ), # 15
    (16, TType.I64, 'packQuantity', None, None, ), # 16
    (17, TType.DOUBLE, 'netPriceAfterCashBack', None, None, ), # 17
    (18, TType.I64, 'showNetPrice', None, None, ), # 18
    (19, TType.I64, 'category_id', None, None, ), # 19
    (20, TType.I64, 'subCategoryId', None, None, ), # 20
    (21, TType.STRING, 'identifier', None, None, ), # 21
  )

  def __init__(self, _id=None, available_price=None, marketPlaceUrl=None, in_stock=None, source_id=None, source_product_name=None, thumbnail=None, cash_back_type=None, cash_back=None, coupon=None, codAvailable=None, tagline=None, offer=None, gross_price=None, cheapestBulkPrice=None, packQuantity=None, netPriceAfterCashBack=None, showNetPrice=None, category_id=None, subCategoryId=None, identifier=None,):
    self._id = _id
    self.available_price = available_price
    self.marketPlaceUrl = marketPlaceUrl
    self.in_stock = in_stock
    self.source_id = source_id
    self.source_product_name = source_product_name
    self.thumbnail = thumbnail
    self.cash_back_type = cash_back_type
    self.cash_back = cash_back
    self.coupon = coupon
    self.codAvailable = codAvailable
    self.tagline = tagline
    self.offer = offer
    self.gross_price = gross_price
    self.cheapestBulkPrice = cheapestBulkPrice
    self.packQuantity = packQuantity
    self.netPriceAfterCashBack = netPriceAfterCashBack
    self.showNetPrice = showNetPrice
    self.category_id = category_id
    self.subCategoryId = subCategoryId
    self.identifier = identifier

  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.DOUBLE:
          self.available_price = iprot.readDouble();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.marketPlaceUrl = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.in_stock = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I64:
          self.source_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRING:
          self.source_product_name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.STRING:
          self.thumbnail = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.I64:
          self.cash_back_type = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.DOUBLE:
          self.cash_back = iprot.readDouble();
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.STRING:
          self.coupon = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.I64:
          self.codAvailable = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.STRING:
          self.tagline = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.STRING:
          self.offer = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.DOUBLE:
          self.gross_price = iprot.readDouble();
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.DOUBLE:
          self.cheapestBulkPrice = iprot.readDouble();
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.I64:
          self.packQuantity = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 17:
        if ftype == TType.DOUBLE:
          self.netPriceAfterCashBack = iprot.readDouble();
        else:
          iprot.skip(ftype)
      elif fid == 18:
        if ftype == TType.I64:
          self.showNetPrice = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 19:
        if ftype == TType.I64:
          self.category_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 20:
        if ftype == TType.I64:
          self.subCategoryId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 21:
        if ftype == TType.STRING:
          self.identifier = 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('LivePricing')
    if self._id is not None:
      oprot.writeFieldBegin('_id', TType.I64, 1)
      oprot.writeI64(self._id)
      oprot.writeFieldEnd()
    if self.available_price is not None:
      oprot.writeFieldBegin('available_price', TType.DOUBLE, 2)
      oprot.writeDouble(self.available_price)
      oprot.writeFieldEnd()
    if self.marketPlaceUrl is not None:
      oprot.writeFieldBegin('marketPlaceUrl', TType.STRING, 3)
      oprot.writeString(self.marketPlaceUrl)
      oprot.writeFieldEnd()
    if self.in_stock is not None:
      oprot.writeFieldBegin('in_stock', TType.I64, 4)
      oprot.writeI64(self.in_stock)
      oprot.writeFieldEnd()
    if self.source_id is not None:
      oprot.writeFieldBegin('source_id', TType.I64, 5)
      oprot.writeI64(self.source_id)
      oprot.writeFieldEnd()
    if self.source_product_name is not None:
      oprot.writeFieldBegin('source_product_name', TType.STRING, 6)
      oprot.writeString(self.source_product_name)
      oprot.writeFieldEnd()
    if self.thumbnail is not None:
      oprot.writeFieldBegin('thumbnail', TType.STRING, 7)
      oprot.writeString(self.thumbnail)
      oprot.writeFieldEnd()
    if self.cash_back_type is not None:
      oprot.writeFieldBegin('cash_back_type', TType.I64, 8)
      oprot.writeI64(self.cash_back_type)
      oprot.writeFieldEnd()
    if self.cash_back is not None:
      oprot.writeFieldBegin('cash_back', TType.DOUBLE, 9)
      oprot.writeDouble(self.cash_back)
      oprot.writeFieldEnd()
    if self.coupon is not None:
      oprot.writeFieldBegin('coupon', TType.STRING, 10)
      oprot.writeString(self.coupon)
      oprot.writeFieldEnd()
    if self.codAvailable is not None:
      oprot.writeFieldBegin('codAvailable', TType.I64, 11)
      oprot.writeI64(self.codAvailable)
      oprot.writeFieldEnd()
    if self.tagline is not None:
      oprot.writeFieldBegin('tagline', TType.STRING, 12)
      oprot.writeString(self.tagline)
      oprot.writeFieldEnd()
    if self.offer is not None:
      oprot.writeFieldBegin('offer', TType.STRING, 13)
      oprot.writeString(self.offer)
      oprot.writeFieldEnd()
    if self.gross_price is not None:
      oprot.writeFieldBegin('gross_price', TType.DOUBLE, 14)
      oprot.writeDouble(self.gross_price)
      oprot.writeFieldEnd()
    if self.cheapestBulkPrice is not None:
      oprot.writeFieldBegin('cheapestBulkPrice', TType.DOUBLE, 15)
      oprot.writeDouble(self.cheapestBulkPrice)
      oprot.writeFieldEnd()
    if self.packQuantity is not None:
      oprot.writeFieldBegin('packQuantity', TType.I64, 16)
      oprot.writeI64(self.packQuantity)
      oprot.writeFieldEnd()
    if self.netPriceAfterCashBack is not None:
      oprot.writeFieldBegin('netPriceAfterCashBack', TType.DOUBLE, 17)
      oprot.writeDouble(self.netPriceAfterCashBack)
      oprot.writeFieldEnd()
    if self.showNetPrice is not None:
      oprot.writeFieldBegin('showNetPrice', TType.I64, 18)
      oprot.writeI64(self.showNetPrice)
      oprot.writeFieldEnd()
    if self.category_id is not None:
      oprot.writeFieldBegin('category_id', TType.I64, 19)
      oprot.writeI64(self.category_id)
      oprot.writeFieldEnd()
    if self.subCategoryId is not None:
      oprot.writeFieldBegin('subCategoryId', TType.I64, 20)
      oprot.writeI64(self.subCategoryId)
      oprot.writeFieldEnd()
    if self.identifier is not None:
      oprot.writeFieldBegin('identifier', TType.STRING, 21)
      oprot.writeString(self.identifier)
      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 BulkItems:
  """
  Attributes:
   - item_id
   - showMrpFlag
   - tagline
   - offer
   - showNetPrice
   - category_id
   - subCategoryId
   - available_price
   - brand
   - identifier
   - model_name
   - mrp
   - product_name
   - source_product_name
   - brand_id
   - quantity
   - internalRank
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'item_id', None, None, ), # 1
    (2, TType.BOOL, 'showMrpFlag', None, None, ), # 2
    (3, TType.STRING, 'tagline', None, None, ), # 3
    (4, TType.STRING, 'offer', None, None, ), # 4
    (5, TType.BOOL, 'showNetPrice', None, None, ), # 5
    (6, TType.I64, 'category_id', None, None, ), # 6
    (7, TType.I64, 'subCategoryId', None, None, ), # 7
    (8, TType.DOUBLE, 'available_price', None, None, ), # 8
    (9, TType.STRING, 'brand', None, None, ), # 9
    (10, TType.STRING, 'identifier', None, None, ), # 10
    (11, TType.STRING, 'model_name', None, None, ), # 11
    (12, TType.DOUBLE, 'mrp', None, None, ), # 12
    (13, TType.STRING, 'product_name', None, None, ), # 13
    (14, TType.STRING, 'source_product_name', None, None, ), # 14
    (15, TType.I64, 'brand_id', None, None, ), # 15
    (16, TType.I64, 'quantity', None, None, ), # 16
    (17, TType.I64, 'internalRank', None, None, ), # 17
  )

  def __init__(self, item_id=None, showMrpFlag=None, tagline=None, offer=None, showNetPrice=None, category_id=None, subCategoryId=None, available_price=None, brand=None, identifier=None, model_name=None, mrp=None, product_name=None, source_product_name=None, brand_id=None, quantity=None, internalRank=None,):
    self.item_id = item_id
    self.showMrpFlag = showMrpFlag
    self.tagline = tagline
    self.offer = offer
    self.showNetPrice = showNetPrice
    self.category_id = category_id
    self.subCategoryId = subCategoryId
    self.available_price = available_price
    self.brand = brand
    self.identifier = identifier
    self.model_name = model_name
    self.mrp = mrp
    self.product_name = product_name
    self.source_product_name = source_product_name
    self.brand_id = brand_id
    self.quantity = quantity
    self.internalRank = internalRank

  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.item_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.BOOL:
          self.showMrpFlag = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.tagline = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.offer = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.BOOL:
          self.showNetPrice = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I64:
          self.category_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.I64:
          self.subCategoryId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.DOUBLE:
          self.available_price = iprot.readDouble();
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.STRING:
          self.brand = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.STRING:
          self.identifier = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.STRING:
          self.model_name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.DOUBLE:
          self.mrp = iprot.readDouble();
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.STRING:
          self.product_name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.STRING:
          self.source_product_name = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.I64:
          self.brand_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.I64:
          self.quantity = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 17:
        if ftype == TType.I64:
          self.internalRank = 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('BulkItems')
    if self.item_id is not None:
      oprot.writeFieldBegin('item_id', TType.I64, 1)
      oprot.writeI64(self.item_id)
      oprot.writeFieldEnd()
    if self.showMrpFlag is not None:
      oprot.writeFieldBegin('showMrpFlag', TType.BOOL, 2)
      oprot.writeBool(self.showMrpFlag)
      oprot.writeFieldEnd()
    if self.tagline is not None:
      oprot.writeFieldBegin('tagline', TType.STRING, 3)
      oprot.writeString(self.tagline)
      oprot.writeFieldEnd()
    if self.offer is not None:
      oprot.writeFieldBegin('offer', TType.STRING, 4)
      oprot.writeString(self.offer)
      oprot.writeFieldEnd()
    if self.showNetPrice is not None:
      oprot.writeFieldBegin('showNetPrice', TType.BOOL, 5)
      oprot.writeBool(self.showNetPrice)
      oprot.writeFieldEnd()
    if self.category_id is not None:
      oprot.writeFieldBegin('category_id', TType.I64, 6)
      oprot.writeI64(self.category_id)
      oprot.writeFieldEnd()
    if self.subCategoryId is not None:
      oprot.writeFieldBegin('subCategoryId', TType.I64, 7)
      oprot.writeI64(self.subCategoryId)
      oprot.writeFieldEnd()
    if self.available_price is not None:
      oprot.writeFieldBegin('available_price', TType.DOUBLE, 8)
      oprot.writeDouble(self.available_price)
      oprot.writeFieldEnd()
    if self.brand is not None:
      oprot.writeFieldBegin('brand', TType.STRING, 9)
      oprot.writeString(self.brand)
      oprot.writeFieldEnd()
    if self.identifier is not None:
      oprot.writeFieldBegin('identifier', TType.STRING, 10)
      oprot.writeString(self.identifier)
      oprot.writeFieldEnd()
    if self.model_name is not None:
      oprot.writeFieldBegin('model_name', TType.STRING, 11)
      oprot.writeString(self.model_name)
      oprot.writeFieldEnd()
    if self.mrp is not None:
      oprot.writeFieldBegin('mrp', TType.DOUBLE, 12)
      oprot.writeDouble(self.mrp)
      oprot.writeFieldEnd()
    if self.product_name is not None:
      oprot.writeFieldBegin('product_name', TType.STRING, 13)
      oprot.writeString(self.product_name)
      oprot.writeFieldEnd()
    if self.source_product_name is not None:
      oprot.writeFieldBegin('source_product_name', TType.STRING, 14)
      oprot.writeString(self.source_product_name)
      oprot.writeFieldEnd()
    if self.brand_id is not None:
      oprot.writeFieldBegin('brand_id', TType.I64, 15)
      oprot.writeI64(self.brand_id)
      oprot.writeFieldEnd()
    if self.quantity is not None:
      oprot.writeFieldBegin('quantity', TType.I64, 16)
      oprot.writeI64(self.quantity)
      oprot.writeFieldEnd()
    if self.internalRank is not None:
      oprot.writeFieldBegin('internalRank', TType.I64, 17)
      oprot.writeI64(self.internalRank)
      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)