freshdesk-rest 0.1.6 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba7686f61c35d2af5c5a159ca56f00f73db7ad61d28a33d9b6f51eefbd9d723d
4
- data.tar.gz: 280a3208233d78d5c76f3e978f7bc47e54073cd0a58143416b4f2f7437324aa7
3
+ metadata.gz: aad4d7b1cecf8c724587cc8dd2eb39b19090d3373c1254af79005be2203301b6
4
+ data.tar.gz: 51d958a4c0ef8ef68147c37fdf735bbb22ddbed54d209c4c0d8827dd003812c7
5
5
  SHA512:
6
- metadata.gz: 695926399da6be98272a9e5343f16d0707ac067127010f74e7f01861ce0fdfc45a11e4e1b639605c6c0a33d14ba9b9a51d21e83e1e43ab89ba6bcd1ec90ee917
7
- data.tar.gz: '09a21453b83810bc8fac5cee2e0a9ad16cc3acb3311003ddddd65281a3e5aac607e88a6e1a95f33d8a8d8441dc07e02e36b317df8569cb8e488579045410adc1'
6
+ metadata.gz: 51e3751e2b249f81377bbf7234128e33bbef047090a1256cecc108d20b20ebfe6ea3db76f7751385fc6bc9da034b19c7630c857c67a7393e6d2e787ce1fe7c4d
7
+ data.tar.gz: 69d2fac0f2c1f1f44d461c4f73969f7b6d6f98159103e5b2ad41ca8befde7c1710eaeb1927b3dd35178af85582081f76db9ed3141a3b9c0ea12a562836e3881b
@@ -0,0 +1,47 @@
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 company_resource
23
+ Freshdesk::Rest::Resource::Company.new(client: api)
24
+ end
25
+
26
+ def ticket_resource
27
+ Freshdesk::Rest::Resource::Ticket.new(client: api)
28
+ end
29
+
30
+ def solutions_article_resource
31
+ Freshdesk::Rest::Resource::Solutions::Article.new(client: api)
32
+ end
33
+
34
+ def solutions_category_resource
35
+ Freshdesk::Rest::Resource::Solutions::Category.new(client: api)
36
+ end
37
+
38
+ def solutions_folder_resource
39
+ Freshdesk::Rest::Resource::Solutions::Folder.new(client: api)
40
+ end
41
+
42
+ private
43
+
44
+ attr_reader :api
45
+ end
46
+ end
47
+ 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
@@ -0,0 +1,38 @@
1
+ require_relative 'parser'
2
+ require_relative 'utils'
3
+ require 'uri'
4
+
5
+ module Freshdesk
6
+ module Rest
7
+ module Resource
8
+ class Company
9
+ include Utils
10
+
11
+ def initialize(client:)
12
+ @client = client
13
+ @path = '/companies'
14
+ end
15
+
16
+ def list(params: {})
17
+ Parser.parse(@client.get(path_with_params(@path, params)))
18
+ end
19
+
20
+ def get(id:)
21
+ Parser.parse(@client.get("#{@path}/#{id}"))
22
+ end
23
+
24
+ def post(data:)
25
+ Parser.parse(@client.post(@path, data))
26
+ end
27
+
28
+ def put(id:, data:)
29
+ Parser.parse(@client.put("#{@path}/#{id}", data))
30
+ end
31
+
32
+ def delete(id:)
33
+ Parser.parse(@client.delete("#{@path}/#{id}"))
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -1,5 +1,5 @@
1
1
  module Freshdesk
2
2
  module Rest
3
- VERSION = '0.1.6'
3
+ VERSION = '2.1.0'
4
4
  end
5
5
  end
@@ -1,7 +1,9 @@
1
+ require_relative 'freshdesk-rest/client'
1
2
  require_relative 'freshdesk-rest/factory'
2
3
  require_relative 'freshdesk-rest/version'
3
4
  require_relative 'freshdesk-rest/configuration'
4
5
  require_relative 'freshdesk-rest/resource/contact'
6
+ require_relative 'freshdesk-rest/resource/company'
5
7
  require_relative 'freshdesk-rest/resource/ticket'
6
8
  require_relative 'freshdesk-rest/resource/solutions'
7
9
  require_relative 'freshdesk-rest/resource/solutions/article'
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.1.6
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Helpling
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-14 00:00:00.000000000 Z
11
+ date: 2024-03-20 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,8 +18,10 @@ 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
24
+ - lib/freshdesk-rest/resource/company.rb
23
25
  - lib/freshdesk-rest/resource/contact.rb
24
26
  - lib/freshdesk-rest/resource/parser.rb
25
27
  - lib/freshdesk-rest/resource/solutions.rb
@@ -49,7 +51,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
51
  - !ruby/object:Gem::Version
50
52
  version: '0'
51
53
  requirements: []
52
- rubygems_version: 3.1.6
54
+ rubygems_version: 3.5.3
53
55
  signing_key:
54
56
  specification_version: 4
55
57
  summary: Freshdesk rest api resource collection