Class: CiscoSpark::Webhook
Instance Attribute Summary collapse
-
#appId ⇒ Object
Returns the value of attribute appId.
-
#created ⇒ Object
Returns the value of attribute created.
-
#createdBy ⇒ Object
Returns the value of attribute createdBy.
-
#event ⇒ Object
Returns the value of attribute event.
-
#filter ⇒ Object
Returns the value of attribute filter.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#orgId ⇒ Object
Returns the value of attribute orgId.
-
#ownedBy ⇒ Object
Returns the value of attribute ownedBy.
-
#resource ⇒ Object
Returns the value of attribute resource.
-
#secret ⇒ Object
Returns the value of attribute secret.
-
#status ⇒ Object
Returns the value of attribute status.
-
#targetUrl ⇒ Object
Returns the value of attribute targetUrl.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ Webhook
constructor
A new instance of Webhook.
Methods inherited from Base
#[], #delete, #refresh, #update
Constructor Details
#initialize(data) ⇒ Webhook
Returns a new instance of Webhook.
4 5 6 7 8 |
# File 'lib/webhook.rb', line 4 def initialize(data) @api_endpoint = 'webhooks' @update_fields = [:name] super end |
Instance Attribute Details
#appId ⇒ Object
Returns the value of attribute appId.
3 4 5 |
# File 'lib/webhook.rb', line 3 def appId @appId end |
#created ⇒ Object
Returns the value of attribute created.
3 4 5 |
# File 'lib/webhook.rb', line 3 def created @created end |
#createdBy ⇒ Object
Returns the value of attribute createdBy.
3 4 5 |
# File 'lib/webhook.rb', line 3 def createdBy @createdBy end |
#event ⇒ Object
Returns the value of attribute event.
3 4 5 |
# File 'lib/webhook.rb', line 3 def event @event end |
#filter ⇒ Object
Returns the value of attribute filter.
3 4 5 |
# File 'lib/webhook.rb', line 3 def filter @filter end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/webhook.rb', line 3 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/webhook.rb', line 3 def name @name end |
#orgId ⇒ Object
Returns the value of attribute orgId.
3 4 5 |
# File 'lib/webhook.rb', line 3 def orgId @orgId end |
#ownedBy ⇒ Object
Returns the value of attribute ownedBy.
3 4 5 |
# File 'lib/webhook.rb', line 3 def ownedBy @ownedBy end |
#resource ⇒ Object
Returns the value of attribute resource.
3 4 5 |
# File 'lib/webhook.rb', line 3 def resource @resource end |
#secret ⇒ Object
Returns the value of attribute secret.
3 4 5 |
# File 'lib/webhook.rb', line 3 def secret @secret end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/webhook.rb', line 3 def status @status end |
#targetUrl ⇒ Object
Returns the value of attribute targetUrl.
3 4 5 |
# File 'lib/webhook.rb', line 3 def targetUrl @targetUrl end |
Class Method Details
.create(payload = {}) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/webhook.rb', line 19 def create(payload = {}) res = CiscoSpark.rest('POST', '/webhooks', payload: payload) if res.ok webhook = CiscoSpark::Webhook.new(JSON.parse(res.body)) return webhook end nil end |
.get(id) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/webhook.rb', line 10 def get(id) res = CiscoSpark.rest('GET', "/webhooks/#{id}") if res.ok webhook = CiscoSpark::Webhook.new(JSON.parse(res.body)) return webhook end nil end |