Subversion Repositories SmartDukaan

Rev

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

Rev 3431 Rev 4544
Line 180... Line 180...
180
     - password
180
     - password
181
     - role
181
     - role
182
    """
182
    """
183
    pass
183
    pass
184
 
184
 
-
 
185
  def shareEntities(self, entityIds, email):
-
 
186
    """
-
 
187
    Saves the list of entity Ids to be shared with an email address
-
 
188
 
-
 
189
    Parameters:
-
 
190
     - entityIds
-
 
191
     - email
-
 
192
    """
-
 
193
    pass
-
 
194
 
185
 
195
 
186
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
196
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
187
  def __init__(self, iprot, oprot=None):
197
  def __init__(self, iprot, oprot=None):
188
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
198
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
189
 
199
 
Line 804... Line 814...
804
      return result.success
814
      return result.success
805
    if result.hse is not None:
815
    if result.hse is not None:
806
      raise result.hse
816
      raise result.hse
807
    raise TApplicationException(TApplicationException.MISSING_RESULT, "authenticateCatalogUser failed: unknown result");
817
    raise TApplicationException(TApplicationException.MISSING_RESULT, "authenticateCatalogUser failed: unknown result");
808
 
818
 
-
 
819
  def shareEntities(self, entityIds, email):
-
 
820
    """
-
 
821
    Saves the list of entity Ids to be shared with an email address
-
 
822
 
-
 
823
    Parameters:
-
 
824
     - entityIds
-
 
825
     - email
-
 
826
    """
-
 
827
    self.send_shareEntities(entityIds, email)
-
 
828
    self.recv_shareEntities()
-
 
829
 
-
 
830
  def send_shareEntities(self, entityIds, email):
-
 
831
    self._oprot.writeMessageBegin('shareEntities', TMessageType.CALL, self._seqid)
-
 
832
    args = shareEntities_args()
-
 
833
    args.entityIds = entityIds
-
 
834
    args.email = email
-
 
835
    args.write(self._oprot)
-
 
836
    self._oprot.writeMessageEnd()
-
 
837
    self._oprot.trans.flush()
-
 
838
 
-
 
839
  def recv_shareEntities(self, ):
-
 
840
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
841
    if mtype == TMessageType.EXCEPTION:
-
 
842
      x = TApplicationException()
-
 
843
      x.read(self._iprot)
-
 
844
      self._iprot.readMessageEnd()
-
 
845
      raise x
-
 
846
    result = shareEntities_result()
-
 
847
    result.read(self._iprot)
-
 
848
    self._iprot.readMessageEnd()
-
 
849
    if result.hse is not None:
-
 
850
      raise result.hse
-
 
851
    return
-
 
852
 
809
 
853
 
810
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
854
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
811
  def __init__(self, handler):
855
  def __init__(self, handler):
812
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
856
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
813
    self._processMap["saveUserEmailForSending"] = Processor.process_saveUserEmailForSending
857
    self._processMap["saveUserEmailForSending"] = Processor.process_saveUserEmailForSending
Line 826... Line 870...
826
    self._processMap["authenticateLogisticsUser"] = Processor.process_authenticateLogisticsUser
870
    self._processMap["authenticateLogisticsUser"] = Processor.process_authenticateLogisticsUser
827
    self._processMap["authenticateStatisticsUser"] = Processor.process_authenticateStatisticsUser
871
    self._processMap["authenticateStatisticsUser"] = Processor.process_authenticateStatisticsUser
828
    self._processMap["authenticateReportUser"] = Processor.process_authenticateReportUser
872
    self._processMap["authenticateReportUser"] = Processor.process_authenticateReportUser
829
    self._processMap["getReports"] = Processor.process_getReports
873
    self._processMap["getReports"] = Processor.process_getReports
830
    self._processMap["authenticateCatalogUser"] = Processor.process_authenticateCatalogUser
874
    self._processMap["authenticateCatalogUser"] = Processor.process_authenticateCatalogUser
-
 
875
    self._processMap["shareEntities"] = Processor.process_shareEntities
831
 
876
 
832
  def process(self, iprot, oprot):
877
  def process(self, iprot, oprot):
833
    (name, type, seqid) = iprot.readMessageBegin()
878
    (name, type, seqid) = iprot.readMessageBegin()
834
    if name not in self._processMap:
879
    if name not in self._processMap:
835
      iprot.skip(TType.STRUCT)
880
      iprot.skip(TType.STRUCT)
Line 1091... Line 1136...
1091
    oprot.writeMessageBegin("authenticateCatalogUser", TMessageType.REPLY, seqid)
1136
    oprot.writeMessageBegin("authenticateCatalogUser", TMessageType.REPLY, seqid)
1092
    result.write(oprot)
1137
    result.write(oprot)
1093
    oprot.writeMessageEnd()
1138
    oprot.writeMessageEnd()
1094
    oprot.trans.flush()
1139
    oprot.trans.flush()
1095
 
1140
 
-
 
1141
  def process_shareEntities(self, seqid, iprot, oprot):
-
 
1142
    args = shareEntities_args()
-
 
1143
    args.read(iprot)
-
 
1144
    iprot.readMessageEnd()
-
 
1145
    result = shareEntities_result()
-
 
1146
    try:
-
 
1147
      self._handler.shareEntities(args.entityIds, args.email)
-
 
1148
    except HelperServiceException, hse:
-
 
1149
      result.hse = hse
-
 
1150
    oprot.writeMessageBegin("shareEntities", TMessageType.REPLY, seqid)
-
 
1151
    result.write(oprot)
-
 
1152
    oprot.writeMessageEnd()
-
 
1153
    oprot.trans.flush()
-
 
1154
 
1096
 
1155
 
1097
# HELPER FUNCTIONS AND STRUCTURES
1156
# HELPER FUNCTIONS AND STRUCTURES
1098
 
1157
 
1099
class saveUserEmailForSending_args:
1158
class saveUserEmailForSending_args:
1100
  """
1159
  """
Line 3609... Line 3668...
3609
    if self.hse is not None:
3668
    if self.hse is not None:
3610
      oprot.writeFieldBegin('hse', TType.STRUCT, 1)
3669
      oprot.writeFieldBegin('hse', TType.STRUCT, 1)
3611
      self.hse.write(oprot)
3670
      self.hse.write(oprot)
3612
      oprot.writeFieldEnd()
3671
      oprot.writeFieldEnd()
3613
    oprot.writeFieldStop()
3672
    oprot.writeFieldStop()
-
 
3673
    oprot.writeStructEnd()
-
 
3674
 
-
 
3675
  def validate(self):
-
 
3676
    return
-
 
3677
 
-
 
3678
 
-
 
3679
  def __repr__(self):
-
 
3680
    L = ['%s=%r' % (key, value)
-
 
3681
      for key, value in self.__dict__.iteritems()]
-
 
3682
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
3683
 
-
 
3684
  def __eq__(self, other):
-
 
3685
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
3686
 
-
 
3687
  def __ne__(self, other):
-
 
3688
    return not (self == other)
-
 
3689
 
-
 
3690
class shareEntities_args:
-
 
3691
  """
-
 
3692
  Attributes:
-
 
3693
   - entityIds
-
 
3694
   - email
-
 
3695
  """
-
 
3696
 
-
 
3697
  thrift_spec = (
-
 
3698
    None, # 0
-
 
3699
    (1, TType.LIST, 'entityIds', (TType.I64,None), None, ), # 1
-
 
3700
    (2, TType.STRING, 'email', None, None, ), # 2
-
 
3701
  )
-
 
3702
 
-
 
3703
  def __init__(self, entityIds=None, email=None,):
-
 
3704
    self.entityIds = entityIds
-
 
3705
    self.email = email
-
 
3706
 
-
 
3707
  def read(self, iprot):
-
 
3708
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
3709
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
3710
      return
-
 
3711
    iprot.readStructBegin()
-
 
3712
    while True:
-
 
3713
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
3714
      if ftype == TType.STOP:
-
 
3715
        break
-
 
3716
      if fid == 1:
-
 
3717
        if ftype == TType.LIST:
-
 
3718
          self.entityIds = []
-
 
3719
          (_etype40, _size37) = iprot.readListBegin()
-
 
3720
          for _i41 in xrange(_size37):
-
 
3721
            _elem42 = iprot.readI64();
-
 
3722
            self.entityIds.append(_elem42)
-
 
3723
          iprot.readListEnd()
-
 
3724
        else:
-
 
3725
          iprot.skip(ftype)
-
 
3726
      elif fid == 2:
-
 
3727
        if ftype == TType.STRING:
-
 
3728
          self.email = iprot.readString();
-
 
3729
        else:
-
 
3730
          iprot.skip(ftype)
-
 
3731
      else:
-
 
3732
        iprot.skip(ftype)
-
 
3733
      iprot.readFieldEnd()
-
 
3734
    iprot.readStructEnd()
-
 
3735
 
-
 
3736
  def write(self, oprot):
-
 
3737
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
3738
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
3739
      return
-
 
3740
    oprot.writeStructBegin('shareEntities_args')
-
 
3741
    if self.entityIds is not None:
-
 
3742
      oprot.writeFieldBegin('entityIds', TType.LIST, 1)
-
 
3743
      oprot.writeListBegin(TType.I64, len(self.entityIds))
-
 
3744
      for iter43 in self.entityIds:
-
 
3745
        oprot.writeI64(iter43)
-
 
3746
      oprot.writeListEnd()
-
 
3747
      oprot.writeFieldEnd()
-
 
3748
    if self.email is not None:
-
 
3749
      oprot.writeFieldBegin('email', TType.STRING, 2)
-
 
3750
      oprot.writeString(self.email)
-
 
3751
      oprot.writeFieldEnd()
-
 
3752
    oprot.writeFieldStop()
-
 
3753
    oprot.writeStructEnd()
-
 
3754
 
-
 
3755
  def validate(self):
-
 
3756
    return
-
 
3757
 
-
 
3758
 
-
 
3759
  def __repr__(self):
-
 
3760
    L = ['%s=%r' % (key, value)
-
 
3761
      for key, value in self.__dict__.iteritems()]
-
 
3762
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
3763
 
-
 
3764
  def __eq__(self, other):
-
 
3765
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
3766
 
-
 
3767
  def __ne__(self, other):
-
 
3768
    return not (self == other)
-
 
3769
 
-
 
3770
class shareEntities_result:
-
 
3771
  """
-
 
3772
  Attributes:
-
 
3773
   - hse
-
 
3774
  """
-
 
3775
 
-
 
3776
  thrift_spec = (
-
 
3777
    None, # 0
-
 
3778
    (1, TType.STRUCT, 'hse', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1
-
 
3779
  )
-
 
3780
 
-
 
3781
  def __init__(self, hse=None,):
-
 
3782
    self.hse = hse
-
 
3783
 
-
 
3784
  def read(self, iprot):
-
 
3785
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
3786
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
3787
      return
-
 
3788
    iprot.readStructBegin()
-
 
3789
    while True:
-
 
3790
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
3791
      if ftype == TType.STOP:
-
 
3792
        break
-
 
3793
      if fid == 1:
-
 
3794
        if ftype == TType.STRUCT:
-
 
3795
          self.hse = HelperServiceException()
-
 
3796
          self.hse.read(iprot)
-
 
3797
        else:
-
 
3798
          iprot.skip(ftype)
-
 
3799
      else:
-
 
3800
        iprot.skip(ftype)
-
 
3801
      iprot.readFieldEnd()
-
 
3802
    iprot.readStructEnd()
-
 
3803
 
-
 
3804
  def write(self, oprot):
-
 
3805
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
3806
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
3807
      return
-
 
3808
    oprot.writeStructBegin('shareEntities_result')
-
 
3809
    if self.hse is not None:
-
 
3810
      oprot.writeFieldBegin('hse', TType.STRUCT, 1)
-
 
3811
      self.hse.write(oprot)
-
 
3812
      oprot.writeFieldEnd()
-
 
3813
    oprot.writeFieldStop()
3614
    oprot.writeStructEnd()
3814
    oprot.writeStructEnd()
3615
 
3815
 
3616
  def validate(self):
3816
  def validate(self):
3617
    return
3817
    return
3618
 
3818