OpenXchangeClient.Api.Filestorage (open_xchange_client v0.10.1)

API calls for all endpoints tagged Filestorage.

Link to this section Summary

Link to this section Functions

Link to this function

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

Creates a file storage account.

Example for creating a new OAuth-based file storage account First, get the description of the file storage service for which a new account is supposed to be created: GET /ajax/fileservice?action=get&id=boxcom&session=... The response might be: json { id: "boxcom", displayName: "Box File Storage Service", configuration: { widget: "oauthAccount", options: { type: "com.openexchange.oauth.boxcom" }, name: "account", displayName: "Select an existing account", mandatory: true } } Next get the associated OAuth account information: GET /ajax/oauth/accounts?action=all&serviceId=com.openexchange.oauth.boxcom&session=... The response might be: json { "data":[ { "id":333, "displayName":"My Box.com account", "serviceId":"com.openexchange.oauth.boxcom" } ] } Finally, create the file storage account: PUT /ajax/fileaccount?action=new&session=... { "filestorageService":"boxcom", "displayName":"My box.com account", "configuration":{ "account":"333", "type":"com.openexchange.oauth.boxcom" } } The response provides the relative identifier of the newly created account.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • body (FileAccountData): A JSON object describing the account to create, with at least the field filestorageService set.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

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

Link to this function

delete_file_account(connection, session, filestorage_service, id, opts \\ [])

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

Deletes a file storage account.

parameters

Parameters

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

returns

Returns

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

Link to this function

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

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

Gets all file storage accounts.

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
    • :filestorage_service (String.t): The identifier of a file storage service to list only those accounts that belong to that file storage service.

returns

Returns

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

Link to this function

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

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

Gets all file storage services.

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

returns

Returns

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

Link to this function

get_file_account(connection, session, filestorage_service, id, opts \\ [])

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

Gets a file storage account.

parameters

Parameters

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

returns

Returns

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

Link to this function

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

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

Gets a file storage service.

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 file storage service to load.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

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

Link to this function

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

Updates a file storage account.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • body (FileAccountData): A JSON object describing the updated data of the account. The fields id and filestorageService must be set.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

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