frontapp 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/frontapp/client.rb +12 -1
- data/lib/frontapp/client/attachments.rb +15 -0
- data/lib/frontapp/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b7ef8cbd97c8e2e8ea8e9688e0bfabdc7f6a5c9
|
4
|
+
data.tar.gz: a527bdfcd864d6d2bd086d6c0e4c063f7d21e46b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a4ff932cc6d255323210d38cb9fe1a40d56af5101920d3f03299412efa50417e16b3ea3cc00237f36ec4875b95f3aeb8fa00686228ce49a3f91700f04805e97
|
7
|
+
data.tar.gz: 88a1cf071c6e3e202e18efb24660d36d301b8fdd5ac6cd5323342f9c56466a9e33173bd13b1eccd4f9389c75c1c82e7238915835bf1fc23ede98f2577c535d16
|
data/lib/frontapp/client.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'uri'
|
2
2
|
require 'http'
|
3
3
|
require 'json'
|
4
|
+
require_relative 'client/attachments.rb'
|
4
5
|
require_relative 'client/channels.rb'
|
5
6
|
require_relative 'client/comments.rb'
|
6
7
|
require_relative 'client/contact_groups.rb'
|
@@ -21,6 +22,7 @@ require_relative 'version'
|
|
21
22
|
module Frontapp
|
22
23
|
class Client
|
23
24
|
|
25
|
+
include Frontapp::Client::Attachments
|
24
26
|
include Frontapp::Client::Channels
|
25
27
|
include Frontapp::Client::Comments
|
26
28
|
include Frontapp::Client::ContactGroups
|
@@ -75,7 +77,7 @@ module Frontapp
|
|
75
77
|
end
|
76
78
|
JSON.parse(res.to_s)
|
77
79
|
end
|
78
|
-
|
80
|
+
|
79
81
|
def get_plain(path)
|
80
82
|
headers_copy = @headers.dup
|
81
83
|
res = @headers.accept("text/plain").get("#{base_url}#{path}")
|
@@ -85,6 +87,15 @@ module Frontapp
|
|
85
87
|
res.to_s
|
86
88
|
end
|
87
89
|
|
90
|
+
def get_raw(path)
|
91
|
+
headers_copy = @headers.dup
|
92
|
+
res = @headers.get("#{base_url}#{path}")
|
93
|
+
if !res.status.success?
|
94
|
+
raise Error.from_response(res)
|
95
|
+
end
|
96
|
+
res
|
97
|
+
end
|
98
|
+
|
88
99
|
def create(path, body)
|
89
100
|
res = @headers.post("#{base_url}#{path}", json: body)
|
90
101
|
response = JSON.parse(res.to_s)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Frontapp
|
2
|
+
class Client
|
3
|
+
module Attachments
|
4
|
+
|
5
|
+
# Parameters
|
6
|
+
# Name Type Description
|
7
|
+
# ----------------------------------------------------------
|
8
|
+
# attachment_link_id string Id of the requested attachment
|
9
|
+
# ----------------------------------------------------------
|
10
|
+
def download_attachment(attachment_link_id)
|
11
|
+
get_raw("download/#{attachment_link_id}")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/frontapp/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frontapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Niels van der Zanden
|
@@ -74,6 +74,7 @@ extra_rdoc_files: []
|
|
74
74
|
files:
|
75
75
|
- lib/frontapp.rb
|
76
76
|
- lib/frontapp/client.rb
|
77
|
+
- lib/frontapp/client/attachments.rb
|
77
78
|
- lib/frontapp/client/channels.rb
|
78
79
|
- lib/frontapp/client/comments.rb
|
79
80
|
- lib/frontapp/client/contact_groups.rb
|