Class: Trello::Webhook
Overview
A webhook is a URL called each time a specified model is updated
Instance Attribute Summary collapse
- #active ⇒ Boolean readonly
- #callback_url ⇒ String readonly
- #consecutive_failures ⇒ Integer readonly
- #description ⇒ String readonly
- #first_consecutive_fail_date ⇒ Datetime readonly
- #id ⇒ String readonly
-
#model_id ⇒ String
readonly
A 24-character hex string.
Attributes inherited from BasicData
Instance Method Summary collapse
-
#activated? ⇒ Boolean
Check if the webhook is activated.
-
#delete ⇒ String
Delete this webhook.
Methods inherited from BasicData
#==, #attributes, client, #collection_name, #collection_path, create, #element_name, #element_path, find, #hash, #initialize, many, one, parse, parse_many, path_name, #refresh!, register_attrs, #save, save, schema, #schema, #update!, #update_fields
Methods included from JsonUtils
Constructor Details
This class inherits a constructor from Trello::BasicData
Instance Attribute Details
#active ⇒ Boolean (readonly)
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/trello/webhook.rb', line 18 class Webhook < BasicData schema do # Readonly attribute :id, readonly: true, primary_key: true attribute :consecutive_failures, readonly: true, remote_key: 'consecutiveFailures' attribute :first_consecutive_fail_date, readonly: true, remote_key: 'firstConsecutiveFailDate', serializer: 'Time' # Writable attribute :description attribute :model_id, remote_key: 'idModel' attribute :callback_url, remote_key: 'callbackURL' attribute :active end validates_presence_of :id, :model_id, :callback_url validates_length_of :description, in: 1..16384 # Delete this webhook # # @return [String] the JSON response from the Trello API def delete client.delete("/webhooks/#{id}") end # Check if the webhook is activated # # @return [Boolean] def activated? active end end |
#callback_url ⇒ String (readonly)
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/trello/webhook.rb', line 18 class Webhook < BasicData schema do # Readonly attribute :id, readonly: true, primary_key: true attribute :consecutive_failures, readonly: true, remote_key: 'consecutiveFailures' attribute :first_consecutive_fail_date, readonly: true, remote_key: 'firstConsecutiveFailDate', serializer: 'Time' # Writable attribute :description attribute :model_id, remote_key: 'idModel' attribute :callback_url, remote_key: 'callbackURL' attribute :active end validates_presence_of :id, :model_id, :callback_url validates_length_of :description, in: 1..16384 # Delete this webhook # # @return [String] the JSON response from the Trello API def delete client.delete("/webhooks/#{id}") end # Check if the webhook is activated # # @return [Boolean] def activated? active end end |
#consecutive_failures ⇒ Integer (readonly)
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/trello/webhook.rb', line 18 class Webhook < BasicData schema do # Readonly attribute :id, readonly: true, primary_key: true attribute :consecutive_failures, readonly: true, remote_key: 'consecutiveFailures' attribute :first_consecutive_fail_date, readonly: true, remote_key: 'firstConsecutiveFailDate', serializer: 'Time' # Writable attribute :description attribute :model_id, remote_key: 'idModel' attribute :callback_url, remote_key: 'callbackURL' attribute :active end validates_presence_of :id, :model_id, :callback_url validates_length_of :description, in: 1..16384 # Delete this webhook # # @return [String] the JSON response from the Trello API def delete client.delete("/webhooks/#{id}") end # Check if the webhook is activated # # @return [Boolean] def activated? active end end |
#description ⇒ String (readonly)
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/trello/webhook.rb', line 18 class Webhook < BasicData schema do # Readonly attribute :id, readonly: true, primary_key: true attribute :consecutive_failures, readonly: true, remote_key: 'consecutiveFailures' attribute :first_consecutive_fail_date, readonly: true, remote_key: 'firstConsecutiveFailDate', serializer: 'Time' # Writable attribute :description attribute :model_id, remote_key: 'idModel' attribute :callback_url, remote_key: 'callbackURL' attribute :active end validates_presence_of :id, :model_id, :callback_url validates_length_of :description, in: 1..16384 # Delete this webhook # # @return [String] the JSON response from the Trello API def delete client.delete("/webhooks/#{id}") end # Check if the webhook is activated # # @return [Boolean] def activated? active end end |
#first_consecutive_fail_date ⇒ Datetime (readonly)
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/trello/webhook.rb', line 18 class Webhook < BasicData schema do # Readonly attribute :id, readonly: true, primary_key: true attribute :consecutive_failures, readonly: true, remote_key: 'consecutiveFailures' attribute :first_consecutive_fail_date, readonly: true, remote_key: 'firstConsecutiveFailDate', serializer: 'Time' # Writable attribute :description attribute :model_id, remote_key: 'idModel' attribute :callback_url, remote_key: 'callbackURL' attribute :active end validates_presence_of :id, :model_id, :callback_url validates_length_of :description, in: 1..16384 # Delete this webhook # # @return [String] the JSON response from the Trello API def delete client.delete("/webhooks/#{id}") end # Check if the webhook is activated # # @return [Boolean] def activated? active end end |
#id ⇒ String (readonly)
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/trello/webhook.rb', line 18 class Webhook < BasicData schema do # Readonly attribute :id, readonly: true, primary_key: true attribute :consecutive_failures, readonly: true, remote_key: 'consecutiveFailures' attribute :first_consecutive_fail_date, readonly: true, remote_key: 'firstConsecutiveFailDate', serializer: 'Time' # Writable attribute :description attribute :model_id, remote_key: 'idModel' attribute :callback_url, remote_key: 'callbackURL' attribute :active end validates_presence_of :id, :model_id, :callback_url validates_length_of :description, in: 1..16384 # Delete this webhook # # @return [String] the JSON response from the Trello API def delete client.delete("/webhooks/#{id}") end # Check if the webhook is activated # # @return [Boolean] def activated? active end end |
#model_id ⇒ String (readonly)
Returns A 24-character hex string.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/trello/webhook.rb', line 18 class Webhook < BasicData schema do # Readonly attribute :id, readonly: true, primary_key: true attribute :consecutive_failures, readonly: true, remote_key: 'consecutiveFailures' attribute :first_consecutive_fail_date, readonly: true, remote_key: 'firstConsecutiveFailDate', serializer: 'Time' # Writable attribute :description attribute :model_id, remote_key: 'idModel' attribute :callback_url, remote_key: 'callbackURL' attribute :active end validates_presence_of :id, :model_id, :callback_url validates_length_of :description, in: 1..16384 # Delete this webhook # # @return [String] the JSON response from the Trello API def delete client.delete("/webhooks/#{id}") end # Check if the webhook is activated # # @return [Boolean] def activated? active end end |
Instance Method Details
#activated? ⇒ Boolean
Check if the webhook is activated
46 47 48 |
# File 'lib/trello/webhook.rb', line 46 def activated? active end |
#delete ⇒ String
Delete this webhook
39 40 41 |
# File 'lib/trello/webhook.rb', line 39 def delete client.delete("/webhooks/#{id}") end |