Subversion Repositories SmartDukaan

Rev

Rev 6531 | Rev 6821 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6531 Rev 6805
Line 562... Line 562...
562
     - offset
562
     - offset
563
     - limit
563
     - limit
564
    """
564
    """
565
    pass
565
    pass
566
 
566
 
-
 
567
  def getInsuranceAmount(self, itemId, insurerId, quantity):
-
 
568
    """
-
 
569
    This method returns the insurance amount needed to insure the given item for a given quantity.
-
 
570
 
-
 
571
    Parameters:
-
 
572
     - itemId
-
 
573
     - insurerId
-
 
574
     - quantity
-
 
575
    """
-
 
576
    pass
-
 
577
 
-
 
578
  def getInsurer(self, insurerId):
-
 
579
    """
-
 
580
    Parameters:
-
 
581
     - insurerId
-
 
582
    """
-
 
583
    pass
-
 
584
 
567
 
585
 
568
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
586
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
569
  def __init__(self, iprot, oprot=None):
587
  def __init__(self, iprot, oprot=None):
570
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
588
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
571
 
589
 
Line 2796... Line 2814...
2796
    self._iprot.readMessageEnd()
2814
    self._iprot.readMessageEnd()
2797
    if result.success is not None:
2815
    if result.success is not None:
2798
      return result.success
2816
      return result.success
2799
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllIgnoredInventoryUpdateItemsList failed: unknown result");
2817
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllIgnoredInventoryUpdateItemsList failed: unknown result");
2800
 
2818
 
-
 
2819
  def getInsuranceAmount(self, itemId, insurerId, quantity):
-
 
2820
    """
-
 
2821
    This method returns the insurance amount needed to insure the given item for a given quantity.
-
 
2822
 
-
 
2823
    Parameters:
-
 
2824
     - itemId
-
 
2825
     - insurerId
-
 
2826
     - quantity
-
 
2827
    """
-
 
2828
    self.send_getInsuranceAmount(itemId, insurerId, quantity)
-
 
2829
    return self.recv_getInsuranceAmount()
-
 
2830
 
-
 
2831
  def send_getInsuranceAmount(self, itemId, insurerId, quantity):
-
 
2832
    self._oprot.writeMessageBegin('getInsuranceAmount', TMessageType.CALL, self._seqid)
-
 
2833
    args = getInsuranceAmount_args()
-
 
2834
    args.itemId = itemId
-
 
2835
    args.insurerId = insurerId
-
 
2836
    args.quantity = quantity
-
 
2837
    args.write(self._oprot)
-
 
2838
    self._oprot.writeMessageEnd()
-
 
2839
    self._oprot.trans.flush()
-
 
2840
 
-
 
2841
  def recv_getInsuranceAmount(self, ):
-
 
2842
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
2843
    if mtype == TMessageType.EXCEPTION:
-
 
2844
      x = TApplicationException()
-
 
2845
      x.read(self._iprot)
-
 
2846
      self._iprot.readMessageEnd()
-
 
2847
      raise x
-
 
2848
    result = getInsuranceAmount_result()
-
 
2849
    result.read(self._iprot)
-
 
2850
    self._iprot.readMessageEnd()
-
 
2851
    if result.success is not None:
-
 
2852
      return result.success
-
 
2853
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getInsuranceAmount failed: unknown result");
-
 
2854
 
-
 
2855
  def getInsurer(self, insurerId):
-
 
2856
    """
-
 
2857
    Parameters:
-
 
2858
     - insurerId
-
 
2859
    """
-
 
2860
    self.send_getInsurer(insurerId)
-
 
2861
    return self.recv_getInsurer()
-
 
2862
 
-
 
2863
  def send_getInsurer(self, insurerId):
-
 
2864
    self._oprot.writeMessageBegin('getInsurer', TMessageType.CALL, self._seqid)
-
 
2865
    args = getInsurer_args()
-
 
2866
    args.insurerId = insurerId
-
 
2867
    args.write(self._oprot)
-
 
2868
    self._oprot.writeMessageEnd()
-
 
2869
    self._oprot.trans.flush()
-
 
2870
 
-
 
2871
  def recv_getInsurer(self, ):
-
 
2872
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
2873
    if mtype == TMessageType.EXCEPTION:
-
 
2874
      x = TApplicationException()
-
 
2875
      x.read(self._iprot)
-
 
2876
      self._iprot.readMessageEnd()
-
 
2877
      raise x
-
 
2878
    result = getInsurer_result()
-
 
2879
    result.read(self._iprot)
-
 
2880
    self._iprot.readMessageEnd()
-
 
2881
    if result.success is not None:
-
 
2882
      return result.success
-
 
2883
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getInsurer failed: unknown result");
-
 
2884
 
2801
 
2885
 
2802
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
2886
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
2803
  def __init__(self, handler):
2887
  def __init__(self, handler):
2804
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
2888
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
2805
    self._processMap["addItem"] = Processor.process_addItem
2889
    self._processMap["addItem"] = Processor.process_addItem
Line 2869... Line 2953...
2869
    self._processMap["getAllItemVouchers"] = Processor.process_getAllItemVouchers
2953
    self._processMap["getAllItemVouchers"] = Processor.process_getAllItemVouchers
2870
    self._processMap["isValidCatalogItemId"] = Processor.process_isValidCatalogItemId
2954
    self._processMap["isValidCatalogItemId"] = Processor.process_isValidCatalogItemId
2871
    self._processMap["getVatPercentageForItem"] = Processor.process_getVatPercentageForItem
2955
    self._processMap["getVatPercentageForItem"] = Processor.process_getVatPercentageForItem
2872
    self._processMap["getVatAmountForItem"] = Processor.process_getVatAmountForItem
2956
    self._processMap["getVatAmountForItem"] = Processor.process_getVatAmountForItem
2873
    self._processMap["getAllIgnoredInventoryUpdateItemsList"] = Processor.process_getAllIgnoredInventoryUpdateItemsList
2957
    self._processMap["getAllIgnoredInventoryUpdateItemsList"] = Processor.process_getAllIgnoredInventoryUpdateItemsList
-
 
2958
    self._processMap["getInsuranceAmount"] = Processor.process_getInsuranceAmount
-
 
2959
    self._processMap["getInsurer"] = Processor.process_getInsurer
2874
 
2960
 
2875
  def process(self, iprot, oprot):
2961
  def process(self, iprot, oprot):
2876
    (name, type, seqid) = iprot.readMessageBegin()
2962
    (name, type, seqid) = iprot.readMessageBegin()
2877
    if name not in self._processMap:
2963
    if name not in self._processMap:
2878
      iprot.skip(TType.STRUCT)
2964
      iprot.skip(TType.STRUCT)
Line 3755... Line 3841...
3755
    oprot.writeMessageBegin("getAllIgnoredInventoryUpdateItemsList", TMessageType.REPLY, seqid)
3841
    oprot.writeMessageBegin("getAllIgnoredInventoryUpdateItemsList", TMessageType.REPLY, seqid)
3756
    result.write(oprot)
3842
    result.write(oprot)
3757
    oprot.writeMessageEnd()
3843
    oprot.writeMessageEnd()
3758
    oprot.trans.flush()
3844
    oprot.trans.flush()
3759
 
3845
 
-
 
3846
  def process_getInsuranceAmount(self, seqid, iprot, oprot):
-
 
3847
    args = getInsuranceAmount_args()
-
 
3848
    args.read(iprot)
-
 
3849
    iprot.readMessageEnd()
-
 
3850
    result = getInsuranceAmount_result()
-
 
3851
    result.success = self._handler.getInsuranceAmount(args.itemId, args.insurerId, args.quantity)
-
 
3852
    oprot.writeMessageBegin("getInsuranceAmount", TMessageType.REPLY, seqid)
-
 
3853
    result.write(oprot)
-
 
3854
    oprot.writeMessageEnd()
-
 
3855
    oprot.trans.flush()
-
 
3856
 
-
 
3857
  def process_getInsurer(self, seqid, iprot, oprot):
-
 
3858
    args = getInsurer_args()
-
 
3859
    args.read(iprot)
-
 
3860
    iprot.readMessageEnd()
-
 
3861
    result = getInsurer_result()
-
 
3862
    result.success = self._handler.getInsurer(args.insurerId)
-
 
3863
    oprot.writeMessageBegin("getInsurer", TMessageType.REPLY, seqid)
-
 
3864
    result.write(oprot)
-
 
3865
    oprot.writeMessageEnd()
-
 
3866
    oprot.trans.flush()
-
 
3867
 
3760
 
3868
 
3761
# HELPER FUNCTIONS AND STRUCTURES
3869
# HELPER FUNCTIONS AND STRUCTURES
3762
 
3870
 
3763
class addItem_args:
3871
class addItem_args:
3764
  """
3872
  """
Line 12956... Line 13064...
12956
      oprot.writeFieldEnd()
13064
      oprot.writeFieldEnd()
12957
    oprot.writeFieldStop()
13065
    oprot.writeFieldStop()
12958
    oprot.writeStructEnd()
13066
    oprot.writeStructEnd()
12959
 
13067
 
12960
  def validate(self):
13068
  def validate(self):
-
 
13069
    return
-
 
13070
 
-
 
13071
 
-
 
13072
  def __repr__(self):
-
 
13073
    L = ['%s=%r' % (key, value)
-
 
13074
      for key, value in self.__dict__.iteritems()]
-
 
13075
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
13076
 
-
 
13077
  def __eq__(self, other):
-
 
13078
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
13079
 
-
 
13080
  def __ne__(self, other):
-
 
13081
    return not (self == other)
-
 
13082
 
-
 
13083
class getInsuranceAmount_args:
-
 
13084
  """
-
 
13085
  Attributes:
-
 
13086
   - itemId
-
 
13087
   - insurerId
-
 
13088
   - quantity
-
 
13089
  """
-
 
13090
 
-
 
13091
  thrift_spec = (
-
 
13092
    None, # 0
-
 
13093
    (1, TType.I64, 'itemId', None, None, ), # 1
-
 
13094
    (2, TType.I64, 'insurerId', None, None, ), # 2
-
 
13095
    (3, TType.I64, 'quantity', None, None, ), # 3
-
 
13096
  )
-
 
13097
 
-
 
13098
  def __init__(self, itemId=None, insurerId=None, quantity=None,):
-
 
13099
    self.itemId = itemId
-
 
13100
    self.insurerId = insurerId
-
 
13101
    self.quantity = quantity
-
 
13102
 
-
 
13103
  def read(self, iprot):
-
 
13104
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
13105
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
13106
      return
-
 
13107
    iprot.readStructBegin()
-
 
13108
    while True:
-
 
13109
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
13110
      if ftype == TType.STOP:
-
 
13111
        break
-
 
13112
      if fid == 1:
-
 
13113
        if ftype == TType.I64:
-
 
13114
          self.itemId = iprot.readI64();
-
 
13115
        else:
-
 
13116
          iprot.skip(ftype)
-
 
13117
      elif fid == 2:
-
 
13118
        if ftype == TType.I64:
-
 
13119
          self.insurerId = iprot.readI64();
-
 
13120
        else:
-
 
13121
          iprot.skip(ftype)
-
 
13122
      elif fid == 3:
-
 
13123
        if ftype == TType.I64:
-
 
13124
          self.quantity = iprot.readI64();
-
 
13125
        else:
-
 
13126
          iprot.skip(ftype)
-
 
13127
      else:
-
 
13128
        iprot.skip(ftype)
-
 
13129
      iprot.readFieldEnd()
-
 
13130
    iprot.readStructEnd()
-
 
13131
 
-
 
13132
  def write(self, oprot):
-
 
13133
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
13134
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
13135
      return
-
 
13136
    oprot.writeStructBegin('getInsuranceAmount_args')
-
 
13137
    if self.itemId is not None:
-
 
13138
      oprot.writeFieldBegin('itemId', TType.I64, 1)
-
 
13139
      oprot.writeI64(self.itemId)
-
 
13140
      oprot.writeFieldEnd()
-
 
13141
    if self.insurerId is not None:
-
 
13142
      oprot.writeFieldBegin('insurerId', TType.I64, 2)
-
 
13143
      oprot.writeI64(self.insurerId)
-
 
13144
      oprot.writeFieldEnd()
-
 
13145
    if self.quantity is not None:
-
 
13146
      oprot.writeFieldBegin('quantity', TType.I64, 3)
-
 
13147
      oprot.writeI64(self.quantity)
-
 
13148
      oprot.writeFieldEnd()
-
 
13149
    oprot.writeFieldStop()
-
 
13150
    oprot.writeStructEnd()
-
 
13151
 
-
 
13152
  def validate(self):
-
 
13153
    return
-
 
13154
 
-
 
13155
 
-
 
13156
  def __repr__(self):
-
 
13157
    L = ['%s=%r' % (key, value)
-
 
13158
      for key, value in self.__dict__.iteritems()]
-
 
13159
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
13160
 
-
 
13161
  def __eq__(self, other):
-
 
13162
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
13163
 
-
 
13164
  def __ne__(self, other):
-
 
13165
    return not (self == other)
-
 
13166
 
-
 
13167
class getInsuranceAmount_result:
-
 
13168
  """
-
 
13169
  Attributes:
-
 
13170
   - success
-
 
13171
  """
-
 
13172
 
-
 
13173
  thrift_spec = (
-
 
13174
    (0, TType.I64, 'success', None, None, ), # 0
-
 
13175
  )
-
 
13176
 
-
 
13177
  def __init__(self, success=None,):
-
 
13178
    self.success = success
-
 
13179
 
-
 
13180
  def read(self, iprot):
-
 
13181
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
13182
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
13183
      return
-
 
13184
    iprot.readStructBegin()
-
 
13185
    while True:
-
 
13186
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
13187
      if ftype == TType.STOP:
-
 
13188
        break
-
 
13189
      if fid == 0:
-
 
13190
        if ftype == TType.I64:
-
 
13191
          self.success = iprot.readI64();
-
 
13192
        else:
-
 
13193
          iprot.skip(ftype)
-
 
13194
      else:
-
 
13195
        iprot.skip(ftype)
-
 
13196
      iprot.readFieldEnd()
-
 
13197
    iprot.readStructEnd()
-
 
13198
 
-
 
13199
  def write(self, oprot):
-
 
13200
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
13201
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
13202
      return
-
 
13203
    oprot.writeStructBegin('getInsuranceAmount_result')
-
 
13204
    if self.success is not None:
-
 
13205
      oprot.writeFieldBegin('success', TType.I64, 0)
-
 
13206
      oprot.writeI64(self.success)
-
 
13207
      oprot.writeFieldEnd()
-
 
13208
    oprot.writeFieldStop()
-
 
13209
    oprot.writeStructEnd()
-
 
13210
 
-
 
13211
  def validate(self):
-
 
13212
    return
-
 
13213
 
-
 
13214
 
-
 
13215
  def __repr__(self):
-
 
13216
    L = ['%s=%r' % (key, value)
-
 
13217
      for key, value in self.__dict__.iteritems()]
-
 
13218
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
13219
 
-
 
13220
  def __eq__(self, other):
-
 
13221
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
13222
 
-
 
13223
  def __ne__(self, other):
-
 
13224
    return not (self == other)
-
 
13225
 
-
 
13226
class getInsurer_args:
-
 
13227
  """
-
 
13228
  Attributes:
-
 
13229
   - insurerId
-
 
13230
  """
-
 
13231
 
-
 
13232
  thrift_spec = (
-
 
13233
    None, # 0
-
 
13234
    (1, TType.I64, 'insurerId', None, None, ), # 1
-
 
13235
  )
-
 
13236
 
-
 
13237
  def __init__(self, insurerId=None,):
-
 
13238
    self.insurerId = insurerId
-
 
13239
 
-
 
13240
  def read(self, iprot):
-
 
13241
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
13242
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
13243
      return
-
 
13244
    iprot.readStructBegin()
-
 
13245
    while True:
-
 
13246
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
13247
      if ftype == TType.STOP:
-
 
13248
        break
-
 
13249
      if fid == 1:
-
 
13250
        if ftype == TType.I64:
-
 
13251
          self.insurerId = iprot.readI64();
-
 
13252
        else:
-
 
13253
          iprot.skip(ftype)
-
 
13254
      else:
-
 
13255
        iprot.skip(ftype)
-
 
13256
      iprot.readFieldEnd()
-
 
13257
    iprot.readStructEnd()
-
 
13258
 
-
 
13259
  def write(self, oprot):
-
 
13260
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
13261
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
13262
      return
-
 
13263
    oprot.writeStructBegin('getInsurer_args')
-
 
13264
    if self.insurerId is not None:
-
 
13265
      oprot.writeFieldBegin('insurerId', TType.I64, 1)
-
 
13266
      oprot.writeI64(self.insurerId)
-
 
13267
      oprot.writeFieldEnd()
-
 
13268
    oprot.writeFieldStop()
-
 
13269
    oprot.writeStructEnd()
-
 
13270
 
-
 
13271
  def validate(self):
-
 
13272
    return
-
 
13273
 
-
 
13274
 
-
 
13275
  def __repr__(self):
-
 
13276
    L = ['%s=%r' % (key, value)
-
 
13277
      for key, value in self.__dict__.iteritems()]
-
 
13278
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
13279
 
-
 
13280
  def __eq__(self, other):
-
 
13281
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
13282
 
-
 
13283
  def __ne__(self, other):
-
 
13284
    return not (self == other)
-
 
13285
 
-
 
13286
class getInsurer_result:
-
 
13287
  """
-
 
13288
  Attributes:
-
 
13289
   - success
-
 
13290
  """
-
 
13291
 
-
 
13292
  thrift_spec = (
-
 
13293
    (0, TType.STRUCT, 'success', (Insurer, Insurer.thrift_spec), None, ), # 0
-
 
13294
  )
-
 
13295
 
-
 
13296
  def __init__(self, success=None,):
-
 
13297
    self.success = success
-
 
13298
 
-
 
13299
  def read(self, iprot):
-
 
13300
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
13301
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
13302
      return
-
 
13303
    iprot.readStructBegin()
-
 
13304
    while True:
-
 
13305
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
13306
      if ftype == TType.STOP:
-
 
13307
        break
-
 
13308
      if fid == 0:
-
 
13309
        if ftype == TType.STRUCT:
-
 
13310
          self.success = Insurer()
-
 
13311
          self.success.read(iprot)
-
 
13312
        else:
-
 
13313
          iprot.skip(ftype)
-
 
13314
      else:
-
 
13315
        iprot.skip(ftype)
-
 
13316
      iprot.readFieldEnd()
-
 
13317
    iprot.readStructEnd()
-
 
13318
 
-
 
13319
  def write(self, oprot):
-
 
13320
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
13321
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
13322
      return
-
 
13323
    oprot.writeStructBegin('getInsurer_result')
-
 
13324
    if self.success is not None:
-
 
13325
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
-
 
13326
      self.success.write(oprot)
-
 
13327
      oprot.writeFieldEnd()
-
 
13328
    oprot.writeFieldStop()
-
 
13329
    oprot.writeStructEnd()
-
 
13330
 
-
 
13331
  def validate(self):
12961
    return
13332
    return
12962
 
13333
 
12963
 
13334
 
12964
  def __repr__(self):
13335
  def __repr__(self):
12965
    L = ['%s=%r' % (key, value)
13336
    L = ['%s=%r' % (key, value)