Class: Sendly::EnterpriseWebhooksSubResource
- Inherits:
-
Object
- Object
- Sendly::EnterpriseWebhooksSubResource
- Defined in:
- lib/sendly/enterprise.rb
Instance Method Summary collapse
- #delete ⇒ Object
- #get ⇒ Object
-
#initialize(client) ⇒ EnterpriseWebhooksSubResource
constructor
A new instance of EnterpriseWebhooksSubResource.
- #rotate_secret ⇒ Object
- #set(url:) ⇒ Object
- #test ⇒ Object
Constructor Details
#initialize(client) ⇒ EnterpriseWebhooksSubResource
Returns a new instance of EnterpriseWebhooksSubResource.
301 302 303 |
# File 'lib/sendly/enterprise.rb', line 301 def initialize(client) @client = client end |
Instance Method Details
#delete ⇒ Object
315 316 317 |
# File 'lib/sendly/enterprise.rb', line 315 def delete @client.delete("/enterprise/webhooks") end |
#get ⇒ Object
311 312 313 |
# File 'lib/sendly/enterprise.rb', line 311 def get @client.get("/enterprise/webhooks") end |
#rotate_secret ⇒ Object
323 324 325 |
# File 'lib/sendly/enterprise.rb', line 323 def rotate_secret @client.post("/enterprise/webhooks/rotate-secret") end |
#set(url:) ⇒ Object
305 306 307 308 309 |
# File 'lib/sendly/enterprise.rb', line 305 def set(url:) raise ArgumentError, "Webhook URL is required" if url.nil? || url.empty? @client.post("/enterprise/webhooks", { url: url }) end |
#test ⇒ Object
319 320 321 |
# File 'lib/sendly/enterprise.rb', line 319 def test @client.post("/enterprise/webhooks/test") end |