示例#1
0
文件: response.py 项目: spoqa/zenpy
 def build(self, response):
     response_json = response.json()
     if 'chats' in response_json or 'docs' in response_json:
         return ChatResultGenerator(self, response_json)
     else:
         return self.api._object_mapping.object_from_json(
             'chat', response_json)
示例#2
0
 def build(self, response):
     response_json = response.json()
     if 'chats' in response_json or 'docs' in response_json:
         if 'next_page' in response_json:
             return ChatIncrementalResultGenerator(self, response_json)
         else:
             return ChatResultGenerator(self, response_json)
     else:
         return self.object_mapping.object_from_json('chat', response_json)
示例#3
0
 def build(self, response):
     return ChatResultGenerator(self, response.json())