Subversion Repositories SmartDukaan

Rev

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

Rev 765 Rev 1137
Line 87... Line 87...
87
     - providerId
87
     - providerId
88
     - pinCode
88
     - pinCode
89
    """
89
    """
90
    pass
90
    pass
91
 
91
 
-
 
92
  def getFreeAwbCount(self, providerId):
-
 
93
    """
-
 
94
    Returns the number of unused AWB numbers for the given provider
-
 
95
    
-
 
96
    Parameters:
-
 
97
     - providerId
-
 
98
    """
-
 
99
    pass
-
 
100
 
92
 
101
 
93
class Client(Iface):
102
class Client(Iface):
94
  def __init__(self, iprot, oprot=None):
103
  def __init__(self, iprot, oprot=None):
95
    self._iprot = self._oprot = iprot
104
    self._iprot = self._oprot = iprot
96
    if oprot != None:
105
    if oprot != None:
Line 366... Line 375...
366
      return result.success
375
      return result.success
367
    if result.se != None:
376
    if result.se != None:
368
      raise result.se
377
      raise result.se
369
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getDestinationCode failed: unknown result");
378
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getDestinationCode failed: unknown result");
370
 
379
 
-
 
380
  def getFreeAwbCount(self, providerId):
-
 
381
    """
-
 
382
    Returns the number of unused AWB numbers for the given provider
-
 
383
    
-
 
384
    Parameters:
-
 
385
     - providerId
-
 
386
    """
-
 
387
    self.send_getFreeAwbCount(providerId)
-
 
388
    return self.recv_getFreeAwbCount()
-
 
389
 
-
 
390
  def send_getFreeAwbCount(self, providerId):
-
 
391
    self._oprot.writeMessageBegin('getFreeAwbCount', TMessageType.CALL, self._seqid)
-
 
392
    args = getFreeAwbCount_args()
-
 
393
    args.providerId = providerId
-
 
394
    args.write(self._oprot)
-
 
395
    self._oprot.writeMessageEnd()
-
 
396
    self._oprot.trans.flush()
-
 
397
 
-
 
398
  def recv_getFreeAwbCount(self, ):
-
 
399
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
400
    if mtype == TMessageType.EXCEPTION:
-
 
401
      x = TApplicationException()
-
 
402
      x.read(self._iprot)
-
 
403
      self._iprot.readMessageEnd()
-
 
404
      raise x
-
 
405
    result = getFreeAwbCount_result()
-
 
406
    result.read(self._iprot)
-
 
407
    self._iprot.readMessageEnd()
-
 
408
    if result.success != None:
-
 
409
      return result.success
-
 
410
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getFreeAwbCount failed: unknown result");
-
 
411
 
371
 
412
 
372
class Processor(Iface, TProcessor):
413
class Processor(Iface, TProcessor):
373
  def __init__(self, handler):
414
  def __init__(self, handler):
374
    self._handler = handler
415
    self._handler = handler
375
    self._processMap = {}
416
    self._processMap = {}
Line 379... Line 420...
379
    self._processMap["getLogisticsEstimation"] = Processor.process_getLogisticsEstimation
420
    self._processMap["getLogisticsEstimation"] = Processor.process_getLogisticsEstimation
380
    self._processMap["getLogisticsInfo"] = Processor.process_getLogisticsInfo
421
    self._processMap["getLogisticsInfo"] = Processor.process_getLogisticsInfo
381
    self._processMap["getEmptyAWB"] = Processor.process_getEmptyAWB
422
    self._processMap["getEmptyAWB"] = Processor.process_getEmptyAWB
382
    self._processMap["getShipmentInfo"] = Processor.process_getShipmentInfo
423
    self._processMap["getShipmentInfo"] = Processor.process_getShipmentInfo
383
    self._processMap["getDestinationCode"] = Processor.process_getDestinationCode
424
    self._processMap["getDestinationCode"] = Processor.process_getDestinationCode
-
 
425
    self._processMap["getFreeAwbCount"] = Processor.process_getFreeAwbCount
384
 
426
 
385
  def process(self, iprot, oprot):
427
  def process(self, iprot, oprot):
386
    (name, type, seqid) = iprot.readMessageBegin()
428
    (name, type, seqid) = iprot.readMessageBegin()
387
    if name not in self._processMap:
429
    if name not in self._processMap:
388
      iprot.skip(TType.STRUCT)
430
      iprot.skip(TType.STRUCT)
Line 504... Line 546...
504
    oprot.writeMessageBegin("getDestinationCode", TMessageType.REPLY, seqid)
546
    oprot.writeMessageBegin("getDestinationCode", TMessageType.REPLY, seqid)
505
    result.write(oprot)
547
    result.write(oprot)
506
    oprot.writeMessageEnd()
548
    oprot.writeMessageEnd()
507
    oprot.trans.flush()
549
    oprot.trans.flush()
508
 
550
 
-
 
551
  def process_getFreeAwbCount(self, seqid, iprot, oprot):
-
 
552
    args = getFreeAwbCount_args()
-
 
553
    args.read(iprot)
-
 
554
    iprot.readMessageEnd()
-
 
555
    result = getFreeAwbCount_result()
-
 
556
    result.success = self._handler.getFreeAwbCount(args.providerId)
-
 
557
    oprot.writeMessageBegin("getFreeAwbCount", TMessageType.REPLY, seqid)
-
 
558
    result.write(oprot)
-
 
559
    oprot.writeMessageEnd()
-
 
560
    oprot.trans.flush()
-
 
561
 
509
 
562
 
510
# HELPER FUNCTIONS AND STRUCTURES
563
# HELPER FUNCTIONS AND STRUCTURES
511
 
564
 
512
class closeSession_args:
565
class closeSession_args:
513
 
566
 
Line 1492... Line 1545...
1492
      oprot.writeFieldEnd()
1545
      oprot.writeFieldEnd()
1493
    oprot.writeFieldStop()
1546
    oprot.writeFieldStop()
1494
    oprot.writeStructEnd()
1547
    oprot.writeStructEnd()
1495
 
1548
 
1496
  def __repr__(self):
1549
  def __repr__(self):
-
 
1550
    L = ['%s=%r' % (key, value)
-
 
1551
      for key, value in self.__dict__.iteritems()]
-
 
1552
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1553
 
-
 
1554
  def __eq__(self, other):
-
 
1555
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1556
 
-
 
1557
  def __ne__(self, other):
-
 
1558
    return not (self == other)
-
 
1559
 
-
 
1560
class getFreeAwbCount_args:
-
 
1561
  """
-
 
1562
  Attributes:
-
 
1563
   - providerId
-
 
1564
  """
-
 
1565
 
-
 
1566
  thrift_spec = (
-
 
1567
    None, # 0
-
 
1568
    (1, TType.I64, 'providerId', None, None, ), # 1
-
 
1569
  )
-
 
1570
 
-
 
1571
  def __init__(self, providerId=None,):
-
 
1572
    self.providerId = providerId
-
 
1573
 
-
 
1574
  def read(self, iprot):
-
 
1575
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1576
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1577
      return
-
 
1578
    iprot.readStructBegin()
-
 
1579
    while True:
-
 
1580
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1581
      if ftype == TType.STOP:
-
 
1582
        break
-
 
1583
      if fid == 1:
-
 
1584
        if ftype == TType.I64:
-
 
1585
          self.providerId = iprot.readI64();
-
 
1586
        else:
-
 
1587
          iprot.skip(ftype)
-
 
1588
      else:
-
 
1589
        iprot.skip(ftype)
-
 
1590
      iprot.readFieldEnd()
-
 
1591
    iprot.readStructEnd()
-
 
1592
 
-
 
1593
  def write(self, oprot):
-
 
1594
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1595
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1596
      return
-
 
1597
    oprot.writeStructBegin('getFreeAwbCount_args')
-
 
1598
    if self.providerId != None:
-
 
1599
      oprot.writeFieldBegin('providerId', TType.I64, 1)
-
 
1600
      oprot.writeI64(self.providerId)
-
 
1601
      oprot.writeFieldEnd()
-
 
1602
    oprot.writeFieldStop()
-
 
1603
    oprot.writeStructEnd()
-
 
1604
 
-
 
1605
  def __repr__(self):
-
 
1606
    L = ['%s=%r' % (key, value)
-
 
1607
      for key, value in self.__dict__.iteritems()]
-
 
1608
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1609
 
-
 
1610
  def __eq__(self, other):
-
 
1611
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1612
 
-
 
1613
  def __ne__(self, other):
-
 
1614
    return not (self == other)
-
 
1615
 
-
 
1616
class getFreeAwbCount_result:
-
 
1617
  """
-
 
1618
  Attributes:
-
 
1619
   - success
-
 
1620
  """
-
 
1621
 
-
 
1622
  thrift_spec = (
-
 
1623
    (0, TType.I64, 'success', None, None, ), # 0
-
 
1624
  )
-
 
1625
 
-
 
1626
  def __init__(self, success=None,):
-
 
1627
    self.success = success
-
 
1628
 
-
 
1629
  def read(self, iprot):
-
 
1630
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1631
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1632
      return
-
 
1633
    iprot.readStructBegin()
-
 
1634
    while True:
-
 
1635
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1636
      if ftype == TType.STOP:
-
 
1637
        break
-
 
1638
      if fid == 0:
-
 
1639
        if ftype == TType.I64:
-
 
1640
          self.success = iprot.readI64();
-
 
1641
        else:
-
 
1642
          iprot.skip(ftype)
-
 
1643
      else:
-
 
1644
        iprot.skip(ftype)
-
 
1645
      iprot.readFieldEnd()
-
 
1646
    iprot.readStructEnd()
-
 
1647
 
-
 
1648
  def write(self, oprot):
-
 
1649
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1650
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1651
      return
-
 
1652
    oprot.writeStructBegin('getFreeAwbCount_result')
-
 
1653
    if self.success != None:
-
 
1654
      oprot.writeFieldBegin('success', TType.I64, 0)
-
 
1655
      oprot.writeI64(self.success)
-
 
1656
      oprot.writeFieldEnd()
-
 
1657
    oprot.writeFieldStop()
-
 
1658
    oprot.writeStructEnd()
-
 
1659
 
-
 
1660
  def __repr__(self):
1497
    L = ['%s=%r' % (key, value)
1661
    L = ['%s=%r' % (key, value)
1498
      for key, value in self.__dict__.iteritems()]
1662
      for key, value in self.__dict__.iteritems()]
1499
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1663
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1500
 
1664
 
1501
  def __eq__(self, other):
1665
  def __eq__(self, other):