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.
249 250 251 |
# File 'lib/sendly/enterprise.rb', line 249 def initialize(client) @client = client end |
Instance Method Details
#delete ⇒ Object
263 264 265 |
# File 'lib/sendly/enterprise.rb', line 263 def delete @client.delete("/enterprise/webhooks") end |
#get ⇒ Object
259 260 261 |
# File 'lib/sendly/enterprise.rb', line 259 def get @client.get("/enterprise/webhooks") end |
#rotate_secret ⇒ Object
271 272 273 |
# File 'lib/sendly/enterprise.rb', line 271 def rotate_secret @client.post("/enterprise/webhooks/rotate-secret") end |
#set(url:) ⇒ Object
253 254 255 256 257 |
# File 'lib/sendly/enterprise.rb', line 253 def set(url:) raise ArgumentError, "Webhook URL is required" if url.nil? || url.empty? @client.post("/enterprise/webhooks", { url: url }) end |
#test ⇒ Object
267 268 269 |
# File 'lib/sendly/enterprise.rb', line 267 def test @client.post("/enterprise/webhooks/test") end |