Subversion Repositories SmartDukaan

Rev

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

Rev 5247 Rev 5527
Line 121... Line 121...
121
     - destination_pin
121
     - destination_pin
122
     - type
122
     - type
123
    """
123
    """
124
    pass
124
    pass
125
 
125
 
-
 
126
  def getProviderForPickupType(self, pickUp):
-
 
127
    """
-
 
128
    Returns the id for a given pickUpType
-
 
129
 
-
 
130
    Parameters:
-
 
131
     - pickUp
-
 
132
    """
-
 
133
    pass
-
 
134
 
126
 
135
 
127
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
136
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
128
  def __init__(self, iprot, oprot=None):
137
  def __init__(self, iprot, oprot=None):
129
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
138
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
130
 
139
 
Line 488... Line 497...
488
      return result.success
497
      return result.success
489
    if result.se is not None:
498
    if result.se is not None:
490
      raise result.se
499
      raise result.se
491
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getEntityLogisticsEstimation failed: unknown result");
500
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getEntityLogisticsEstimation failed: unknown result");
492
 
501
 
-
 
502
  def getProviderForPickupType(self, pickUp):
-
 
503
    """
-
 
504
    Returns the id for a given pickUpType
-
 
505
 
-
 
506
    Parameters:
-
 
507
     - pickUp
-
 
508
    """
-
 
509
    self.send_getProviderForPickupType(pickUp)
-
 
510
    return self.recv_getProviderForPickupType()
-
 
511
 
-
 
512
  def send_getProviderForPickupType(self, pickUp):
-
 
513
    self._oprot.writeMessageBegin('getProviderForPickupType', TMessageType.CALL, self._seqid)
-
 
514
    args = getProviderForPickupType_args()
-
 
515
    args.pickUp = pickUp
-
 
516
    args.write(self._oprot)
-
 
517
    self._oprot.writeMessageEnd()
-
 
518
    self._oprot.trans.flush()
-
 
519
 
-
 
520
  def recv_getProviderForPickupType(self, ):
-
 
521
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
522
    if mtype == TMessageType.EXCEPTION:
-
 
523
      x = TApplicationException()
-
 
524
      x.read(self._iprot)
-
 
525
      self._iprot.readMessageEnd()
-
 
526
      raise x
-
 
527
    result = getProviderForPickupType_result()
-
 
528
    result.read(self._iprot)
-
 
529
    self._iprot.readMessageEnd()
-
 
530
    if result.success is not None:
-
 
531
      return result.success
-
 
532
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getProviderForPickupType failed: unknown result");
-
 
533
 
493
 
534
 
494
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
535
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
495
  def __init__(self, handler):
536
  def __init__(self, handler):
496
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
537
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
497
    self._processMap["getProvider"] = Processor.process_getProvider
538
    self._processMap["getProvider"] = Processor.process_getProvider
Line 502... Line 543...
502
    self._processMap["getShipmentInfo"] = Processor.process_getShipmentInfo
543
    self._processMap["getShipmentInfo"] = Processor.process_getShipmentInfo
503
    self._processMap["getDestinationCode"] = Processor.process_getDestinationCode
544
    self._processMap["getDestinationCode"] = Processor.process_getDestinationCode
504
    self._processMap["getFreeAwbCount"] = Processor.process_getFreeAwbCount
545
    self._processMap["getFreeAwbCount"] = Processor.process_getFreeAwbCount
505
    self._processMap["getHolidays"] = Processor.process_getHolidays
546
    self._processMap["getHolidays"] = Processor.process_getHolidays
506
    self._processMap["getEntityLogisticsEstimation"] = Processor.process_getEntityLogisticsEstimation
547
    self._processMap["getEntityLogisticsEstimation"] = Processor.process_getEntityLogisticsEstimation
-
 
548
    self._processMap["getProviderForPickupType"] = Processor.process_getProviderForPickupType
507
 
549
 
508
  def process(self, iprot, oprot):
550
  def process(self, iprot, oprot):
509
    (name, type, seqid) = iprot.readMessageBegin()
551
    (name, type, seqid) = iprot.readMessageBegin()
510
    if name not in self._processMap:
552
    if name not in self._processMap:
511
      iprot.skip(TType.STRUCT)
553
      iprot.skip(TType.STRUCT)
Line 652... Line 694...
652
    oprot.writeMessageBegin("getEntityLogisticsEstimation", TMessageType.REPLY, seqid)
694
    oprot.writeMessageBegin("getEntityLogisticsEstimation", TMessageType.REPLY, seqid)
653
    result.write(oprot)
695
    result.write(oprot)
654
    oprot.writeMessageEnd()
696
    oprot.writeMessageEnd()
655
    oprot.trans.flush()
697
    oprot.trans.flush()
656
 
698
 
-
 
699
  def process_getProviderForPickupType(self, seqid, iprot, oprot):
-
 
700
    args = getProviderForPickupType_args()
-
 
701
    args.read(iprot)
-
 
702
    iprot.readMessageEnd()
-
 
703
    result = getProviderForPickupType_result()
-
 
704
    result.success = self._handler.getProviderForPickupType(args.pickUp)
-
 
705
    oprot.writeMessageBegin("getProviderForPickupType", TMessageType.REPLY, seqid)
-
 
706
    result.write(oprot)
-
 
707
    oprot.writeMessageEnd()
-
 
708
    oprot.trans.flush()
-
 
709
 
657
 
710
 
658
# HELPER FUNCTIONS AND STRUCTURES
711
# HELPER FUNCTIONS AND STRUCTURES
659
 
712
 
660
class getProvider_args:
713
class getProvider_args:
661
  """
714
  """
Line 2081... Line 2134...
2081
      oprot.writeFieldEnd()
2134
      oprot.writeFieldEnd()
2082
    oprot.writeFieldStop()
2135
    oprot.writeFieldStop()
2083
    oprot.writeStructEnd()
2136
    oprot.writeStructEnd()
2084
 
2137
 
2085
  def validate(self):
2138
  def validate(self):
-
 
2139
    return
-
 
2140
 
-
 
2141
 
-
 
2142
  def __repr__(self):
-
 
2143
    L = ['%s=%r' % (key, value)
-
 
2144
      for key, value in self.__dict__.iteritems()]
-
 
2145
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
2146
 
-
 
2147
  def __eq__(self, other):
-
 
2148
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
2149
 
-
 
2150
  def __ne__(self, other):
-
 
2151
    return not (self == other)
-
 
2152
 
-
 
2153
class getProviderForPickupType_args:
-
 
2154
  """
-
 
2155
  Attributes:
-
 
2156
   - pickUp
-
 
2157
  """
-
 
2158
 
-
 
2159
  thrift_spec = (
-
 
2160
    None, # 0
-
 
2161
    (1, TType.I64, 'pickUp', None, None, ), # 1
-
 
2162
  )
-
 
2163
 
-
 
2164
  def __init__(self, pickUp=None,):
-
 
2165
    self.pickUp = pickUp
-
 
2166
 
-
 
2167
  def read(self, iprot):
-
 
2168
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
2169
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
2170
      return
-
 
2171
    iprot.readStructBegin()
-
 
2172
    while True:
-
 
2173
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
2174
      if ftype == TType.STOP:
-
 
2175
        break
-
 
2176
      if fid == 1:
-
 
2177
        if ftype == TType.I64:
-
 
2178
          self.pickUp = iprot.readI64();
-
 
2179
        else:
-
 
2180
          iprot.skip(ftype)
-
 
2181
      else:
-
 
2182
        iprot.skip(ftype)
-
 
2183
      iprot.readFieldEnd()
-
 
2184
    iprot.readStructEnd()
-
 
2185
 
-
 
2186
  def write(self, oprot):
-
 
2187
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
2188
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
2189
      return
-
 
2190
    oprot.writeStructBegin('getProviderForPickupType_args')
-
 
2191
    if self.pickUp is not None:
-
 
2192
      oprot.writeFieldBegin('pickUp', TType.I64, 1)
-
 
2193
      oprot.writeI64(self.pickUp)
-
 
2194
      oprot.writeFieldEnd()
-
 
2195
    oprot.writeFieldStop()
-
 
2196
    oprot.writeStructEnd()
-
 
2197
 
-
 
2198
  def validate(self):
-
 
2199
    return
-
 
2200
 
-
 
2201
 
-
 
2202
  def __repr__(self):
-
 
2203
    L = ['%s=%r' % (key, value)
-
 
2204
      for key, value in self.__dict__.iteritems()]
-
 
2205
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
2206
 
-
 
2207
  def __eq__(self, other):
-
 
2208
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
2209
 
-
 
2210
  def __ne__(self, other):
-
 
2211
    return not (self == other)
-
 
2212
 
-
 
2213
class getProviderForPickupType_result:
-
 
2214
  """
-
 
2215
  Attributes:
-
 
2216
   - success
-
 
2217
  """
-
 
2218
 
-
 
2219
  thrift_spec = (
-
 
2220
    (0, TType.I64, 'success', None, None, ), # 0
-
 
2221
  )
-
 
2222
 
-
 
2223
  def __init__(self, success=None,):
-
 
2224
    self.success = success
-
 
2225
 
-
 
2226
  def read(self, iprot):
-
 
2227
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
2228
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
2229
      return
-
 
2230
    iprot.readStructBegin()
-
 
2231
    while True:
-
 
2232
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
2233
      if ftype == TType.STOP:
-
 
2234
        break
-
 
2235
      if fid == 0:
-
 
2236
        if ftype == TType.I64:
-
 
2237
          self.success = iprot.readI64();
-
 
2238
        else:
-
 
2239
          iprot.skip(ftype)
-
 
2240
      else:
-
 
2241
        iprot.skip(ftype)
-
 
2242
      iprot.readFieldEnd()
-
 
2243
    iprot.readStructEnd()
-
 
2244
 
-
 
2245
  def write(self, oprot):
-
 
2246
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
2247
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
2248
      return
-
 
2249
    oprot.writeStructBegin('getProviderForPickupType_result')
-
 
2250
    if self.success is not None:
-
 
2251
      oprot.writeFieldBegin('success', TType.I64, 0)
-
 
2252
      oprot.writeI64(self.success)
-
 
2253
      oprot.writeFieldEnd()
-
 
2254
    oprot.writeFieldStop()
-
 
2255
    oprot.writeStructEnd()
-
 
2256
 
-
 
2257
  def validate(self):
2086
    return
2258
    return
2087
 
2259
 
2088
 
2260
 
2089
  def __repr__(self):
2261
  def __repr__(self):
2090
    L = ['%s=%r' % (key, value)
2262
    L = ['%s=%r' % (key, value)