freshdesk-rest 0.1.5 → 2.0.0
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/client.rb +43 -0
- data/lib/freshdesk-rest/factory.rb +10 -0
- data/lib/freshdesk-rest/resource/contact.rb +5 -0
- data/lib/freshdesk-rest/version.rb +1 -1
- data/lib/freshdesk-rest.rb +1 -0
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bc6ab83544f21d8c0a6873372dd3b5d80bd003c3fc62ff23e074f040ac414e7
|
4
|
+
data.tar.gz: 46e16135cab76d38398d87ae55fb4d21227f82c7b4707c8c1121df242f31943d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 466bebf0fed5cf850005336d56c10cda84e406ac91ff9665ac634207000ebd4ade887acdd1de7e77c6cf165968b45876c2f7faa012fe56c736d09ae62ca78aed
|
7
|
+
data.tar.gz: cf6539a9fb2a24e453c7dded2b15347b475f01f614d15c83c7e8f9c4923b7f0b6d347a1dfa782e44297ac89d9f71de04d9e7eda28f97082033e7d8b91c76679c
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'rest-client'
|
2
|
+
require_relative 'api'
|
3
|
+
|
4
|
+
module Freshdesk
|
5
|
+
module Rest
|
6
|
+
class Client
|
7
|
+
def initialize(
|
8
|
+
api_key: Freshdesk::Rest.configuration.api_key,
|
9
|
+
domain: Freshdesk::Rest.configuration.domain
|
10
|
+
)
|
11
|
+
@api = Freshdesk::Rest::Api.new(
|
12
|
+
rest_client: RestClient,
|
13
|
+
api_key:,
|
14
|
+
domain:
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
def contact_resource
|
19
|
+
Freshdesk::Rest::Resource::Contact.new(client: api)
|
20
|
+
end
|
21
|
+
|
22
|
+
def ticket_resource
|
23
|
+
Freshdesk::Rest::Resource::Ticket.new(client: api)
|
24
|
+
end
|
25
|
+
|
26
|
+
def solutions_article_resource
|
27
|
+
Freshdesk::Rest::Resource::Solutions::Article.new(client: api)
|
28
|
+
end
|
29
|
+
|
30
|
+
def solutions_category_resource
|
31
|
+
Freshdesk::Rest::Resource::Solutions::Category.new(client: api)
|
32
|
+
end
|
33
|
+
|
34
|
+
def solutions_folder_resource
|
35
|
+
Freshdesk::Rest::Resource::Solutions::Folder.new(client: api)
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
attr_reader :api
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -31,6 +31,16 @@ module Freshdesk
|
|
31
31
|
def self.solutions_folder_resource
|
32
32
|
Freshdesk::Rest::Resource::Solutions::Folder.new(client: api)
|
33
33
|
end
|
34
|
+
|
35
|
+
class << self
|
36
|
+
extend Gem::Deprecate
|
37
|
+
deprecate :api, :none, 2024, 5
|
38
|
+
deprecate :contact_resource, "Freshdesk::Rest::Client.new.contact_resource", 2024, 5
|
39
|
+
deprecate :ticket_resource, "Freshdesk::Rest::Client.new.ticket_resource", 2024, 5
|
40
|
+
deprecate :solutions_article_resource, "Freshdesk::Rest::Client.new.solutions_article_resource", 2024, 5
|
41
|
+
deprecate :solutions_category_resource, "Freshdesk::Rest::Client.new.solutions_category_resource", 2024, 5
|
42
|
+
deprecate :solutions_folder_resource, "Freshdesk::Rest::Client.new.solutions_folder_resource", 2024, 5
|
43
|
+
end
|
34
44
|
end
|
35
45
|
end
|
36
46
|
end
|
@@ -32,6 +32,11 @@ module Freshdesk
|
|
32
32
|
def delete(id:)
|
33
33
|
Parser.parse(@client.delete("#{@path}/#{id}"))
|
34
34
|
end
|
35
|
+
|
36
|
+
def hard_delete(id:, force: false)
|
37
|
+
force_params = force ? { force: true } : {}
|
38
|
+
Parser.parse(@client.delete(path_with_params([@path, id, 'hard_delete'], force_params)))
|
39
|
+
end
|
35
40
|
end
|
36
41
|
end
|
37
42
|
end
|
data/lib/freshdesk-rest.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: freshdesk-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Helpling
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A ruby gem to interact with Freshdesk REST resources
|
14
14
|
email: tech@helpling.com
|
@@ -18,6 +18,7 @@ extra_rdoc_files: []
|
|
18
18
|
files:
|
19
19
|
- lib/freshdesk-rest.rb
|
20
20
|
- lib/freshdesk-rest/api.rb
|
21
|
+
- lib/freshdesk-rest/client.rb
|
21
22
|
- lib/freshdesk-rest/configuration.rb
|
22
23
|
- lib/freshdesk-rest/factory.rb
|
23
24
|
- lib/freshdesk-rest/resource/contact.rb
|
@@ -34,7 +35,7 @@ licenses:
|
|
34
35
|
- MIT
|
35
36
|
metadata:
|
36
37
|
source_code_uri: https://github.com/Helpling/freshdesk-rest
|
37
|
-
post_install_message:
|
38
|
+
post_install_message:
|
38
39
|
rdoc_options: []
|
39
40
|
require_paths:
|
40
41
|
- lib
|
@@ -49,8 +50,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
49
50
|
- !ruby/object:Gem::Version
|
50
51
|
version: '0'
|
51
52
|
requirements: []
|
52
|
-
rubygems_version: 3.
|
53
|
-
signing_key:
|
53
|
+
rubygems_version: 3.5.3
|
54
|
+
signing_key:
|
54
55
|
specification_version: 4
|
55
56
|
summary: Freshdesk rest api resource collection
|
56
57
|
test_files: []
|