class_docstr: Client to interact with the Frappe API.
  
  Attributes:
      domain (str): Path to Frappe domain to use (e.g. https://mindsdbfrappe.com).
      access_token (str): Frappe authorization token to use for all API requests.
docstr: Gets all documents matching the given doctype from Frappe.
  
  See https://frappeframework.com/docs/v14/user/en/api/rest#listing-documents
  Args:
      doctype (str): The document type to retrieve.
      limit (int): At most, how many messages to return.
      filters (List[List]): List of filters in the form [field, operator, value] e.g. ["amount", ">", 50]
docstr_tok: ["Gets","all","documents","matching","the","given","doctype","from","Frappe",".","See","https",":","\/\/frappeframework.com\/docs\/v14\/user\/en\/api\/rest","#","listing-documents","Args",":","doctype","(","str",")",":","The","document","type","to","retrieve",".","limit","(","int",")",":","At","most",",","how","many","messages","to","return",".","filters","(","List","[","List","]",")",":","List","of","filters","in","the","form","[","field",",","operator",",","value","]","e.g",".","[","``","amount","''",",","``",">","''",",","50","]"]
code: def get_documents(
      self,
      doctype: str,
      limit: int = None,
      fields: List[str] = None,
      filters: List[List] = None,
  ) -> List[Dict]:
      """Gets all documents matching the given doctype from Frappe.
  
      See https://frappeframework.com/docs/v14/user/en/api/rest#listing-documents
      Args:
          doctype (str): The document type to retrieve.
          limit (int): At most, how many messages to return.
          filters (List[List]): List of filters in the form [field, operator, value] e.g. ["amount", ">", 50]
      """
      params = {"fields": json.dumps(["*"])}
      if limit is not None:
          params["limit_page_length"] = limit
      if filters is not None:
          params["filters"] = json.dumps(filters)
      if fields is not None:
          params["fields"] = json.dumps(fields)
      documents_response = requests.get(
          f"{self.base_url}/resource/{doctype}/",
          params=params,
          headers=self.headers,
          allow_redirects=False,
      )
      if documents_response.is_redirect:
          # We have to manually redirect to preserve the 'Authorization' header.
          # See https://github.com/request/request/pull/1184/commits/210b326fd8625f358e06c59dc11e74468b1de515.
          redirect_url = documents_response.headers.get(
              "location", None
          )
          if redirect_url is None:
              raise requests.HTTPError("Could not find redirect URL")
          documents_response = requests.get(
              redirect_url,
              params=params,
              headers=self.headers,
              allow_redirects=False,
          )
  
      if not documents_response.ok:
          documents_response.raise_for_status()
      return documents_response.json()["data"]
  
file_path: mindsdb/mindsdb/integrations/handlers/frappe_handler/frappe_client.py
imports: import json
  import requests
  from typing import Dict, List
label_desc: Use image node_id 3 for calling the FrappeClient obj's underlying member method code with example usage: obj.get_documents(doctype, limit, fields, filters) and returns: documents_response