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.
119 120 121 |
# File 'lib/supersendtx/resources.rb', line 119 def initialize(http) @http = http end |
Instance Method Details
#create(**params) ⇒ Object
131 132 133 |
# File 'lib/supersendtx/resources.rb', line 131 def create(**params) @http.request("POST", "/webhooks", body: params) end |
#delete(webhook_id) ⇒ Object
139 140 141 |
# File 'lib/supersendtx/resources.rb', line 139 def delete(webhook_id) @http.request("DELETE", "/webhooks/#{URI.encode_www_form_component(webhook_id)}") end |
#get(webhook_id) ⇒ Object
127 128 129 |
# File 'lib/supersendtx/resources.rb', line 127 def get(webhook_id) @http.request("GET", "/webhooks/#{URI.encode_www_form_component(webhook_id)}") end |
#list(limit: nil, cursor: nil) ⇒ Object
123 124 125 |
# File 'lib/supersendtx/resources.rb', line 123 def list(limit: nil, cursor: nil) @http.request("GET", "/webhooks#{@http.query({ "limit" => limit, "cursor" => cursor })}") end |
#update(webhook_id, **params) ⇒ Object
135 136 137 |
# File 'lib/supersendtx/resources.rb', line 135 def update(webhook_id, **params) @http.request("PATCH", "/webhooks/#{URI.encode_www_form_component(webhook_id)}", body: params) end |