quovo 1.0.8 → 1.0.9
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/README.md +21 -0
- data/lib/quovo.rb +2 -0
- data/lib/quovo/api.rb +4 -0
- data/lib/quovo/api/webhooks.rb +38 -0
- data/lib/quovo/models/transaction.rb +2 -0
- data/lib/quovo/models/webhook.rb +13 -0
- data/lib/quovo/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b880b5ba6b9a4c0fddcc69d78618307bf641ce3f
|
4
|
+
data.tar.gz: b16bdad0fad1d53ab9de5eec146cb053bb484f7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a701f6edf07195f0f5f26d2ad88e3c3a5541bf34472459cf809ef69e0b0b7b9bb103d6c47ce96090a1c6fb0b717632f9af2d87d2126dc40876529822e39da288
|
7
|
+
data.tar.gz: 563f33ef04d56a9702300dc3ba8c9936344d50d7befda8b79b406400b14c901151f58dfaa517e9988178339695782cb526e9ad87fe573f79fda0dc107a27e736
|
data/README.md
CHANGED
@@ -169,6 +169,27 @@ Hook is a registered callback that invokes when web request happens.
|
|
169
169
|
client.iframe_token.create(user_id)
|
170
170
|
```
|
171
171
|
|
172
|
+
### Webhooks
|
173
|
+
```ruby
|
174
|
+
client.webhooks.all
|
175
|
+
client.webhooks.create(options)
|
176
|
+
# Options:
|
177
|
+
# events: - a list of events to subscribe to. Default is ['*']
|
178
|
+
# is_active: - whether the webhook is enabled or not. Default is 'true'
|
179
|
+
# secret: - the string used to calculate the signature on each webhook delivery (required)
|
180
|
+
# name: - a unique name (required)
|
181
|
+
# url: - the URL the webhook should POST data to. (required)
|
182
|
+
client.webhooks.update(name, options)
|
183
|
+
# Options:
|
184
|
+
# events: - a list of events to subscribe to. Default is ['*']
|
185
|
+
# is_active: - whether the webhook is enabled or not
|
186
|
+
# secret: - the string used to calculate the signature on each webhook delivery
|
187
|
+
# name: - a unique name (required)
|
188
|
+
# url: - the URL the webhook should POST data to.
|
189
|
+
client.webhooks.delete(name)
|
190
|
+
```
|
191
|
+
|
192
|
+
|
172
193
|
## Contributors
|
173
194
|
* Canopy Financials [https://www.canopyfa.com](https://www.canopyfa.com)
|
174
195
|
* Castle Digital Partners [https://castle.co](https://castle.co)
|
data/lib/quovo.rb
CHANGED
@@ -36,6 +36,7 @@ require 'quovo/models/user'
|
|
36
36
|
require 'quovo/models/position'
|
37
37
|
require 'quovo/models/transaction'
|
38
38
|
require 'quovo/models/iframe_token'
|
39
|
+
require 'quovo/models/webhook'
|
39
40
|
|
40
41
|
require 'quovo/api/base'
|
41
42
|
require 'quovo/api/brokerages'
|
@@ -46,6 +47,7 @@ require 'quovo/api/users'
|
|
46
47
|
require 'quovo/api/positions'
|
47
48
|
require 'quovo/api/history'
|
48
49
|
require 'quovo/api/iframe_token'
|
50
|
+
require 'quovo/api/webhooks'
|
49
51
|
require 'quovo/api'
|
50
52
|
|
51
53
|
module Quovo
|
data/lib/quovo/api.rb
CHANGED
@@ -0,0 +1,38 @@
|
|
1
|
+
module Quovo
|
2
|
+
module Api
|
3
|
+
class Webhooks < Base
|
4
|
+
using Quovo::Refinements::Cast
|
5
|
+
using Quovo::Refinements::Require
|
6
|
+
using Quovo::Refinements::Permit
|
7
|
+
|
8
|
+
def all
|
9
|
+
api(:get, '/webhooks')
|
10
|
+
.fetch('webhooks')
|
11
|
+
.cast(Webhook)
|
12
|
+
end
|
13
|
+
|
14
|
+
def create(params)
|
15
|
+
params
|
16
|
+
.permit!(:events, :is_active, :secret, :name, :url)
|
17
|
+
.require!(:secret, :name, :url)
|
18
|
+
api(:post, '/webhooks', params)
|
19
|
+
.fetch('webhook')
|
20
|
+
.cast(Webhook)
|
21
|
+
end
|
22
|
+
|
23
|
+
def update(name, params)
|
24
|
+
name.require!(as: :name)
|
25
|
+
params.permit!(:events, :is_active, :secret, :url)
|
26
|
+
params[:name] = name
|
27
|
+
api(:put, '/webhooks', params)
|
28
|
+
.fetch('webhook')
|
29
|
+
.cast(Webhook)
|
30
|
+
end
|
31
|
+
|
32
|
+
def delete(name)
|
33
|
+
name.require!(as: :name)
|
34
|
+
api(:delete, '/webhooks', name: name)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/quovo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quovo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Gorkunov
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-05-15 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Quovo RESTful API client, configurable, thread-safe and well-tested
|
15
15
|
email:
|
@@ -35,6 +35,7 @@ files:
|
|
35
35
|
- lib/quovo/api/portfolios.rb
|
36
36
|
- lib/quovo/api/positions.rb
|
37
37
|
- lib/quovo/api/users.rb
|
38
|
+
- lib/quovo/api/webhooks.rb
|
38
39
|
- lib/quovo/config.rb
|
39
40
|
- lib/quovo/errors.rb
|
40
41
|
- lib/quovo/fake.rb
|
@@ -52,6 +53,7 @@ files:
|
|
52
53
|
- lib/quovo/models/sync.rb
|
53
54
|
- lib/quovo/models/transaction.rb
|
54
55
|
- lib/quovo/models/user.rb
|
56
|
+
- lib/quovo/models/webhook.rb
|
55
57
|
- lib/quovo/refinements/cast.rb
|
56
58
|
- lib/quovo/refinements/compact.rb
|
57
59
|
- lib/quovo/refinements/permit.rb
|