Subversion Repositories SmartDukaan

Rev

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

Rev 3226 Rev 3376
Line 3... Line 3...
3
#
3
#
4
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
4
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
#
5
#
6
 
6
 
7
from thrift.Thrift import *
7
from thrift.Thrift import *
-
 
8
import shop2020.thriftpy.generic.GenericService
8
from ttypes import *
9
from ttypes import *
9
from thrift.Thrift import TProcessor
10
from thrift.Thrift import TProcessor
10
from thrift.transport import TTransport
11
from thrift.transport import TTransport
11
from thrift.protocol import TBinaryProtocol
12
from thrift.protocol import TBinaryProtocol
12
try:
13
try:
13
  from thrift.protocol import fastbinary
14
  from thrift.protocol import fastbinary
14
except:
15
except:
15
  fastbinary = None
16
  fastbinary = None
16
 
17
 
17
 
18
 
18
class Iface:
-
 
19
  def closeSession(self, ):
-
 
20
    """
-
 
21
    For closing the open session in sqlalchemy
19
class Iface(shop2020.thriftpy.generic.GenericService.Iface):
22
    """
-
 
23
    pass
-
 
24
 
-
 
25
  def createTransaction(self, transaction):
20
  def createTransaction(self, transaction):
26
    """
21
    """
27
    Parameters:
22
    Parameters:
28
     - transaction
23
     - transaction
29
    """
24
    """
Line 548... Line 543...
548
     - warehouseId
543
     - warehouseId
549
    """
544
    """
550
    pass
545
    pass
551
 
546
 
552
 
547
 
553
class Client(Iface):
548
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
554
  def __init__(self, iprot, oprot=None):
549
  def __init__(self, iprot, oprot=None):
555
    self._iprot = self._oprot = iprot
-
 
556
    if oprot != None:
-
 
557
      self._oprot = oprot
-
 
558
    self._seqid = 0
-
 
559
 
-
 
560
  def closeSession(self, ):
-
 
561
    """
-
 
562
    For closing the open session in sqlalchemy
-
 
563
    """
-
 
564
    self.send_closeSession()
-
 
565
    self.recv_closeSession()
-
 
566
 
-
 
567
  def send_closeSession(self, ):
-
 
568
    self._oprot.writeMessageBegin('closeSession', TMessageType.CALL, self._seqid)
550
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
569
    args = closeSession_args()
-
 
570
    args.write(self._oprot)
-
 
571
    self._oprot.writeMessageEnd()
-
 
572
    self._oprot.trans.flush()
-
 
573
 
-
 
574
  def recv_closeSession(self, ):
-
 
575
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
576
    if mtype == TMessageType.EXCEPTION:
-
 
577
      x = TApplicationException()
-
 
578
      x.read(self._iprot)
-
 
579
      self._iprot.readMessageEnd()
-
 
580
      raise x
-
 
581
    result = closeSession_result()
-
 
582
    result.read(self._iprot)
-
 
583
    self._iprot.readMessageEnd()
-
 
584
    return
-
 
585
 
551
 
586
  def createTransaction(self, transaction):
552
  def createTransaction(self, transaction):
587
    """
553
    """
588
    Parameters:
554
    Parameters:
589
     - transaction
555
     - transaction
Line 2348... Line 2314...
2348
    if result.ex != None:
2314
    if result.ex != None:
2349
      raise result.ex
2315
      raise result.ex
2350
    raise TApplicationException(TApplicationException.MISSING_RESULT, "createPurchaseOrder failed: unknown result");
2316
    raise TApplicationException(TApplicationException.MISSING_RESULT, "createPurchaseOrder failed: unknown result");
2351
 
2317
 
2352
 
2318
 
2353
class Processor(Iface, TProcessor):
2319
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
2354
  def __init__(self, handler):
2320
  def __init__(self, handler):
2355
    self._handler = handler
-
 
2356
    self._processMap = {}
-
 
2357
    self._processMap["closeSession"] = Processor.process_closeSession
2321
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
2358
    self._processMap["createTransaction"] = Processor.process_createTransaction
2322
    self._processMap["createTransaction"] = Processor.process_createTransaction
2359
    self._processMap["getTransaction"] = Processor.process_getTransaction
2323
    self._processMap["getTransaction"] = Processor.process_getTransaction
2360
    self._processMap["getTransactionsForCustomer"] = Processor.process_getTransactionsForCustomer
2324
    self._processMap["getTransactionsForCustomer"] = Processor.process_getTransactionsForCustomer
2361
    self._processMap["getTransactionsForShoppingCartId"] = Processor.process_getTransactionsForShoppingCartId
2325
    self._processMap["getTransactionsForShoppingCartId"] = Processor.process_getTransactionsForShoppingCartId
2362
    self._processMap["getTransactionStatus"] = Processor.process_getTransactionStatus
2326
    self._processMap["getTransactionStatus"] = Processor.process_getTransactionStatus
Line 2418... Line 2382...
2418
      return
2382
      return
2419
    else:
2383
    else:
2420
      self._processMap[name](self, seqid, iprot, oprot)
2384
      self._processMap[name](self, seqid, iprot, oprot)
2421
    return True
2385
    return True
2422
 
2386
 
2423
  def process_closeSession(self, seqid, iprot, oprot):
-
 
2424
    args = closeSession_args()
-
 
2425
    args.read(iprot)
-
 
2426
    iprot.readMessageEnd()
-
 
2427
    result = closeSession_result()
-
 
2428
    self._handler.closeSession()
-
 
2429
    oprot.writeMessageBegin("closeSession", TMessageType.REPLY, seqid)
-
 
2430
    result.write(oprot)
-
 
2431
    oprot.writeMessageEnd()
-
 
2432
    oprot.trans.flush()
-
 
2433
 
-
 
2434
  def process_createTransaction(self, seqid, iprot, oprot):
2387
  def process_createTransaction(self, seqid, iprot, oprot):
2435
    args = createTransaction_args()
2388
    args = createTransaction_args()
2436
    args.read(iprot)
2389
    args.read(iprot)
2437
    iprot.readMessageEnd()
2390
    iprot.readMessageEnd()
2438
    result = createTransaction_result()
2391
    result = createTransaction_result()
Line 3091... Line 3044...
3091
    oprot.trans.flush()
3044
    oprot.trans.flush()
3092
 
3045
 
3093
 
3046
 
3094
# HELPER FUNCTIONS AND STRUCTURES
3047
# HELPER FUNCTIONS AND STRUCTURES
3095
 
3048
 
3096
class closeSession_args:
-
 
3097
 
-
 
3098
  thrift_spec = (
-
 
3099
  )
-
 
3100
 
-
 
3101
  def read(self, iprot):
-
 
3102
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
3103
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
3104
      return
-
 
3105
    iprot.readStructBegin()
-
 
3106
    while True:
-
 
3107
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
3108
      if ftype == TType.STOP:
-
 
3109
        break
-
 
3110
      else:
-
 
3111
        iprot.skip(ftype)
-
 
3112
      iprot.readFieldEnd()
-
 
3113
    iprot.readStructEnd()
-
 
3114
 
-
 
3115
  def write(self, oprot):
-
 
3116
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
3117
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
3118
      return
-
 
3119
    oprot.writeStructBegin('closeSession_args')
-
 
3120
    oprot.writeFieldStop()
-
 
3121
    oprot.writeStructEnd()
-
 
3122
 
-
 
3123
  def __repr__(self):
-
 
3124
    L = ['%s=%r' % (key, value)
-
 
3125
      for key, value in self.__dict__.iteritems()]
-
 
3126
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
3127
 
-
 
3128
  def __eq__(self, other):
-
 
3129
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
3130
 
-
 
3131
  def __ne__(self, other):
-
 
3132
    return not (self == other)
-
 
3133
 
-
 
3134
class closeSession_result:
-
 
3135
 
-
 
3136
  thrift_spec = (
-
 
3137
  )
-
 
3138
 
-
 
3139
  def read(self, iprot):
-
 
3140
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
3141
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
3142
      return
-
 
3143
    iprot.readStructBegin()
-
 
3144
    while True:
-
 
3145
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
3146
      if ftype == TType.STOP:
-
 
3147
        break
-
 
3148
      else:
-
 
3149
        iprot.skip(ftype)
-
 
3150
      iprot.readFieldEnd()
-
 
3151
    iprot.readStructEnd()
-
 
3152
 
-
 
3153
  def write(self, oprot):
-
 
3154
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
3155
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
3156
      return
-
 
3157
    oprot.writeStructBegin('closeSession_result')
-
 
3158
    oprot.writeFieldStop()
-
 
3159
    oprot.writeStructEnd()
-
 
3160
 
-
 
3161
  def __repr__(self):
-
 
3162
    L = ['%s=%r' % (key, value)
-
 
3163
      for key, value in self.__dict__.iteritems()]
-
 
3164
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
3165
 
-
 
3166
  def __eq__(self, other):
-
 
3167
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
3168
 
-
 
3169
  def __ne__(self, other):
-
 
3170
    return not (self == other)
-
 
3171
 
-
 
3172
class createTransaction_args:
3049
class createTransaction_args:
3173
  """
3050
  """
3174
  Attributes:
3051
  Attributes:
3175
   - transaction
3052
   - transaction
3176
  """
3053
  """