processDocumentFromURL method Null safety

Future<Map<String, dynamic>> processDocumentFromURL(
  1. {String? fileUrl,
  2. List<String>? fileUrls,
  3. List<String>? categories,
  4. bool deleteAfterProcessing = false,
  5. int boostMode = 0,
  6. String? externalId,
  7. int maxPagesToProcess = 1}
)

Process document from url.

Returns a Map containing the processed document information from the fileUrl or fileUrls using the desired or default options.

Implementation

Future<Map<String, dynamic>> processDocumentFromURL(
    {String? fileUrl,
    List<String>? fileUrls,
    List<String>? categories,
    bool deleteAfterProcessing = false,
    int boostMode = 0,
    String? externalId,
    int maxPagesToProcess = 1}) {
  final Map<String, dynamic> body = {
    "auto_delete": deleteAfterProcessing,
    "boost_mode": boostMode,
    "categories": categories ?? [],
    "external_id": externalId,
    "file_url": fileUrl,
    "file_urls": fileUrls,
    "max_pages_to_process": maxPagesToProcess
  };
  return request(HTTPMethod.post, 'documents', body: body);
}