Current section

Files

Jump to
open_xchange_client lib open_xchange_client api chronos.ex
Raw

lib/open_xchange_client/api/chronos.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.Chronos do
@moduledoc """
API calls for all endpoints tagged `Chronos`.
"""
alias OpenXchangeClient.Connection
import OpenXchangeClient.RequestBuilder
@doc """
Accepts an itip invitation.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- data_source (String.t): The identifier of the data source. Currently only \"com.openexchange.mail.ical\" is valid.
- description_format (String.t): The desired output fromat. Currently only \"html\" is valid.
- body (ConversionDataSource): The data source object.
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, OpenXchangeClient.Model.ActionResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec accept(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
OpenXchangeClient.Model.ConversionDataSource.t(),
keyword()
) :: {:ok, OpenXchangeClient.Model.ActionResponse.t()} | {:error, Tesla.Env.t()}
def accept(connection, session, data_source, description_format, body, _opts \\ []) do
%{}
|> method(:put)
|> url("/chronos/itip?action=accept")
|> add_param(:query, :session, session)
|> add_param(:query, :dataSource, data_source)
|> add_param(:query, :descriptionFormat, description_format)
|> add_param(:body, :body, body)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.ActionResponse{}}
])
end
@doc """
Accepts an itip invitation and ignores conflicts ir possible.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- data_source (String.t): The identifier of the data source. Currently only \"com.openexchange.mail.ical\" is valid.
- description_format (String.t): The desired output fromat. Currently only \"html\" is valid.
- body (ConversionDataSource): The data source object.
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, OpenXchangeClient.Model.ActionResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec accept_and_ignore_conflicts(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
OpenXchangeClient.Model.ConversionDataSource.t(),
keyword()
) :: {:ok, OpenXchangeClient.Model.ActionResponse.t()} | {:error, Tesla.Env.t()}
def accept_and_ignore_conflicts(
connection,
session,
data_source,
description_format,
body,
_opts \\ []
) do
%{}
|> method(:put)
|> url("/chronos/itip?action=accept_and_ignore_conflicts")
|> add_param(:query, :session, session)
|> add_param(:query, :dataSource, data_source)
|> add_param(:query, :descriptionFormat, description_format)
|> add_param(:body, :body, body)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.ActionResponse{}}
])
end
@doc """
Acknowledges an alarm.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- id (String.t): ID of the event.
- folder (String.t): ID of the folder who contains the events.
- alarm_id (integer()): The id of the alarm which shall be acknowledged.
- opts (KeywordList): [optional] Optional parameters
- :extended_entities (boolean()): If set to 'true' attendees of internal users will be extended by a 'contact' field, which contains some of the contact fields of this user.
- :push_token (String.t): The client's push token to allow filtering of push events for modified calendar data
## Returns
{:ok, OpenXchangeClient.Model.ChronosCalendarResultResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec acknowledge_alarm(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
integer(),
keyword()
) ::
{:ok, OpenXchangeClient.Model.ChronosCalendarResultResponse.t()}
| {:error, Tesla.Env.t()}
def acknowledge_alarm(connection, session, id, folder, alarm_id, opts \\ []) do
optional_params = %{
:extendedEntities => :query,
:pushToken => :query
}
%{}
|> method(:get)
|> url("/chronos/alarm?action=ack")
|> add_param(:query, :session, session)
|> add_param(:query, :id, id)
|> add_param(:query, :folder, folder)
|> add_param(:query, :alarmId, alarm_id)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.ChronosCalendarResultResponse{}}
])
end
@doc """
Analyzes an itip message.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- data_source (String.t): The identifier of the data source. Currently only \"com.openexchange.mail.ical\" is valid.
- description_format (String.t): The desired output fromat. Currently only \"html\" is valid.
- body (ConversionDataSource): The data source object.
- opts (KeywordList): [optional] Optional parameters
- :timezone (String.t): The timezone to show the event in.
## Returns
{:ok, OpenXchangeClient.Model.AnalyzeResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec analyze(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
OpenXchangeClient.Model.ConversionDataSource.t(),
keyword()
) :: {:ok, OpenXchangeClient.Model.AnalyzeResponse.t()} | {:error, Tesla.Env.t()}
def analyze(connection, session, data_source, description_format, body, opts \\ []) do
optional_params = %{
:timezone => :query
}
%{}
|> method(:put)
|> url("/chronos/itip?action=analyze")
|> add_param(:query, :session, session)
|> add_param(:query, :dataSource, data_source)
|> add_param(:query, :descriptionFormat, description_format)
|> add_param(:body, :body, body)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.AnalyzeResponse{}}
])
end
@doc """
Browses a specific page of the SchedJoules calendars catalog. If no 'id' is provided, then the root page is returned.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- opts (KeywordList): [optional] Optional parameters
- :id (integer()): The identifier of the page.
- :language (String.t): The language/locale to translate the results to. If none is provided then the locale of the user's session will be used. If that one is not available then falls back to 'en'.
- :country (String.t): The country/location for which to fetch the available catalog pages from the SchedJoules. If none is provided then the country of the user's session will be used. If that one is not available then falls back to 'us'. The 'country' parameter is only used for the root page. Otherwise it has no effect.
## Returns
{:ok, OpenXchangeClient.Model.BrowseResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec browse(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, OpenXchangeClient.Model.BrowseResponse.t()} | {:error, Tesla.Env.t()}
def browse(connection, session, opts \\ []) do
optional_params = %{
:id => :query,
:language => :query,
:country => :query
}
%{}
|> method(:get)
|> url("/chronos/schedjoules?action=browse")
|> add_param(:query, :session, session)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.BrowseResponse{}}
])
end
@doc """
Changes an organizer of an event.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- folder (String.t): ID of the folder who contains the events.
- id (String.t): ID of the event.
- timestamp (integer()): Timestamp of the last update of the event.
- change_organizer_body (InlineObject3):
- opts (KeywordList): [optional] Optional parameters
- :recurrence_id (String.t): The recurrence identifier.
- :recurrence_range (String.t): The targeted range specified with the recurrence id.
- :expand (boolean()): Defines if event series should be extended or not.
- :fields (String.t): A comma-separated list of field identifiers.
- :push_token (String.t): The client's push token to allow filtering of push events for modified calendar data
- :range_start (String.t): If expand is set to 'true' this parameter defines a lower inclusive limit as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which start on or after this date are returned.
- :range_end (String.t): If expand is set to 'true' this parameter defines a upper exclusive limit as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which end before this date are returned.
## Returns
{:ok, OpenXchangeClient.Model.ChronosCalendarResultResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec change_organizer(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
integer(),
OpenXchangeClient.Model.InlineObject3.t(),
keyword()
) ::
{:ok, OpenXchangeClient.Model.ChronosCalendarResultResponse.t()}
| {:error, Tesla.Env.t()}
def change_organizer(
connection,
session,
folder,
id,
timestamp,
change_organizer_body,
opts \\ []
) do
optional_params = %{
:recurrenceId => :query,
:recurrenceRange => :query,
:expand => :query,
:fields => :query,
:pushToken => :query,
:rangeStart => :query,
:rangeEnd => :query
}
%{}
|> method(:put)
|> url("/chronos?action=changeOrganizer")
|> add_param(:query, :session, session)
|> add_param(:query, :folder, folder)
|> add_param(:query, :id, id)
|> add_param(:query, :timestamp, timestamp)
|> add_param(:body, :body, change_organizer_body)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.ChronosCalendarResultResponse{}}
])
end
@doc """
Retreives a list of all countries that are supported by SchedJoules.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- opts (KeywordList): [optional] Optional parameters
- :language (String.t): The language/locale to translate the results to. If none is provided then the locale of the user's session will be used. If that one is not available then falls back to 'en'.
## Returns
{:ok, OpenXchangeClient.Model.CountriesResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec countries(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, OpenXchangeClient.Model.CountriesResponse.t()} | {:error, Tesla.Env.t()}
def countries(connection, session, opts \\ []) do
optional_params = %{
:language => :query
}
%{}
|> method(:get)
|> url("/chronos/schedjoules?action=countries")
|> add_param(:query, :session, session)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.CountriesResponse{}}
])
end
@doc """
Creates an event.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- folder (String.t): ID of the folder who contains the events.
- body (EventData): A JSON object containing the event's data.
- opts (KeywordList): [optional] Optional parameters
- :check_conflicts (boolean()): Whether to check for conflicts or not.
- :send_internal_notifications (boolean()): Specifies that attendees should be notified about the changes when saving a meeting or not.
- :extended_entities (boolean()): If set to 'true' attendees of internal users will be extended by a 'contact' field, which contains some of the contact fields of this user.
- :push_token (String.t): The client's push token to allow filtering of push events for modified calendar data
- :range_start (String.t): If expand is set to 'true' this parameter defines a lower inclusive limit as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which start on or after this date are returned.
- :range_end (String.t): If expand is set to 'true' this parameter defines a upper exclusive limit as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which end before this date are returned.
- :expand (boolean()): Defines if event series should be extended or not.
- :used_groups (String.t): In case the client resolves groups into single attendees the client can provide the ids of the groups he used (resolved) as a comma separated list. This way the usecount of those groups will be increased.
## Returns
{:ok, OpenXchangeClient.Model.ChronosCalendarResultResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec create_event(
Tesla.Env.client(),
String.t(),
String.t(),
OpenXchangeClient.Model.EventData.t(),
keyword()
) ::
{:ok, OpenXchangeClient.Model.ChronosCalendarResultResponse.t()}
| {:error, Tesla.Env.t()}
def create_event(connection, session, folder, body, opts \\ []) do
optional_params = %{
:checkConflicts => :query,
:sendInternalNotifications => :query,
:extendedEntities => :query,
:pushToken => :query,
:rangeStart => :query,
:rangeEnd => :query,
:expand => :query,
:usedGroups => :query
}
%{}
|> method(:put)
|> url("/chronos?action=new")
|> add_param(:query, :session, session)
|> add_param(:query, :folder, folder)
|> add_param(:body, :body, body)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.ChronosCalendarResultResponse{}}
])
end
@doc """
Creates an event and attaches files.
#### Note It is possible to create multiple attachments at once. Therefore add additional form fields and replace \"[index]\" in `file_[index]` with the appropriate index, like `file_1`. The index always starts with 0 (mandatory attachment object). There can only be one json payload describing the EventData, the rest json payloads (if present) will simply be ignored.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- folder (String.t): ID of the folder who contains the events.
- json0 (String.t): A JSON object containing the event's data as described in [EventData](#/definitions/EventData).
- file0 (String.t): The attachment file as per `<input type=\\\"file\\\" />`.
- opts (KeywordList): [optional] Optional parameters
- :check_conflicts (boolean()): Whether to check for conflicts or not.
- :send_internal_notifications (boolean()): Specifies that attendees should be notified about the changes when saving a meeting or not.
- :extended_entities (boolean()): If set to 'true' attendees of internal users will be extended by a 'contact' field, which contains some of the contact fields of this user.
- :used_groups (String.t): In case the client resolves groups into single attendees the client can provide the ids of the groups he used (resolved) as a comma separated list. This way the usecount of those groups will be increased.
## Returns
{:ok, String.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec create_event_with_attachments(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
String.t(),
keyword()
) :: {:ok, String.t()} | {:error, Tesla.Env.t()}
def create_event_with_attachments(connection, session, folder, json0, file0, opts \\ []) do
optional_params = %{
:checkConflicts => :query,
:sendInternalNotifications => :query,
:extendedEntities => :query,
:usedGroups => :query
}
%{}
|> method(:post)
|> url("/chronos?action=new")
|> add_param(:query, :session, session)
|> add_param(:query, :folder, folder)
|> add_param(:form, :json_0, json0)
|> add_param(:file, :file_0, file0)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, false}
])
end
@doc """
Declines an itip invitation.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- data_source (String.t): The identifier of the data source. Currently only \"com.openexchange.mail.ical\" is valid.
- description_format (String.t): The desired output fromat. Currently only \"html\" is valid.
- body (ConversionDataSource): The data source object.
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, OpenXchangeClient.Model.ActionResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec decline(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
OpenXchangeClient.Model.ConversionDataSource.t(),
keyword()
) :: {:ok, OpenXchangeClient.Model.ActionResponse.t()} | {:error, Tesla.Env.t()}
def decline(connection, session, data_source, description_format, body, _opts \\ []) do
%{}
|> method(:put)
|> url("/chronos/itip?action=decline")
|> add_param(:query, :session, session)
|> add_param(:query, :dataSource, data_source)
|> add_param(:query, :descriptionFormat, description_format)
|> add_param(:body, :body, body)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.ActionResponse{}}
])
end
@doc """
Deletes events.
## 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 events.
- delete_body (InlineObject2):
- opts (KeywordList): [optional] Optional parameters
- :range_start (String.t): If expand is set to 'true' this parameter defines a lower inclusive limit as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which start on or after this date are returned.
- :range_end (String.t): If expand is set to 'true' this parameter defines a upper exclusive limit as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which end before this date are returned.
- :expand (boolean()): Defines if event series should be extended or not.
- :extended_entities (boolean()): If set to 'true' attendees of internal users will be extended by a 'contact' field, which contains some of the contact fields of this user.
- :fields (String.t): A comma-separated list of field identifiers.
- :push_token (String.t): The client's push token to allow filtering of push events for modified calendar data
## Returns
{:ok, OpenXchangeClient.Model.ChronosMultipleCalendarResultResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec delete_event(
Tesla.Env.client(),
String.t(),
integer(),
OpenXchangeClient.Model.InlineObject2.t(),
keyword()
) ::
{:ok, OpenXchangeClient.Model.ChronosMultipleCalendarResultResponse.t()}
| {:error, Tesla.Env.t()}
def delete_event(connection, session, timestamp, delete_body, opts \\ []) do
optional_params = %{
:rangeStart => :query,
:rangeEnd => :query,
:expand => :query,
:extendedEntities => :query,
:fields => :query,
:pushToken => :query
}
%{}
|> method(:put)
|> url("/chronos?action=delete")
|> add_param(:query, :session, session)
|> add_param(:query, :timestamp, timestamp)
|> add_param(:body, :body, delete_body)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.ChronosMultipleCalendarResultResponse{}}
])
end
@doc """
Gets free-busy timeslots for the given attendees.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- from (String.t): Lower inclusive limit of the queried range as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which start on or after this date are returned.
- until (String.t): Upper exclusive limit of the queried range as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which end before this date are returned.
- body (FreeBusyBody):
- opts (KeywordList): [optional] Optional parameters
- :mask_id (String.t): The identifier of an existing event or event series to ignore when calculating free/busy information. This is useful when a client wants to find a new timeslot for an existing event.
- :merge (boolean()): Set to <code>true</code> to merge the resulting free/busy-times.
## Returns
{:ok, OpenXchangeClient.Model.ChronosFreeBusyResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec freebusy(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
OpenXchangeClient.Model.FreeBusyBody.t(),
keyword()
) :: {:ok, OpenXchangeClient.Model.ChronosFreeBusyResponse.t()} | {:error, Tesla.Env.t()}
def freebusy(connection, session, from, until, body, opts \\ []) do
optional_params = %{
:maskId => :query,
:merge => :query
}
%{}
|> method(:put)
|> url("/chronos?action=freeBusy")
|> add_param(:query, :session, session)
|> add_param(:query, :from, from)
|> add_param(:query, :until, until)
|> add_param(:body, :body, body)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.ChronosFreeBusyResponse{}}
])
end
@doc """
Retrieves not acknowledged alarm triggers.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- range_end (String.t): Upper exclusive limit of the queried range as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which should trigger before this date are returned.
- opts (KeywordList): [optional] Optional parameters
- :actions (String.t): A comma separated list of alarm actions. Only this actions will be returned.
## Returns
{:ok, OpenXchangeClient.Model.AlarmTriggerResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec get_alarm_trigger(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, OpenXchangeClient.Model.AlarmTriggerResponse.t()} | {:error, Tesla.Env.t()}
def get_alarm_trigger(connection, session, range_end, opts \\ []) do
optional_params = %{
:actions => :query
}
%{}
|> method(:get)
|> url("/chronos/alarm?action=pending")
|> add_param(:query, :session, session)
|> add_param(:query, :rangeEnd, range_end)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.AlarmTriggerResponse{}}
])
end
@doc """
Gets all events in folder.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- range_start (String.t): Lower inclusive limit of the queried range as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which start on or after this date are returned.
- range_end (String.t): Upper exclusive limit of the queried range as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which end before this date are returned.
- opts (KeywordList): [optional] Optional parameters
- :folder (String.t): ID of the folder who contains the events. If not set, all events of the default account will be queried.
- :fields (String.t): A comma-separated list of field identifiers.
- :order (String.t): The sort order to apply, either <code>ASC</code> for ascending, or <code>DESC</code> for descending.
- :sort (String.t): Specifies the field for sorting the results.
- :expand (boolean()): Defines if event series should be extended or not.
- :extended_entities (boolean()): If set to 'true' attendees of internal users will be extended by a 'contact' field, which contains some of the contact fields of this user.
- :update_cache (boolean()): If set to 'true' the cache will be forced to be updated (e. g. by contacting the underlying external account)
## Returns
{:ok, OpenXchangeClient.Model.EventsResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec get_all_events(Tesla.Env.client(), String.t(), String.t(), String.t(), keyword()) ::
{:ok, OpenXchangeClient.Model.EventsResponse.t()} | {:error, Tesla.Env.t()}
def get_all_events(connection, session, range_start, range_end, opts \\ []) do
optional_params = %{
:folder => :query,
:fields => :query,
:order => :query,
:sort => :query,
:expand => :query,
:extendedEntities => :query,
:updateCache => :query
}
%{}
|> method(:get)
|> url("/chronos?action=all")
|> add_param(:query, :session, session)
|> add_param(:query, :rangeStart, range_start)
|> add_param(:query, :rangeEnd, range_end)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.EventsResponse{}}
])
end
@doc """
Gets all events of multiple folders.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- range_start (String.t): Lower inclusive limit of the queried range as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which start on or after this date are returned.
- range_end (String.t): Upper exclusive limit of the queried range as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which end before this date are returned.
- body (ChronosFolderBody): A JSON object containing the folder ids.
- opts (KeywordList): [optional] Optional parameters
- :fields (String.t): A comma-separated list of field identifiers.
- :order (String.t): The sort order to apply, either <code>ASC</code> for ascending, or <code>DESC</code> for descending.
- :sort (String.t): Specifies the field for sorting the results.
- :expand (boolean()): Defines if event series should be extended or not.
- :update_cache (boolean()): If set to 'true' the cache will be forced to be updated (e. g. by contacting the underlying external account)
## Returns
{:ok, OpenXchangeClient.Model.MultipleFolderEventsResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec get_all_events_for_multiple_folders(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
OpenXchangeClient.Model.ChronosFolderBody.t(),
keyword()
) ::
{:ok, OpenXchangeClient.Model.MultipleFolderEventsResponse.t()}
| {:error, Tesla.Env.t()}
def get_all_events_for_multiple_folders(
connection,
session,
range_start,
range_end,
body,
opts \\ []
) do
optional_params = %{
:fields => :query,
:order => :query,
:sort => :query,
:expand => :query,
:updateCache => :query
}
%{}
|> method(:put)
|> url("/chronos?action=all")
|> add_param(:query, :session, session)
|> add_param(:query, :rangeStart, range_start)
|> add_param(:query, :rangeEnd, range_end)
|> add_param(:body, :body, body)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.MultipleFolderEventsResponse{}}
])
end
@doc """
Gets the configured availability of the user.
## 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
{:ok, OpenXchangeClient.Model.GetAvailabilityResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec get_availability(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, OpenXchangeClient.Model.GetAvailabilityResponse.t()} | {:error, Tesla.Env.t()}
def get_availability(connection, session, _opts \\ []) do
%{}
|> method(:get)
|> url("/chronos/availability?action=get")
|> add_param(:query, :session, session)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.GetAvailabilityResponse{}}
])
end
@doc """
Gets an event.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- id (String.t): ID of the event.
- folder (String.t): ID of the folder who contains the events.
- opts (KeywordList): [optional] Optional parameters
- :recurrence_id (String.t): The recurrence identifier.
- :fields (String.t): A comma-separated list of field identifiers.
- :extended_entities (boolean()): If set to 'true' attendees of internal users will be extended by a 'contact' field, which contains some of the contact fields of this user.
## Returns
{:ok, OpenXchangeClient.Model.EventResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec get_event(Tesla.Env.client(), String.t(), String.t(), String.t(), keyword()) ::
{:ok, OpenXchangeClient.Model.EventResponse.t()} | {:error, Tesla.Env.t()}
def get_event(connection, session, id, folder, opts \\ []) do
optional_params = %{
:recurrenceId => :query,
:fields => :query,
:extendedEntities => :query
}
%{}
|> method(:get)
|> url("/chronos?action=get")
|> add_param(:query, :session, session)
|> add_param(:query, :id, id)
|> add_param(:query, :folder, folder)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.EventResponse{}}
])
end
@doc """
Gets the attachment of an event.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- id (String.t): ID of the event.
- folder (String.t): ID of the folder who contains the events.
- managed_id (integer()): The identifier of the attachment.
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, String.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec get_event_attachment(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
integer(),
keyword()
) :: {:ok, String.t()} | {:error, Tesla.Env.t()}
def get_event_attachment(connection, session, id, folder, managed_id, _opts \\ []) do
%{}
|> method(:get)
|> url("/chronos?action=getAttachment")
|> add_param(:query, :session, session)
|> add_param(:query, :id, id)
|> add_param(:query, :folder, folder)
|> add_param(:query, :managedId, managed_id)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, false}
])
end
@doc """
Gets a list of events.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- body ([OpenXchangeClient.Model.EventId.t]): A JSON array of JSON objects with the id and optionally the recurrence position of the event.
- opts (KeywordList): [optional] Optional parameters
- :fields (String.t): A comma-separated list of field identifiers.
- :extended_entities (boolean()): If set to 'true' attendees of internal users will be extended by a 'contact' field, which contains some of the contact fields of this user.
## Returns
{:ok, OpenXchangeClient.Model.EventsResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec get_event_list(
Tesla.Env.client(),
String.t(),
list(OpenXchangeClient.Model.EventId.t()),
keyword()
) :: {:ok, OpenXchangeClient.Model.EventsResponse.t()} | {:error, Tesla.Env.t()}
def get_event_list(connection, session, body, opts \\ []) do
optional_params = %{
:fields => :query,
:extendedEntities => :query
}
%{}
|> method(:put)
|> url("/chronos?action=list")
|> add_param(:query, :session, session)
|> add_param(:body, :body, body)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.EventsResponse{}}
])
end
@doc """
Gets all events where the session userattendee's participation status equals \"NEEDS-ACTION\".
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- range_start (String.t): Lower inclusive limit of the queried range as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which start on or after this date are returned.
- range_end (String.t): Upper exclusive limit of the queried range as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which end before this date are returned.
- opts (KeywordList): [optional] Optional parameters
- :fields (String.t): A comma-separated list of field identifiers.
- :order (String.t): The sort order to apply, either <code>ASC</code> for ascending, or <code>DESC</code> for descending.
- :sort (String.t): Specifies the field for sorting the results.
- :extended_entities (boolean()): If set to 'true' attendees of internal users will be extended by a 'contact' field, which contains some of the contact fields of this user.
## Returns
{:ok, OpenXchangeClient.Model.EventsResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec get_events_needing_action(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
keyword()
) :: {:ok, OpenXchangeClient.Model.EventsResponse.t()} | {:error, Tesla.Env.t()}
def get_events_needing_action(connection, session, range_start, range_end, opts \\ []) do
optional_params = %{
:fields => :query,
:order => :query,
:sort => :query,
:extendedEntities => :query
}
%{}
|> method(:get)
|> url("/chronos?action=needsAction")
|> add_param(:query, :session, session)
|> add_param(:query, :rangeStart, range_start)
|> add_param(:query, :rangeEnd, range_end)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.EventsResponse{}}
])
end
@doc """
Gets all changed events since the given timestamp.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- folder (String.t): ID of the folder who contains the events.
- timestamp (integer()): Timestamp of the last update of the requested events.
- opts (KeywordList): [optional] Optional parameters
- :range_start (String.t): Lower inclusive limit of the queried range as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which start on or after this date are returned.
- :range_end (String.t): Upper exclusive limit of the queried range as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which end before this date are returned.
- :fields (String.t): A comma-separated list of field identifiers.
- :order (String.t): The sort order to apply, either <code>ASC</code> for ascending, or <code>DESC</code> for descending.
- :sort (String.t): Specifies the field for sorting the results.
- :expand (boolean()): Defines if event series should be extended or not.
- :extended_entities (boolean()): If set to 'true' attendees of internal users will be extended by a 'contact' field, which contains some of the contact fields of this user.
## Returns
{:ok, OpenXchangeClient.Model.ChronosUpdatesResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec get_updates(Tesla.Env.client(), String.t(), String.t(), integer(), keyword()) ::
{:ok, OpenXchangeClient.Model.ChronosUpdatesResponse.t()} | {:error, Tesla.Env.t()}
def get_updates(connection, session, folder, timestamp, opts \\ []) do
optional_params = %{
:rangeStart => :query,
:rangeEnd => :query,
:fields => :query,
:order => :query,
:sort => :query,
:expand => :query,
:extendedEntities => :query
}
%{}
|> method(:get)
|> url("/chronos?action=updates")
|> add_param(:query, :session, session)
|> add_param(:query, :folder, folder)
|> add_param(:query, :timestamp, timestamp)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.ChronosUpdatesResponse{}}
])
end
@doc """
Gets a ZIP archive for multiple attachments of an event.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- id (String.t): ID of the event.
- folder (String.t): ID of the folder who contains the events.
- body ([String.t]): A JSON array with the identifiers of the attachments, which shall be put into ZIP archive
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, String.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec get_zipped_event_attachments(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
list(String.t()),
keyword()
) :: {:ok, String.t()} | {:error, Tesla.Env.t()}
def get_zipped_event_attachments(connection, session, id, folder, body, _opts \\ []) do
%{}
|> method(:put)
|> url("/chronos?action=zipAttachments")
|> add_param(:query, :session, session)
|> add_param(:query, :id, id)
|> add_param(:query, :folder, folder)
|> add_param(:body, :body, body)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, false}
])
end
@doc """
Retrieves a list of all supported languages by SchedJoules
## 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
{:ok, OpenXchangeClient.Model.LanguagesResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec languages(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, OpenXchangeClient.Model.LanguagesResponse.t()} | {:error, Tesla.Env.t()}
def languages(connection, session, _opts \\ []) do
%{}
|> method(:get)
|> url("/chronos/schedjoules?action=languages")
|> add_param(:query, :session, session)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.LanguagesResponse{}}
])
end
@doc """
Moves an event to another calendar folder.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- folder (String.t): ID of the folder who contains the events.
- id (String.t): ID of the event.
- timestamp (integer()): Timestamp of the last update of the event.
- target_folder (String.t): ID of the target folder.
- opts (KeywordList): [optional] Optional parameters
- :check_conflicts (boolean()): Whether to check for conflicts or not.
- :recurrence_id (String.t): The recurrence identifier.
- :send_internal_notifications (boolean()): Specifies that attendees should be notified about the changes when saving a meeting or not.
- :extended_entities (boolean()): If set to 'true' attendees of internal users will be extended by a 'contact' field, which contains some of the contact fields of this user.
- :push_token (String.t): The client's push token to allow filtering of push events for modified calendar data
- :range_start (String.t): If expand is set to 'true' this parameter defines a lower inclusive limit as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which start on or after this date are returned.
- :range_end (String.t): If expand is set to 'true' this parameter defines a upper exclusive limit as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which end before this date are returned.
- :expand (boolean()): Defines if event series should be extended or not.
## Returns
{:ok, OpenXchangeClient.Model.ChronosCalendarResultResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec move_event(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
integer(),
String.t(),
keyword()
) ::
{:ok, OpenXchangeClient.Model.ChronosCalendarResultResponse.t()}
| {:error, Tesla.Env.t()}
def move_event(connection, session, folder, id, timestamp, target_folder, opts \\ []) do
optional_params = %{
:checkConflicts => :query,
:recurrenceId => :query,
:sendInternalNotifications => :query,
:extendedEntities => :query,
:pushToken => :query,
:rangeStart => :query,
:rangeEnd => :query,
:expand => :query
}
%{}
|> method(:put)
|> url("/chronos?action=move")
|> add_param(:query, :session, session)
|> add_param(:query, :folder, folder)
|> add_param(:query, :id, id)
|> add_param(:query, :timestamp, timestamp)
|> add_param(:query, :targetFolder, target_folder)
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.ChronosCalendarResultResponse{}}
])
end
@doc """
Probe to check given ICal calendar properties before creating a new account.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- body (CalendarAccountProbeData): The properties to check.
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, OpenXchangeClient.Model.CalendarAccountProbeResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec probe(
Tesla.Env.client(),
String.t(),
OpenXchangeClient.Model.CalendarAccountProbeData.t(),
keyword()
) ::
{:ok, OpenXchangeClient.Model.CalendarAccountProbeResponse.t()}
| {:error, Tesla.Env.t()}
def probe(connection, session, body, _opts \\ []) do
%{}
|> method(:put)
|> url("/chronos/account?action=probe")
|> add_param(:query, :session, session)
|> add_param(:body, :body, body)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.CalendarAccountProbeResponse{}}
])
end
@doc """
Resolves an event identifier to an event, and returns it in the perspective of the current session's user, i.e. having an appropriate parent folder identifier assigned.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- id (String.t): ID of the event.
- opts (KeywordList): [optional] Optional parameters
- :fields (String.t): A comma-separated list of field identifiers.
- :extended_entities (boolean()): If set to 'true' attendees of internal users will be extended by a 'contact' field, which contains some of the contact fields of this user.
## Returns
{:ok, OpenXchangeClient.Model.EventResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec resolve_event(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, OpenXchangeClient.Model.EventResponse.t()} | {:error, Tesla.Env.t()}
def resolve_event(connection, session, id, opts \\ []) do
optional_params = %{
:fields => :query,
:extendedEntities => :query
}
%{}
|> method(:get)
|> url("/chronos?action=resolve")
|> add_param(:query, :session, session)
|> add_param(:query, :id, id)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.EventResponse{}}
])
end
@doc """
Performs a full text search with the specified query.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- query (String.t): The query
- opts (KeywordList): [optional] Optional parameters
- :language (String.t): The language/locale to translate the results to. If none is provided then the locale of the user's session will be used. If that one is not available then falls back to 'en'.
- :max_rows (integer()): Specifies the maximum amount of results to return. If not specified, then it will fall back to '20'
## Returns
{:ok, OpenXchangeClient.Model.SearchResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec search(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, OpenXchangeClient.Model.SearchResponse.t()} | {:error, Tesla.Env.t()}
def search(connection, session, query, opts \\ []) do
optional_params = %{
:language => :query,
:maxRows => :query
}
%{}
|> method(:get)
|> url("/chronos/schedjoules?action=search")
|> add_param(:query, :session, session)
|> add_param(:query, :query, query)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.SearchResponse{}}
])
end
@doc """
Sets/Overwrites the availability of the user. If an empty payload is sent, then the availability of the user is deleted/unset.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- body (AvailabilityData): A JSON object containing the availability's data.
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, nil} on success
{:error, Tesla.Env.t} on failure
"""
@spec set_availability(
Tesla.Env.client(),
String.t(),
OpenXchangeClient.Model.AvailabilityData.t(),
keyword()
) :: {:ok, nil} | {:error, Tesla.Env.t()}
def set_availability(connection, session, body, _opts \\ []) do
%{}
|> method(:put)
|> url("/chronos/availability?action=set")
|> add_param(:query, :session, session)
|> add_param(:body, :body, body)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, false}
])
end
@doc """
Snoozes an alarm by the given duration.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- id (String.t): ID of the event.
- folder (String.t): ID of the folder who contains the events.
- alarm_id (integer()): The id of the alarm which shall be snoozed.
- snooze_time (integer()): The duration in milliseconds the alarm should be snoozed by. E.g. 300000 for 5 minutes.
- opts (KeywordList): [optional] Optional parameters
- :extended_entities (boolean()): If set to 'true' attendees of internal users will be extended by a 'contact' field, which contains some of the contact fields of this user.
- :push_token (String.t): The client's push token to allow filtering of push events for modified calendar data
## Returns
{:ok, OpenXchangeClient.Model.ChronosCalendarResultResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec snooze_alarm(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
integer(),
integer(),
keyword()
) ::
{:ok, OpenXchangeClient.Model.ChronosCalendarResultResponse.t()}
| {:error, Tesla.Env.t()}
def snooze_alarm(connection, session, id, folder, alarm_id, snooze_time, opts \\ []) do
optional_params = %{
:extendedEntities => :query,
:pushToken => :query
}
%{}
|> method(:get)
|> url("/chronos/alarm?action=snooze")
|> add_param(:query, :session, session)
|> add_param(:query, :id, id)
|> add_param(:query, :folder, folder)
|> add_param(:query, :alarmId, alarm_id)
|> add_param(:query, :snoozeTime, snooze_time)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.ChronosCalendarResultResponse{}}
])
end
@doc """
Tentatively accepts an itip invitation.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- data_source (String.t): The identifier of the data source. Currently only \"com.openexchange.mail.ical\" is valid.
- description_format (String.t): The desired output fromat. Currently only \"html\" is valid.
- body (ConversionDataSource): The data source object.
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, OpenXchangeClient.Model.ActionResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec tentative(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
OpenXchangeClient.Model.ConversionDataSource.t(),
keyword()
) :: {:ok, OpenXchangeClient.Model.ActionResponse.t()} | {:error, Tesla.Env.t()}
def tentative(connection, session, data_source, description_format, body, _opts \\ []) do
%{}
|> method(:put)
|> url("/chronos/itip?action=tentative")
|> add_param(:query, :session, session)
|> add_param(:query, :dataSource, data_source)
|> add_param(:query, :descriptionFormat, description_format)
|> add_param(:body, :body, body)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.ActionResponse{}}
])
end
@doc """
Updates an event based on an update sent by the organizer or a reply sent to the organizer.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- data_source (String.t): The identifier of the data source. Currently only \"com.openexchange.mail.ical\" is valid.
- description_format (String.t): The desired output fromat. Currently only \"html\" is valid.
- body (ConversionDataSource): The data source object.
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, OpenXchangeClient.Model.ActionResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec update(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
OpenXchangeClient.Model.ConversionDataSource.t(),
keyword()
) :: {:ok, OpenXchangeClient.Model.ActionResponse.t()} | {:error, Tesla.Env.t()}
def update(connection, session, data_source, description_format, body, _opts \\ []) do
%{}
|> method(:put)
|> url("/chronos/itip?action=update")
|> add_param(:query, :session, session)
|> add_param(:query, :dataSource, data_source)
|> add_param(:query, :descriptionFormat, description_format)
|> add_param(:body, :body, body)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.ActionResponse{}}
])
end
@doc """
Updates the personal alarms of an event.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- folder (String.t): ID of the folder who contains the events.
- id (String.t): ID of the event.
- timestamp (integer()): Timestamp of the last update of the event.
- body ([OpenXchangeClient.Model.Alarm.t]): A JSON array containing the alarms.
- opts (KeywordList): [optional] Optional parameters
- :recurrence_id (String.t): The recurrence identifier.
- :extended_entities (boolean()): If set to 'true' attendees of internal users will be extended by a 'contact' field, which contains some of the contact fields of this user.
- :push_token (String.t): The client's push token to allow filtering of push events for modified calendar data
## Returns
{:ok, OpenXchangeClient.Model.ChronosCalendarResultResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec update_alarms(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
integer(),
list(OpenXchangeClient.Model.Alarm.t()),
keyword()
) ::
{:ok, OpenXchangeClient.Model.ChronosCalendarResultResponse.t()}
| {:error, Tesla.Env.t()}
def update_alarms(connection, session, folder, id, timestamp, body, opts \\ []) do
optional_params = %{
:recurrenceId => :query,
:extendedEntities => :query,
:pushToken => :query
}
%{}
|> method(:put)
|> url("/chronos/alarm?action=updateAlarms")
|> add_param(:query, :session, session)
|> add_param(:query, :folder, folder)
|> add_param(:query, :id, id)
|> add_param(:query, :timestamp, timestamp)
|> add_param(:body, :body, body)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.ChronosCalendarResultResponse{}}
])
end
@doc """
Updates the attendee status of an event.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- folder (String.t): ID of the folder who contains the events.
- id (String.t): ID of the event.
- timestamp (integer()): Timestamp of the last update of the event.
- body (AttendeeAndAlarm):
- opts (KeywordList): [optional] Optional parameters
- :recurrence_id (String.t): The recurrence identifier.
- :send_internal_notifications (boolean()): Specifies that attendees should be notified about the changes when saving a meeting or not.
- :extended_entities (boolean()): If set to 'true' attendees of internal users will be extended by a 'contact' field, which contains some of the contact fields of this user.
- :push_token (String.t): The client's push token to allow filtering of push events for modified calendar data
- :check_conflicts (boolean()): Whether to check for conflicts or not.
- :range_start (String.t): If expand is set to 'true' this parameter defines a lower inclusive limit as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which start on or after this date are returned.
- :range_end (String.t): If expand is set to 'true' this parameter defines a upper exclusive limit as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which end before this date are returned.
- :expand (boolean()): Defines if event series should be extended or not.
## Returns
{:ok, OpenXchangeClient.Model.ChronosCalendarResultResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec update_attendee(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
integer(),
OpenXchangeClient.Model.AttendeeAndAlarm.t(),
keyword()
) ::
{:ok, OpenXchangeClient.Model.ChronosCalendarResultResponse.t()}
| {:error, Tesla.Env.t()}
def update_attendee(connection, session, folder, id, timestamp, body, opts \\ []) do
optional_params = %{
:recurrenceId => :query,
:sendInternalNotifications => :query,
:extendedEntities => :query,
:pushToken => :query,
:checkConflicts => :query,
:rangeStart => :query,
:rangeEnd => :query,
:expand => :query
}
%{}
|> method(:put)
|> url("/chronos?action=updateAttendee")
|> add_param(:query, :session, session)
|> add_param(:query, :folder, folder)
|> add_param(:query, :id, id)
|> add_param(:query, :timestamp, timestamp)
|> add_param(:body, :body, body)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.ChronosCalendarResultResponse{}}
])
end
@doc """
Updates an event.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- folder (String.t): ID of the folder who contains the events.
- id (String.t): ID of the event.
- timestamp (integer()): Timestamp of the last update of the event.
- update_body (InlineObject1):
- opts (KeywordList): [optional] Optional parameters
- :recurrence_id (String.t): The recurrence identifier.
- :recurrence_range (String.t): The targeted range specified with the recurrence id.
- :check_conflicts (boolean()): Whether to check for conflicts or not.
- :send_internal_notifications (boolean()): Specifies that attendees should be notified about the changes when saving a meeting or not.
- :extended_entities (boolean()): If set to 'true' attendees of internal users will be extended by a 'contact' field, which contains some of the contact fields of this user.
- :push_token (String.t): The client's push token to allow filtering of push events for modified calendar data
- :range_start (String.t): If expand is set to 'true' this parameter defines a lower inclusive limit as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which start on or after this date are returned.
- :range_end (String.t): If expand is set to 'true' this parameter defines a upper exclusive limit as a utc date-time value as specified in rfc 5545 chapter 3.3.5. E.g. \"20170708T220000Z\". Only events which end before this date are returned.
- :expand (boolean()): Defines if event series should be extended or not.
- :used_groups (String.t): In case the client resolves groups into single attendees the client can provide the ids of the groups he used (resolved) as a comma separated list. This way the usecount of those groups will be increased.
## Returns
{:ok, OpenXchangeClient.Model.ChronosCalendarResultResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec update_event(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
integer(),
OpenXchangeClient.Model.InlineObject1.t(),
keyword()
) ::
{:ok, OpenXchangeClient.Model.ChronosCalendarResultResponse.t()}
| {:error, Tesla.Env.t()}
def update_event(connection, session, folder, id, timestamp, update_body, opts \\ []) do
optional_params = %{
:recurrenceId => :query,
:recurrenceRange => :query,
:checkConflicts => :query,
:sendInternalNotifications => :query,
:extendedEntities => :query,
:pushToken => :query,
:rangeStart => :query,
:rangeEnd => :query,
:expand => :query,
:usedGroups => :query
}
%{}
|> method(:put)
|> url("/chronos?action=update")
|> add_param(:query, :session, session)
|> add_param(:query, :folder, folder)
|> add_param(:query, :id, id)
|> add_param(:query, :timestamp, timestamp)
|> add_param(:body, :body, update_body)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.ChronosCalendarResultResponse{}}
])
end
@doc """
Updates an event and its attachments.
#### Note It is possible to update multiple attachments at once. Therefore add additional form fields and replace \"[index]\" in `file_[index]` with the appropriate index, like `file_1`. The index always starts with 0 (mandatory attachment object). There can only be one json payload describing the EventData, the rest json payloads (if present) will simply be ignored. If the event already has attachments, then for each of those attachments their valid manageId must be provided as part of the attachment metadata. The absense of an already existing attachment for the event will result in the deletion of that attachment.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- folder (String.t): ID of the folder who contains the events.
- id (String.t): ID of the event.
- timestamp (integer()): Timestamp of the last update of the event.
- json0 (String.t): A JSON object containing an optional comment for the user to provide information about the update of the event under the key 'comment' and the event's data as described in [EventData](#/definitions/EventData) under the key 'data'.
- file0 (String.t): The attachment file as per `<input type=\\\"file\\\" />`.
- opts (KeywordList): [optional] Optional parameters
- :recurrence_id (String.t): The recurrence identifier.
- :check_conflicts (boolean()): Whether to check for conflicts or not.
- :send_internal_notifications (boolean()): Specifies that attendees should be notified about the changes when saving a meeting or not.
- :extended_entities (boolean()): If set to 'true' attendees of internal users will be extended by a 'contact' field, which contains some of the contact fields of this user.
- :used_groups (String.t): In case the client resolves groups into single attendees the client can provide the ids of the groups he used (resolved) as a comma separated list. This way the usecount of those groups will be increased.
## Returns
{:ok, String.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec update_event_with_attachments(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
integer(),
String.t(),
String.t(),
keyword()
) :: {:ok, String.t()} | {:error, Tesla.Env.t()}
def update_event_with_attachments(
connection,
session,
folder,
id,
timestamp,
json0,
file0,
opts \\ []
) do
optional_params = %{
:recurrenceId => :query,
:checkConflicts => :query,
:sendInternalNotifications => :query,
:extendedEntities => :query,
:usedGroups => :query
}
%{}
|> method(:post)
|> url("/chronos?action=update")
|> add_param(:query, :session, session)
|> add_param(:query, :folder, folder)
|> add_param(:query, :id, id)
|> add_param(:query, :timestamp, timestamp)
|> add_param(:form, :json_0, json0)
|> add_param(:file, :file_0, file0)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, false}
])
end
end