Class: Coffrify::Webhooks
- Inherits:
-
Object
- Object
- Coffrify::Webhooks
- Defined in:
- lib/coffrify/client.rb
Instance Method Summary collapse
- #create(**body) ⇒ Object
- #delete(id) ⇒ Object
- #deliveries(id, limit: 20) ⇒ Object
- #events ⇒ Object
- #get(id) ⇒ Object
-
#initialize(client) ⇒ Webhooks
constructor
A new instance of Webhooks.
- #list ⇒ Object
- #replay(delivery_id) ⇒ Object
- #test(id) ⇒ Object
- #update(id, **b) ⇒ Object
Constructor Details
#initialize(client) ⇒ Webhooks
Returns a new instance of Webhooks.
110 |
# File 'lib/coffrify/client.rb', line 110 def initialize(client); @c = client; end |
Instance Method Details
#create(**body) ⇒ Object
114 |
# File 'lib/coffrify/client.rb', line 114 def create(**body); @c.request(:post, "/webhooks", body: body); end |
#delete(id) ⇒ Object
116 |
# File 'lib/coffrify/client.rb', line 116 def delete(id); @c.request(:delete, "/webhooks", body: { id: id }); end |
#deliveries(id, limit: 20) ⇒ Object
118 119 120 |
# File 'lib/coffrify/client.rb', line 118 def deliveries(id, limit: 20) @c.request(:get, "/webhooks/#{escape(id)}/deliveries", query: { limit: limit }) end |
#events ⇒ Object
124 125 126 |
# File 'lib/coffrify/client.rb', line 124 def events @c.request(:get, "/webhooks/events") end |
#get(id) ⇒ Object
113 |
# File 'lib/coffrify/client.rb', line 113 def get(id); @c.request(:get, "/webhooks/#{escape(id)}"); end |
#list ⇒ Object
112 |
# File 'lib/coffrify/client.rb', line 112 def list; @c.request(:get, "/webhooks"); end |
#replay(delivery_id) ⇒ Object
121 122 123 |
# File 'lib/coffrify/client.rb', line 121 def replay(delivery_id) @c.request(:post, "/webhooks/deliveries/#{escape(delivery_id)}/replay") end |
#test(id) ⇒ Object
117 |
# File 'lib/coffrify/client.rb', line 117 def test(id); @c.request(:post, "/webhooks/#{escape(id)}/test"); end |
#update(id, **b) ⇒ Object
115 |
# File 'lib/coffrify/client.rb', line 115 def update(id, **b); @c.request(:patch, "/webhooks", body: b.merge(id: id)); end |