BexioApiClient. Files
(bexio_api_client v2.0.0)
Copy Markdown
Bexio API for the files part of the API
Summary
Functions
Create a file by uploading it from the given path as multipart/form-data.
Delete a file. It cannot be undone.
Download file (original content).
Fetch single file.
Show file usage.
Fetch a list of files.
Download file (original content).
Search files via query. The following search fields are supported
Update a file (name, archived state and/or source type).
Types
Functions
@spec create_file(req :: Req.Request.t(), path :: String.t()) :: {:ok, BexioApiClient.Files.File.t()} | api_error_type()
Create a file by uploading it from the given path as multipart/form-data.
The file name and content type are derived from the path.
@spec delete_file(req :: Req.Request.t(), id :: non_neg_integer()) :: {:ok, boolean()} | api_error_type()
Delete a file. It cannot be undone.
@spec download_file(req :: Req.Request.t(), id :: non_neg_integer()) :: {:ok, {String.t(), any()}} | api_error_type()
Download file (original content).
@spec fetch_file(req :: Req.Request.t(), id :: non_neg_integer()) :: {:ok, BexioApiClient.Files.File.t()} | api_error_type()
Fetch single file.
@spec fetch_file_usage(req :: Req.Request.t(), id :: non_neg_integer()) :: {:ok, BexioApiClient.Files.FileUsage.t()} | api_error_type()
Show file usage.
@spec fetch_files( req :: Req.Request.t(), opts :: [BexioApiClient.GlobalArguments.offset_arg()] ) :: {:ok, [BexioApiClient.Files.File.t()]} | api_error_type()
Fetch a list of files.
@spec preview_file(req :: Req.Request.t(), id :: non_neg_integer()) :: {:ok, {String.t(), any()}} | api_error_type()
Download file (original content).
@spec search_files( req :: Req.Request.t(), criteria :: [BexioApiClient.SearchCriteria.t()], opts :: [BexioApiClient.GlobalArguments.offset_arg()] ) :: {:ok, [BexioApiClient.Files.File.t()]} | api_error_type()
Search files via query. The following search fields are supported:
- id
- uuid
- created_at
- name
- extension
- size_in_bytes
- mime_type
- user_id
- archived?
- source_id
@spec update_file(req :: Req.Request.t(), file :: BexioApiClient.Files.File.t()) :: {:ok, BexioApiClient.Files.File.t()} | api_error_type()
Update a file (name, archived state and/or source type).