smartrecruiters 0.2.1 → 0.2.2

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: 43b208ba52de7a4abd48c460617a3c267ca388c0b2e01b26efb75c09952f0c67
4
- data.tar.gz: 9d4c943804618bb66cb5ae563189bd4c1e7dd8ad060306598f8bd67e93657163
3
+ metadata.gz: 880173b6afc67da655803a5f93d354e1f1ef10d9d726b5b5942a48f73f0eb87d
4
+ data.tar.gz: d3b4f7b200d70db0481a2e414d21c01520178a4701dfa8c3186bb157e5f406eb
5
5
  SHA512:
6
- metadata.gz: 0ff353352a5f4023ab32c0dc9b4412d409ed10053d634df05bc0d6bbd1b9fe346aa4d706b89138975617da27d1d05a9bf1e34ee1d9d4cd164598f091edc43c2d
7
- data.tar.gz: 7f4d67c805e2b733c97a8605772adebc7b4e48ab54652033807bd396bdcd7502b847471bbcacf4a81c86d5d746f8b8b97b25e8816133b22bfe423e0e91780630
6
+ metadata.gz: 7eb8a0275d2e6f9070ad8314d85d319de9746485b2358353e1ba158d0a88677c1f9cc4efa03eb9a0fa1e09af4109427184d4c5899f1729a6a0c44dc95a34204f
7
+ data.tar.gz: d25bd9697ce20cb2496a1cf34df9015bc874e7acdd1174c666fb50f299a78d319edc871a59257fe6bedf0f2f74e41295edded4caffd9ac460a57335cf736b9a1
data/.rubocop.yml CHANGED
@@ -6,4 +6,7 @@ Metrics/MethodLength:
6
6
  Max: 20
7
7
 
8
8
  AllCops:
9
- NewCops: enable
9
+ NewCops: enable
10
+
11
+ Metrics/ClassLength:
12
+ Max: 200
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ### [0.2.2](https://www.github.com/davejcameron/smartrecruiters/compare/v0.2.1...v0.2.2) (2021-10-17)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * candidate routes and add tests ([#15](https://www.github.com/davejcameron/smartrecruiters/issues/15)) ([fe33b32](https://www.github.com/davejcameron/smartrecruiters/commit/fe33b32c4a1af521191ee976751102217a48cf5d))
9
+ * reports apis and add tests ([#17](https://www.github.com/davejcameron/smartrecruiters/issues/17)) ([47bac12](https://www.github.com/davejcameron/smartrecruiters/commit/47bac1240a1a4495e883afa7e26de1312c97ddda))
10
+
3
11
  ### [0.2.1](https://www.github.com/davejcameron/smartrecruiters/compare/v0.2.0...v0.2.1) (2021-10-13)
4
12
 
5
13
 
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SmartRecruiters
4
+ class ReportFile < Object
5
+ end
6
+ end
@@ -21,7 +21,6 @@ module SmartRecruiters
21
21
 
22
22
  def delete(candidate_id:)
23
23
  delete_request("candidates/#{candidate_id}")
24
- true
25
24
  end
26
25
 
27
26
  def retrieve_consent(candidate_id:)
@@ -29,8 +28,7 @@ module SmartRecruiters
29
28
  end
30
29
 
31
30
  def retrieve_consents(candidate_id:)
32
- response = get_request("candidates/#{candidate_id}/consents")
33
- Collection.from_response(response, type: Object.new)
31
+ Object.new get_request("candidates/#{candidate_id}/consents").body
34
32
  end
35
33
 
36
34
  def retrieve_application(candidate_id:, job_id:)
@@ -43,7 +41,8 @@ module SmartRecruiters
43
41
  end
44
42
 
45
43
  def retrieve_status_history(candidate_id:, job_id:)
46
- Object.new get_request("candidates/#{candidate_id}/jobs/#{job_id}/status/history").body
44
+ response = get_request("candidates/#{candidate_id}/jobs/#{job_id}/status/history")
45
+ Collection.from_response(response, type: Object)
47
46
  end
48
47
  end
49
48
  end
@@ -2,30 +2,31 @@
2
2
 
3
3
  module SmartRecruiters
4
4
  class ReportsResource < Resource
5
- REPORT_API = 'reporting-api/v201804'
5
+ REPORT_API = 'reporting-api/v201804/reports'
6
6
  def list(**params)
7
- response = get_request("#{REPORT_API}/reports", params: params)
7
+ response = get_request(REPORT_API.to_s, params: params)
8
8
  Collection.from_response(response, type: Report)
9
9
  end
10
10
 
11
11
  def retrieve(report_id:)
12
- Report.new get_request("#{REPORT_API}/reports/#{report_id}").body
12
+ Report.new get_request("#{REPORT_API}/#{report_id}").body
13
13
  end
14
14
 
15
15
  def retrieve_files(report_id:)
16
- Object.new get_request("#{REPORT_API}/reports/#{report_id}/files").body
16
+ response = get_request("#{REPORT_API}/#{report_id}/files")
17
+ Collection.from_response(response, type: ReportFile)
17
18
  end
18
19
 
19
20
  def generate_report(report_id:)
20
- Report.new post_request("#{REPORT_API}/reports/#{report_id}").body
21
+ Report.new post_request("#{REPORT_API}/#{report_id}/files", body: {}).body
21
22
  end
22
23
 
23
24
  def retrieve_recent_file(report_id:)
24
- Report.new get_request("#{REPORT_API}/reports/#{report_id}/files/recent").body
25
+ ReportFile.new get_request("#{REPORT_API}/#{report_id}/files/recent").body
25
26
  end
26
27
 
27
28
  def retrieve_recent_file_data(report_id:)
28
- response = get_request("#{REPORT_API}/reports/#{report_id}/files/recent/data").body
29
+ response = get_request("#{REPORT_API}/#{report_id}/files/recent/data").body
29
30
  Object.new JSON.parse(response)
30
31
  end
31
32
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SmartRecruiters
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
5
5
  end
@@ -18,6 +18,7 @@ module SmartRecruiters
18
18
  autoload :Offer, 'smartrecruiters/objects/offer'
19
19
  autoload :User, 'smartrecruiters/objects/user'
20
20
  autoload :Report, 'smartrecruiters/objects/report'
21
+ autoload :ReportFile, 'smartrecruiters/objects/report_file'
21
22
  autoload :Review, 'smartrecruiters/objects/review'
22
23
  autoload :SystemRole, 'smartrecruiters/objects/system_role'
23
24
  autoload :Webhook, 'smartrecruiters/objects/webhook'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartrecruiters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cameron
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-14 00:00:00.000000000 Z
11
+ date: 2021-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -112,6 +112,7 @@ files:
112
112
  - lib/smartrecruiters/objects/job.rb
113
113
  - lib/smartrecruiters/objects/offer.rb
114
114
  - lib/smartrecruiters/objects/report.rb
115
+ - lib/smartrecruiters/objects/report_file.rb
115
116
  - lib/smartrecruiters/objects/review.rb
116
117
  - lib/smartrecruiters/objects/system_role.rb
117
118
  - lib/smartrecruiters/objects/user.rb