OpenXchangeClient.Api.Resources (open_xchange_client v0.10.1)

API calls for all endpoints tagged Resources.

Link to this section Summary

Link to this section Functions

Link to this function

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

Creates a resource.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • body (ResourceData): A JSON object containing the resource data. The field id is not present.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

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

Link to this function

delete_resources(connection, session, timestamp, body, opts \\ [])

Deletes resources.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • timestamp (integer()): Timestamp of the last update of the group to delete.
  • body ([OpenXchangeClient.Model.ResourceListElement.t]): A JSON array of objects with the field id containing the unique identifier of the resource.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

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

Link to this function

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

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

Gets all resources.

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_resource(connection, session, id, opts \\ [])

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

Gets a resource.

parameters

Parameters

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

returns

Returns

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

Link to this function

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

Gets a list of resources.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • body ([OpenXchangeClient.Model.ResourceListElement.t]): A JSON array of JSON objects with the id of the requested resources.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

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

Link to this function

get_resource_updates(connection, session, timestamp, opts \\ [])

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

Gets the new, modified and deleted resources.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • timestamp (integer()): Timestamp of the last update of the requested resources.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

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

Link to this function

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

Searches for resources.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • body (ResourceSearchBody): A JSON object with the search parameters.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

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

Link to this function

update_resource(connection, session, id, timestamp, body, opts \\ [])

Updates a resource.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (integer()): ID of the resource that shall be updated.
  • timestamp (integer()): Timestamp of the last update of the resource to update. If the resource was modified after the specified timestamp, then the update must fail.
  • body (ResourceData): A JSON object containing the resource data fields to change. Only modified fields are present and the field id is omitted.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

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