Subversion Repositories SmartDukaan

Rev

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

Rev 6433 Rev 6497
Line 101... Line 101...
101
     - couponCode
101
     - couponCode
102
     - userId
102
     - userId
103
    """
103
    """
104
    pass
104
    pass
105
 
105
 
-
 
106
  def getActiveCodes(self, promotionId):
-
 
107
    """
-
 
108
    Parameters:
-
 
109
     - promotionId
-
 
110
    """
-
 
111
    pass
-
 
112
 
-
 
113
  def deleteCoupon(self, couponCode):
-
 
114
    """
-
 
115
    Parameters:
-
 
116
     - couponCode
-
 
117
    """
-
 
118
    pass
-
 
119
 
106
  def getActiveCoupons(self, ):
120
  def getActiveCoupons(self, ):
107
    """
121
    """
108
    Returns a list of active coupons
122
    Returns a list of active coupons
109
    """
123
    """
110
    pass
124
    pass
Line 547... Line 561...
547
      return result.success
561
      return result.success
548
    if result.pex is not None:
562
    if result.pex is not None:
549
      raise result.pex
563
      raise result.pex
550
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
564
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
551
 
565
 
-
 
566
  def getActiveCodes(self, promotionId):
-
 
567
    """
-
 
568
    Parameters:
-
 
569
     - promotionId
-
 
570
    """
-
 
571
    self.send_getActiveCodes(promotionId)
-
 
572
    return self.recv_getActiveCodes()
-
 
573
 
-
 
574
  def send_getActiveCodes(self, promotionId):
-
 
575
    self._oprot.writeMessageBegin('getActiveCodes', TMessageType.CALL, self._seqid)
-
 
576
    args = getActiveCodes_args()
-
 
577
    args.promotionId = promotionId
-
 
578
    args.write(self._oprot)
-
 
579
    self._oprot.writeMessageEnd()
-
 
580
    self._oprot.trans.flush()
-
 
581
 
-
 
582
  def recv_getActiveCodes(self, ):
-
 
583
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
584
    if mtype == TMessageType.EXCEPTION:
-
 
585
      x = TApplicationException()
-
 
586
      x.read(self._iprot)
-
 
587
      self._iprot.readMessageEnd()
-
 
588
      raise x
-
 
589
    result = getActiveCodes_result()
-
 
590
    result.read(self._iprot)
-
 
591
    self._iprot.readMessageEnd()
-
 
592
    if result.success is not None:
-
 
593
      return result.success
-
 
594
    if result.pex is not None:
-
 
595
      raise result.pex
-
 
596
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getActiveCodes failed: unknown result");
-
 
597
 
-
 
598
  def deleteCoupon(self, couponCode):
-
 
599
    """
-
 
600
    Parameters:
-
 
601
     - couponCode
-
 
602
    """
-
 
603
    self.send_deleteCoupon(couponCode)
-
 
604
    self.recv_deleteCoupon()
-
 
605
 
-
 
606
  def send_deleteCoupon(self, couponCode):
-
 
607
    self._oprot.writeMessageBegin('deleteCoupon', TMessageType.CALL, self._seqid)
-
 
608
    args = deleteCoupon_args()
-
 
609
    args.couponCode = couponCode
-
 
610
    args.write(self._oprot)
-
 
611
    self._oprot.writeMessageEnd()
-
 
612
    self._oprot.trans.flush()
-
 
613
 
-
 
614
  def recv_deleteCoupon(self, ):
-
 
615
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
616
    if mtype == TMessageType.EXCEPTION:
-
 
617
      x = TApplicationException()
-
 
618
      x.read(self._iprot)
-
 
619
      self._iprot.readMessageEnd()
-
 
620
      raise x
-
 
621
    result = deleteCoupon_result()
-
 
622
    result.read(self._iprot)
-
 
623
    self._iprot.readMessageEnd()
-
 
624
    if result.pex is not None:
-
 
625
      raise result.pex
-
 
626
    return
-
 
627
 
552
  def getActiveCoupons(self, ):
628
  def getActiveCoupons(self, ):
553
    """
629
    """
554
    Returns a list of active coupons
630
    Returns a list of active coupons
555
    """
631
    """
556
    self.send_getActiveCoupons()
632
    self.send_getActiveCoupons()
Line 860... Line 936...
860
    self._processMap["generateCouponsForPromotion"] = Processor.process_generateCouponsForPromotion
936
    self._processMap["generateCouponsForPromotion"] = Processor.process_generateCouponsForPromotion
861
    self._processMap["applyCoupon"] = Processor.process_applyCoupon
937
    self._processMap["applyCoupon"] = Processor.process_applyCoupon
862
    self._processMap["applyRechargeCoupon"] = Processor.process_applyRechargeCoupon
938
    self._processMap["applyRechargeCoupon"] = Processor.process_applyRechargeCoupon
863
    self._processMap["trackCouponUsage"] = Processor.process_trackCouponUsage
939
    self._processMap["trackCouponUsage"] = Processor.process_trackCouponUsage
864
    self._processMap["getCouponUsageCountByUser"] = Processor.process_getCouponUsageCountByUser
940
    self._processMap["getCouponUsageCountByUser"] = Processor.process_getCouponUsageCountByUser
-
 
941
    self._processMap["getActiveCodes"] = Processor.process_getActiveCodes
-
 
942
    self._processMap["deleteCoupon"] = Processor.process_deleteCoupon
865
    self._processMap["getActiveCoupons"] = Processor.process_getActiveCoupons
943
    self._processMap["getActiveCoupons"] = Processor.process_getActiveCoupons
866
    self._processMap["createCoupon"] = Processor.process_createCoupon
944
    self._processMap["createCoupon"] = Processor.process_createCoupon
867
    self._processMap["getSuccessfulPaymentCountForCoupon"] = Processor.process_getSuccessfulPaymentCountForCoupon
945
    self._processMap["getSuccessfulPaymentCountForCoupon"] = Processor.process_getSuccessfulPaymentCountForCoupon
868
    self._processMap["getRuleDocString"] = Processor.process_getRuleDocString
946
    self._processMap["getRuleDocString"] = Processor.process_getRuleDocString
869
    self._processMap["getItemDiscountMap"] = Processor.process_getItemDiscountMap
947
    self._processMap["getItemDiscountMap"] = Processor.process_getItemDiscountMap
Line 1039... Line 1117...
1039
    oprot.writeMessageBegin("getCouponUsageCountByUser", TMessageType.REPLY, seqid)
1117
    oprot.writeMessageBegin("getCouponUsageCountByUser", TMessageType.REPLY, seqid)
1040
    result.write(oprot)
1118
    result.write(oprot)
1041
    oprot.writeMessageEnd()
1119
    oprot.writeMessageEnd()
1042
    oprot.trans.flush()
1120
    oprot.trans.flush()
1043
 
1121
 
-
 
1122
  def process_getActiveCodes(self, seqid, iprot, oprot):
-
 
1123
    args = getActiveCodes_args()
-
 
1124
    args.read(iprot)
-
 
1125
    iprot.readMessageEnd()
-
 
1126
    result = getActiveCodes_result()
-
 
1127
    try:
-
 
1128
      result.success = self._handler.getActiveCodes(args.promotionId)
-
 
1129
    except PromotionException, pex:
-
 
1130
      result.pex = pex
-
 
1131
    oprot.writeMessageBegin("getActiveCodes", TMessageType.REPLY, seqid)
-
 
1132
    result.write(oprot)
-
 
1133
    oprot.writeMessageEnd()
-
 
1134
    oprot.trans.flush()
-
 
1135
 
-
 
1136
  def process_deleteCoupon(self, seqid, iprot, oprot):
-
 
1137
    args = deleteCoupon_args()
-
 
1138
    args.read(iprot)
-
 
1139
    iprot.readMessageEnd()
-
 
1140
    result = deleteCoupon_result()
-
 
1141
    try:
-
 
1142
      self._handler.deleteCoupon(args.couponCode)
-
 
1143
    except PromotionException, pex:
-
 
1144
      result.pex = pex
-
 
1145
    oprot.writeMessageBegin("deleteCoupon", TMessageType.REPLY, seqid)
-
 
1146
    result.write(oprot)
-
 
1147
    oprot.writeMessageEnd()
-
 
1148
    oprot.trans.flush()
-
 
1149
 
1044
  def process_getActiveCoupons(self, seqid, iprot, oprot):
1150
  def process_getActiveCoupons(self, seqid, iprot, oprot):
1045
    args = getActiveCoupons_args()
1151
    args = getActiveCoupons_args()
1046
    args.read(iprot)
1152
    args.read(iprot)
1047
    iprot.readMessageEnd()
1153
    iprot.readMessageEnd()
1048
    result = getActiveCoupons_result()
1154
    result = getActiveCoupons_result()
Line 2696... Line 2802...
2696
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2802
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2697
 
2803
 
2698
  def __ne__(self, other):
2804
  def __ne__(self, other):
2699
    return not (self == other)
2805
    return not (self == other)
2700
 
2806
 
2701
class getActiveCoupons_args:
2807
class getActiveCodes_args:
-
 
2808
  """
-
 
2809
  Attributes:
-
 
2810
   - promotionId
-
 
2811
  """
2702
 
2812
 
2703
  thrift_spec = (
2813
  thrift_spec = (
-
 
2814
    None, # 0
-
 
2815
    (1, TType.I64, 'promotionId', None, None, ), # 1
2704
  )
2816
  )
2705
 
2817
 
-
 
2818
  def __init__(self, promotionId=None,):
-
 
2819
    self.promotionId = promotionId
-
 
2820
 
2706
  def read(self, iprot):
2821
  def read(self, iprot):
2707
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2822
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2708
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2823
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2709
      return
2824
      return
2710
    iprot.readStructBegin()
2825
    iprot.readStructBegin()
2711
    while True:
2826
    while True:
2712
      (fname, ftype, fid) = iprot.readFieldBegin()
2827
      (fname, ftype, fid) = iprot.readFieldBegin()
2713
      if ftype == TType.STOP:
2828
      if ftype == TType.STOP:
2714
        break
2829
        break
-
 
2830
      if fid == 1:
-
 
2831
        if ftype == TType.I64:
-
 
2832
          self.promotionId = iprot.readI64();
-
 
2833
        else:
-
 
2834
          iprot.skip(ftype)
2715
      else:
2835
      else:
2716
        iprot.skip(ftype)
2836
        iprot.skip(ftype)
2717
      iprot.readFieldEnd()
2837
      iprot.readFieldEnd()
2718
    iprot.readStructEnd()
2838
    iprot.readStructEnd()
2719
 
2839
 
2720
  def write(self, oprot):
2840
  def write(self, oprot):
2721
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2841
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2722
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2842
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2723
      return
2843
      return
2724
    oprot.writeStructBegin('getActiveCoupons_args')
2844
    oprot.writeStructBegin('getActiveCodes_args')
-
 
2845
    if self.promotionId is not None:
-
 
2846
      oprot.writeFieldBegin('promotionId', TType.I64, 1)
-
 
2847
      oprot.writeI64(self.promotionId)
-
 
2848
      oprot.writeFieldEnd()
2725
    oprot.writeFieldStop()
2849
    oprot.writeFieldStop()
2726
    oprot.writeStructEnd()
2850
    oprot.writeStructEnd()
2727
 
2851
 
2728
  def validate(self):
2852
  def validate(self):
2729
    return
2853
    return
Line 2738... Line 2862...
2738
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2862
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2739
 
2863
 
2740
  def __ne__(self, other):
2864
  def __ne__(self, other):
2741
    return not (self == other)
2865
    return not (self == other)
2742
 
2866
 
2743
class getActiveCoupons_result:
2867
class getActiveCodes_result:
2744
  """
2868
  """
2745
  Attributes:
2869
  Attributes:
2746
   - success
2870
   - success
2747
   - pex
2871
   - pex
2748
  """
2872
  """
Line 2789... Line 2913...
2789
 
2913
 
2790
  def write(self, oprot):
2914
  def write(self, oprot):
2791
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2915
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2792
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2916
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2793
      return
2917
      return
2794
    oprot.writeStructBegin('getActiveCoupons_result')
2918
    oprot.writeStructBegin('getActiveCodes_result')
2795
    if self.success is not None:
2919
    if self.success is not None:
2796
      oprot.writeFieldBegin('success', TType.LIST, 0)
2920
      oprot.writeFieldBegin('success', TType.LIST, 0)
2797
      oprot.writeListBegin(TType.STRUCT, len(self.success))
2921
      oprot.writeListBegin(TType.STRUCT, len(self.success))
2798
      for iter43 in self.success:
2922
      for iter43 in self.success:
2799
        iter43.write(oprot)
2923
        iter43.write(oprot)
Line 2819... Line 2943...
2819
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2943
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2820
 
2944
 
2821
  def __ne__(self, other):
2945
  def __ne__(self, other):
2822
    return not (self == other)
2946
    return not (self == other)
2823
 
2947
 
-
 
2948
class deleteCoupon_args:
-
 
2949
  """
-
 
2950
  Attributes:
-
 
2951
   - couponCode
-
 
2952
  """
-
 
2953
 
-
 
2954
  thrift_spec = (
-
 
2955
    None, # 0
-
 
2956
    (1, TType.STRING, 'couponCode', None, None, ), # 1
-
 
2957
  )
-
 
2958
 
-
 
2959
  def __init__(self, couponCode=None,):
-
 
2960
    self.couponCode = couponCode
-
 
2961
 
-
 
2962
  def read(self, iprot):
-
 
2963
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
2964
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
2965
      return
-
 
2966
    iprot.readStructBegin()
-
 
2967
    while True:
-
 
2968
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
2969
      if ftype == TType.STOP:
-
 
2970
        break
-
 
2971
      if fid == 1:
-
 
2972
        if ftype == TType.STRING:
-
 
2973
          self.couponCode = iprot.readString();
-
 
2974
        else:
-
 
2975
          iprot.skip(ftype)
-
 
2976
      else:
-
 
2977
        iprot.skip(ftype)
-
 
2978
      iprot.readFieldEnd()
-
 
2979
    iprot.readStructEnd()
-
 
2980
 
-
 
2981
  def write(self, oprot):
-
 
2982
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
2983
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
2984
      return
-
 
2985
    oprot.writeStructBegin('deleteCoupon_args')
-
 
2986
    if self.couponCode is not None:
-
 
2987
      oprot.writeFieldBegin('couponCode', TType.STRING, 1)
-
 
2988
      oprot.writeString(self.couponCode)
-
 
2989
      oprot.writeFieldEnd()
-
 
2990
    oprot.writeFieldStop()
-
 
2991
    oprot.writeStructEnd()
-
 
2992
 
-
 
2993
  def validate(self):
-
 
2994
    return
-
 
2995
 
-
 
2996
 
-
 
2997
  def __repr__(self):
-
 
2998
    L = ['%s=%r' % (key, value)
-
 
2999
      for key, value in self.__dict__.iteritems()]
-
 
3000
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
3001
 
-
 
3002
  def __eq__(self, other):
-
 
3003
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
3004
 
-
 
3005
  def __ne__(self, other):
-
 
3006
    return not (self == other)
-
 
3007
 
-
 
3008
class deleteCoupon_result:
-
 
3009
  """
-
 
3010
  Attributes:
-
 
3011
   - pex
-
 
3012
  """
-
 
3013
 
-
 
3014
  thrift_spec = (
-
 
3015
    None, # 0
-
 
3016
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
-
 
3017
  )
-
 
3018
 
-
 
3019
  def __init__(self, pex=None,):
-
 
3020
    self.pex = pex
-
 
3021
 
-
 
3022
  def read(self, iprot):
-
 
3023
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
3024
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
3025
      return
-
 
3026
    iprot.readStructBegin()
-
 
3027
    while True:
-
 
3028
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
3029
      if ftype == TType.STOP:
-
 
3030
        break
-
 
3031
      if fid == 1:
-
 
3032
        if ftype == TType.STRUCT:
-
 
3033
          self.pex = PromotionException()
-
 
3034
          self.pex.read(iprot)
-
 
3035
        else:
-
 
3036
          iprot.skip(ftype)
-
 
3037
      else:
-
 
3038
        iprot.skip(ftype)
-
 
3039
      iprot.readFieldEnd()
-
 
3040
    iprot.readStructEnd()
-
 
3041
 
-
 
3042
  def write(self, oprot):
-
 
3043
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
3044
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
3045
      return
-
 
3046
    oprot.writeStructBegin('deleteCoupon_result')
-
 
3047
    if self.pex is not None:
-
 
3048
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
-
 
3049
      self.pex.write(oprot)
-
 
3050
      oprot.writeFieldEnd()
-
 
3051
    oprot.writeFieldStop()
-
 
3052
    oprot.writeStructEnd()
-
 
3053
 
-
 
3054
  def validate(self):
-
 
3055
    return
-
 
3056
 
-
 
3057
 
-
 
3058
  def __repr__(self):
-
 
3059
    L = ['%s=%r' % (key, value)
-
 
3060
      for key, value in self.__dict__.iteritems()]
-
 
3061
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
3062
 
-
 
3063
  def __eq__(self, other):
-
 
3064
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
3065
 
-
 
3066
  def __ne__(self, other):
-
 
3067
    return not (self == other)
-
 
3068
 
-
 
3069
class getActiveCoupons_args:
-
 
3070
 
-
 
3071
  thrift_spec = (
-
 
3072
  )
-
 
3073
 
-
 
3074
  def read(self, iprot):
-
 
3075
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
3076
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
3077
      return
-
 
3078
    iprot.readStructBegin()
-
 
3079
    while True:
-
 
3080
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
3081
      if ftype == TType.STOP:
-
 
3082
        break
-
 
3083
      else:
-
 
3084
        iprot.skip(ftype)
-
 
3085
      iprot.readFieldEnd()
-
 
3086
    iprot.readStructEnd()
-
 
3087
 
-
 
3088
  def write(self, oprot):
-
 
3089
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
3090
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
3091
      return
-
 
3092
    oprot.writeStructBegin('getActiveCoupons_args')
-
 
3093
    oprot.writeFieldStop()
-
 
3094
    oprot.writeStructEnd()
-
 
3095
 
-
 
3096
  def validate(self):
-
 
3097
    return
-
 
3098
 
-
 
3099
 
-
 
3100
  def __repr__(self):
-
 
3101
    L = ['%s=%r' % (key, value)
-
 
3102
      for key, value in self.__dict__.iteritems()]
-
 
3103
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
3104
 
-
 
3105
  def __eq__(self, other):
-
 
3106
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
3107
 
-
 
3108
  def __ne__(self, other):
-
 
3109
    return not (self == other)
-
 
3110
 
-
 
3111
class getActiveCoupons_result:
-
 
3112
  """
-
 
3113
  Attributes:
-
 
3114
   - success
-
 
3115
   - pex
-
 
3116
  """
-
 
3117
 
-
 
3118
  thrift_spec = (
-
 
3119
    (0, TType.LIST, 'success', (TType.STRUCT,(Coupon, Coupon.thrift_spec)), None, ), # 0
-
 
3120
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
-
 
3121
  )
-
 
3122
 
-
 
3123
  def __init__(self, success=None, pex=None,):
-
 
3124
    self.success = success
-
 
3125
    self.pex = pex
-
 
3126
 
-
 
3127
  def read(self, iprot):
-
 
3128
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
3129
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
3130
      return
-
 
3131
    iprot.readStructBegin()
-
 
3132
    while True:
-
 
3133
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
3134
      if ftype == TType.STOP:
-
 
3135
        break
-
 
3136
      if fid == 0:
-
 
3137
        if ftype == TType.LIST:
-
 
3138
          self.success = []
-
 
3139
          (_etype47, _size44) = iprot.readListBegin()
-
 
3140
          for _i48 in xrange(_size44):
-
 
3141
            _elem49 = Coupon()
-
 
3142
            _elem49.read(iprot)
-
 
3143
            self.success.append(_elem49)
-
 
3144
          iprot.readListEnd()
-
 
3145
        else:
-
 
3146
          iprot.skip(ftype)
-
 
3147
      elif fid == 1:
-
 
3148
        if ftype == TType.STRUCT:
-
 
3149
          self.pex = PromotionException()
-
 
3150
          self.pex.read(iprot)
-
 
3151
        else:
-
 
3152
          iprot.skip(ftype)
-
 
3153
      else:
-
 
3154
        iprot.skip(ftype)
-
 
3155
      iprot.readFieldEnd()
-
 
3156
    iprot.readStructEnd()
-
 
3157
 
-
 
3158
  def write(self, oprot):
-
 
3159
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
3160
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
3161
      return
-
 
3162
    oprot.writeStructBegin('getActiveCoupons_result')
-
 
3163
    if self.success is not None:
-
 
3164
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
3165
      oprot.writeListBegin(TType.STRUCT, len(self.success))
-
 
3166
      for iter50 in self.success:
-
 
3167
        iter50.write(oprot)
-
 
3168
      oprot.writeListEnd()
-
 
3169
      oprot.writeFieldEnd()
-
 
3170
    if self.pex is not None:
-
 
3171
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
-
 
3172
      self.pex.write(oprot)
-
 
3173
      oprot.writeFieldEnd()
-
 
3174
    oprot.writeFieldStop()
-
 
3175
    oprot.writeStructEnd()
-
 
3176
 
-
 
3177
  def validate(self):
-
 
3178
    return
-
 
3179
 
-
 
3180
 
-
 
3181
  def __repr__(self):
-
 
3182
    L = ['%s=%r' % (key, value)
-
 
3183
      for key, value in self.__dict__.iteritems()]
-
 
3184
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
3185
 
-
 
3186
  def __eq__(self, other):
-
 
3187
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
3188
 
-
 
3189
  def __ne__(self, other):
-
 
3190
    return not (self == other)
-
 
3191
 
2824
class createCoupon_args:
3192
class createCoupon_args:
2825
  """
3193
  """
2826
  Attributes:
3194
  Attributes:
2827
   - promotionId
3195
   - promotionId
2828
   - endOn
3196
   - endOn
Line 3288... Line 3656...
3288
      if ftype == TType.STOP:
3656
      if ftype == TType.STOP:
3289
        break
3657
        break
3290
      if fid == 1:
3658
      if fid == 1:
3291
        if ftype == TType.LIST:
3659
        if ftype == TType.LIST:
3292
          self.itemIds = []
3660
          self.itemIds = []
3293
          (_etype47, _size44) = iprot.readListBegin()
3661
          (_etype54, _size51) = iprot.readListBegin()
3294
          for _i48 in xrange(_size44):
3662
          for _i55 in xrange(_size51):
3295
            _elem49 = iprot.readI64();
3663
            _elem56 = iprot.readI64();
3296
            self.itemIds.append(_elem49)
3664
            self.itemIds.append(_elem56)
3297
          iprot.readListEnd()
3665
          iprot.readListEnd()
3298
        else:
3666
        else:
3299
          iprot.skip(ftype)
3667
          iprot.skip(ftype)
3300
      else:
3668
      else:
3301
        iprot.skip(ftype)
3669
        iprot.skip(ftype)
Line 3308... Line 3676...
3308
      return
3676
      return
3309
    oprot.writeStructBegin('getItemDiscountMap_args')
3677
    oprot.writeStructBegin('getItemDiscountMap_args')
3310
    if self.itemIds is not None:
3678
    if self.itemIds is not None:
3311
      oprot.writeFieldBegin('itemIds', TType.LIST, 1)
3679
      oprot.writeFieldBegin('itemIds', TType.LIST, 1)
3312
      oprot.writeListBegin(TType.I64, len(self.itemIds))
3680
      oprot.writeListBegin(TType.I64, len(self.itemIds))
3313
      for iter50 in self.itemIds:
3681
      for iter57 in self.itemIds:
3314
        oprot.writeI64(iter50)
3682
        oprot.writeI64(iter57)
3315
      oprot.writeListEnd()
3683
      oprot.writeListEnd()
3316
      oprot.writeFieldEnd()
3684
      oprot.writeFieldEnd()
3317
    oprot.writeFieldStop()
3685
    oprot.writeFieldStop()
3318
    oprot.writeStructEnd()
3686
    oprot.writeStructEnd()
3319
 
3687
 
Line 3358... Line 3726...
3358
      if ftype == TType.STOP:
3726
      if ftype == TType.STOP:
3359
        break
3727
        break
3360
      if fid == 0:
3728
      if fid == 0:
3361
        if ftype == TType.LIST:
3729
        if ftype == TType.LIST:
3362
          self.success = []
3730
          self.success = []
3363
          (_etype54, _size51) = iprot.readListBegin()
3731
          (_etype61, _size58) = iprot.readListBegin()
3364
          for _i55 in xrange(_size51):
3732
          for _i62 in xrange(_size58):
3365
            _elem56 = ItemCouponDiscount()
3733
            _elem63 = ItemCouponDiscount()
3366
            _elem56.read(iprot)
3734
            _elem63.read(iprot)
3367
            self.success.append(_elem56)
3735
            self.success.append(_elem63)
3368
          iprot.readListEnd()
3736
          iprot.readListEnd()
3369
        else:
3737
        else:
3370
          iprot.skip(ftype)
3738
          iprot.skip(ftype)
3371
      elif fid == 1:
3739
      elif fid == 1:
3372
        if ftype == TType.STRUCT:
3740
        if ftype == TType.STRUCT:
Line 3385... Line 3753...
3385
      return
3753
      return
3386
    oprot.writeStructBegin('getItemDiscountMap_result')
3754
    oprot.writeStructBegin('getItemDiscountMap_result')
3387
    if self.success is not None:
3755
    if self.success is not None:
3388
      oprot.writeFieldBegin('success', TType.LIST, 0)
3756
      oprot.writeFieldBegin('success', TType.LIST, 0)
3389
      oprot.writeListBegin(TType.STRUCT, len(self.success))
3757
      oprot.writeListBegin(TType.STRUCT, len(self.success))
3390
      for iter57 in self.success:
3758
      for iter64 in self.success:
3391
        iter57.write(oprot)
3759
        iter64.write(oprot)
3392
      oprot.writeListEnd()
3760
      oprot.writeListEnd()
3393
      oprot.writeFieldEnd()
3761
      oprot.writeFieldEnd()
3394
    if self.pex is not None:
3762
    if self.pex is not None:
3395
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
3763
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
3396
      self.pex.write(oprot)
3764
      self.pex.write(oprot)
Line 3496... Line 3864...
3496
      if ftype == TType.STOP:
3864
      if ftype == TType.STOP:
3497
        break
3865
        break
3498
      if fid == 0:
3866
      if fid == 0:
3499
        if ftype == TType.MAP:
3867
        if ftype == TType.MAP:
3500
          self.success = {}
3868
          self.success = {}
3501
          (_ktype59, _vtype60, _size58 ) = iprot.readMapBegin() 
3869
          (_ktype66, _vtype67, _size65 ) = iprot.readMapBegin() 
3502
          for _i62 in xrange(_size58):
3870
          for _i69 in xrange(_size65):
3503
            _key63 = iprot.readString();
3871
            _key70 = iprot.readString();
3504
            _val64 = iprot.readDouble();
3872
            _val71 = iprot.readDouble();
3505
            self.success[_key63] = _val64
3873
            self.success[_key70] = _val71
3506
          iprot.readMapEnd()
3874
          iprot.readMapEnd()
3507
        else:
3875
        else:
3508
          iprot.skip(ftype)
3876
          iprot.skip(ftype)
3509
      else:
3877
      else:
3510
        iprot.skip(ftype)
3878
        iprot.skip(ftype)
Line 3517... Line 3885...
3517
      return
3885
      return
3518
    oprot.writeStructBegin('getDiscountsForEntity_result')
3886
    oprot.writeStructBegin('getDiscountsForEntity_result')
3519
    if self.success is not None:
3887
    if self.success is not None:
3520
      oprot.writeFieldBegin('success', TType.MAP, 0)
3888
      oprot.writeFieldBegin('success', TType.MAP, 0)
3521
      oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(self.success))
3889
      oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(self.success))
3522
      for kiter65,viter66 in self.success.items():
3890
      for kiter72,viter73 in self.success.items():
3523
        oprot.writeString(kiter65)
3891
        oprot.writeString(kiter72)
3524
        oprot.writeDouble(viter66)
3892
        oprot.writeDouble(viter73)
3525
      oprot.writeMapEnd()
3893
      oprot.writeMapEnd()
3526
      oprot.writeFieldEnd()
3894
      oprot.writeFieldEnd()
3527
    oprot.writeFieldStop()
3895
    oprot.writeFieldStop()
3528
    oprot.writeStructEnd()
3896
    oprot.writeStructEnd()
3529
 
3897