Subversion Repositories SmartDukaan

Rev

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

Rev 7746 Rev 8707
Line 142... Line 142...
142
    """
142
    """
143
    Returns a list of active coupons
143
    Returns a list of active coupons
144
    """
144
    """
145
    pass
145
    pass
146
 
146
 
147
  def createCoupon(self, promotionId, couponCode, arguments, isCod, prefix):
147
  def createCoupon(self, promotionId, couponCategory, couponCode, arguments, isCod, prefix):
148
    """
148
    """
149
    Creates a coupon with prefix (optional, pass null)and returns couponcode if successfully created.
149
    Creates a coupon with prefix (optional, pass null)and returns couponcode if successfully created.
150
 
150
 
151
    Parameters:
151
    Parameters:
152
     - promotionId
152
     - promotionId
-
 
153
     - couponCategory
153
     - couponCode
154
     - couponCode
154
     - arguments
155
     - arguments
155
     - isCod
156
     - isCod
156
     - prefix
157
     - prefix
157
    """
158
    """
Line 769... Line 770...
769
      return result.success
770
      return result.success
770
    if result.pex is not None:
771
    if result.pex is not None:
771
      raise result.pex
772
      raise result.pex
772
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
773
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
773
 
774
 
774
  def createCoupon(self, promotionId, couponCode, arguments, isCod, prefix):
775
  def createCoupon(self, promotionId, couponCategory, couponCode, arguments, isCod, prefix):
775
    """
776
    """
776
    Creates a coupon with prefix (optional, pass null)and returns couponcode if successfully created.
777
    Creates a coupon with prefix (optional, pass null)and returns couponcode if successfully created.
777
 
778
 
778
    Parameters:
779
    Parameters:
779
     - promotionId
780
     - promotionId
-
 
781
     - couponCategory
780
     - couponCode
782
     - couponCode
781
     - arguments
783
     - arguments
782
     - isCod
784
     - isCod
783
     - prefix
785
     - prefix
784
    """
786
    """
785
    self.send_createCoupon(promotionId, couponCode, arguments, isCod, prefix)
787
    self.send_createCoupon(promotionId, couponCategory, couponCode, arguments, isCod, prefix)
786
    return self.recv_createCoupon()
788
    return self.recv_createCoupon()
787
 
789
 
788
  def send_createCoupon(self, promotionId, couponCode, arguments, isCod, prefix):
790
  def send_createCoupon(self, promotionId, couponCategory, couponCode, arguments, isCod, prefix):
789
    self._oprot.writeMessageBegin('createCoupon', TMessageType.CALL, self._seqid)
791
    self._oprot.writeMessageBegin('createCoupon', TMessageType.CALL, self._seqid)
790
    args = createCoupon_args()
792
    args = createCoupon_args()
791
    args.promotionId = promotionId
793
    args.promotionId = promotionId
-
 
794
    args.couponCategory = couponCategory
792
    args.couponCode = couponCode
795
    args.couponCode = couponCode
793
    args.arguments = arguments
796
    args.arguments = arguments
794
    args.isCod = isCod
797
    args.isCod = isCod
795
    args.prefix = prefix
798
    args.prefix = prefix
796
    args.write(self._oprot)
799
    args.write(self._oprot)
Line 1324... Line 1327...
1324
    args = createCoupon_args()
1327
    args = createCoupon_args()
1325
    args.read(iprot)
1328
    args.read(iprot)
1326
    iprot.readMessageEnd()
1329
    iprot.readMessageEnd()
1327
    result = createCoupon_result()
1330
    result = createCoupon_result()
1328
    try:
1331
    try:
1329
      result.success = self._handler.createCoupon(args.promotionId, args.couponCode, args.arguments, args.isCod, args.prefix)
1332
      result.success = self._handler.createCoupon(args.promotionId, args.couponCategory, args.couponCode, args.arguments, args.isCod, args.prefix)
1330
    except PromotionException, pex:
1333
    except PromotionException, pex:
1331
      result.pex = pex
1334
      result.pex = pex
1332
    oprot.writeMessageBegin("createCoupon", TMessageType.REPLY, seqid)
1335
    oprot.writeMessageBegin("createCoupon", TMessageType.REPLY, seqid)
1333
    result.write(oprot)
1336
    result.write(oprot)
1334
    oprot.writeMessageEnd()
1337
    oprot.writeMessageEnd()
Line 3765... Line 3768...
3765
 
3768
 
3766
class createCoupon_args:
3769
class createCoupon_args:
3767
  """
3770
  """
3768
  Attributes:
3771
  Attributes:
3769
   - promotionId
3772
   - promotionId
-
 
3773
   - couponCategory
3770
   - couponCode
3774
   - couponCode
3771
   - arguments
3775
   - arguments
3772
   - isCod
3776
   - isCod
3773
   - prefix
3777
   - prefix
3774
  """
3778
  """
3775
 
3779
 
3776
  thrift_spec = (
3780
  thrift_spec = (
3777
    None, # 0
3781
    None, # 0
3778
    (1, TType.I64, 'promotionId', None, None, ), # 1
3782
    (1, TType.I64, 'promotionId', None, None, ), # 1
-
 
3783
    (2, TType.I64, 'couponCategory', None, None, ), # 2
3779
    (2, TType.STRING, 'couponCode', None, None, ), # 2
3784
    (3, TType.STRING, 'couponCode', None, None, ), # 3
3780
    (3, TType.STRING, 'arguments', None, None, ), # 3
3785
    (4, TType.STRING, 'arguments', None, None, ), # 4
3781
    (4, TType.BOOL, 'isCod', None, None, ), # 4
3786
    (5, TType.BOOL, 'isCod', None, None, ), # 5
3782
    (5, TType.STRING, 'prefix', None, None, ), # 5
3787
    (6, TType.STRING, 'prefix', None, None, ), # 6
3783
  )
3788
  )
3784
 
3789
 
3785
  def __init__(self, promotionId=None, couponCode=None, arguments=None, isCod=None, prefix=None,):
3790
  def __init__(self, promotionId=None, couponCategory=None, couponCode=None, arguments=None, isCod=None, prefix=None,):
3786
    self.promotionId = promotionId
3791
    self.promotionId = promotionId
-
 
3792
    self.couponCategory = couponCategory
3787
    self.couponCode = couponCode
3793
    self.couponCode = couponCode
3788
    self.arguments = arguments
3794
    self.arguments = arguments
3789
    self.isCod = isCod
3795
    self.isCod = isCod
3790
    self.prefix = prefix
3796
    self.prefix = prefix
3791
 
3797
 
Line 3802... Line 3808...
3802
        if ftype == TType.I64:
3808
        if ftype == TType.I64:
3803
          self.promotionId = iprot.readI64();
3809
          self.promotionId = iprot.readI64();
3804
        else:
3810
        else:
3805
          iprot.skip(ftype)
3811
          iprot.skip(ftype)
3806
      elif fid == 2:
3812
      elif fid == 2:
-
 
3813
        if ftype == TType.I64:
-
 
3814
          self.couponCategory = iprot.readI64();
-
 
3815
        else:
-
 
3816
          iprot.skip(ftype)
-
 
3817
      elif fid == 3:
3807
        if ftype == TType.STRING:
3818
        if ftype == TType.STRING:
3808
          self.couponCode = iprot.readString();
3819
          self.couponCode = iprot.readString();
3809
        else:
3820
        else:
3810
          iprot.skip(ftype)
3821
          iprot.skip(ftype)
3811
      elif fid == 3:
3822
      elif fid == 4:
3812
        if ftype == TType.STRING:
3823
        if ftype == TType.STRING:
3813
          self.arguments = iprot.readString();
3824
          self.arguments = iprot.readString();
3814
        else:
3825
        else:
3815
          iprot.skip(ftype)
3826
          iprot.skip(ftype)
3816
      elif fid == 4:
3827
      elif fid == 5:
3817
        if ftype == TType.BOOL:
3828
        if ftype == TType.BOOL:
3818
          self.isCod = iprot.readBool();
3829
          self.isCod = iprot.readBool();
3819
        else:
3830
        else:
3820
          iprot.skip(ftype)
3831
          iprot.skip(ftype)
3821
      elif fid == 5:
3832
      elif fid == 6:
3822
        if ftype == TType.STRING:
3833
        if ftype == TType.STRING:
3823
          self.prefix = iprot.readString();
3834
          self.prefix = iprot.readString();
3824
        else:
3835
        else:
3825
          iprot.skip(ftype)
3836
          iprot.skip(ftype)
3826
      else:
3837
      else:
Line 3835... Line 3846...
3835
    oprot.writeStructBegin('createCoupon_args')
3846
    oprot.writeStructBegin('createCoupon_args')
3836
    if self.promotionId is not None:
3847
    if self.promotionId is not None:
3837
      oprot.writeFieldBegin('promotionId', TType.I64, 1)
3848
      oprot.writeFieldBegin('promotionId', TType.I64, 1)
3838
      oprot.writeI64(self.promotionId)
3849
      oprot.writeI64(self.promotionId)
3839
      oprot.writeFieldEnd()
3850
      oprot.writeFieldEnd()
-
 
3851
    if self.couponCategory is not None:
-
 
3852
      oprot.writeFieldBegin('couponCategory', TType.I64, 2)
-
 
3853
      oprot.writeI64(self.couponCategory)
-
 
3854
      oprot.writeFieldEnd()
3840
    if self.couponCode is not None:
3855
    if self.couponCode is not None:
3841
      oprot.writeFieldBegin('couponCode', TType.STRING, 2)
3856
      oprot.writeFieldBegin('couponCode', TType.STRING, 3)
3842
      oprot.writeString(self.couponCode)
3857
      oprot.writeString(self.couponCode)
3843
      oprot.writeFieldEnd()
3858
      oprot.writeFieldEnd()
3844
    if self.arguments is not None:
3859
    if self.arguments is not None:
3845
      oprot.writeFieldBegin('arguments', TType.STRING, 3)
3860
      oprot.writeFieldBegin('arguments', TType.STRING, 4)
3846
      oprot.writeString(self.arguments)
3861
      oprot.writeString(self.arguments)
3847
      oprot.writeFieldEnd()
3862
      oprot.writeFieldEnd()
3848
    if self.isCod is not None:
3863
    if self.isCod is not None:
3849
      oprot.writeFieldBegin('isCod', TType.BOOL, 4)
3864
      oprot.writeFieldBegin('isCod', TType.BOOL, 5)
3850
      oprot.writeBool(self.isCod)
3865
      oprot.writeBool(self.isCod)
3851
      oprot.writeFieldEnd()
3866
      oprot.writeFieldEnd()
3852
    if self.prefix is not None:
3867
    if self.prefix is not None:
3853
      oprot.writeFieldBegin('prefix', TType.STRING, 5)
3868
      oprot.writeFieldBegin('prefix', TType.STRING, 6)
3854
      oprot.writeString(self.prefix)
3869
      oprot.writeString(self.prefix)
3855
      oprot.writeFieldEnd()
3870
      oprot.writeFieldEnd()
3856
    oprot.writeFieldStop()
3871
    oprot.writeFieldStop()
3857
    oprot.writeStructEnd()
3872
    oprot.writeStructEnd()
3858
 
3873