Class: Wire::Resources::WebhookEndpoints
- Inherits:
-
Base
- Object
- Base
- Wire::Resources::WebhookEndpoints
show all
- Defined in:
- lib/wire/resources/webhook_endpoints.rb
Overview
WebhookEndpoints: create, retrieve, update, delete, list.
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#create(params = {}) ⇒ Object
10
11
12
13
14
|
# File 'lib/wire/resources/webhook_endpoints.rb', line 10
def create(params = {})
params = params.dup
key = params.delete(:idempotency_key) || params.delete("idempotency_key")
@client.request("POST", "/v1/webhook_endpoints", body: params, idempotency_key: key)
end
|
#delete(id) ⇒ Object
30
31
32
|
# File 'lib/wire/resources/webhook_endpoints.rb', line 30
def delete(id)
@client.request("DELETE", "/v1/webhook_endpoints/#{escape(id)}")
end
|
#list(params = {}) ⇒ Object
Returns an Enumerator that auto-paginates across all pages.
35
36
37
|
# File 'lib/wire/resources/webhook_endpoints.rb', line 35
def list(params = {})
paginate("/v1/webhook_endpoints", params)
end
|
#retrieve(id) ⇒ Object
16
17
18
|
# File 'lib/wire/resources/webhook_endpoints.rb', line 16
def retrieve(id)
@client.request("GET", "/v1/webhook_endpoints/#{escape(id)}")
end
|
#update(id, params = {}) ⇒ Object
21
22
23
24
25
26
27
28
|
# File 'lib/wire/resources/webhook_endpoints.rb', line 21
def update(id, params = {})
params = params.dup
key = params.delete(:idempotency_key) || params.delete("idempotency_key")
@client.request(
"POST", "/v1/webhook_endpoints/#{escape(id)}",
body: params, idempotency_key: key
)
end
|