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

api_error_type()

@type api_error_type() :: BexioApiClient.Helpers.api_error_type()

Functions

create_file(req, path)

@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.

delete_file(req, id)

@spec delete_file(req :: Req.Request.t(), id :: non_neg_integer()) ::
  {:ok, boolean()} | api_error_type()

Delete a file. It cannot be undone.

download_file(req, id)

@spec download_file(req :: Req.Request.t(), id :: non_neg_integer()) ::
  {:ok, {String.t(), any()}} | api_error_type()

Download file (original content).

fetch_file(req, id)

@spec fetch_file(req :: Req.Request.t(), id :: non_neg_integer()) ::
  {:ok, BexioApiClient.Files.File.t()} | api_error_type()

Fetch single file.

fetch_file_usage(req, id)

@spec fetch_file_usage(req :: Req.Request.t(), id :: non_neg_integer()) ::
  {:ok, BexioApiClient.Files.FileUsage.t()} | api_error_type()

Show file usage.

fetch_files(req, opts \\ [])

@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.

preview_file(req, id)

@spec preview_file(req :: Req.Request.t(), id :: non_neg_integer()) ::
  {:ok, {String.t(), any()}} | api_error_type()

Download file (original content).

search_files(req, criteria, opts \\ [])

@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

update_file(req, file)

@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).