View Source CalDAVClient.Event (caldav_client v2.0.0)

Allows for managing events on the calendar server.

Link to this section Summary

Functions

Returns an event with the specified UID property (see RFC 4791, section 7.8.6).

Returns a specific event in the iCalendar format along with its ETag.

Retrieves all events or its occurrences within a specific time range (see RFC 4791, section 7.8.1).

Retrieves all events or its occurrences having an VALARM within a specific time range (see RFC 4791, section 7.8.5).

Retrieves all occurrences of events for given XML request body.

Link to this section Types

Specs

t() :: %CalDAVClient.Event{
  etag: String.t(),
  icalendar: String.t(),
  url: String.t()
}

Link to this section Functions

Link to this function

create(caldav_client, event_url, event_icalendar)

View Source

Specs

create(
  CalDAVClient.Client.t(),
  event_url :: String.t(),
  event_icalendar :: String.t()
) ::
  {:ok, etag :: String.t() | nil} | {:error, any()}

Creates an event (see RFC 4791, section 5.3.2).

Link to this function

delete(caldav_client, event_url, opts \\ [])

View Source

Specs

delete(CalDAVClient.Client.t(), event_url :: String.t(), opts :: keyword()) ::
  :ok | {:error, any()}

Deletes a specific event.

options

Options

  • etag - a specific ETag used to ensure that the client overwrites the latest version of the event.
Link to this function

find_by_uid(caldav_client, calendar_url, event_uid)

View Source

Specs

find_by_uid(
  CalDAVClient.Client.t(),
  calendar_url :: String.t(),
  event_uid :: String.t()
) ::
  {:ok, t()} | {:error, any()}

Returns an event with the specified UID property (see RFC 4791, section 7.8.6).

Link to this function

get(caldav_client, event_url)

View Source

Specs

get(CalDAVClient.Client.t(), event_url :: String.t()) ::
  {:ok, icalendar :: String.t(), etag :: String.t()} | {:error, any()}

Returns a specific event in the iCalendar format along with its ETag.

Link to this function

get_events(caldav_client, calendar_url, from, to, opts \\ [])

View Source

Specs

get_events(
  CalDAVClient.Client.t(),
  calendar_url :: String.t(),
  from :: DateTime.t(),
  to :: DateTime.t(),
  opts :: keyword()
) :: {:ok, [t()]} | {:error, any()}

Retrieves all events or its occurrences within a specific time range (see RFC 4791, section 7.8.1).

options

Options

  • expand - if true, recurring events will be expanded to occurrences, defaults to false.
Link to this function

get_events_by_alarm(caldav_client, calendar_url, from, to, opts \\ [])

View Source

Specs

get_events_by_alarm(
  CalDAVClient.Client.t(),
  calendar_url :: String.t(),
  from :: DateTime.t(),
  to :: DateTime.t(),
  opts :: keyword()
) :: {:ok, [t()]} | {:error, any()}

Retrieves all events or its occurrences having an VALARM within a specific time range (see RFC 4791, section 7.8.5).

options

Options

  • expand - if true, recurring events will be expanded to occurrences, defaults to false.
  • event_from - start of time range for events or occurrences, defaults to 0000-00-00T00:00:00Z.
  • event_to - end of time range for events or occurrences, defaults to 9999-12-31T23:59:59Z.
Link to this function

get_events_by_xml(caldav_client, calendar_url, request_xml)

View Source

Specs

get_events_by_xml(
  CalDAVClient.Client.t(),
  calendar_url :: String.t(),
  request_xml :: String.t()
) :: {:ok, [t()]} | {:error, any()}

Retrieves all occurrences of events for given XML request body.

Link to this function

update(caldav_client, event_url, event_icalendar, opts \\ [])

View Source

Specs

update(
  CalDAVClient.Client.t(),
  event_url :: String.t(),
  event_icalendar :: String.t(),
  opts :: keyword()
) :: {:ok, etag :: String.t() | nil} | {:error, any()}

Updates a specific event (see RFC 4791, section 5.3.2).

options

Options

  • etag - a specific ETag used to ensure that the client overwrites the latest version of the event.