Subversion Repositories SmartDukaan

Rev

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

Rev 5530 Rev 5591
Line 157... Line 157...
157
    Parameters:
157
    Parameters:
158
     - invoice
158
     - invoice
159
    """
159
    """
160
    pass
160
    pass
161
 
161
 
-
 
162
  def addSupplier(self, supplier):
-
 
163
    """
-
 
164
    Creates a supplier
-
 
165
 
-
 
166
    Parameters:
-
 
167
     - supplier
-
 
168
    """
-
 
169
    pass
-
 
170
 
-
 
171
  def updateSupplier(self, supplier):
-
 
172
    """
-
 
173
    Updates a supplier
-
 
174
 
-
 
175
    Parameters:
-
 
176
     - supplier
-
 
177
    """
-
 
178
    pass
-
 
179
 
162
 
180
 
163
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
181
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
164
  def __init__(self, iprot, oprot=None):
182
  def __init__(self, iprot, oprot=None):
165
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
183
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
166
 
184
 
Line 673... Line 691...
673
    self._iprot.readMessageEnd()
691
    self._iprot.readMessageEnd()
674
    if result.e is not None:
692
    if result.e is not None:
675
      raise result.e
693
      raise result.e
676
    return
694
    return
677
 
695
 
-
 
696
  def addSupplier(self, supplier):
-
 
697
    """
-
 
698
    Creates a supplier
-
 
699
 
-
 
700
    Parameters:
-
 
701
     - supplier
-
 
702
    """
-
 
703
    self.send_addSupplier(supplier)
-
 
704
    return self.recv_addSupplier()
-
 
705
 
-
 
706
  def send_addSupplier(self, supplier):
-
 
707
    self._oprot.writeMessageBegin('addSupplier', TMessageType.CALL, self._seqid)
-
 
708
    args = addSupplier_args()
-
 
709
    args.supplier = supplier
-
 
710
    args.write(self._oprot)
-
 
711
    self._oprot.writeMessageEnd()
-
 
712
    self._oprot.trans.flush()
-
 
713
 
-
 
714
  def recv_addSupplier(self, ):
-
 
715
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
716
    if mtype == TMessageType.EXCEPTION:
-
 
717
      x = TApplicationException()
-
 
718
      x.read(self._iprot)
-
 
719
      self._iprot.readMessageEnd()
-
 
720
      raise x
-
 
721
    result = addSupplier_result()
-
 
722
    result.read(self._iprot)
-
 
723
    self._iprot.readMessageEnd()
-
 
724
    if result.success is not None:
-
 
725
      return result.success
-
 
726
    raise TApplicationException(TApplicationException.MISSING_RESULT, "addSupplier failed: unknown result");
-
 
727
 
-
 
728
  def updateSupplier(self, supplier):
-
 
729
    """
-
 
730
    Updates a supplier
-
 
731
 
-
 
732
    Parameters:
-
 
733
     - supplier
-
 
734
    """
-
 
735
    self.send_updateSupplier(supplier)
-
 
736
    self.recv_updateSupplier()
-
 
737
 
-
 
738
  def send_updateSupplier(self, supplier):
-
 
739
    self._oprot.writeMessageBegin('updateSupplier', TMessageType.CALL, self._seqid)
-
 
740
    args = updateSupplier_args()
-
 
741
    args.supplier = supplier
-
 
742
    args.write(self._oprot)
-
 
743
    self._oprot.writeMessageEnd()
-
 
744
    self._oprot.trans.flush()
-
 
745
 
-
 
746
  def recv_updateSupplier(self, ):
-
 
747
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
748
    if mtype == TMessageType.EXCEPTION:
-
 
749
      x = TApplicationException()
-
 
750
      x.read(self._iprot)
-
 
751
      self._iprot.readMessageEnd()
-
 
752
      raise x
-
 
753
    result = updateSupplier_result()
-
 
754
    result.read(self._iprot)
-
 
755
    self._iprot.readMessageEnd()
-
 
756
    return
-
 
757
 
678
 
758
 
679
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
759
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
680
  def __init__(self, handler):
760
  def __init__(self, handler):
681
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
761
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
682
    self._processMap["createPurchaseOrder"] = Processor.process_createPurchaseOrder
762
    self._processMap["createPurchaseOrder"] = Processor.process_createPurchaseOrder
Line 692... Line 772...
692
    self._processMap["fulfillPO"] = Processor.process_fulfillPO
772
    self._processMap["fulfillPO"] = Processor.process_fulfillPO
693
    self._processMap["updatePurchaseOrder"] = Processor.process_updatePurchaseOrder
773
    self._processMap["updatePurchaseOrder"] = Processor.process_updatePurchaseOrder
694
    self._processMap["unFulfillPO"] = Processor.process_unFulfillPO
774
    self._processMap["unFulfillPO"] = Processor.process_unFulfillPO
695
    self._processMap["getInvoices"] = Processor.process_getInvoices
775
    self._processMap["getInvoices"] = Processor.process_getInvoices
696
    self._processMap["createInvoice"] = Processor.process_createInvoice
776
    self._processMap["createInvoice"] = Processor.process_createInvoice
-
 
777
    self._processMap["addSupplier"] = Processor.process_addSupplier
-
 
778
    self._processMap["updateSupplier"] = Processor.process_updateSupplier
697
 
779
 
698
  def process(self, iprot, oprot):
780
  def process(self, iprot, oprot):
699
    (name, type, seqid) = iprot.readMessageBegin()
781
    (name, type, seqid) = iprot.readMessageBegin()
700
    if name not in self._processMap:
782
    if name not in self._processMap:
701
      iprot.skip(TType.STRUCT)
783
      iprot.skip(TType.STRUCT)
Line 912... Line 994...
912
    oprot.writeMessageBegin("createInvoice", TMessageType.REPLY, seqid)
994
    oprot.writeMessageBegin("createInvoice", TMessageType.REPLY, seqid)
913
    result.write(oprot)
995
    result.write(oprot)
914
    oprot.writeMessageEnd()
996
    oprot.writeMessageEnd()
915
    oprot.trans.flush()
997
    oprot.trans.flush()
916
 
998
 
-
 
999
  def process_addSupplier(self, seqid, iprot, oprot):
-
 
1000
    args = addSupplier_args()
-
 
1001
    args.read(iprot)
-
 
1002
    iprot.readMessageEnd()
-
 
1003
    result = addSupplier_result()
-
 
1004
    result.success = self._handler.addSupplier(args.supplier)
-
 
1005
    oprot.writeMessageBegin("addSupplier", TMessageType.REPLY, seqid)
-
 
1006
    result.write(oprot)
-
 
1007
    oprot.writeMessageEnd()
-
 
1008
    oprot.trans.flush()
-
 
1009
 
-
 
1010
  def process_updateSupplier(self, seqid, iprot, oprot):
-
 
1011
    args = updateSupplier_args()
-
 
1012
    args.read(iprot)
-
 
1013
    iprot.readMessageEnd()
-
 
1014
    result = updateSupplier_result()
-
 
1015
    self._handler.updateSupplier(args.supplier)
-
 
1016
    oprot.writeMessageBegin("updateSupplier", TMessageType.REPLY, seqid)
-
 
1017
    result.write(oprot)
-
 
1018
    oprot.writeMessageEnd()
-
 
1019
    oprot.trans.flush()
-
 
1020
 
917
 
1021
 
918
# HELPER FUNCTIONS AND STRUCTURES
1022
# HELPER FUNCTIONS AND STRUCTURES
919
 
1023
 
920
class createPurchaseOrder_args:
1024
class createPurchaseOrder_args:
921
  """
1025
  """
Line 2929... Line 3033...
2929
    oprot.writeFieldStop()
3033
    oprot.writeFieldStop()
2930
    oprot.writeStructEnd()
3034
    oprot.writeStructEnd()
2931
 
3035
 
2932
  def validate(self):
3036
  def validate(self):
2933
    return
3037
    return
-
 
3038
 
-
 
3039
 
-
 
3040
  def __repr__(self):
-
 
3041
    L = ['%s=%r' % (key, value)
-
 
3042
      for key, value in self.__dict__.iteritems()]
-
 
3043
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
3044
 
-
 
3045
  def __eq__(self, other):
-
 
3046
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
3047
 
-
 
3048
  def __ne__(self, other):
-
 
3049
    return not (self == other)
-
 
3050
 
-
 
3051
class addSupplier_args:
-
 
3052
  """
-
 
3053
  Attributes:
-
 
3054
   - supplier
-
 
3055
  """
-
 
3056
 
-
 
3057
  thrift_spec = (
-
 
3058
    None, # 0
-
 
3059
    (1, TType.STRUCT, 'supplier', (Supplier, Supplier.thrift_spec), None, ), # 1
-
 
3060
  )
-
 
3061
 
-
 
3062
  def __init__(self, supplier=None,):
-
 
3063
    self.supplier = supplier
-
 
3064
 
-
 
3065
  def read(self, iprot):
-
 
3066
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
3067
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
3068
      return
-
 
3069
    iprot.readStructBegin()
-
 
3070
    while True:
-
 
3071
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
3072
      if ftype == TType.STOP:
-
 
3073
        break
-
 
3074
      if fid == 1:
-
 
3075
        if ftype == TType.STRUCT:
-
 
3076
          self.supplier = Supplier()
-
 
3077
          self.supplier.read(iprot)
-
 
3078
        else:
-
 
3079
          iprot.skip(ftype)
-
 
3080
      else:
-
 
3081
        iprot.skip(ftype)
-
 
3082
      iprot.readFieldEnd()
-
 
3083
    iprot.readStructEnd()
-
 
3084
 
-
 
3085
  def write(self, oprot):
-
 
3086
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
3087
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
3088
      return
-
 
3089
    oprot.writeStructBegin('addSupplier_args')
-
 
3090
    if self.supplier is not None:
-
 
3091
      oprot.writeFieldBegin('supplier', TType.STRUCT, 1)
-
 
3092
      self.supplier.write(oprot)
-
 
3093
      oprot.writeFieldEnd()
-
 
3094
    oprot.writeFieldStop()
-
 
3095
    oprot.writeStructEnd()
-
 
3096
 
-
 
3097
  def validate(self):
-
 
3098
    return
-
 
3099
 
-
 
3100
 
-
 
3101
  def __repr__(self):
-
 
3102
    L = ['%s=%r' % (key, value)
-
 
3103
      for key, value in self.__dict__.iteritems()]
-
 
3104
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
3105
 
-
 
3106
  def __eq__(self, other):
-
 
3107
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
3108
 
-
 
3109
  def __ne__(self, other):
-
 
3110
    return not (self == other)
-
 
3111
 
-
 
3112
class addSupplier_result:
-
 
3113
  """
-
 
3114
  Attributes:
-
 
3115
   - success
-
 
3116
  """
-
 
3117
 
-
 
3118
  thrift_spec = (
-
 
3119
    (0, TType.STRUCT, 'success', (Supplier, Supplier.thrift_spec), None, ), # 0
-
 
3120
  )
-
 
3121
 
-
 
3122
  def __init__(self, success=None,):
-
 
3123
    self.success = success
-
 
3124
 
-
 
3125
  def read(self, iprot):
-
 
3126
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
3127
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
3128
      return
-
 
3129
    iprot.readStructBegin()
-
 
3130
    while True:
-
 
3131
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
3132
      if ftype == TType.STOP:
-
 
3133
        break
-
 
3134
      if fid == 0:
-
 
3135
        if ftype == TType.STRUCT:
-
 
3136
          self.success = Supplier()
-
 
3137
          self.success.read(iprot)
-
 
3138
        else:
-
 
3139
          iprot.skip(ftype)
-
 
3140
      else:
-
 
3141
        iprot.skip(ftype)
-
 
3142
      iprot.readFieldEnd()
-
 
3143
    iprot.readStructEnd()
-
 
3144
 
-
 
3145
  def write(self, oprot):
-
 
3146
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
3147
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
3148
      return
-
 
3149
    oprot.writeStructBegin('addSupplier_result')
-
 
3150
    if self.success is not None:
-
 
3151
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
-
 
3152
      self.success.write(oprot)
-
 
3153
      oprot.writeFieldEnd()
-
 
3154
    oprot.writeFieldStop()
-
 
3155
    oprot.writeStructEnd()
-
 
3156
 
-
 
3157
  def validate(self):
-
 
3158
    return
-
 
3159
 
-
 
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 updateSupplier_args:
-
 
3173
  """
-
 
3174
  Attributes:
-
 
3175
   - supplier
-
 
3176
  """
-
 
3177
 
-
 
3178
  thrift_spec = (
-
 
3179
    None, # 0
-
 
3180
    (1, TType.STRUCT, 'supplier', (Supplier, Supplier.thrift_spec), None, ), # 1
-
 
3181
  )
-
 
3182
 
-
 
3183
  def __init__(self, supplier=None,):
-
 
3184
    self.supplier = supplier
-
 
3185
 
-
 
3186
  def read(self, iprot):
-
 
3187
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
3188
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
3189
      return
-
 
3190
    iprot.readStructBegin()
-
 
3191
    while True:
-
 
3192
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
3193
      if ftype == TType.STOP:
-
 
3194
        break
-
 
3195
      if fid == 1:
-
 
3196
        if ftype == TType.STRUCT:
-
 
3197
          self.supplier = Supplier()
-
 
3198
          self.supplier.read(iprot)
-
 
3199
        else:
-
 
3200
          iprot.skip(ftype)
-
 
3201
      else:
-
 
3202
        iprot.skip(ftype)
-
 
3203
      iprot.readFieldEnd()
-
 
3204
    iprot.readStructEnd()
-
 
3205
 
-
 
3206
  def write(self, oprot):
-
 
3207
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
3208
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
3209
      return
-
 
3210
    oprot.writeStructBegin('updateSupplier_args')
-
 
3211
    if self.supplier is not None:
-
 
3212
      oprot.writeFieldBegin('supplier', TType.STRUCT, 1)
-
 
3213
      self.supplier.write(oprot)
-
 
3214
      oprot.writeFieldEnd()
-
 
3215
    oprot.writeFieldStop()
-
 
3216
    oprot.writeStructEnd()
-
 
3217
 
-
 
3218
  def validate(self):
-
 
3219
    return
-
 
3220
 
-
 
3221
 
-
 
3222
  def __repr__(self):
-
 
3223
    L = ['%s=%r' % (key, value)
-
 
3224
      for key, value in self.__dict__.iteritems()]
-
 
3225
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
3226
 
-
 
3227
  def __eq__(self, other):
-
 
3228
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
3229
 
-
 
3230
  def __ne__(self, other):
-
 
3231
    return not (self == other)
-
 
3232
 
-
 
3233
class updateSupplier_result:
-
 
3234
 
-
 
3235
  thrift_spec = (
-
 
3236
  )
-
 
3237
 
-
 
3238
  def read(self, iprot):
-
 
3239
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
3240
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
3241
      return
-
 
3242
    iprot.readStructBegin()
-
 
3243
    while True:
-
 
3244
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
3245
      if ftype == TType.STOP:
-
 
3246
        break
-
 
3247
      else:
-
 
3248
        iprot.skip(ftype)
-
 
3249
      iprot.readFieldEnd()
-
 
3250
    iprot.readStructEnd()
-
 
3251
 
-
 
3252
  def write(self, oprot):
-
 
3253
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
3254
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
3255
      return
-
 
3256
    oprot.writeStructBegin('updateSupplier_result')
-
 
3257
    oprot.writeFieldStop()
-
 
3258
    oprot.writeStructEnd()
-
 
3259
 
-
 
3260
  def validate(self):
-
 
3261
    return
2934
 
3262
 
2935
 
3263
 
2936
  def __repr__(self):
3264
  def __repr__(self):
2937
    L = ['%s=%r' % (key, value)
3265
    L = ['%s=%r' % (key, value)
2938
      for key, value in self.__dict__.iteritems()]
3266
      for key, value in self.__dict__.iteritems()]