Class: Calendly::Organization
- Inherits:
-
Object
- Object
- Calendly::Organization
- Includes:
- ModelUtils
- Defined in:
- lib/calendly/models/organization.rb
Overview
Calendly’s organization model.
Constant Summary collapse
- UUID_RE =
%r{\A#{Client::API_HOST}/organizations/(#{UUID_FORMAT})\z}.freeze
Constants included from ModelUtils
Instance Attribute Summary collapse
-
#uri ⇒ String
Canonical resource reference.
-
#uuid ⇒ String
unique id of the Organization object.
Instance Method Summary collapse
-
#create_invitation(email) ⇒ Calendly::OrganizationInvitation
Invite a person to an Organization.
-
#create_webhook(url, events, signing_key: nil) ⇒ Calendly::WebhookSubscription
Create a user scope webhook associated with self.
-
#event_types(options: nil) ⇒ Array<Calendly::EventType>
Returns all Event Types associated with self.
- #event_types!(options: nil) ⇒ Object
-
#invitations(options: nil) ⇒ Array<Calendly::OrganizationInvitation>
Get Organization Invitations.
- #invitations!(options: nil) ⇒ Object
-
#memberships(options: nil) ⇒ Array<Calendly::OrganizationMembership>
Get List memberships of all users belonging to self.
- #memberships!(options: nil) ⇒ Object
-
#scheduled_events(options: nil) ⇒ Array<Calendly::Event>
Returns all Scheduled Events associated with self.
- #scheduled_events!(options: nil) ⇒ Object
-
#webhooks(options: nil) ⇒ Array<Calendly::WebhookSubscription>
Get List of organization scope Webhooks associated with self.
- #webhooks!(options: nil) ⇒ Object
Methods included from ModelUtils
#client, #id, included, #initialize, #inspect
Instance Attribute Details
#uri ⇒ String
Canonical resource reference.
15 16 17 |
# File 'lib/calendly/models/organization.rb', line 15 def uri @uri end |
#uuid ⇒ String
unique id of the Organization object.
11 12 13 |
# File 'lib/calendly/models/organization.rb', line 11 def uuid @uuid end |
Instance Method Details
#create_invitation(email) ⇒ Calendly::OrganizationInvitation
Invite a person to an Organization.
77 78 79 |
# File 'lib/calendly/models/organization.rb', line 77 def create_invitation(email) client.create_invitation uuid, email end |
#create_webhook(url, events, signing_key: nil) ⇒ Calendly::WebhookSubscription
Create a user scope webhook associated with self.
173 174 175 |
# File 'lib/calendly/models/organization.rb', line 173 def create_webhook(url, events, signing_key: nil) client.create_webhook url, events, uri, signing_key: signing_key end |
#event_types(options: nil) ⇒ Array<Calendly::EventType>
Returns all Event Types associated with self.
Accepts comma-separated list of field:direction values.
94 95 96 97 98 99 |
# File 'lib/calendly/models/organization.rb', line 94 def event_types(options: nil) return @cached_event_types if defined?(@cached_event_types) && @cached_event_types request_proc = proc { |opts| client.event_types uri, options: opts } @cached_event_types = auto_pagination request_proc, end |
#event_types!(options: nil) ⇒ Object
102 103 104 105 |
# File 'lib/calendly/models/organization.rb', line 102 def event_types!(options: nil) @cached_event_types = nil event_types options: end |
#invitations(options: nil) ⇒ Array<Calendly::OrganizationInvitation>
Get Organization Invitations.
Accepts comma-separated list of field:direction values.
55 56 57 58 59 60 |
# File 'lib/calendly/models/organization.rb', line 55 def invitations(options: nil) return @cached_invitations if defined?(@cached_invitations) && @cached_invitations request_proc = proc { |opts| client.invitations uuid, options: opts } @cached_invitations = auto_pagination request_proc, end |
#invitations!(options: nil) ⇒ Object
63 64 65 66 |
# File 'lib/calendly/models/organization.rb', line 63 def invitations!(options: nil) @cached_invitations = nil invitations options: end |
#memberships(options: nil) ⇒ Array<Calendly::OrganizationMembership>
Get List memberships of all users belonging to self.
28 29 30 31 32 33 |
# File 'lib/calendly/models/organization.rb', line 28 def memberships(options: nil) return @cached_memberships if defined?(@cached_memberships) && @cached_memberships request_proc = proc { |opts| client.memberships uri, options: opts } @cached_memberships = auto_pagination request_proc, end |
#memberships!(options: nil) ⇒ Object
36 37 38 39 |
# File 'lib/calendly/models/organization.rb', line 36 def memberships!(options: nil) @cached_memberships = nil memberships options: end |
#scheduled_events(options: nil) ⇒ Array<Calendly::Event>
Returns all Scheduled Events associated with self.
Accepts comma-separated list of field:direction values.
123 124 125 126 127 128 |
# File 'lib/calendly/models/organization.rb', line 123 def scheduled_events(options: nil) return @cached_scheduled_events if defined?(@cached_scheduled_events) && @cached_scheduled_events request_proc = proc { |opts| client.scheduled_events uri, options: opts } @cached_scheduled_events = auto_pagination request_proc, end |
#scheduled_events!(options: nil) ⇒ Object
131 132 133 134 |
# File 'lib/calendly/models/organization.rb', line 131 def scheduled_events!(options: nil) @cached_scheduled_events = nil scheduled_events options: end |
#webhooks(options: nil) ⇒ Array<Calendly::WebhookSubscription>
Get List of organization scope Webhooks associated with self.
Accepts comma-separated list of field:direction values.
148 149 150 151 152 153 |
# File 'lib/calendly/models/organization.rb', line 148 def webhooks(options: nil) return @cached_webhooks if defined?(@cached_webhooks) && @cached_webhooks request_proc = proc { |opts| client.webhooks uri, options: opts } @cached_webhooks = auto_pagination request_proc, end |
#webhooks!(options: nil) ⇒ Object
156 157 158 159 |
# File 'lib/calendly/models/organization.rb', line 156 def webhooks!(options: nil) @cached_webhooks = nil webhooks options: end |