Class: HookSniff::OperationalWebhook

Inherits:
Object
  • Object
show all
Defined in:
lib/hooksniff/api/operational_webhook.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ OperationalWebhook

Returns a new instance of OperationalWebhook.



5
6
7
# File 'lib/hooksniff/api/operational_webhook.rb', line 5

def initialize(client)
  @client = client
end

Instance Method Details

#create_endpoint(attrs) ⇒ Object



17
18
19
# File 'lib/hooksniff/api/operational_webhook.rb', line 17

def create_endpoint(attrs)
  @client.execute_request("POST", "/v1/operational-webhooks", body: attrs)
end

#delete_endpoint(id) ⇒ Object



25
26
27
28
# File 'lib/hooksniff/api/operational_webhook.rb', line 25

def delete_endpoint(id)
  @client.execute_request("DELETE", "/v1/operational-webhooks/#{id}")
  nil
end

#get_endpoint(id) ⇒ Object



13
14
15
# File 'lib/hooksniff/api/operational_webhook.rb', line 13

def get_endpoint(id)
  @client.execute_request("GET", "/v1/operational-webhooks/#{id}")
end

#list_deliveries(endpoint_id) ⇒ Object



30
31
32
# File 'lib/hooksniff/api/operational_webhook.rb', line 30

def list_deliveries(endpoint_id)
  @client.execute_request("GET", "/v1/operational-webhooks/#{endpoint_id}/deliveries")
end

#list_endpoints(params = {}) ⇒ Object



9
10
11
# File 'lib/hooksniff/api/operational_webhook.rb', line 9

def list_endpoints(params = {})
  @client.execute_request("GET", "/v1/operational-webhooks", query_params: params)
end

#update_endpoint(id, attrs) ⇒ Object



21
22
23
# File 'lib/hooksniff/api/operational_webhook.rb', line 21

def update_endpoint(id, attrs)
  @client.execute_request("PUT", "/v1/operational-webhooks/#{id}", body: attrs)
end