JSCalendar.Group (JSCalendar v0.1.0)

Copy Markdown View Source

A collection of events and tasks (RFC 8984 ยง5.3).

entries is mandatory and mixed โ€” events and tasks together โ€” and RFC 8984 requires that entries of a type the reader does not recognise are ignored rather than treated as an error. Those are kept in unknown_entries instead of discarded, so a group can be read, changed and written back without quietly losing the members this implementation did not understand.

Summary

Types

t()

A group of calendar objects.

Functions

Read this object from a decoded JSON map.

The @type value RFC 8984 gives this object.

Write this object back to a JSON-ready map.

Types

t()

@type t() :: %JSCalendar.Group{
  alerts: term(),
  categories: term(),
  color: term(),
  created: term(),
  description: term(),
  description_content_type: term(),
  entries: [JSCalendar.Event.t() | JSCalendar.Task.t()] | nil,
  excluded: term(),
  excluded_recurrence_rules: term(),
  extra: map(),
  free_busy_status: term(),
  keywords: term(),
  links: term(),
  locale: term(),
  localizations: term(),
  locations: term(),
  method: term(),
  participants: term(),
  priority: term(),
  privacy: term(),
  prod_id: term(),
  recurrence_id: term(),
  recurrence_id_time_zone: term(),
  recurrence_overrides: term(),
  recurrence_rules: term(),
  related_to: term(),
  reply_to: term(),
  request_status: term(),
  sent_by: term(),
  sequence: term(),
  show_without_time: term(),
  source: JSCalendar.Link.t() | nil,
  time_zone: term(),
  time_zones: term(),
  title: String.t(),
  uid: String.t() | nil,
  updated: term(),
  use_default_alerts: term(),
  virtual_locations: term()
}

A group of calendar objects.

Functions

from_map(map)

@spec from_map(map()) :: {:ok, struct()} | {:error, term()}

Read this object from a decoded JSON map.

Arguments

Returns

  • {:ok, object}; or

  • {:error, reason} when a property does not match its declared type.

jscalendar_type()

@spec jscalendar_type() :: String.t()

The @type value RFC 8984 gives this object.

Returns

  • the type name as a string.

to_map(object)

@spec to_map(struct()) :: map()

Write this object back to a JSON-ready map.

Arguments

  • object is a t/0.

Returns