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.



301
302
303
# File 'lib/sendly/enterprise.rb', line 301

def initialize(client)
  @client = client
end

Instance Method Details

#deleteObject



315
316
317
# File 'lib/sendly/enterprise.rb', line 315

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

#getObject



311
312
313
# File 'lib/sendly/enterprise.rb', line 311

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

#rotate_secretObject



323
324
325
# File 'lib/sendly/enterprise.rb', line 323

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

#set(url:) ⇒ Object

Raises:

  • (ArgumentError)


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

#testObject



319
320
321
# File 'lib/sendly/enterprise.rb', line 319

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