OpenXchangeClient.Api.File (open_xchange_client v0.10.1)

API calls for all endpoints tagged File.

Link to this section Summary

Functions

Requests a formerly uploaded file.

Updates a file's last access timestamp and keeps it alive. By updating the last access timestamp the file is prevented from being deleted from both session and disk storage.

Uploads a file. It can be uploaded multiple files at once. Each file must be specified in an own form field (the form field name is arbitrary).

Link to this section Functions

Link to this function

get_file(connection, session, id, opts \\ [])

@spec get_file(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, nil} | {:ok, String.t()} | {:error, Tesla.Env.t()}

Requests a formerly uploaded file.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): The ID of the uploaded file.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

keep_alive(connection, session, id, opts \\ [])

@spec keep_alive(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, OpenXchangeClient.Model.CommonResponse.t()} | {:error, Tesla.Env.t()}

Updates a file's last access timestamp and keeps it alive. By updating the last access timestamp the file is prevented from being deleted from both session and disk storage.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): The ID of the uploaded file whose timestamp should be updated.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

upload_file(connection, session, module, type, file, opts \\ [])

@spec upload_file(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, String.t()} | {:error, Tesla.Env.t()}

Uploads a file. It can be uploaded multiple files at once. Each file must be specified in an own form field (the form field name is arbitrary).

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • module (String.t): The module for which the file is uploaded to determine proper upload quota constraints (e.g. "mail", "infostore", etc.).
  • type (String.t): The file type filter to define which file types are allowed during upload. Currently supported filters are: file (for all), text (for text/*), media (for image, audio or video), image (for image/*), audio (for audio/*), video (for video/*) and application (for application/*).
  • file (String.t): The file to upload.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

on success {:error, Tesla.Env.t} on failure