code: def get_messages(self, limit=25, *, query=None, order_by=None, batch=None,
                       download_attachments=False):
          
  
          if self.root:
              url = self.build_url(self._endpoints.get('root_messages'))
          else:
              url = self.build_url(self._endpoints.get('folder_messages').format(
                  id=self.folder_id))
  
          if limit is None or limit > self.protocol.max_top_value:
              batch = self.protocol.max_top_value
  
          params = {'$top': batch if batch else limit}
  
          if order_by:
              params['$orderby'] = order_by
  
          if query:
              if isinstance(query, str):
                  params['$filter'] = query
              else:
                  params.update(query.as_params())
  
          response = self.con.get(url, params=params)
          if not response:
              return iter(())
  
          data = response.json()
  
          # Everything received from cloud must be passed as self._cloud_data_key
          messages = (self.message_constructor(
              parent=self,
              download_attachments=download_attachments,
              **{self._cloud_data_key: message})
              for message in data.get('value', []))
  
          next_link = data.get(NEXT_LINK_KEYWORD, None)
          if batch and next_link:
              return Pagination(parent=self, data=messages,
                                constructor=self.message_constructor,
                                next_link=next_link, limit=limit,
                                download_attachments=download_attachments)
          else:
              return messages
docs: Downloads messages from this folder
  
          :param int limit: limits the result set. Over 999 uses batch.
          :param query: applies a filter to the request such as
           "displayName eq 'HelloFolder'"
          :type query: Query or str
          :param order_by: orders the result set based on this condition
          :type order_by: Query or str
          :param int batch: batch size, retrieves items in
           batches allowing to retrieve more items than the limit.
          :param bool download_attachments: whether or not to download attachments
          :return: list of messages
          :rtype: list[Message] or Pagination