faxplus_api 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/faxplus_api/base.rb +7 -7
- data/lib/faxplus_api/file.rb +1 -1
- data/lib/faxplus_api/outbox.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 522e0a417cb9e97b26a73388d7369cfb9cf0cdf9ab4d69ef0e6f20f75f64a029
|
4
|
+
data.tar.gz: 502520063d90636f49deaee39b3f341ea9d4b516f67b8108e8a2f4a3b58d0412
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c60c55d502184d9e37acb42c7021ab08f33cfa82d46437645e905c7f814c78b8b5961ef0541b3f42c9ea98b1467ca86e16a4bd17d7a279185f2f7e669653199
|
7
|
+
data.tar.gz: af05b0b220a6118cbff131c7268bfb1754b1e3545b8ad0892f0d198e5e1681344286696c01f80e3597794dd1e2f9c0100334c682833309fb11c6a15e30f469ca
|
data/lib/faxplus_api/base.rb
CHANGED
@@ -9,16 +9,16 @@ module FaxplusApi
|
|
9
9
|
@base_url = client.base_url
|
10
10
|
end
|
11
11
|
|
12
|
-
def make_request(url
|
12
|
+
def make_request(url:, data:, method: 'get', content_type: 'application/json')
|
13
13
|
begin
|
14
14
|
response = if method == 'post'
|
15
|
-
RestClient.post(url, data
|
15
|
+
RestClient.post(url, data, headers(content_type))
|
16
16
|
elsif method == 'put'
|
17
|
-
RestClient.put(url, data
|
17
|
+
RestClient.put(url, data, headers(content_type))
|
18
18
|
elsif method == 'get'
|
19
|
-
RestClient.get(url, headers)
|
19
|
+
RestClient.get(url, headers(content_type))
|
20
20
|
elsif method == 'delete'
|
21
|
-
RestClient.delete(url, headers)
|
21
|
+
RestClient.delete(url, headers(content_type))
|
22
22
|
end
|
23
23
|
rescue RestClient::ExceptionWithResponse => e
|
24
24
|
return { error: e.response.body }
|
@@ -31,9 +31,9 @@ module FaxplusApi
|
|
31
31
|
|
32
32
|
private
|
33
33
|
|
34
|
-
def headers
|
34
|
+
def headers(content_type)
|
35
35
|
{
|
36
|
-
'Content-Type' =>
|
36
|
+
'Content-Type' => content_type,
|
37
37
|
'Accept' => 'application/json',
|
38
38
|
'Authorization' => "Bearer #{@access_token}"
|
39
39
|
}
|
data/lib/faxplus_api/file.rb
CHANGED
@@ -4,7 +4,7 @@ module FaxplusApi
|
|
4
4
|
class File < Base
|
5
5
|
def upload(url: "#{@base_url}/accounts/%{user_id}/files", user_id:, data: {})
|
6
6
|
url = url % {user_id: user_id}
|
7
|
-
make_request(url: url, data: data, method: 'post')
|
7
|
+
make_request(url: url, data: data, method: 'post', content_type: 'multipart/form-data')
|
8
8
|
end
|
9
9
|
|
10
10
|
def get(url: "#{@base_url}/accounts/%{user_id}/files/%{fax_id}", user_id:, fax_id:, data: {})
|
data/lib/faxplus_api/outbox.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faxplus_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dilkhush Soni
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 1.8.6
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 1.8.6
|
55
55
|
description:
|
56
56
|
email:
|
57
57
|
- dilkhushsoni2010@gmail.com
|
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '0'
|
91
91
|
requirements: []
|
92
|
-
rubygems_version: 3.1.
|
92
|
+
rubygems_version: 3.1.6
|
93
93
|
signing_key:
|
94
94
|
specification_version: 4
|
95
95
|
summary: A simple wrapper around faxplus's API
|