Class: Broadcast::Resources::WebhookEndpoints

Inherits:
Base
  • Object
show all
Defined in:
lib/broadcast/resources/webhook_endpoints.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Broadcast::Resources::Base

Instance Method Details

#create(**attrs) ⇒ Object



14
15
16
# File 'lib/broadcast/resources/webhook_endpoints.rb', line 14

def create(**attrs)
  post('/api/v1/webhook_endpoints', { webhook_endpoint: attrs })
end

#delete(id) ⇒ Object



22
23
24
# File 'lib/broadcast/resources/webhook_endpoints.rb', line 22

def delete(id)
  @client.request(:delete, "/api/v1/webhook_endpoints/#{id}")
end

#deliveries(id, **params) ⇒ Object



30
31
32
# File 'lib/broadcast/resources/webhook_endpoints.rb', line 30

def deliveries(id, **params)
  get("/api/v1/webhook_endpoints/#{id}/deliveries", params)
end

#get_endpoint(id) ⇒ Object



10
11
12
# File 'lib/broadcast/resources/webhook_endpoints.rb', line 10

def get_endpoint(id)
  get("/api/v1/webhook_endpoints/#{id}")
end

#list(**params) ⇒ Object



6
7
8
# File 'lib/broadcast/resources/webhook_endpoints.rb', line 6

def list(**params)
  get('/api/v1/webhook_endpoints', params)
end

#test(id, event_type: 'test.webhook') ⇒ Object



26
27
28
# File 'lib/broadcast/resources/webhook_endpoints.rb', line 26

def test(id, event_type: 'test.webhook')
  post("/api/v1/webhook_endpoints/#{id}/test", { event_type: event_type })
end

#update(id, **attrs) ⇒ Object



18
19
20
# File 'lib/broadcast/resources/webhook_endpoints.rb', line 18

def update(id, **attrs)
  patch("/api/v1/webhook_endpoints/#{id}", { webhook_endpoint: attrs })
end