class Calendly::OrganizationMembership
Calendly's organization membership model.
Constants
- ASSOCIATION
- TIME_FIELDS
- UUID_RE
Attributes
@return [Time] Moment when user record was first created.
@return [Organization] Reference to Organization
associated with this membership.
@return [String] User's role within the organization
@return [Time] Moment when user record was last updated.
@return [String] Canonical resource reference.
@return [Calendly::User] Primary account details of a specific user.
@return [String] unique id of the OrganizationMembership
object.
Public Instance Methods
Create a user scope webhook associated with self.
@param [String] url Canonical reference (unique identifier) for the resource. @param [Array<String>] events List of user events to subscribe to. options: invitee.created or invitee.canceled @param [String] signing_key secret key shared between your application and Calendly
. Optional. @return [Calendly::WebhookSubscription] @raise [Calendly::Error] if the url arg is empty. @raise [Calendly::Error] if the events arg is empty. @raise [Calendly::Error] if the organization.uri is empty. @raise [Calendly::ApiError] if the api returns error code. @since 0.1.3
# 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
Remove self from associated Organization
.
@raise [Calendly::Error] if the uuid is empty. @raise [Calendly::ApiError] if the api returns error code. @since 0.1.0
# File lib/calendly/models/organization_membership.rb, line 61 def delete client.delete_membership uuid end
Get Organization
Membership associated with self.
@return [Calendly::OrganizationMembership] @raise [Calendly::Error] if the uuid is empty. @raise [Calendly::ApiError] if the api returns error code. @since 0.1.0
# File lib/calendly/models/organization_membership.rb, line 51 def fetch client.membership uuid end
Get List of user scope Webhooks associated with self.
@param [Hash] options the optional request parameters. Optional. @option options [Integer] :count Number of rows to return. @option options [String] :page_token Pass this to get the next portion of collection. @option options [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values. Accepts comma-separated list of {field}:{direction} values. @return [Array<Calendly::WebhookSubscription>] @raise [Calendly::Error] if the organization.uri is empty. @raise [Calendly::Error] if the user.uri is empty. @raise [Calendly::ApiError] if the api returns error code. @since 0.1.3
# File lib/calendly/models/organization_membership.rb, line 78 def user_scope_webhooks(options: nil) user.webhooks options: options end
@since 0.2.0
# File lib/calendly/models/organization_membership.rb, line 83 def user_scope_webhooks!(options: nil) user.webhooks! options: options end
Private Instance Methods
Calendly::ModelUtils#after_set_attributes
# File lib/calendly/models/organization_membership.rb, line 105 def after_set_attributes(attrs) super attrs if user.is_a?(User) && user.current_organization.nil? && organization.is_a?(Organization) # rubocop:disable Style/GuardClause user.current_organization = organization end end
Calendly::ModelUtils#inspect_attributes
# File lib/calendly/models/organization_membership.rb, line 112 def inspect_attributes super + %i[role] end