Class: Calendly::OrganizationInvitation

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

Overview

Calendly’s organization invitation model.

Constant Summary collapse

UUID_RE =
%r{\A#{Client::API_HOST}/organizations/#{UUID_FORMAT}/invitations/(#{UUID_FORMAT})\z}.freeze
TIME_FIELDS =
%i[created_at updated_at last_sent_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

#created_atTime

Moment when user record was first created.

Returns:

  • (Time)


35
36
37
# File 'lib/calendly/models/organization_invitation.rb', line 35

def created_at
  @created_at
end

#emailString

Invited person’s email.

Returns:

  • (String)


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

def email
  @email
end

#last_sent_atTime

Moment when the last invitation was sent.

Returns:

  • (Time)


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

def last_sent_at
  @last_sent_at
end

#organizationCalendly::Organization

Reference to Organization associated with this invitation.



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

def organization
  @organization
end

#statusString

Invitation status.

Returns:

  • (String)


31
32
33
# File 'lib/calendly/models/organization_invitation.rb', line 31

def status
  @status
end

#updated_atTime

Moment when user record was last updated.

Returns:

  • (Time)


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

def updated_at
  @updated_at
end

#uriString

Canonical resource reference.

Returns:

  • (String)


23
24
25
# File 'lib/calendly/models/organization_invitation.rb', line 23

def uri
  @uri
end

#userCalendly::User

If a person accepted the invitation, a reference to their User.

Returns:



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

def user
  @user
end

#uuidString

unique id of the OrganizationInvitation object.

Returns:

  • (String)


19
20
21
# File 'lib/calendly/models/organization_invitation.rb', line 19

def uuid
  @uuid
end

Class Method Details

.associationObject



10
11
12
13
14
15
# File 'lib/calendly/models/organization_invitation.rb', line 10

def self.association
  {
    user: User,
    organization: Organization
  }
end

Instance Method Details

#deletetrue

Revoke self Invitation.

Returns:

  • (true)

Raises:

Since:

  • 0.1.0



73
74
75
# File 'lib/calendly/models/organization_invitation.rb', line 73

def delete
  client.delete_invitation organization&.uuid, uuid
end

#fetchCalendly::OrganizationInvitation

Get Organization Invitation associated with self.

Returns:

Raises:

Since:

  • 0.1.0



61
62
63
# File 'lib/calendly/models/organization_invitation.rb', line 61

def fetch
  client.invitation organization&.uuid, uuid
end