Class: Calendly::Event

Inherits:
Object
  • Object
show all
Includes:
ModelUtils
Defined in:
lib/calendly/models/event.rb

Overview

Calendly’s event model. A meeting that has been scheduled

Constant Summary collapse

UUID_RE =
%r{\A#{Client::API_HOST}/scheduled_events/(\w+)\z}.freeze
TIME_FIELDS =
i[start_time end_time created_at updated_at].freeze
ASSOCIATION =
{event_type: EventType}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ModelUtils

#client, #id, included, #initialize, #inspect

Instance Attribute Details

#created_atTime

Moment when user record was first created.

Returns:

  • (Time)


36
37
38
# File 'lib/calendly/models/event.rb', line 36

def created_at
  @created_at
end

#end_timeTime

Moment when event is (or was) scheduled to end.

Returns:

  • (Time)


33
34
35
# File 'lib/calendly/models/event.rb', line 33

def end_time
  @end_time
end

#event_typeEventType

Reference to Event Type associated with this event.

Returns:



43
44
45
# File 'lib/calendly/models/event.rb', line 43

def event_type
  @event_type
end

#invitees_counter_activeInteger

number of active invitees in this event.

Returns:

  • (Integer)


54
55
56
# File 'lib/calendly/models/event.rb', line 54

def invitees_counter_active
  @invitees_counter_active
end

#invitees_counter_limitInteger

max invitees in this event.

Returns:

  • (Integer)


57
58
59
# File 'lib/calendly/models/event.rb', line 57

def invitees_counter_limit
  @invitees_counter_limit
end

#invitees_counter_totalInteger

number of total invitees in this event.

Returns:

  • (Integer)


51
52
53
# File 'lib/calendly/models/event.rb', line 51

def invitees_counter_total
  @invitees_counter_total
end

#locationCalendly::Location

location in this event.

Returns:



47
48
49
# File 'lib/calendly/models/event.rb', line 47

def location
  @location
end

#nameString

Name of the event.

Returns:

  • (String)


24
25
26
# File 'lib/calendly/models/event.rb', line 24

def name
  @name
end

#start_timeTime

Moment when event is (or was) scheduled to begin.

Returns:

  • (Time)


30
31
32
# File 'lib/calendly/models/event.rb', line 30

def start_time
  @start_time
end

#statusString

Whether the event is active or canceled.

Returns:

  • (String)


27
28
29
# File 'lib/calendly/models/event.rb', line 27

def status
  @status
end

#updated_atTime

Moment when user record was last updated.

Returns:

  • (Time)


39
40
41
# File 'lib/calendly/models/event.rb', line 39

def updated_at
  @updated_at
end

#uriString

Canonical resource reference.

Returns:

  • (String)


21
22
23
# File 'lib/calendly/models/event.rb', line 21

def uri
  @uri
end

#uuidString

unique id of the Event object.

Returns:

  • (String)


18
19
20
# File 'lib/calendly/models/event.rb', line 18

def uuid
  @uuid
end

Instance Method Details

#fetchCalendly::Event

Get Scheduled Event associated with self.

Returns:

Raises:

Since:

  • 0.1.0



66
67
68
# File 'lib/calendly/models/event.rb', line 66

def fetch
  client.scheduled_event uuid
end

#invitees(opts = {}) ⇒ Array<Calendly::Invitee>

Returns all Event Invitees associated with self.

Pass this to get the next portion of collection. Accepts comma-separated list of field:direction values.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional request parameters.

Options Hash (opts):

  • :count (Integer)

    Number of rows to return.

  • :email (String)

    Filter by email.

  • :page_token (String)
  • :sort (String)

    Order results by the specified field and directin.

  • :status (String)

    Whether the scheduled event is active or canceled.

Returns:

Raises:

Since:

  • 0.1.0



85
86
87
88
89
90
# File 'lib/calendly/models/event.rb', line 85

def invitees(opts = {})
  return @cached_invitees if @cached_invitees

  request_proc = proc { |options| client.event_invitees uuid, options }
  @cached_invitees = auto_pagination request_proc, opts
end

#invitees!(opts = {}) ⇒ Object

Since:

  • 0.2.0



93
94
95
96
# File 'lib/calendly/models/event.rb', line 93

def invitees!(opts = {})
  @cached_invitees = nil
  invitees opts
end