Current section
Files
Jump to
Current section
Files
lib/open_xchange_client/api/export.ex
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
# https://openapi-generator.tech
# Do not edit the class manually.
defmodule OpenXchangeClient.Api.Export do
@moduledoc """
API calls for all endpoints tagged `Export`.
"""
alias OpenXchangeClient.Connection
import OpenXchangeClient.RequestBuilder
@doc """
Exports contact data to a CSV file.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- folder (String.t): Object ID of the folder whose content shall be exported. This must be a contact folder.
- opts (KeywordList): [optional] Optional parameters
- :columns (String.t): A comma-separated list of columns to export, like \"501,502\". A column is specified by a numeric column identifier, see [Detailed contact data](#detailed-contact-data).
- :export_dlists (String.t): Toggles whether distribution lists shall be exported too (default is `false`).
## Returns
{:ok, String.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec export_as_csv(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, String.t()} | {:error, Tesla.Env.t()}
def export_as_csv(connection, session, folder, opts \\ []) do
optional_params = %{
:columns => :query,
:export_dlists => :query
}
%{}
|> method(:get)
|> url("/export?action=CSV")
|> add_param(:query, :session, session)
|> add_param(:query, :folder, folder)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, false}
])
end
@doc """
Exports a batch of contact data to a CSV file.
Exports a batch of contact data to a CSV file.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- body ([OpenXchangeClient.Model.InfoItemExport.t]): A JSON array of JSON objects with the id and folder_id.
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, String.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec export_as_csv_0(
Tesla.Env.client(),
String.t(),
list(OpenXchangeClient.Model.InfoItemExport.t()),
keyword()
) :: {:ok, String.t()} | {:error, Tesla.Env.t()}
def export_as_csv_0(connection, session, body, _opts \\ []) do
%{}
|> method(:put)
|> url("/export?action=CSV")
|> add_param(:query, :session, session)
|> add_param(:body, :body, body)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, false}
])
end
@doc """
Exports appointment and task data to an iCalendar file.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- folder (String.t): Object ID of the folder whose content shall be exported. This must be a calendar folder.
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, String.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec export_as_i_cal(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, String.t()} | {:error, Tesla.Env.t()}
def export_as_i_cal(connection, session, folder, _opts \\ []) do
%{}
|> method(:get)
|> url("/export?action=ICAL")
|> add_param(:query, :session, session)
|> add_param(:query, :folder, folder)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, false}
])
end
@doc """
Exports a batch of appointments and tasks data to a iCalendar file.
Exports a batch of appointments and tasks data to a iCalendar file.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- body ([OpenXchangeClient.Model.InfoItemExport.t]): A JSON array of JSON objects with the id and folder_id.
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, String.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec export_as_i_cal_0(
Tesla.Env.client(),
String.t(),
list(OpenXchangeClient.Model.InfoItemExport.t()),
keyword()
) :: {:ok, String.t()} | {:error, Tesla.Env.t()}
def export_as_i_cal_0(connection, session, body, _opts \\ []) do
%{}
|> method(:put)
|> url("/export?action=ICAL")
|> add_param(:query, :session, session)
|> add_param(:body, :body, body)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, false}
])
end
@doc """
Exports contact data to a vCard file.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- opts (KeywordList): [optional] Optional parameters
- :folder (String.t): Object ID of the folder whose content shall be exported. This must be a contact folder. Only required if there is no ids parameter submitted.
## Returns
{:ok, String.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec export_as_v_card(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, String.t()} | {:error, Tesla.Env.t()}
def export_as_v_card(connection, session, opts \\ []) do
optional_params = %{
:folder => :query
}
%{}
|> method(:get)
|> url("/export?action=VCARD")
|> add_param(:query, :session, session)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, false}
])
end
@doc """
Exports a batch of contact data to a vCard file.
Exports a batch of contact data to a vCard file.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- body ([OpenXchangeClient.Model.InfoItemExport.t]): A JSON array of JSON objects with the id and folder_id.
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, String.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec export_as_v_card_0(
Tesla.Env.client(),
String.t(),
list(OpenXchangeClient.Model.InfoItemExport.t()),
keyword()
) :: {:ok, String.t()} | {:error, Tesla.Env.t()}
def export_as_v_card_0(connection, session, body, _opts \\ []) do
%{}
|> method(:put)
|> url("/export?action=VCARD")
|> add_param(:query, :session, session)
|> add_param(:body, :body, body)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, false}
])
end
end