Class: SuperSendTX::WebhooksResource

Inherits:
Object
  • Object
show all
Defined in:
lib/supersendtx/resources.rb

Instance Method Summary collapse

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