Class: Sendly::EnterpriseWebhooksSubResource

Inherits:
Object
  • Object
show all
Defined in:
lib/sendly/enterprise.rb

Instance Method Summary collapse

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

#deleteObject



263
264
265
# File 'lib/sendly/enterprise.rb', line 263

def delete
  @client.delete("/enterprise/webhooks")
end

#getObject



259
260
261
# File 'lib/sendly/enterprise.rb', line 259

def get
  @client.get("/enterprise/webhooks")
end

#rotate_secretObject



271
272
273
# File 'lib/sendly/enterprise.rb', line 271

def rotate_secret
  @client.post("/enterprise/webhooks/rotate-secret")
end

#set(url:) ⇒ Object

Raises:

  • (ArgumentError)


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

#testObject



267
268
269
# File 'lib/sendly/enterprise.rb', line 267

def test
  @client.post("/enterprise/webhooks/test")
end