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/(#{UUID_FORMAT})\z}.freeze
TIME_FIELDS =
i[start_time end_time created_at updated_at].freeze
ASSOCIATION =
{
  event_type: EventType,
  event_guests: Guest,
  cancellation: InviteeCancellation,
  invitees_counter: InviteesCounter,
  location: Location
}.freeze

Constants included from ModelUtils

ModelUtils::UUID_FORMAT

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ModelUtils

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

Instance Attribute Details

#cancellationInviteeCancellation

Provides data pertaining to the cancellation of the Invitee.

Returns:



64
65
66
# File 'lib/calendly/models/event.rb', line 64

def cancellation
  @cancellation
end

#created_atTime

Moment when user record was first created.

Returns:

  • (Time)


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

def created_at
  @created_at
end

#end_timeTime

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

Returns:

  • (Time)


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

def end_time
  @end_time
end

#event_guestsArray<Guest>

Additional people added to an event by an invitee.

Returns:



80
81
82
# File 'lib/calendly/models/event.rb', line 80

def event_guests
  @event_guests
end

#event_membershipsArray<User>

Event membership list.

Returns:



76
77
78
# File 'lib/calendly/models/event.rb', line 76

def event_memberships
  @event_memberships
end

#event_typeEventType

Reference to Event Type associated with this event.

Returns:



60
61
62
# File 'lib/calendly/models/event.rb', line 60

def event_type
  @event_type
end

#invitees_counterInviteesCounter

invitees counter.

Returns:



68
69
70
# File 'lib/calendly/models/event.rb', line 68

def invitees_counter
  @invitees_counter
end

#locationCalendly::Location

location in this event.

Returns:



72
73
74
# File 'lib/calendly/models/event.rb', line 72

def location
  @location
end

#nameString

Name of the event.

Returns:

  • (String)


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

def name
  @name
end

#start_timeTime

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

Returns:

  • (Time)


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

def start_time
  @start_time
end

#statusString

Whether the event is active or canceled.

Returns:

  • (String)


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

def status
  @status
end

#updated_atTime

Moment when user record was last updated.

Returns:

  • (Time)


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

def updated_at
  @updated_at
end

#uriString

Canonical resource reference.

Returns:

  • (String)


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

def uri
  @uri
end

#uuidString

unique id of the Event object.

Returns:

  • (String)


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

def uuid
  @uuid
end

Instance Method Details

#fetchCalendly::Event

Get Scheduled Event associated with self.

Returns:

Raises:

Since:

  • 0.1.0



89
90
91
# File 'lib/calendly/models/event.rb', line 89

def fetch
  client.scheduled_event uuid
end

#invitees(options: nil) ⇒ 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:

  • options (Hash) (defaults to: nil)

    the optional request parameters. Optional.

  • opts (Hash)

    a customizable set of options

Options Hash (options:):

  • :count (Integer)

    Number of rows to return.

  • :email (String)

    Filter by email.

  • :page_token (String)

Returns:

Raises:

Since:

  • 0.1.0



108
109
110
111
112
113
# File 'lib/calendly/models/event.rb', line 108

def invitees(options: nil)
  return @cached_invitees if defined?(@cached_invitees) && @cached_invitees

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

#invitees!(options: nil) ⇒ Object

Since:

  • 0.2.0



116
117
118
119
# File 'lib/calendly/models/event.rb', line 116

def invitees!(options: nil)
  @cached_invitees = nil
  invitees options: options
end