Class: Fakturoid::Api::Webhook

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/fakturoid/api/webhook.rb

Instance Attribute Summary

Attributes included from Base

#client

Instance Method Summary collapse

Methods included from Base

#initialize, #perform_request

Instance Method Details

#all(params = {}) ⇒ Object



8
9
10
11
12
# File 'lib/fakturoid/api/webhook.rb', line 8

def all(params = {})
  request_params = Utils.permit_params(params, :page)

  perform_request(HTTP_GET, "webhooks.json", request_params: request_params)
end

#create(payload = {}) ⇒ Object



19
20
21
# File 'lib/fakturoid/api/webhook.rb', line 19

def create(payload = {})
  perform_request(HTTP_POST, "webhooks.json", payload: payload)
end

#delete(id) ⇒ Object



28
29
30
31
# File 'lib/fakturoid/api/webhook.rb', line 28

def delete(id)
  Utils.validate_numerical_id(id)
  perform_request(HTTP_DELETE, "webhooks/#{id}.json")
end

#find(id) ⇒ Object



14
15
16
17
# File 'lib/fakturoid/api/webhook.rb', line 14

def find(id)
  Utils.validate_numerical_id(id)
  perform_request(HTTP_GET, "webhooks/#{id}.json")
end

#update(id, payload = {}) ⇒ Object



23
24
25
26
# File 'lib/fakturoid/api/webhook.rb', line 23

def update(id, payload = {})
  Utils.validate_numerical_id(id)
  perform_request(HTTP_PATCH, "webhooks/#{id}.json", payload: payload)
end