Class: Postscale::Resources::Webhooks

Inherits:
Resource
  • Object
show all
Defined in:
lib/postscale/resources/webhooks.rb

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Postscale::Resources::Resource

Instance Method Details

#create(request = nil, **kwargs) ⇒ Object



6
7
8
# File 'lib/postscale/resources/webhooks.rb', line 6

def create(request = nil, **kwargs)
  @http.post("/v1/webhooks", json: request_hash(request, kwargs))
end

#delete(id) ⇒ Object



14
15
16
# File 'lib/postscale/resources/webhooks.rb', line 14

def delete(id)
  @http.delete("/v1/webhooks/#{encode(id)}")
end

#deliveries(params = nil, **kwargs) ⇒ Object



18
19
20
# File 'lib/postscale/resources/webhooks.rb', line 18

def deliveries(params = nil, **kwargs)
  @http.get("/v1/webhook-deliveries", params: params_hash(params, kwargs))
end

#endpoint_deliveries(id, params = nil, **kwargs) ⇒ Object



22
23
24
# File 'lib/postscale/resources/webhooks.rb', line 22

def endpoint_deliveries(id, params = nil, **kwargs)
  @http.get("/v1/webhooks/#{encode(id)}/deliveries", params: params_hash(params, kwargs))
end

#list(params = nil, **kwargs) ⇒ Object



10
11
12
# File 'lib/postscale/resources/webhooks.rb', line 10

def list(params = nil, **kwargs)
  @http.get("/v1/webhooks", params: params_hash(params, kwargs))
end

#rotate_secret(id, request = nil, **kwargs) ⇒ Object



26
27
28
# File 'lib/postscale/resources/webhooks.rb', line 26

def rotate_secret(id, request = nil, **kwargs)
  @http.post("/v1/webhooks/#{encode(id)}/rotate", json: request_hash(request, kwargs))
end

#verify_signature(body, signature_header, secrets, **options) ⇒ Object



30
31
32
# File 'lib/postscale/resources/webhooks.rb', line 30

def verify_signature(body, signature_header, secrets, **options)
  Webhook.verify_signature(body, signature_header, secrets, **options)
end