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)
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)
def build(self, response): return ChatResultGenerator(self, response.json())