示例#1
0
 def test_get_lead_activity_wrap(self):
     self.assertEqual(get_lead_activity.wrap("*****@*****.**"),
                      u"<ns1:paramsGetLeadActivity>"
                      u"<leadKey>"
                      u"<keyType>EMAIL</keyType>"
                      u"<keyValue>[email protected]</keyValue>"
                      u"</leadKey>"
                      u"</ns1:paramsGetLeadActivity>")
示例#2
0
 def test_get_lead_activity_wrap(self):
     self.assertEqual(
         get_lead_activity.wrap("*****@*****.**"),
         u"<ns1:paramsGetLeadActivity>"
         u"<leadKey>"
         u"<keyType>EMAIL</keyType>"
         u"<keyValue>[email protected]</keyValue>"
         u"</leadKey>"
         u"</ns1:paramsGetLeadActivity>")
示例#3
0
    def get_lead_activity(self, email=None):

        if not email or not isinstance(email, (str, unicode)):
            raise ValueError('Must supply an email as a non empty string.')

        body = get_lead_activity.wrap(email)
        response = self.request(body)
        if response.status_code == 200:
            return get_lead_activity.unwrap(response)
        else:
            raise Exception(response.text)
示例#4
0
    def get_lead_activity(self, email=None):

        if not email or not isinstance(email, (str, unicode)):
            raise ValueError('Must supply an email as a non empty string.')

        body = get_lead_activity.wrap(email)
        response = self.request(body)
        if response.status_code == 200:
            return get_lead_activity.unwrap(response)
        else:
            raise Exception(response.text)
示例#5
0
    def get_lead_activity(self, email=None, key_value=None, key_type='EMAIL',
                          activity_types=None, limit=100, offset=0):

        if email:
            key_value = email
            key_type = 'EMAIL'

        if not key_value or not isinstance(key_value, (str, unicode)):
            raise ValueError('Must supply a key_value(i.e. email) as a non empty string.')

        body = get_lead_activity.wrap(key_type=key_type,
                                      key_value=key_value,
                                      activity_types=activity_types,
                                      batch_size=limit,
                                      offset=offset)

        response = self.request(body)
        print response.content

        if response.status_code == 200:
            return get_lead_activity.unwrap(response)
        else:
            raise Exception(response.text)