Module: Tacokit::Client::Webhooks

Included in:
Tacokit::Client
Defined in:
lib/tacokit/client/webhooks.rb

Instance Method Summary collapse

Instance Method Details

#create_webhook(token, model_id, callback_url, options = {}) ⇒ Object

POST /1/webhooks


21
22
23
24
25
26
# File 'lib/tacokit/client/webhooks.rb', line 21

def create_webhook(token, model_id, callback_url, options = {})
  options.update \
    model_id: model_id,
    callback_url: callback_url
  post webhook_path, options
end

#delete_webhook(webhook_id) ⇒ Object

DELETE /1/webhooks/


29
30
31
# File 'lib/tacokit/client/webhooks.rb', line 29

def delete_webhook(webhook_id)
  delete webhook_path(webhook_id)
end

#update_webhook(webhook_id, options = {}) ⇒ Object


10
11
12
# File 'lib/tacokit/client/webhooks.rb', line 10

def update_webhook(webhook_id, options = {})
  put webhook_path(webhook_id), options
end

#webhook(webhook_id) ⇒ Object


5
6
7
# File 'lib/tacokit/client/webhooks.rb', line 5

def webhook(webhook_id)
  get webhook_path(webhook_id)
end

#webhook_path(*paths) ⇒ Object


33
34
35
# File 'lib/tacokit/client/webhooks.rb', line 33

def webhook_path(*paths)
  path_join "webhooks", *paths
end