OpenXchangeClient.Api.Resources (open_xchange_client v0.10.0)
API calls for all endpoints tagged Resources
.
Link to this section Summary
Functions
Creates a resource.
Deletes resources.
Gets all resources.
Gets a resource.
Gets a list of resources.
Gets the new, modified and deleted resources.
Searches for resources.
Updates a resource.
Link to this section Functions
create_resource(connection, session, body, opts \\ [])
@spec create_resource( Tesla.Env.client(), String.t(), OpenXchangeClient.Model.ResourceData.t(), keyword() ) :: {:ok, OpenXchangeClient.Model.ResourceUpdateResponse.t()} | {:error, Tesla.Env.t()}
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
delete_resources(connection, session, timestamp, body, opts \\ [])
@spec delete_resources( Tesla.Env.client(), String.t(), integer(), [OpenXchangeClient.Model.ResourceListElement.t()], keyword() ) :: {:ok, OpenXchangeClient.Model.ResourcesResponse.t()} | {:error, Tesla.Env.t()}
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
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
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
get_resource_list(connection, session, body, opts \\ [])
@spec get_resource_list( Tesla.Env.client(), String.t(), [OpenXchangeClient.Model.ResourceListElement.t()], keyword() ) :: {:ok, OpenXchangeClient.Model.ResourcesResponse.t()} | {:error, Tesla.Env.t()}
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
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
search_resources(connection, session, body, opts \\ [])
@spec search_resources( Tesla.Env.client(), String.t(), OpenXchangeClient.Model.ResourceSearchBody.t(), keyword() ) :: {:ok, OpenXchangeClient.Model.ResourcesResponse.t()} | {:error, Tesla.Env.t()}
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
update_resource(connection, session, id, timestamp, body, opts \\ [])
@spec update_resource( Tesla.Env.client(), String.t(), integer(), integer(), OpenXchangeClient.Model.ResourceData.t(), keyword() ) :: {:ok, OpenXchangeClient.Model.CommonResponse.t()} | {:error, Tesla.Env.t()}
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