Class: Calendly::OrganizationInvitation
- Inherits:
-
Object
- Object
- Calendly::OrganizationInvitation
- 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/\w+/invitations/(\w+)\z}.freeze
- TIME_FIELDS =
%i[created_at updated_at last_sent_at].freeze
- ASSOCIATION =
{user: User, organization: Organization}.freeze
Instance Attribute Summary collapse
-
#created_at ⇒ Time
Moment when user record was first created.
-
#email ⇒ String
Invited person’s email.
-
#last_sent_at ⇒ Time
Moment when the last invitation was sent.
-
#organization ⇒ Organization
Reference to Organization associated with this invitation.
-
#status ⇒ String
Invitation status.
-
#updated_at ⇒ Time
Moment when user record was last updated.
-
#uri ⇒ String
Canonical resource reference.
-
#user ⇒ User
If a person accepted the invitation, a reference to their User.
-
#uuid ⇒ String
unique id of the OrganizationInvitation object.
Instance Method Summary collapse
-
#delete ⇒ true
Revoke self Invitation.
-
#fetch ⇒ Calendly::OrganizationInvitation
Get Organization Invitation associated with self.
Methods included from ModelUtils
#client, #id, included, #initialize, #inspect
Instance Attribute Details
#created_at ⇒ Time
Moment when user record was first created.
25 26 27 |
# File 'lib/calendly/models/organization_invitation.rb', line 25 def created_at @created_at end |
#email ⇒ String
Invited person’s email.
19 20 21 |
# File 'lib/calendly/models/organization_invitation.rb', line 19 def email @email end |
#last_sent_at ⇒ Time
Moment when the last invitation was sent.
31 32 33 |
# File 'lib/calendly/models/organization_invitation.rb', line 31 def last_sent_at @last_sent_at end |
#organization ⇒ Organization
Reference to Organization associated with this invitation.
35 36 37 |
# File 'lib/calendly/models/organization_invitation.rb', line 35 def organization @organization end |
#status ⇒ String
Invitation status.
22 23 24 |
# File 'lib/calendly/models/organization_invitation.rb', line 22 def status @status end |
#updated_at ⇒ Time
Moment when user record was last updated.
28 29 30 |
# File 'lib/calendly/models/organization_invitation.rb', line 28 def updated_at @updated_at end |
#uri ⇒ String
Canonical resource reference.
16 17 18 |
# File 'lib/calendly/models/organization_invitation.rb', line 16 def uri @uri end |
#user ⇒ User
If a person accepted the invitation, a reference to their User.
39 40 41 |
# File 'lib/calendly/models/organization_invitation.rb', line 39 def user @user end |
#uuid ⇒ String
unique id of the OrganizationInvitation object.
13 14 15 |
# File 'lib/calendly/models/organization_invitation.rb', line 13 def uuid @uuid end |
Instance Method Details
#delete ⇒ true
Revoke self Invitation.
62 63 64 65 |
# File 'lib/calendly/models/organization_invitation.rb', line 62 def delete org_uuid = organization.uuid if organization client.delete_invitation org_uuid, uuid end |
#fetch ⇒ Calendly::OrganizationInvitation
Get Organization Invitation associated with self.
49 50 51 52 |
# File 'lib/calendly/models/organization_invitation.rb', line 49 def fetch org_uuid = organization.uuid if organization client.invitation org_uuid, uuid end |