OpenXchangeClient.Api.Folders (open_xchange_client v0.10.0)

API calls for all endpoints tagged Folders.

Link to this section Summary

Functions

Checks the existing upload for given type.

Clears the content of a list of folders.

Gets the new, modified and deleted folders of a given folder.

Gets the parent folders above the specified folder.

Gets the folders at the root level of the folder structure.

Gets the subfolders of a specified parent folder.

Notifies users or groups about a shared folder.

Restore specified folders from trash folder

Link to this section Functions

Link to this function

check_limits(connection, session, id, type, body, opts \\ [])

Checks the existing upload for given type.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): Object ID of the folder to check.
  • type (String.t): The type of the files to upload (e. g. 'filestorage, 'pim')
  • body (FolderCheckLimitsData): A JSON object containing an array of file meta data (size and name).
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

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

Link to this function

clear_folders(connection, session, body, opts \\ [])

@spec clear_folders(Tesla.Env.client(), String.t(), [String.t()], keyword()) ::
  {:ok, OpenXchangeClient.Model.FoldersCleanUpResponse.t()}
  | {:error, Tesla.Env.t()}

Clears the content of a list of folders.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • body ([String.t]): A JSON array with object IDs of the folders.
  • opts (KeywordList): [optional] Optional parameters
    • :tree (String.t): The identifier of the folder tree. If missing "0" (primary folder tree) is assumed.
    • :allowed_modules (String.t): An array of modules (either numbers or strings; e.g. "tasks,calendar,contacts,mail") supported by requesting client. If missing, all available modules are considered.
    • :push_token (String.t): The client's push token to restrict the generated drive event

returns

Returns

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

Link to this function

create_folder(connection, folder_id, session, body, opts \\ [])

Creates a new folder.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • folder_id (String.t): The parent folder object ID of the newly created folder.
  • session (String.t): A session ID previously obtained from the login module.
  • body (NewFolderBody): JSON object with "folder" object containing the modified fields and optional "notification" object to let added permission entities be notified about newly shared folders for all modules except mail. (Example: {"folder":{"module":"infostore","subscribed":true,"title":"Test123"}} or {"folder":{"module":"infostore","subscribed":true,"title":"Test123","permissions":[{"bits":403710016,"entity":84,"group":false}]},"notification":{"transport":"mail","message":"The message"}})
  • opts (KeywordList): [optional] Optional parameters
    • :tree (String.t): The identifier of the folder tree. If missing "0" (primary folder tree) is assumed.
    • :allowed_modules (String.t): An array of modules (either numbers or strings; e.g. "tasks,calendar,contacts,mail") supported by requesting client. If missing, all available modules are considered.
    • :push_token (String.t): The client's push token to restrict the generated drive event

returns

Returns

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

Link to this function

delete_folders(connection, session, body, opts \\ [])

@spec delete_folders(Tesla.Env.client(), String.t(), [String.t()], keyword()) ::
  {:ok, OpenXchangeClient.Model.FoldersCleanUpResponse.t()}
  | {:error, Tesla.Env.t()}

Deletes a list of folders.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • body ([String.t]): A JSON array with object IDs of the folders.
  • opts (KeywordList): [optional] Optional parameters
    • :tree (String.t): The identifier of the folder tree. If missing "0" (primary folder tree) is assumed.
    • :timestamp (integer()): The optional timestamp of the last update of the deleted folders.
    • :allowed_modules (String.t): An array of modules (either numbers or strings; e.g. "tasks,calendar,contacts,mail") supported by requesting client. If missing, all available modules are considered.
    • :hard_delete (boolean()): If set to true, the folders are deleted permanently. Otherwise, and if the underlying storage supports a trash folder and the folders are not yet located below the trash folder, they are moved to the trash folder.
    • :fail_on_error (boolean()): If an error occured for one folder and this parameter is set to true the process will abort and throw an error. If this parameter is set to 'false' the process will continue for the remaining folders and will add a warning to the response instead.
    • :extended_response (boolean()): If this parameter is set to true a different response will be returned. The response contains an array of json objects, which can contain the following fields: <ul> <li><code>new_path</code> - The new path of the folder in case of a trash operation.</li> <li><code>path</code> - The old path.</li> <li><code>hasFailed</code> - A boolean flag indicating that the delete operation has failed.</li> <li><code>isTrashed</code> - A boolean flag indicating that the folder has been trashed.</li> <li><code>isSuppoprted</code> - A boolean flag indicating that the folder storage supports trashing.</li> </ul>
    • :push_token (String.t): The client's push token to restrict the generated drive event

returns

Returns

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

Link to this function

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

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

Gets a folder.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): Object ID of the requested folder.
  • opts (KeywordList): [optional] Optional parameters
    • :tree (String.t): The identifier of the folder tree. If missing "0" (primary folder tree) is assumed.
    • :allowed_modules (String.t): An array of modules (either numbers or strings; e.g. "tasks,calendar,contacts,mail") supported by requesting client. If missing, all available modules are considered.
    • :language (String.t): Optional locale to use instead of the currently configured locale of the user.

returns

Returns

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

Link to this function

get_folder_updates(connection, session, parent, timestamp, columns, opts \\ [])

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

Gets the new, modified and deleted folders of a given folder.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • parent (String.t): Object ID of a folder, which is the parent folder of the requested folders.
  • timestamp (integer()): Timestamp of the last update of the requested folders.
  • columns (String.t): A comma-separated list of columns to return, like "1,300". Each column is specified by a numeric column identifier, see Common folder data and Detailed folder data.
  • opts (KeywordList): [optional] Optional parameters
    • :tree (String.t): The identifier of the folder tree. If missing "0" (primary folder tree) is assumed.
    • :language (String.t): Optional locale to use instead of the currently configured locale of the user.
    • :ignore (String.t): Which kinds of updates should be ignored. Currently, the only valid value – "deleted" – causes deleted object IDs not to be returned.
    • :allowed_modules (String.t): An array of modules (either numbers or strings; e.g. "tasks,calendar,contacts,mail") supported by requesting client. If missing, all available modules are considered.

returns

Returns

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

Link to this function

get_path(connection, session, id, columns, opts \\ [])

Gets the parent folders above the specified folder.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): Object ID of a folder.
  • columns (String.t): A comma-separated list of columns to return, like "1,300". Each column is specified by a numeric column identifier, see Common folder data and Detailed folder data.
  • opts (KeywordList): [optional] Optional parameters
    • :tree (String.t): The identifier of the folder tree. If missing "0" (primary folder tree) is assumed.
    • :allowed_modules (String.t): An array of modules (either numbers or strings; e.g. "tasks,calendar,contacts,mail") supported by requesting client. If missing, all available modules are considered.
    • :language (String.t): Optional locale to use instead of the currently configured locale of the user.

returns

Returns

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

Link to this function

get_root_folders(connection, session, columns, opts \\ [])

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

Gets the folders at the root level of the folder structure.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • columns (String.t): A comma-separated list of columns to return, like "1,300". Each column is specified by a numeric column identifier, see Common folder data and Detailed folder data.
  • opts (KeywordList): [optional] Optional parameters
    • :tree (String.t): The identifier of the folder tree. If missing "0" (primary folder tree) is assumed.
    • :allowed_modules (String.t): An array of modules (either numbers or strings; e.g. "tasks,calendar,contacts,mail") supported by requesting client. If missing, all available modules are considered.

returns

Returns

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

Link to this function

get_shared_folders(connection, session, columns, content_type, opts \\ [])

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

Gets shared folders of a certain module.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • columns (String.t): A comma-separated list of columns to return, like "1,300". Each column is specified by a numeric column identifier, see Common folder data and Detailed folder data.
  • content_type (String.t): The desired content type (either numbers or strings; e.g. "tasks", "calendar", "contacts", "mail", "infostore").
  • opts (KeywordList): [optional] Optional parameters
    • :tree (String.t): The identifier of the folder tree. If missing "0" (primary folder tree) is assumed.
    • :language (String.t): Optional locale to use instead of the currently configured locale of the user.
    • :all (integer()): Set to 1 to list even not subscribed folders.

returns

Returns

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

Link to this function

get_sub_folders(connection, session, parent, columns, opts \\ [])

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

Gets the subfolders of a specified parent folder.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • parent (String.t): Object ID of a folder, which is the parent folder of the requested folders.
  • columns (String.t): A comma-separated list of columns to return, like "1,300". Each column is specified by a numeric column identifier, see Common folder data and Detailed folder data.
  • opts (KeywordList): [optional] Optional parameters
    • :all (integer()): Set to 1 to list even not subscribed folders.
    • :tree (String.t): The identifier of the folder tree. If missing "0" (primary folder tree) is assumed.
    • :allowed_modules (String.t): An array of modules (either numbers or strings; e.g. "tasks,calendar,contacts,mail") supported by requesting client. If missing, all available modules are considered.
    • :language (String.t): Optional locale to use instead of the currently configured locale of the user.
    • :error_on_duplicate_name (boolean()):

returns

Returns

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

Link to this function

get_visible_folders(connection, session, content_type, columns, opts \\ [])

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

Gets all visible folders of a certain module.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • content_type (String.t): The desired content type (either numbers or strings; e.g. "tasks", "calendar", "contacts", "mail", "infostore").
  • columns (String.t): A comma-separated list of columns to return, like "1,300". Each column is specified by a numeric column identifier, see Common folder data and Detailed folder data.
  • opts (KeywordList): [optional] Optional parameters
    • :tree (String.t): The identifier of the folder tree. If missing "0" (primary folder tree) is assumed.
    • :language (String.t): Optional locale to use instead of the currently configured locale of the user.

returns

Returns

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

Link to this function

notify_about_shared_folder(connection, session, id, body, opts \\ [])

Notifies users or groups about a shared folder.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): Object ID of the shared folder to notify about.
  • body (FolderSharingNotificationBody): JSON object providing the JSON array entities, which holds the entity ID(s) of the users or groups that should be notified. To send a custom message to the recipients, an additional JSON object notification may be included, inside of which an optional message can be passed (otherwise, some default message is used). (Example: {"entities":["2332"]} or {"entities":["2332"],"notification":{"transport":"mail","message":"The message"}})
  • opts (KeywordList): [optional] Optional parameters
    • :tree (String.t): The identifier of the folder tree. If missing "0" (primary folder tree) is assumed.

returns

Returns

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

Link to this function

restore_folders(connection, session, opts \\ [])

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

Restore specified folders from trash folder

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • opts (KeywordList): [optional] Optional parameters
    • :tree (String.t): The identifier of the folder tree. If missing "0" (primary folder tree) is assumed.
    • :push_token (String.t): The client's push token to restrict the generated drive event

returns

Returns

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

Link to this function

update_folder(connection, session, id, body, opts \\ [])

Updates a folder.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): Object ID of the updated folder.
  • body (FolderBody): JSON object with "folder" object containing the modified fields and optional "notification" object to let added permission entities be notified about newly shared folders for all modules except mail. (Example: {"folder":{"title":"test123"}} or {"folder":{"permissions":[{"bits":403710016,"entity":84,"group":false}]},"notification":{"transport":"mail","message":"The message"}})
  • opts (KeywordList): [optional] Optional parameters
    • :allow_enqueue (boolean()): Optional flag that specifies whether the request is allowed for being submitted to job queue.
    • :timestamp (integer()): Timestamp of the updated folder. If the folder was modified after the specified timestamp, then the update must fail.
    • :tree (String.t): The identifier of the folder tree. If missing "0" (primary folder tree) is assumed.
    • :allowed_modules (String.t): An array of modules (either numbers or strings; e.g. "tasks,calendar,contacts,mail") supported by requesting client. If missing, all available modules are considered.
    • :cascade_permissions (boolean()): true to cascade permissions to all sub-folders. The user must have administrative permissions to all sub-folders subject to change. If one permission change fails, the entire operation fails.
    • :push_token (String.t): The client's push token to restrict the generated drive event

returns

Returns

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