# `GraphApi.Calendar`
[🔗](https://github.com/keenmate/microsoft_graph/blob/v1.0.0-rc.1/lib/graph_api/resources/calendar.ex#L1)

Operations on calendar resources (`/users/{id}/events`, `/users/{id}/calendarView`, etc.).

## Examples

    {:ok, %{"value" => events}} = GraphApi.Calendar.list_events("user-id")

    {:ok, %{"value" => view}} = GraphApi.Calendar.calendar_view("user-id",
      start_date_time: "2024-01-01T00:00:00",
      end_date_time: "2024-01-31T23:59:59"
    )

# `calendar_view`

```elixir
@spec calendar_view(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, term()}
```

Gets the calendar view (events in a date range) for a user.

## Required Options

* `:start_date_time` - ISO 8601 start datetime string
* `:end_date_time` - ISO 8601 end datetime string

## Examples

    GraphApi.Calendar.calendar_view("user-id",
      start_date_time: "2024-01-01T00:00:00",
      end_date_time: "2024-01-31T23:59:59"
    )

# `calendar_view_query`

```elixir
@spec calendar_view_query(
  String.t(),
  keyword()
) :: GraphApi.Batch.Request.t()
```

Batch query variant of `calendar_view/2`. Embeds start/end datetimes in the URL.

# `create_event`

```elixir
@spec create_event(String.t(), map(), keyword()) :: {:ok, map()} | {:error, term()}
```

Creates an event on a user's default calendar.

# `create_event_query`

```elixir
@spec create_event_query(String.t(), map(), keyword()) :: GraphApi.Batch.Request.t()
```

Batch query variant of `create_event/3`.

# `delete_event`

```elixir
@spec delete_event(String.t(), String.t(), keyword()) :: :ok | {:error, term()}
```

Deletes an event.

# `delete_event_query`

```elixir
@spec delete_event_query(String.t(), String.t(), keyword()) ::
  GraphApi.Batch.Request.t()
```

Batch query variant of `delete_event/3`.

# `events_delta`

```elixir
@spec events_delta(
  String.t(),
  keyword()
) :: {:ok, GraphApi.Delta.delta_page()} | {:error, term()}
```

Delta query for a user's calendar events. Returns event changes since the last sync.

# `events_delta_query`

```elixir
@spec events_delta_query(
  String.t(),
  keyword()
) :: GraphApi.Batch.Request.t()
```

Batch query variant of `events_delta/2`.

# `get_event`

```elixir
@spec get_event(String.t(), String.t(), keyword()) :: {:ok, map()} | {:error, term()}
```

Gets a specific event.

# `get_event_query`

```elixir
@spec get_event_query(String.t(), String.t(), keyword()) :: GraphApi.Batch.Request.t()
```

Batch query variant of `get_event/3`.

# `list_calendars`

```elixir
@spec list_calendars(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, term()}
```

Lists a user's calendars.

# `list_calendars_query`

```elixir
@spec list_calendars_query(
  String.t(),
  keyword()
) :: GraphApi.Batch.Request.t()
```

Batch query variant of `list_calendars/2`.

# `list_events`

```elixir
@spec list_events(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, term()}
```

Lists events on a user's default calendar.

# `list_events_query`

```elixir
@spec list_events_query(
  String.t(),
  keyword()
) :: GraphApi.Batch.Request.t()
```

Batch query variant of `list_events/2`.

# `update_event`

```elixir
@spec update_event(String.t(), String.t(), map(), keyword()) ::
  {:ok, map()} | :ok | {:error, term()}
```

Updates an event.

# `update_event_query`

```elixir
@spec update_event_query(String.t(), String.t(), map(), keyword()) ::
  GraphApi.Batch.Request.t()
```

Batch query variant of `update_event/4`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
