Class: Calendly::OrganizationMembership
- Inherits:
-
Object
- Object
- Calendly::OrganizationMembership
- Includes:
- ModelUtils
- Defined in:
- lib/calendly/models/organization_membership.rb
Overview
Calendly’s organization membership model.
Constant Summary collapse
- UUID_RE =
%r{\A#{Client::API_HOST}/organization_memberships/(#{UUID_FORMAT})\z}.freeze
- TIME_FIELDS =
%i[created_at updated_at].freeze
Constants included from ModelUtils
Instance Attribute Summary collapse
-
#created_at ⇒ Time
Moment when user record was first created.
-
#organization ⇒ Calendly::Organization
Reference to Organization associated with this membership.
-
#role ⇒ String
User’s role within the organization.
-
#updated_at ⇒ Time
Moment when user record was last updated.
-
#uri ⇒ String
Canonical resource reference.
-
#user ⇒ Calendly::User
Primary account details of a specific user.
-
#uuid ⇒ String
unique id of the OrganizationMembership object.
Class Method Summary collapse
Instance Method Summary collapse
-
#create_user_scope_webhook(url, events, signing_key: nil) ⇒ Calendly::WebhookSubscription
Create a user scope webhook associated with self.
-
#delete ⇒ Object
Remove self from associated Organization.
-
#fetch ⇒ Calendly::OrganizationMembership
Get Organization Membership associated with self.
-
#user_scope_webhooks(options: nil) ⇒ Array<Calendly::WebhookSubscription>
Get List of user scope Webhooks associated with self.
- #user_scope_webhooks!(options: nil) ⇒ Object
Methods included from ModelUtils
#client, #id, included, #initialize, #inspect
Instance Attribute Details
#created_at ⇒ Time
Moment when user record was first created.
31 32 33 |
# File 'lib/calendly/models/organization_membership.rb', line 31 def created_at @created_at end |
#organization ⇒ Calendly::Organization
Reference to Organization associated with this membership.
43 44 45 |
# File 'lib/calendly/models/organization_membership.rb', line 43 def organization @organization end |
#role ⇒ String
User’s role within the organization
27 28 29 |
# File 'lib/calendly/models/organization_membership.rb', line 27 def role @role end |
#updated_at ⇒ Time
Moment when user record was last updated.
35 36 37 |
# File 'lib/calendly/models/organization_membership.rb', line 35 def updated_at @updated_at end |
#uri ⇒ String
Canonical resource reference.
23 24 25 |
# File 'lib/calendly/models/organization_membership.rb', line 23 def uri @uri end |
#user ⇒ Calendly::User
Primary account details of a specific user.
39 40 41 |
# File 'lib/calendly/models/organization_membership.rb', line 39 def user @user end |
#uuid ⇒ String
unique id of the OrganizationMembership object.
19 20 21 |
# File 'lib/calendly/models/organization_membership.rb', line 19 def uuid @uuid end |
Class Method Details
.association ⇒ Object
10 11 12 13 14 15 |
# File 'lib/calendly/models/organization_membership.rb', line 10 def self.association { user: User, organization: Organization } end |
Instance Method Details
#create_user_scope_webhook(url, events, signing_key: nil) ⇒ Calendly::WebhookSubscription
Create a user scope webhook associated with self.
99 100 101 |
# File 'lib/calendly/models/organization_membership.rb', line 99 def create_user_scope_webhook(url, events, signing_key: nil) user.create_webhook url, events, signing_key: signing_key end |
#delete ⇒ Object
Remove self from associated Organization.
62 63 64 |
# File 'lib/calendly/models/organization_membership.rb', line 62 def delete client.delete_membership uuid end |
#fetch ⇒ Calendly::OrganizationMembership
Get Organization Membership associated with self.
52 53 54 |
# File 'lib/calendly/models/organization_membership.rb', line 52 def fetch client.membership uuid end |
#user_scope_webhooks(options: nil) ⇒ Array<Calendly::WebhookSubscription>
Get List of user scope Webhooks associated with self.
78 79 80 |
# File 'lib/calendly/models/organization_membership.rb', line 78 def user_scope_webhooks(options: nil) user.webhooks options: end |
#user_scope_webhooks!(options: nil) ⇒ Object
83 84 85 |
# File 'lib/calendly/models/organization_membership.rb', line 83 def user_scope_webhooks!(options: nil) user.webhooks! options: end |