Class: Exa::Resources::Webhooks

Inherits:
Base
  • Object
show all
Defined in:
lib/exa/resources/webhooks.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

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

Instance Method Details

#attempts(id, params = nil) ⇒ Object



51
52
53
54
55
56
57
58
# File 'lib/exa/resources/webhooks.rb', line 51

def attempts(id, params = nil)
  client.request(
    method: :get,
    path: ["v0", "webhooks", id, "attempts"],
    query: params,
    response_model: Exa::Responses::WebhookAttemptListResponse
  )
end

#create(params) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/exa/resources/webhooks.rb', line 8

def create(params)
  client.request(
    method: :post,
    path: webhooks_path,
    body: params,
    response_model: Exa::Responses::Webhook
  )
end

#delete(id) ⇒ Object



43
44
45
46
47
48
49
# File 'lib/exa/resources/webhooks.rb', line 43

def delete(id)
  client.request(
    method: :delete,
    path: webhooks_path(id),
    response_model: Exa::Responses::Webhook
  )
end

#list(params = nil) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/exa/resources/webhooks.rb', line 17

def list(params = nil)
  client.request(
    method: :get,
    path: webhooks_path,
    query: params,
    response_model: Exa::Responses::WebhookListResponse
  )
end

#retrieve(id) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/exa/resources/webhooks.rb', line 26

def retrieve(id)
  client.request(
    method: :get,
    path: webhooks_path(id),
    response_model: Exa::Responses::Webhook
  )
end

#update(id, params) ⇒ Object



34
35
36
37
38
39
40
41
# File 'lib/exa/resources/webhooks.rb', line 34

def update(id, params)
  client.request(
    method: :patch,
    path: webhooks_path(id),
    body: params,
    response_model: Exa::Responses::Webhook
  )
end