freshdesk-rest 2.0.0 → 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: 7bc6ab83544f21d8c0a6873372dd3b5d80bd003c3fc62ff23e074f040ac414e7
4
- data.tar.gz: 46e16135cab76d38398d87ae55fb4d21227f82c7b4707c8c1121df242f31943d
3
+ metadata.gz: aad4d7b1cecf8c724587cc8dd2eb39b19090d3373c1254af79005be2203301b6
4
+ data.tar.gz: 51d958a4c0ef8ef68147c37fdf735bbb22ddbed54d209c4c0d8827dd003812c7
5
5
  SHA512:
6
- metadata.gz: 466bebf0fed5cf850005336d56c10cda84e406ac91ff9665ac634207000ebd4ade887acdd1de7e77c6cf165968b45876c2f7faa012fe56c736d09ae62ca78aed
7
- data.tar.gz: cf6539a9fb2a24e453c7dded2b15347b475f01f614d15c83c7e8f9c4923b7f0b6d347a1dfa782e44297ac89d9f71de04d9e7eda28f97082033e7d8b91c76679c
6
+ metadata.gz: 51e3751e2b249f81377bbf7234128e33bbef047090a1256cecc108d20b20ebfe6ea3db76f7751385fc6bc9da034b19c7630c857c67a7393e6d2e787ce1fe7c4d
7
+ data.tar.gz: 69d2fac0f2c1f1f44d461c4f73969f7b6d6f98159103e5b2ad41ca8befde7c1710eaeb1927b3dd35178af85582081f76db9ed3141a3b9c0ea12a562836e3881b
@@ -19,6 +19,10 @@ module Freshdesk
19
19
  Freshdesk::Rest::Resource::Contact.new(client: api)
20
20
  end
21
21
 
22
+ def company_resource
23
+ Freshdesk::Rest::Resource::Company.new(client: api)
24
+ end
25
+
22
26
  def ticket_resource
23
27
  Freshdesk::Rest::Resource::Ticket.new(client: api)
24
28
  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 = '2.0.0'
3
+ VERSION = '2.1.0'
4
4
  end
5
5
  end
@@ -3,6 +3,7 @@ require_relative 'freshdesk-rest/factory'
3
3
  require_relative 'freshdesk-rest/version'
4
4
  require_relative 'freshdesk-rest/configuration'
5
5
  require_relative 'freshdesk-rest/resource/contact'
6
+ require_relative 'freshdesk-rest/resource/company'
6
7
  require_relative 'freshdesk-rest/resource/ticket'
7
8
  require_relative 'freshdesk-rest/resource/solutions'
8
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: 2.0.0
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-03-18 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
@@ -21,6 +21,7 @@ files:
21
21
  - lib/freshdesk-rest/client.rb
22
22
  - lib/freshdesk-rest/configuration.rb
23
23
  - lib/freshdesk-rest/factory.rb
24
+ - lib/freshdesk-rest/resource/company.rb
24
25
  - lib/freshdesk-rest/resource/contact.rb
25
26
  - lib/freshdesk-rest/resource/parser.rb
26
27
  - lib/freshdesk-rest/resource/solutions.rb