Class: Calendly::WebhookSubscription
- Inherits:
-
Object
- Object
- Calendly::WebhookSubscription
- Includes:
- ModelUtils
- Defined in:
- lib/calendly/models/webhook_subscription.rb
Overview
Calendly’s webhook model.
Constant Summary collapse
- UUID_RE =
%r{\A#{Client::API_HOST}/webhook_subscriptions/(#{UUID_FORMAT})\z}.freeze
- TIME_FIELDS =
%i[created_at updated_at retry_started_at].freeze
Constants included from ModelUtils
Instance Attribute Summary collapse
-
#callback_url ⇒ String
The callback URL to use when the event is triggered.
-
#created_at ⇒ Time
The moment when the webhook subscription was created.
-
#creator ⇒ Calendly::User
The user who created the webhook subscription.
-
#events ⇒ Array<String>
A list of events to which the webhook is subscribed.
-
#organization ⇒ Calendly::Organization
The organization that’s associated with the webhook subscription.
-
#retry_started_at ⇒ Time
The date and time the webhook subscription is retried.
-
#scope ⇒ String
The scope of the webhook subscription.
-
#state ⇒ String
Indicates if the webhook subscription is “active” or “disabled”.
-
#updated_at ⇒ Time
The moment when the webhook subscription was last updated.
-
#uri ⇒ String
Canonical reference (unique identifier) for the webhook.
-
#user ⇒ Calendly::User
The user that’s associated with the webhook subscription.
-
#uuid ⇒ String
unique id of the WebhookSubscription object.
Class Method Summary collapse
Instance Method Summary collapse
-
#delete ⇒ true
Delete a webhook subscription associated with self.
-
#fetch ⇒ Calendly::WebhookSubscription
Get a webhook subscription associated with self.
Methods included from ModelUtils
#client, #id, included, #initialize, #inspect
Instance Attribute Details
#callback_url ⇒ String
The callback URL to use when the event is triggered.
28 29 30 |
# File 'lib/calendly/models/webhook_subscription.rb', line 28 def callback_url @callback_url end |
#created_at ⇒ Time
The moment when the webhook subscription was created.
32 33 34 |
# File 'lib/calendly/models/webhook_subscription.rb', line 32 def created_at @created_at end |
#creator ⇒ Calendly::User
The user who created the webhook subscription.
64 65 66 |
# File 'lib/calendly/models/webhook_subscription.rb', line 64 def creator @creator end |
#events ⇒ Array<String>
A list of events to which the webhook is subscribed.
48 49 50 |
# File 'lib/calendly/models/webhook_subscription.rb', line 48 def events @events end |
#organization ⇒ Calendly::Organization
The organization that’s associated with the webhook subscription.
56 57 58 |
# File 'lib/calendly/models/webhook_subscription.rb', line 56 def organization @organization end |
#retry_started_at ⇒ Time
The date and time the webhook subscription is retried.
40 41 42 |
# File 'lib/calendly/models/webhook_subscription.rb', line 40 def retry_started_at @retry_started_at end |
#scope ⇒ String
The scope of the webhook subscription.
52 53 54 |
# File 'lib/calendly/models/webhook_subscription.rb', line 52 def scope @scope end |
#state ⇒ String
Indicates if the webhook subscription is “active” or “disabled”.
44 45 46 |
# File 'lib/calendly/models/webhook_subscription.rb', line 44 def state @state end |
#updated_at ⇒ Time
The moment when the webhook subscription was last updated.
36 37 38 |
# File 'lib/calendly/models/webhook_subscription.rb', line 36 def updated_at @updated_at end |
#uri ⇒ String
Canonical reference (unique identifier) for the webhook.
24 25 26 |
# File 'lib/calendly/models/webhook_subscription.rb', line 24 def uri @uri end |
#user ⇒ Calendly::User
The user that’s associated with the webhook subscription.
60 61 62 |
# File 'lib/calendly/models/webhook_subscription.rb', line 60 def user @user end |
#uuid ⇒ String
unique id of the WebhookSubscription object.
20 21 22 |
# File 'lib/calendly/models/webhook_subscription.rb', line 20 def uuid @uuid end |
Class Method Details
.association ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/calendly/models/webhook_subscription.rb', line 10 def self.association { organization: Organization, user: User, creator: User } end |
Instance Method Details
#delete ⇒ true
Delete a webhook subscription associated with self.
84 85 86 |
# File 'lib/calendly/models/webhook_subscription.rb', line 84 def delete client.delete_webhook uuid end |
#fetch ⇒ Calendly::WebhookSubscription
Get a webhook subscription associated with self.
73 74 75 |
# File 'lib/calendly/models/webhook_subscription.rb', line 73 def fetch client.webhook uuid end |