stannp 0.2.0 → 0.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/CHANGELOG.md +4 -0
- data/lib/stannp/client.rb +4 -0
- data/lib/stannp/resource.rb +0 -8
- data/lib/stannp/resources/addresses.rb +10 -0
- data/lib/stannp/resources/recipients.rb +6 -0
- data/lib/stannp/version.rb +1 -1
- data/lib/stannp.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfc91d10039a3c87a7c4e8725a764dce523dd9f26ff814a20a39757bdb86108d
|
4
|
+
data.tar.gz: 153a1c9b0a9a6fc9cfc23a4fa630ba144a01712027dc4f39865199c5eb463875
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a8c1c3a9047377908c0726dac92833007c367816d0683deed3fec3d92bc5f468b9c2b17bc957501f334f53c7ca57e7bd1d1cf8d834ecb2beac627492ec4d9fb
|
7
|
+
data.tar.gz: 992bb70c57042c83ca701a34cfb4cb843fe4f34484ee27d3eb4ff08196d980324d58dd536e05705edd4ddb23320a0a5aa2f52e2a12d87e1e34eb4d922e9b20bf
|
data/CHANGELOG.md
CHANGED
data/lib/stannp/client.rb
CHANGED
data/lib/stannp/resource.rb
CHANGED
@@ -14,14 +14,6 @@ module Stannp
|
|
14
14
|
handle_response client.connection.post(url, body, headers)
|
15
15
|
end
|
16
16
|
|
17
|
-
def patch_request(url, body:, headers: {})
|
18
|
-
handle_response client.connection.patch(url, body, headers)
|
19
|
-
end
|
20
|
-
|
21
|
-
def put_request(url, body:, headers: {})
|
22
|
-
handle_response client.connection.put(url, body, headers)
|
23
|
-
end
|
24
|
-
|
25
17
|
private
|
26
18
|
|
27
19
|
attr_reader :client
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Stannp
|
4
|
+
class AddressesResource < Resource
|
5
|
+
def validate(attributes:)
|
6
|
+
url = "https://dash.stannp.com/api/v1/addresses/validate?api_key=#{client.api_key}"
|
7
|
+
post_request(url, body: attributes).body['data']['is_valid']
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -35,5 +35,11 @@ module Stannp
|
|
35
35
|
|
36
36
|
raise e
|
37
37
|
end
|
38
|
+
|
39
|
+
def import(group_id:, file:, options: {})
|
40
|
+
url = "https://dash.stannp.com/api/v1/recipients/import?api_key=#{client.api_key}"
|
41
|
+
body = { group_id: group_id, file: file }.merge(options)
|
42
|
+
post_request(url, body: body).body['success']
|
43
|
+
end
|
38
44
|
end
|
39
45
|
end
|
data/lib/stannp/version.rb
CHANGED
data/lib/stannp.rb
CHANGED
@@ -12,6 +12,7 @@ module Stannp
|
|
12
12
|
autoload :AccountResource, 'stannp/resources/account'
|
13
13
|
autoload :UserResource, 'stannp/resources/user'
|
14
14
|
autoload :RecipientsResource, 'stannp/resources/recipients'
|
15
|
+
autoload :AddressesResource, 'stannp/resources/addresses'
|
15
16
|
# objects
|
16
17
|
autoload :User, 'stannp/objects/user'
|
17
18
|
autoload :Recipient, 'stannp/objects/recipient'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stannp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- k-p-jones
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- lib/stannp/objects/user.rb
|
64
64
|
- lib/stannp/resource.rb
|
65
65
|
- lib/stannp/resources/account.rb
|
66
|
+
- lib/stannp/resources/addresses.rb
|
66
67
|
- lib/stannp/resources/recipients.rb
|
67
68
|
- lib/stannp/resources/user.rb
|
68
69
|
- lib/stannp/version.rb
|