freshdesk-rest 0.0.1 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/freshdesk-rest.rb +1 -0
- data/lib/freshdesk-rest/api.rb +0 -3
- data/lib/freshdesk-rest/factory.rb +4 -0
- data/lib/freshdesk-rest/resource/contact.rb +11 -3
- data/lib/freshdesk-rest/resource/ticket.rb +18 -0
- data/lib/freshdesk-rest/version.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 987d85ec3b80f0fc16f604b39897c8daa94da5aaca9bb6dd08b1c6230fa9db87
|
4
|
+
data.tar.gz: 8490474bb957d3bd86f1bba8f821ed0cad0a40e6dcc502ccc2b3267f62509307
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7099c7a116eb87c28c21895d4a9d73f62e9c2550f4534eea7e05fe6fb7409ff0e76d46ac3d6f236aadfa4e0f1fe2ed7b91ed24ccd0c4daa1596aa340a76c137c
|
7
|
+
data.tar.gz: e6875ee01ad39b7bf37b204c44c3fdff13f1e02689af93d4c73bb99a205d9ea2dfe4cc7d75fac561e84833fb5c24588705a0efadbe7fd1f4ceaf3ff8003f52b3
|
data/lib/freshdesk-rest.rb
CHANGED
@@ -2,6 +2,7 @@ require_relative 'freshdesk-rest/factory'
|
|
2
2
|
require_relative 'freshdesk-rest/version'
|
3
3
|
require_relative 'freshdesk-rest/configuration'
|
4
4
|
require_relative 'freshdesk-rest/resource/contact'
|
5
|
+
require_relative 'freshdesk-rest/resource/ticket'
|
5
6
|
|
6
7
|
module Freshdesk
|
7
8
|
module Rest
|
data/lib/freshdesk-rest/api.rb
CHANGED
@@ -10,9 +10,7 @@ module Freshdesk
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def list(params: {})
|
13
|
-
|
14
|
-
path = [@path, (query.empty? ? nil : query)].compact.join('?')
|
15
|
-
Parser.parse(@client.get(path))
|
13
|
+
Parser.parse(@client.get([@path, presence(query(params))].compact.join('?')))
|
16
14
|
end
|
17
15
|
|
18
16
|
def get(id:)
|
@@ -30,6 +28,16 @@ module Freshdesk
|
|
30
28
|
def delete(id:)
|
31
29
|
Parser.parse(@client.delete("#{@path}/#{id}"))
|
32
30
|
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def presence(value)
|
35
|
+
value.empty? ? nil : value
|
36
|
+
end
|
37
|
+
|
38
|
+
def query(params)
|
39
|
+
URI.encode_www_form(params.to_a)
|
40
|
+
end
|
33
41
|
end
|
34
42
|
end
|
35
43
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require_relative 'parser'
|
2
|
+
|
3
|
+
module Freshdesk
|
4
|
+
module Rest
|
5
|
+
module Resource
|
6
|
+
class Ticket
|
7
|
+
def initialize(client:)
|
8
|
+
@client = client
|
9
|
+
@path = '/tickets'
|
10
|
+
end
|
11
|
+
|
12
|
+
def post(data:)
|
13
|
+
Parser.parse(@client.post(@path, data))
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: freshdesk-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
autorequire:
|
7
|
+
- Helpling
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A ruby gem to interact with Freshdesk REST resources
|
14
|
-
email:
|
14
|
+
email: tech@helpling.com
|
15
15
|
executables: []
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
@@ -22,13 +22,14 @@ files:
|
|
22
22
|
- lib/freshdesk-rest/factory.rb
|
23
23
|
- lib/freshdesk-rest/resource/contact.rb
|
24
24
|
- lib/freshdesk-rest/resource/parser.rb
|
25
|
+
- lib/freshdesk-rest/resource/ticket.rb
|
25
26
|
- lib/freshdesk-rest/version.rb
|
26
27
|
homepage: https://rubygems.org/gems/freshdesk-rest
|
27
28
|
licenses:
|
28
29
|
- MIT
|
29
30
|
metadata:
|
30
|
-
source_code_uri: https://github.com/
|
31
|
-
post_install_message:
|
31
|
+
source_code_uri: https://github.com/Helpling/freshdesk-rest
|
32
|
+
post_install_message:
|
32
33
|
rdoc_options: []
|
33
34
|
require_paths:
|
34
35
|
- lib
|
@@ -43,9 +44,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
44
|
- !ruby/object:Gem::Version
|
44
45
|
version: '0'
|
45
46
|
requirements: []
|
46
|
-
|
47
|
-
|
48
|
-
signing_key:
|
47
|
+
rubygems_version: 3.0.3
|
48
|
+
signing_key:
|
49
49
|
specification_version: 4
|
50
50
|
summary: Freshdesk rest api resource collection
|
51
51
|
test_files: []
|