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
- ASSOCIATION =
{user: User, organization: Organization}.freeze
Constants included from ModelUtils
Instance Attribute Summary collapse
-
#created_at ⇒ Time
Moment when user record was first created.
-
#organization ⇒ 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.
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.
30 31 32 |
# File 'lib/calendly/models/organization_membership.rb', line 30 def created_at @created_at end |
#organization ⇒ Organization
Reference to Organization associated with this membership.
42 43 44 |
# File 'lib/calendly/models/organization_membership.rb', line 42 def organization @organization end |
#role ⇒ String
User’s role within the organization
26 27 28 |
# File 'lib/calendly/models/organization_membership.rb', line 26 def role @role end |
#updated_at ⇒ Time
Moment when user record was last updated.
34 35 36 |
# File 'lib/calendly/models/organization_membership.rb', line 34 def updated_at @updated_at end |
#uri ⇒ String
Canonical resource reference.
22 23 24 |
# File 'lib/calendly/models/organization_membership.rb', line 22 def uri @uri end |
#user ⇒ Calendly::User
Primary account details of a specific user.
38 39 40 |
# File 'lib/calendly/models/organization_membership.rb', line 38 def user @user end |
#uuid ⇒ String
unique id of the OrganizationMembership object.
18 19 20 |
# File 'lib/calendly/models/organization_membership.rb', line 18 def uuid @uuid 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.
61 62 63 |
# File 'lib/calendly/models/organization_membership.rb', line 61 def delete client.delete_membership uuid end |
#fetch ⇒ Calendly::OrganizationMembership
Get Organization Membership associated with self.
51 52 53 |
# File 'lib/calendly/models/organization_membership.rb', line 51 def fetch client.membership uuid end |
#user_scope_webhooks(options: nil) ⇒ Array<Calendly::WebhookSubscription>
Get List of user scope Webhooks associated with self.
Accepts comma-separated list of field:direction values.
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 |