class Myfinance::Resources::Webhook

A wrapper to Myfinance Webhooks API

API

Documentation: app.myfinance.com.br/docs/api/webhooks

Public Instance Methods

create(params) click to toggle source

Create a webhook

API

Method: POST /integrations/webhooks

Documentation: app.myfinance.com.br/docs/api/webhooks#post_create

# File lib/myfinance/resources/webhook.rb, line 46
def create(params)
  http.post("/integrations/webhooks", body: { webhook: params }) do |response|
    respond_with_object(response, "webhook")
  end
end
destroy(id) click to toggle source

Destroy a webhook

API

Method: DELETE /integrations/webhooks/:id

Documentation: app.myfinance.com.br/docs/api/webhooks#delete_destroy

# File lib/myfinance/resources/webhook.rb, line 76
def destroy(id)
  http.delete("/integrations/webhooks/#{id}", body: {}) do |response|
    respond_with_object(response, "webhook")
  end
end
find(id) click to toggle source

List a webhook

API

Method: GET /integrations/webhooks/:id

Documentation: app.myfinance.com.br/docs/api/webhooks#get_show

# File lib/myfinance/resources/webhook.rb, line 32
def find(id)
  http.get("/integrations/webhooks/#{id}", body: {}) do |response|
    respond_with_object response, "webhook"
  end
end
find_all() click to toggle source

List all webhooks

API

Method: GET /integrations/webhooks

Documentation: app.myfinance.com.br/docs/api/webhooks#get_index

# File lib/myfinance/resources/webhook.rb, line 18
def find_all
  http.get("/integrations/webhooks", body: {}) do |response|
    respond_with_collection(response)
  end
end
update(id, params = {}) click to toggle source

Updates a webhook

API

Method: PUT /integrations/webhooks/:id

Documentation: app.myfinance.com.br/docs/api/webhooks#put_update

# File lib/myfinance/resources/webhook.rb, line 60
def update(id, params = {})
  http.put(
    "/integrations/webhooks/#{id}", body: { webhook: params }
  ) do |response|
    respond_with_object(response, "webhook")
  end
end