Class: Dyte::WebhooksResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/dyte/resources/webhooks.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Dyte::Resource

Instance Method Details

#fetch(webhook_id:) ⇒ Object



3
4
5
# File 'lib/dyte/resources/webhooks.rb', line 3

def fetch(webhook_id:)
  Webhook.new get_request("webhooks/#{webhook_id}").body.dig("data")
end

#listObject



7
8
9
10
# File 'lib/dyte/resources/webhooks.rb', line 7

def list
  response = get_request("webhooks")
  Collection.from_response(response, type: Webhook)
end