Uploads

pydantic model DeleteFileResponse[source]

Show JSON schema
{
   "title": "DeleteFileResponse",
   "type": "object",
   "properties": {
      "message": {
         "title": "Message",
         "type": "string"
      }
   },
   "required": [
      "message"
   ]
}

Fields:
field message: str [Required]
class ExtractorTypes[source]
PDF_EXTRACTOR_1_0 = 'PDF_EXTRACTOR_1_0'
pydantic model FileResponse[source]

Model to represent a single upload in the ListFilesResponse

Show JSON schema
{
   "title": "FileResponse",
   "description": "Model to represent a single upload in the ListFilesResponse",
   "type": "object",
   "properties": {
      "file_id": {
         "title": "File Id",
         "type": "string"
      },
      "file_name": {
         "title": "File Name",
         "type": "string"
      },
      "status": {
         "$ref": "#/$defs/FileStatus"
      },
      "upload_ts": {
         "format": "date-time",
         "title": "Upload Ts",
         "type": "string"
      },
      "raw_size": {
         "title": "Raw Size",
         "type": "integer"
      },
      "folder_id": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Folder Id"
      },
      "tags": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Tags"
      },
      "company_shared_permission": {
         "anyOf": [
            {
               "$ref": "#/$defs/SharePermission"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      }
   },
   "$defs": {
      "FileStatus": {
         "enum": [
            "PENDING",
            "PROCESSING",
            "COMPLETED",
            "FAILED",
            "DELETED"
         ],
         "title": "FileStatus",
         "type": "string"
      },
      "SharePermission": {
         "enum": [
            "read",
            "undefined"
         ],
         "title": "SharePermission",
         "type": "string"
      }
   },
   "required": [
      "file_id",
      "file_name",
      "status",
      "upload_ts",
      "raw_size"
   ]
}

Fields:
Validators:
field company_shared_permission: SharePermission | None = None
Validated by:
field folder_id: str | None = None
Validated by:
field id: str [Required] (alias 'file_id')
Validated by:
field name: str [Required] (alias 'file_name')
Validated by:
field raw_size: int [Required]
Validated by:
field status: FileStatus [Required]
Validated by:
field tags: list[str] | None = None
Validated by:
field uploaded_at: datetime [Required] (alias 'upload_ts')
Validated by:
validator set_company_shared_permission  »  all fields[source]
Parameters:

values (dict) –

validator set_tz  »  all fields[source]
pydantic model FileShareResponse[source]

Show JSON schema
{
   "title": "FileShareResponse",
   "type": "object",
   "properties": {
      "status": {
         "const": "OK",
         "title": "Status",
         "type": "string"
      },
      "message": {
         "title": "Message",
         "type": "string"
      }
   },
   "required": [
      "status",
      "message"
   ]
}

Fields:
field message: str [Required]
field status: Literal['OK'] [Required]
class FileStatus[source]
COMPLETED = 'COMPLETED'
DELETED = 'DELETED'
FAILED = 'FAILED'
PENDING = 'PENDING'
PROCESSING = 'PROCESSING'
pydantic model GetDownloadPresignedUrlResponse[source]

Show JSON schema
{
   "title": "GetDownloadPresignedUrlResponse",
   "type": "object",
   "properties": {
      "url": {
         "title": "Url",
         "type": "string"
      }
   },
   "required": [
      "url"
   ]
}

Fields:
field url: str [Required]
pydantic model GetFileStatusResponse[source]

Show JSON schema
{
   "title": "GetFileStatusResponse",
   "type": "object",
   "properties": {
      "status": {
         "anyOf": [
            {
               "$ref": "#/$defs/FileStatus"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "error": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Error"
      }
   },
   "$defs": {
      "FileStatus": {
         "enum": [
            "PENDING",
            "PROCESSING",
            "COMPLETED",
            "FAILED",
            "DELETED"
         ],
         "title": "FileStatus",
         "type": "string"
      }
   }
}

Fields:
field error: str | None = None
field status: FileStatus | None = None
pydantic model ListFilesResponse[source]

Model to represent the response of the list uploads endpoint

Show JSON schema
{
   "title": "ListFilesResponse",
   "description": "Model to represent the response of the list uploads endpoint",
   "type": "object",
   "properties": {
      "results": {
         "items": {
            "$ref": "#/$defs/FileResponse"
         },
         "title": "Results",
         "type": "array"
      }
   },
   "$defs": {
      "FileResponse": {
         "description": "Model to represent a single upload in the ListFilesResponse",
         "properties": {
            "file_id": {
               "title": "File Id",
               "type": "string"
            },
            "file_name": {
               "title": "File Name",
               "type": "string"
            },
            "status": {
               "$ref": "#/$defs/FileStatus"
            },
            "upload_ts": {
               "format": "date-time",
               "title": "Upload Ts",
               "type": "string"
            },
            "raw_size": {
               "title": "Raw Size",
               "type": "integer"
            },
            "folder_id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Folder Id"
            },
            "tags": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Tags"
            },
            "company_shared_permission": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SharePermission"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            }
         },
         "required": [
            "file_id",
            "file_name",
            "status",
            "upload_ts",
            "raw_size"
         ],
         "title": "FileResponse",
         "type": "object"
      },
      "FileStatus": {
         "enum": [
            "PENDING",
            "PROCESSING",
            "COMPLETED",
            "FAILED",
            "DELETED"
         ],
         "title": "FileStatus",
         "type": "string"
      },
      "SharePermission": {
         "enum": [
            "read",
            "undefined"
         ],
         "title": "SharePermission",
         "type": "string"
      }
   },
   "required": [
      "results"
   ]
}

Fields:
field results: list[FileResponse] [Required]
pydantic model PostFileRequest[source]

Model to represent the request of the post upload endpoint

Show JSON schema
{
   "title": "PostFileRequest",
   "description": "Model to represent the request of the post upload endpoint",
   "type": "object",
   "properties": {
      "filename": {
         "title": "Filename",
         "type": "string"
      },
      "folder_id": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Folder Id"
      },
      "source_url": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Source Url"
      },
      "upload_mode": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Upload Mode"
      },
      "properties": {
         "anyOf": [
            {
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Properties"
      },
      "connect_to": {
         "default": [
            "smart_topics"
         ],
         "items": {
            "const": "smart_topics",
            "type": "string"
         },
         "title": "Connect To",
         "type": "array"
      },
      "extractor": {
         "anyOf": [
            {
               "$ref": "#/$defs/ExtractorTypes"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      }
   },
   "$defs": {
      "ExtractorTypes": {
         "enum": [
            "PDF_EXTRACTOR_1_0"
         ],
         "title": "ExtractorTypes",
         "type": "string"
      }
   },
   "required": [
      "filename"
   ]
}

Fields:
field connect_to: list[Literal['smart_topics']] = ['smart_topics']
field extractor: ExtractorTypes | None = None
field filename: str [Required]
field folder_id: str | None = None
field properties: dict | None = None
field source_url: str | None = None
field upload_mode: str | None = None
pydantic model PostFileResponse[source]

Model to represent the response of the post upload endpoint

Show JSON schema
{
   "title": "PostFileResponse",
   "description": "Model to represent the response of the post upload endpoint",
   "type": "object",
   "properties": {
      "file_id": {
         "title": "File Id",
         "type": "string"
      },
      "Location": {
         "title": "Location",
         "type": "string"
      }
   },
   "required": [
      "file_id",
      "Location"
   ]
}

Fields:
field file_id: str [Required]
field location: str [Required] (alias 'Location')
class UploadsConnectionProtocol[source]
__init__(*args, **kwargs)
delete_file(id)[source]
Parameters:

id (str) –

Return type:

DeleteFileResponse

download_analytics(id)[source]
Parameters:

id (str) –

Return type:

Iterable[bytes]

download_annotated(id)[source]
Parameters:

id (str) –

Return type:

Iterable[bytes]

download_text(id)[source]
Parameters:

id (str) –

Return type:

Iterable[bytes]

get_download_presigned_url(id)[source]
Parameters:

id (str) –

Return type:

GetDownloadPresignedUrlResponse

get_file(id)[source]
Parameters:

id (str) –

Return type:

FileResponse

get_file_status(file_id)[source]
Parameters:

file_id (str) –

Return type:

GetFileStatusResponse

list_files(date_range, tags, status, file_name, folder_id, page_size, shared, offset)[source]
Parameters:
  • date_range (AbsoluteDateRange | None) –

  • tags (list[str] | None) –

  • status (FileStatus | None) –

  • file_name (str | None) –

  • folder_id (str | None) –

  • page_size (int) –

  • shared (bool | None) –

  • offset (int) –

Return type:

ListFilesResponse

post_file(request)[source]
Parameters:

request (PostFileRequest) –

Return type:

PostFileResponse

share_file_with_company(file_id)[source]
Parameters:

file_id (str) –

Return type:

FileResponse

unshare_file_with_company(file_id)[source]
Parameters:

file_id (str) –

Return type:

FileResponse

update_file_tags(file_id, tags)[source]
Parameters:
  • file_id (str) –

  • tags (list[str]) –

Return type:

FileResponse