Subversion Repositories SmartDukaan

Rev

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

Rev 18794 Rev 19004
Line 2514... Line 2514...
2514
    Parameters:
2514
    Parameters:
2515
     - transactionId
2515
     - transactionId
2516
    """
2516
    """
2517
    pass
2517
    pass
2518
 
2518
 
-
 
2519
  def getOrdersInBatchAsPromisedShipping(self, statuses, offset, limit, warehouse_id, source):
-
 
2520
    """
-
 
2521
    Returns at most 'limit' orders with the given statuses for the given warehouse starting from the given offset.
-
 
2522
    These orders should be in order of promised shipping time.
-
 
2523
    Pass the status as null and the limit as 0 to ignore them.
-
 
2524
 
-
 
2525
    Parameters:
-
 
2526
     - statuses
-
 
2527
     - offset
-
 
2528
     - limit
-
 
2529
     - warehouse_id
-
 
2530
     - source
-
 
2531
    """
-
 
2532
    pass
-
 
2533
 
2519
 
2534
 
2520
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
2535
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
2521
  def __init__(self, iprot, oprot=None):
2536
  def __init__(self, iprot, oprot=None):
2522
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
2537
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
2523
 
2538
 
Line 12029... Line 12044...
12029
      return result.success
12044
      return result.success
12030
    if result.ex is not None:
12045
    if result.ex is not None:
12031
      raise result.ex
12046
      raise result.ex
12032
    raise TApplicationException(TApplicationException.MISSING_RESULT, "verifyOrderForTransaction failed: unknown result");
12047
    raise TApplicationException(TApplicationException.MISSING_RESULT, "verifyOrderForTransaction failed: unknown result");
12033
 
12048
 
-
 
12049
  def getOrdersInBatchAsPromisedShipping(self, statuses, offset, limit, warehouse_id, source):
-
 
12050
    """
-
 
12051
    Returns at most 'limit' orders with the given statuses for the given warehouse starting from the given offset.
-
 
12052
    These orders should be in order of promised shipping time.
-
 
12053
    Pass the status as null and the limit as 0 to ignore them.
-
 
12054
 
-
 
12055
    Parameters:
-
 
12056
     - statuses
-
 
12057
     - offset
-
 
12058
     - limit
-
 
12059
     - warehouse_id
-
 
12060
     - source
-
 
12061
    """
-
 
12062
    self.send_getOrdersInBatchAsPromisedShipping(statuses, offset, limit, warehouse_id, source)
-
 
12063
    return self.recv_getOrdersInBatchAsPromisedShipping()
-
 
12064
 
-
 
12065
  def send_getOrdersInBatchAsPromisedShipping(self, statuses, offset, limit, warehouse_id, source):
-
 
12066
    self._oprot.writeMessageBegin('getOrdersInBatchAsPromisedShipping', TMessageType.CALL, self._seqid)
-
 
12067
    args = getOrdersInBatchAsPromisedShipping_args()
-
 
12068
    args.statuses = statuses
-
 
12069
    args.offset = offset
-
 
12070
    args.limit = limit
-
 
12071
    args.warehouse_id = warehouse_id
-
 
12072
    args.source = source
-
 
12073
    args.write(self._oprot)
-
 
12074
    self._oprot.writeMessageEnd()
-
 
12075
    self._oprot.trans.flush()
-
 
12076
 
-
 
12077
  def recv_getOrdersInBatchAsPromisedShipping(self, ):
-
 
12078
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
12079
    if mtype == TMessageType.EXCEPTION:
-
 
12080
      x = TApplicationException()
-
 
12081
      x.read(self._iprot)
-
 
12082
      self._iprot.readMessageEnd()
-
 
12083
      raise x
-
 
12084
    result = getOrdersInBatchAsPromisedShipping_result()
-
 
12085
    result.read(self._iprot)
-
 
12086
    self._iprot.readMessageEnd()
-
 
12087
    if result.success is not None:
-
 
12088
      return result.success
-
 
12089
    if result.ex is not None:
-
 
12090
      raise result.ex
-
 
12091
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getOrdersInBatchAsPromisedShipping failed: unknown result");
-
 
12092
 
12034
 
12093
 
12035
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
12094
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
12036
  def __init__(self, handler):
12095
  def __init__(self, handler):
12037
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
12096
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
12038
    self._processMap["createTransaction"] = Processor.process_createTransaction
12097
    self._processMap["createTransaction"] = Processor.process_createTransaction
Line 12319... Line 12378...
12319
    self._processMap["processReturnPickup"] = Processor.process_processReturnPickup
12378
    self._processMap["processReturnPickup"] = Processor.process_processReturnPickup
12320
    self._processMap["markReturnTransactionComplete"] = Processor.process_markReturnTransactionComplete
12379
    self._processMap["markReturnTransactionComplete"] = Processor.process_markReturnTransactionComplete
12321
    self._processMap["refundReturnTransactionPayment"] = Processor.process_refundReturnTransactionPayment
12380
    self._processMap["refundReturnTransactionPayment"] = Processor.process_refundReturnTransactionPayment
12322
    self._processMap["getReturnTransactionsForCustomer"] = Processor.process_getReturnTransactionsForCustomer
12381
    self._processMap["getReturnTransactionsForCustomer"] = Processor.process_getReturnTransactionsForCustomer
12323
    self._processMap["verifyOrderForTransaction"] = Processor.process_verifyOrderForTransaction
12382
    self._processMap["verifyOrderForTransaction"] = Processor.process_verifyOrderForTransaction
-
 
12383
    self._processMap["getOrdersInBatchAsPromisedShipping"] = Processor.process_getOrdersInBatchAsPromisedShipping
12324
 
12384
 
12325
  def process(self, iprot, oprot):
12385
  def process(self, iprot, oprot):
12326
    (name, type, seqid) = iprot.readMessageBegin()
12386
    (name, type, seqid) = iprot.readMessageBegin()
12327
    if name not in self._processMap:
12387
    if name not in self._processMap:
12328
      iprot.skip(TType.STRUCT)
12388
      iprot.skip(TType.STRUCT)
Line 15892... Line 15952...
15892
    oprot.writeMessageBegin("verifyOrderForTransaction", TMessageType.REPLY, seqid)
15952
    oprot.writeMessageBegin("verifyOrderForTransaction", TMessageType.REPLY, seqid)
15893
    result.write(oprot)
15953
    result.write(oprot)
15894
    oprot.writeMessageEnd()
15954
    oprot.writeMessageEnd()
15895
    oprot.trans.flush()
15955
    oprot.trans.flush()
15896
 
15956
 
-
 
15957
  def process_getOrdersInBatchAsPromisedShipping(self, seqid, iprot, oprot):
-
 
15958
    args = getOrdersInBatchAsPromisedShipping_args()
-
 
15959
    args.read(iprot)
-
 
15960
    iprot.readMessageEnd()
-
 
15961
    result = getOrdersInBatchAsPromisedShipping_result()
-
 
15962
    try:
-
 
15963
      result.success = self._handler.getOrdersInBatchAsPromisedShipping(args.statuses, args.offset, args.limit, args.warehouse_id, args.source)
-
 
15964
    except TransactionServiceException, ex:
-
 
15965
      result.ex = ex
-
 
15966
    oprot.writeMessageBegin("getOrdersInBatchAsPromisedShipping", TMessageType.REPLY, seqid)
-
 
15967
    result.write(oprot)
-
 
15968
    oprot.writeMessageEnd()
-
 
15969
    oprot.trans.flush()
-
 
15970
 
15897
 
15971
 
15898
# HELPER FUNCTIONS AND STRUCTURES
15972
# HELPER FUNCTIONS AND STRUCTURES
15899
 
15973
 
15900
class createTransaction_args:
15974
class createTransaction_args:
15901
  """
15975
  """
Line 55650... Line 55724...
55650
      oprot.writeFieldEnd()
55724
      oprot.writeFieldEnd()
55651
    if self.ex is not None:
55725
    if self.ex is not None:
55652
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
55726
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
55653
      self.ex.write(oprot)
55727
      self.ex.write(oprot)
55654
      oprot.writeFieldEnd()
55728
      oprot.writeFieldEnd()
-
 
55729
    oprot.writeFieldStop()
-
 
55730
    oprot.writeStructEnd()
-
 
55731
 
-
 
55732
  def validate(self):
-
 
55733
    return
-
 
55734
 
-
 
55735
 
-
 
55736
  def __repr__(self):
-
 
55737
    L = ['%s=%r' % (key, value)
-
 
55738
      for key, value in self.__dict__.iteritems()]
-
 
55739
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
55740
 
-
 
55741
  def __eq__(self, other):
-
 
55742
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
55743
 
-
 
55744
  def __ne__(self, other):
-
 
55745
    return not (self == other)
-
 
55746
 
-
 
55747
class getOrdersInBatchAsPromisedShipping_args:
-
 
55748
  """
-
 
55749
  Attributes:
-
 
55750
   - statuses
-
 
55751
   - offset
-
 
55752
   - limit
-
 
55753
   - warehouse_id
-
 
55754
   - source
-
 
55755
  """
-
 
55756
 
-
 
55757
  thrift_spec = (
-
 
55758
    None, # 0
-
 
55759
    (1, TType.LIST, 'statuses', (TType.I32,None), None, ), # 1
-
 
55760
    (2, TType.I64, 'offset', None, None, ), # 2
-
 
55761
    (3, TType.I64, 'limit', None, None, ), # 3
-
 
55762
    (4, TType.I64, 'warehouse_id', None, None, ), # 4
-
 
55763
    (5, TType.I64, 'source', None, None, ), # 5
-
 
55764
  )
-
 
55765
 
-
 
55766
  def __init__(self, statuses=None, offset=None, limit=None, warehouse_id=None, source=None,):
-
 
55767
    self.statuses = statuses
-
 
55768
    self.offset = offset
-
 
55769
    self.limit = limit
-
 
55770
    self.warehouse_id = warehouse_id
-
 
55771
    self.source = source
-
 
55772
 
-
 
55773
  def read(self, iprot):
-
 
55774
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
55775
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
55776
      return
-
 
55777
    iprot.readStructBegin()
-
 
55778
    while True:
-
 
55779
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
55780
      if ftype == TType.STOP:
-
 
55781
        break
-
 
55782
      if fid == 1:
-
 
55783
        if ftype == TType.LIST:
-
 
55784
          self.statuses = []
-
 
55785
          (_etype1412, _size1409) = iprot.readListBegin()
-
 
55786
          for _i1413 in xrange(_size1409):
-
 
55787
            _elem1414 = iprot.readI32();
-
 
55788
            self.statuses.append(_elem1414)
-
 
55789
          iprot.readListEnd()
-
 
55790
        else:
-
 
55791
          iprot.skip(ftype)
-
 
55792
      elif fid == 2:
-
 
55793
        if ftype == TType.I64:
-
 
55794
          self.offset = iprot.readI64();
-
 
55795
        else:
-
 
55796
          iprot.skip(ftype)
-
 
55797
      elif fid == 3:
-
 
55798
        if ftype == TType.I64:
-
 
55799
          self.limit = iprot.readI64();
-
 
55800
        else:
-
 
55801
          iprot.skip(ftype)
-
 
55802
      elif fid == 4:
-
 
55803
        if ftype == TType.I64:
-
 
55804
          self.warehouse_id = iprot.readI64();
-
 
55805
        else:
-
 
55806
          iprot.skip(ftype)
-
 
55807
      elif fid == 5:
-
 
55808
        if ftype == TType.I64:
-
 
55809
          self.source = iprot.readI64();
-
 
55810
        else:
-
 
55811
          iprot.skip(ftype)
-
 
55812
      else:
-
 
55813
        iprot.skip(ftype)
-
 
55814
      iprot.readFieldEnd()
-
 
55815
    iprot.readStructEnd()
-
 
55816
 
-
 
55817
  def write(self, oprot):
-
 
55818
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
55819
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
55820
      return
-
 
55821
    oprot.writeStructBegin('getOrdersInBatchAsPromisedShipping_args')
-
 
55822
    if self.statuses is not None:
-
 
55823
      oprot.writeFieldBegin('statuses', TType.LIST, 1)
-
 
55824
      oprot.writeListBegin(TType.I32, len(self.statuses))
-
 
55825
      for iter1415 in self.statuses:
-
 
55826
        oprot.writeI32(iter1415)
-
 
55827
      oprot.writeListEnd()
-
 
55828
      oprot.writeFieldEnd()
-
 
55829
    if self.offset is not None:
-
 
55830
      oprot.writeFieldBegin('offset', TType.I64, 2)
-
 
55831
      oprot.writeI64(self.offset)
-
 
55832
      oprot.writeFieldEnd()
-
 
55833
    if self.limit is not None:
-
 
55834
      oprot.writeFieldBegin('limit', TType.I64, 3)
-
 
55835
      oprot.writeI64(self.limit)
-
 
55836
      oprot.writeFieldEnd()
-
 
55837
    if self.warehouse_id is not None:
-
 
55838
      oprot.writeFieldBegin('warehouse_id', TType.I64, 4)
-
 
55839
      oprot.writeI64(self.warehouse_id)
-
 
55840
      oprot.writeFieldEnd()
-
 
55841
    if self.source is not None:
-
 
55842
      oprot.writeFieldBegin('source', TType.I64, 5)
-
 
55843
      oprot.writeI64(self.source)
-
 
55844
      oprot.writeFieldEnd()
-
 
55845
    oprot.writeFieldStop()
-
 
55846
    oprot.writeStructEnd()
-
 
55847
 
-
 
55848
  def validate(self):
-
 
55849
    return
-
 
55850
 
-
 
55851
 
-
 
55852
  def __repr__(self):
-
 
55853
    L = ['%s=%r' % (key, value)
-
 
55854
      for key, value in self.__dict__.iteritems()]
-
 
55855
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
55856
 
-
 
55857
  def __eq__(self, other):
-
 
55858
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
55859
 
-
 
55860
  def __ne__(self, other):
-
 
55861
    return not (self == other)
-
 
55862
 
-
 
55863
class getOrdersInBatchAsPromisedShipping_result:
-
 
55864
  """
-
 
55865
  Attributes:
-
 
55866
   - success
-
 
55867
   - ex
-
 
55868
  """
-
 
55869
 
-
 
55870
  thrift_spec = (
-
 
55871
    (0, TType.LIST, 'success', (TType.STRUCT,(Order, Order.thrift_spec)), None, ), # 0
-
 
55872
    (1, TType.STRUCT, 'ex', (TransactionServiceException, TransactionServiceException.thrift_spec), None, ), # 1
-
 
55873
  )
-
 
55874
 
-
 
55875
  def __init__(self, success=None, ex=None,):
-
 
55876
    self.success = success
-
 
55877
    self.ex = ex
-
 
55878
 
-
 
55879
  def read(self, iprot):
-
 
55880
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
55881
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
55882
      return
-
 
55883
    iprot.readStructBegin()
-
 
55884
    while True:
-
 
55885
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
55886
      if ftype == TType.STOP:
-
 
55887
        break
-
 
55888
      if fid == 0:
-
 
55889
        if ftype == TType.LIST:
-
 
55890
          self.success = []
-
 
55891
          (_etype1419, _size1416) = iprot.readListBegin()
-
 
55892
          for _i1420 in xrange(_size1416):
-
 
55893
            _elem1421 = Order()
-
 
55894
            _elem1421.read(iprot)
-
 
55895
            self.success.append(_elem1421)
-
 
55896
          iprot.readListEnd()
-
 
55897
        else:
-
 
55898
          iprot.skip(ftype)
-
 
55899
      elif fid == 1:
-
 
55900
        if ftype == TType.STRUCT:
-
 
55901
          self.ex = TransactionServiceException()
-
 
55902
          self.ex.read(iprot)
-
 
55903
        else:
-
 
55904
          iprot.skip(ftype)
-
 
55905
      else:
-
 
55906
        iprot.skip(ftype)
-
 
55907
      iprot.readFieldEnd()
-
 
55908
    iprot.readStructEnd()
-
 
55909
 
-
 
55910
  def write(self, oprot):
-
 
55911
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
55912
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
55913
      return
-
 
55914
    oprot.writeStructBegin('getOrdersInBatchAsPromisedShipping_result')
-
 
55915
    if self.success is not None:
-
 
55916
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
55917
      oprot.writeListBegin(TType.STRUCT, len(self.success))
-
 
55918
      for iter1422 in self.success:
-
 
55919
        iter1422.write(oprot)
-
 
55920
      oprot.writeListEnd()
-
 
55921
      oprot.writeFieldEnd()
-
 
55922
    if self.ex is not None:
-
 
55923
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
-
 
55924
      self.ex.write(oprot)
-
 
55925
      oprot.writeFieldEnd()
55655
    oprot.writeFieldStop()
55926
    oprot.writeFieldStop()
55656
    oprot.writeStructEnd()
55927
    oprot.writeStructEnd()
55657
 
55928
 
55658
  def validate(self):
55929
  def validate(self):
55659
    return
55930
    return