Class: SuperSendTX::WebhooksResource
- Inherits:
-
Object
- Object
- SuperSendTX::WebhooksResource
- Defined in:
- lib/supersendtx/resources.rb
Instance Method Summary collapse
- #create(**params) ⇒ Object
- #delete(webhook_id) ⇒ Object
- #get(webhook_id) ⇒ Object
-
#initialize(http) ⇒ WebhooksResource
constructor
A new instance of WebhooksResource.
- #list(limit: nil, cursor: nil) ⇒ Object
- #update(webhook_id, **params) ⇒ Object
Constructor Details
#initialize(http) ⇒ WebhooksResource
Returns a new instance of WebhooksResource.
117 118 119 |
# File 'lib/supersendtx/resources.rb', line 117 def initialize(http) @http = http end |
Instance Method Details
#create(**params) ⇒ Object
129 130 131 |
# File 'lib/supersendtx/resources.rb', line 129 def create(**params) @http.request("POST", "/webhooks", body: params) end |
#delete(webhook_id) ⇒ Object
137 138 139 |
# File 'lib/supersendtx/resources.rb', line 137 def delete(webhook_id) @http.request("DELETE", "/webhooks/#{URI.encode_www_form_component(webhook_id)}") end |
#get(webhook_id) ⇒ Object
125 126 127 |
# File 'lib/supersendtx/resources.rb', line 125 def get(webhook_id) @http.request("GET", "/webhooks/#{URI.encode_www_form_component(webhook_id)}") end |
#list(limit: nil, cursor: nil) ⇒ Object
121 122 123 |
# File 'lib/supersendtx/resources.rb', line 121 def list(limit: nil, cursor: nil) @http.request("GET", "/webhooks#{@http.query({ "limit" => limit, "cursor" => cursor })}") end |
#update(webhook_id, **params) ⇒ Object
133 134 135 |
# File 'lib/supersendtx/resources.rb', line 133 def update(webhook_id, **params) @http.request("PATCH", "/webhooks/#{URI.encode_www_form_component(webhook_id)}", body: params) end |