Class: Calendly::Invitee

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

Overview

Calendly’s invitee model. An individual who has been invited to meet with a Calendly member.

Constant Summary collapse

UUID_RE =
%r{\A#{Client::API_HOST}/scheduled_events/(#{UUID_FORMAT})/invitees/(#{UUID_FORMAT})\z}.freeze
UUID_RE_INDEX =
2
TIME_FIELDS =
%i[created_at updated_at].freeze

Constants included from ModelUtils

ModelUtils::UUID_FORMAT

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ModelUtils

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

Instance Attribute Details

#cancel_urlString

Link to cancelling the event for the invitee.

Returns:

  • (String)


83
84
85
# File 'lib/calendly/models/invitee.rb', line 83

def cancel_url
  @cancel_url
end

#cancellationInviteeCancellation

Returns Provides data pertaining to the cancellation of the Invitee.

Returns:



98
99
100
# File 'lib/calendly/models/invitee.rb', line 98

def cancellation
  @cancellation
end

#created_atTime

Moment when user record was first created.

Returns:

  • (Time)


91
92
93
# File 'lib/calendly/models/invitee.rb', line 91

def created_at
  @created_at
end

#emailString

The invitee’s email address.

Returns:

  • (String)


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

def email
  @email
end

#eventEvent

Reference to Event associated with this invitee.

Returns:



109
110
111
# File 'lib/calendly/models/invitee.rb', line 109

def event
  @event
end

#first_nameString

The first name of the invitee who booked the event when the event type is configured to use separate fields for first name and last name. Null when event type is configured to use a single field for name.

Returns:

  • (String)


49
50
51
# File 'lib/calendly/models/invitee.rb', line 49

def first_name
  @first_name
end

#last_nameString

The last name of the invitee who booked the event when the event type is configured to use separate fields for first name and last name. Null when event type is configured to use a single field for name.

Returns:

  • (String)


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

def last_name
  @last_name
end

#nameString

The invitee’s human-readable name.

Returns:

  • (String)


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

def name
  @name
end

#new_inviteeString?

Link to new invitee, after reschedule.

Returns:

  • (String, nil)


79
80
81
# File 'lib/calendly/models/invitee.rb', line 79

def new_invitee
  @new_invitee
end

#no_showInviteeNoShow?

Provides data pertaining to the associated no show for the Invitee.

Returns:



105
106
107
# File 'lib/calendly/models/invitee.rb', line 105

def no_show
  @no_show
end

#old_inviteeString?

Reference to old Invitee instance that got rescheduled.

Returns:

  • (String, nil)


75
76
77
# File 'lib/calendly/models/invitee.rb', line 75

def old_invitee
  @old_invitee
end

#paymentInviteePayment

Returns Invitee payment.

Returns:



101
102
103
# File 'lib/calendly/models/invitee.rb', line 101

def payment
  @payment
end

#questions_and_answersArray<Calendly::InviteeQuestionAndAnswer>

A collection of form responses from the invitee.



113
114
115
# File 'lib/calendly/models/invitee.rb', line 113

def questions_and_answers
  @questions_and_answers
end

#reschedule_urlString

Link to rescheduling the event for the invitee.

Returns:

  • (String)


87
88
89
# File 'lib/calendly/models/invitee.rb', line 87

def reschedule_url
  @reschedule_url
end

#rescheduledBoolean

Indicates if this invitee has rescheduled. If true, a reference to the new Invitee instance is provided in the new_invitee field.

Returns:

  • (Boolean)


71
72
73
# File 'lib/calendly/models/invitee.rb', line 71

def rescheduled
  @rescheduled
end

#statusString

Whether the invitee has canceled or is still active.

Returns:

  • (String)


58
59
60
# File 'lib/calendly/models/invitee.rb', line 58

def status
  @status
end

#text_reminder_numberString

Text (SMS) reminder phone number.

Returns:

  • (String)


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

def text_reminder_number
  @text_reminder_number
end

#timezoneString

Timezone offest to use when presenting time information to invitee.

Returns:

  • (String)


62
63
64
# File 'lib/calendly/models/invitee.rb', line 62

def timezone
  @timezone
end

#trackingCalendly::InviteeTracking



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

def tracking
  @tracking
end

#updated_atTime

Moment when user record was last updated.

Returns:

  • (Time)


95
96
97
# File 'lib/calendly/models/invitee.rb', line 95

def updated_at
  @updated_at
end

#uriString

Canonical resource reference.

Returns:

  • (String)


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

def uri
  @uri
end

#uuidString

unique id of the Invitee object.

Returns:

  • (String)


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

def uuid
  @uuid
end

Class Method Details

.associationObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/calendly/models/invitee.rb', line 12

def self.association
  {
    event: Event,
    cancellation: InviteeCancellation,
    payment: InviteePayment,
    no_show: InviteeNoShow,
    questions_and_answers: InviteeQuestionAndAnswer,
    tracking: InviteeTracking
  }
end

.extract_event_uuid(str) ⇒ Object



23
24
25
26
27
28
# File 'lib/calendly/models/invitee.rb', line 23

def self.extract_event_uuid(str)
  m = extract_uuid_match str
  return unless m

  m[1]
end

Instance Method Details

#fetchCalendly::Invitee

Get Event Invitee associated with self.

Returns:

Raises:

Since:

  • 0.1.0



126
127
128
# File 'lib/calendly/models/invitee.rb', line 126

def fetch
  client.event_invitee event&.uuid, uuid
end

#mark_no_showCalendly::InviteeNoShow

Marks as a No Show. If already marked as a No Show, do nothing.

Returns:

Raises:

Since:

  • 0.9.0



138
139
140
141
142
# File 'lib/calendly/models/invitee.rb', line 138

def mark_no_show
  return no_show if no_show

  @no_show = client.create_invitee_no_show uri
end

#unmark_no_showtrue?

Unmarks as a No Show. If already unmarked as a No Show, do nothing.

Returns:

  • (true, nil)

Raises:

Since:

  • 0.9.0



152
153
154
155
156
157
158
# File 'lib/calendly/models/invitee.rb', line 152

def unmark_no_show
  return unless no_show

  no_show.delete
  @no_show = nil
  true
end