paubox 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +7 -0
- data/lib/paubox/client.rb +32 -0
- data/lib/paubox/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 03c144256b933b90453a794a96dd10a17979ebd6672c4718c09105a440c5ec9e
|
|
4
|
+
data.tar.gz: 3b85993acff1094aea7ff20c415857e38e51ebde9329584bc5ab48ccb31dffb5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c9453c28e1e1357ba079e274b46a0b7ec12414272e809658bf58e05abfaeedbcb68409f580089a72b95c24b9570214a1cabf2ee25fd4c740d0a30ba2424c66e5
|
|
7
|
+
data.tar.gz: 9ffef90ede4234b5b867670e3ba709512130b5af1aabb498567c1b333ada21d127cb4f1ce6b147e773443064af6e14621cb8ad4405a716c504df63f9e8eec2f1
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.3.0](https://github.com/Paubox/paubox-ruby/compare/v1.2.0...v1.3.0) (2026-09-17)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* webhook endpoint CRUD support ([#31](https://github.com/Paubox/paubox-ruby/issues/31)) ([1d78b47](https://github.com/Paubox/paubox-ruby/commit/1d78b4743658d81461ae2b6154ccf13209e6b329))
|
|
11
|
+
|
|
5
12
|
## [1.2.0](https://github.com/Paubox/paubox-ruby/compare/v1.1.0...v1.2.0) (2026-09-16)
|
|
6
13
|
|
|
7
14
|
|
data/lib/paubox/client.rb
CHANGED
|
@@ -162,6 +162,38 @@ module Paubox
|
|
|
162
162
|
RestClient.get(url, auth_header)
|
|
163
163
|
end
|
|
164
164
|
|
|
165
|
+
def list_webhook_endpoints
|
|
166
|
+
url = request_endpoint('webhook_endpoints')
|
|
167
|
+
response = RestClient.get(url, auth_header)
|
|
168
|
+
JSON.parse(response.body)
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
def create_webhook_endpoint(target_url:, events:, signing_key: nil, api_key: nil, active: true)
|
|
172
|
+
url = request_endpoint('webhook_endpoints')
|
|
173
|
+
payload = { target_url: target_url, events: events, active: active,
|
|
174
|
+
signing_key: signing_key, api_key: api_key }.compact.to_json
|
|
175
|
+
response = RestClient.post(url, payload, auth_header)
|
|
176
|
+
JSON.parse(response.body)
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def get_webhook_endpoint(id)
|
|
180
|
+
url = request_endpoint("webhook_endpoints/#{id}")
|
|
181
|
+
response = RestClient.get(url, auth_header)
|
|
182
|
+
JSON.parse(response.body)
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
def update_webhook_endpoint(id, **params)
|
|
186
|
+
url = request_endpoint("webhook_endpoints/#{id}")
|
|
187
|
+
response = RestClient.patch(url, params.to_json, auth_header)
|
|
188
|
+
JSON.parse(response.body)
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
def delete_webhook_endpoint(id)
|
|
192
|
+
url = request_endpoint("webhook_endpoints/#{id}")
|
|
193
|
+
response = RestClient.delete(url, auth_header)
|
|
194
|
+
JSON.parse(response.body)
|
|
195
|
+
end
|
|
196
|
+
|
|
165
197
|
def send_request(method: :get, payload: {}, path: '')
|
|
166
198
|
url = request_endpoint(path)
|
|
167
199
|
|
data/lib/paubox/version.rb
CHANGED