Module: Office365::REST::Event

Includes:
Concerns::Base
Included in:
API
Defined in:
lib/office365/rest/event.rb

Constant Summary collapse

BASE_URI =
"/me/events"
CALENDARVIEW_URL =
"/me/calendarview"

Instance Method Summary collapse

Instance Method Details

#event(identifier) ⇒ Object

Raises:

  • (ArgumentError)


31
32
33
34
35
# File 'lib/office365/rest/event.rb', line 31

def event(identifier)
  raise ArgumentError, "Identifier must be provided" if identifier.nil? || identifier.empty?

  wrap_results(kclass: Models::Event, base_uri: [BASE_URI, identifier].join("/"), identifier: identifier)
end

#events(args = {}) ⇒ Object

params: args => { next_link: (nil / next_page_url) }

startdatetime: 2024-11-14T07:59:41.313Z
enddatetime: 2024-11-21T07:59:41.313Z

response { results: [], next_link: ‘…’ }



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/office365/rest/event.rb', line 16

def events(args = {})
  if args[:startdatetime] && args[:enddatetime]
    wrap_results(
      args.merge(
        kclass: Models::Event,
        base_uri: CALENDARVIEW_URL,
        startdatetime: args[:startdatetime],
        enddatetime: args[:enddatetime]
      )
    )
  else
    wrap_results(args.merge(kclass: Models::Event, base_uri: BASE_URI))
  end
end