cb-api 18.5.6 → 19.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -0
- data/lib/cb/clients/job.rb +0 -5
- data/lib/cb/config.rb +1 -2
- data/lib/cb/models/implementations/job_results.rb +5 -16
- data/lib/cb/requests/job_search/get.rb +2 -2
- data/lib/cb/responses/job/search.rb +3 -23
- data/lib/cb/utils/response_map.rb +1 -1
- data/lib/cb/version.rb +1 -1
- metadata +2 -6
- data/lib/cb/models/implementations/collapsed_job_results.rb +0 -37
- data/lib/cb/models/implementations/collapsed_jobs.rb +0 -46
- data/lib/cb/models/implementations/job_results_v3.rb +0 -21
- data/lib/cb/responses/job/search_v3.rb +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee3ffb53f8b2c77159417a8e0f454826efb3cea8
|
4
|
+
data.tar.gz: a1a61ee78495e8cd0bb837e0e900cab531eb2beb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7d8166fbf9a190faea2c323583da6ad0cf71f6ce6ec9a02af49cd354f9ff1640a2406561bfa7c3b1d8c6316eb20a3ee411cb659fb6a784d8d1ff462eb8472c1
|
7
|
+
data.tar.gz: 406a4f578a1d320fa547e20f51a6ce0d3163ecc3e244908ab721ea7a5d47b849bf0b0de78525c86965ff2eceeb5983fe0c5bf2fdb72bc12663a813563a9a5036
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,7 @@ Version History
|
|
3
3
|
* All Version bumps are required to update this file as well!!
|
4
4
|
----
|
5
5
|
|
6
|
+
* 19.0.0 Removed job search version(s) prior to version 3. Breaks existing consumers of the API in the following ways. JobResultsV3 renamed to JobResults. The old JobResults path no longer works. Users of the JobSearch API will now need to use OAuth and not Developer Keys to use the JobSearch API>
|
6
7
|
* 18.5.6 Adding an additional field to application form
|
7
8
|
* 18.5.5 Turn company recs response into an array if its not.
|
8
9
|
* 18.5.4 Catch nil Jobs for company recs.
|
data/lib/cb/clients/job.rb
CHANGED
@@ -14,11 +14,6 @@ module Cb
|
|
14
14
|
module Clients
|
15
15
|
class Job
|
16
16
|
class << self
|
17
|
-
def search(args)
|
18
|
-
response = api_client.cb_get(Cb.configuration.uri_job_search, query: args)
|
19
|
-
Cb::Responses::Job::Search.new(response)
|
20
|
-
end
|
21
|
-
|
22
17
|
def find_by_criteria(criteria)
|
23
18
|
query = api_client.class.criteria_to_hash(criteria)
|
24
19
|
json_response = api_client.cb_get(Cb.configuration.uri_job_find, query: query)
|
data/lib/cb/config.rb
CHANGED
@@ -57,8 +57,7 @@ module Cb
|
|
57
57
|
@uri_job_industry_search ||= '/v1/industrycodes'
|
58
58
|
@uri_employee_types ||= '/v1/employeetypes'
|
59
59
|
@uri_company_find ||= '/Employer/CompanyDetails'
|
60
|
-
@uri_job_search ||= '/
|
61
|
-
@uri_job_search_v3 ||= '/consumer/jobs/search/'
|
60
|
+
@uri_job_search ||= '/consumer/jobs/search/'
|
62
61
|
@uri_job_find ||= '/v3/Job'
|
63
62
|
@uri_education_code ||= '/v1/EducationCodes'
|
64
63
|
@uri_recommendation_for_job ||= '/v1/Recommendations/ForJob'
|
@@ -11,24 +11,13 @@
|
|
11
11
|
module Cb
|
12
12
|
module Models
|
13
13
|
class JobResults
|
14
|
-
attr_reader :
|
15
|
-
def initialize(args_hash, job_hashes)
|
16
|
-
@args_hash = args_hash
|
17
|
-
@jobs = extract_jobs(job_hashes)
|
18
|
-
@total_count = args_hash['TotalCount']
|
19
|
-
@last_item_index = args_hash['LastItemIndex']
|
20
|
-
@city = args_hash['City']
|
21
|
-
@state_code = args_hash['StateCode']
|
22
|
-
@postal_code = args_hash['PostalCode']
|
23
|
-
@search_location = args_hash['SearchMetaData']['SearchLocations']['SearchLocation'] rescue nil
|
24
|
-
end
|
25
|
-
|
26
|
-
private
|
14
|
+
attr_reader :api_response
|
27
15
|
|
28
|
-
def
|
29
|
-
|
30
|
-
|
16
|
+
def initialize(response_hash = {})
|
17
|
+
unless response_hash.is_a?(Hash)
|
18
|
+
response_hash = {}
|
31
19
|
end
|
20
|
+
@api_response = response_hash
|
32
21
|
end
|
33
22
|
end
|
34
23
|
end
|
@@ -20,7 +20,7 @@ module Cb
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def endpoint_uri
|
23
|
-
Cb.configuration.
|
23
|
+
Cb.configuration.uri_job_search
|
24
24
|
end
|
25
25
|
|
26
26
|
def http_method
|
@@ -30,7 +30,7 @@ module Cb
|
|
30
30
|
def headers
|
31
31
|
{
|
32
32
|
'HostSite' => args[:host_site] || Cb.configuration.host_site,
|
33
|
-
'Accept' => '
|
33
|
+
'Accept' => 'application/json;version=3.0'
|
34
34
|
}.merge(token.headers)
|
35
35
|
end
|
36
36
|
|
@@ -19,37 +19,17 @@ module Cb
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def hash_containing_metadata
|
22
|
-
|
22
|
+
'search_metadata'
|
23
23
|
end
|
24
24
|
|
25
25
|
def extract_models
|
26
|
-
|
27
|
-
Models::CollapsedJobResults.new(response[root_node])
|
28
|
-
else
|
29
|
-
Models::JobResults.new(response[root_node], job_hashes)
|
30
|
-
end
|
26
|
+
Models::JobResults.new(response)
|
31
27
|
end
|
32
28
|
|
33
29
|
private
|
34
30
|
|
35
31
|
def root_node
|
36
|
-
'
|
37
|
-
end
|
38
|
-
|
39
|
-
def job_hashes
|
40
|
-
hashes = response[root_node]['Results']['JobSearchResult'] rescue []
|
41
|
-
|
42
|
-
if hashes.is_a?(Array)
|
43
|
-
hashes
|
44
|
-
elsif hashes.nil?
|
45
|
-
[]
|
46
|
-
else
|
47
|
-
[hashes]
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
def is_collapsed
|
52
|
-
response[root_node].key?('GroupedJobSearchResults')
|
32
|
+
'data'
|
53
33
|
end
|
54
34
|
end
|
55
35
|
end
|
@@ -56,7 +56,7 @@ module Cb
|
|
56
56
|
|
57
57
|
Cb::Requests::Job::Report => Cb::Responses::Job::Report,
|
58
58
|
|
59
|
-
Cb::Requests::JobSearch::Get => Cb::Responses::Job::
|
59
|
+
Cb::Requests::JobSearch::Get => Cb::Responses::Job::Search,
|
60
60
|
|
61
61
|
Cb::Requests::Recommendations::Resume => Cb::Responses::Recommendations,
|
62
62
|
|
data/lib/cb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cb-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 19.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The CareerBuilder.com Niche and Consumer Development teams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -259,8 +259,6 @@ files:
|
|
259
259
|
- lib/cb/models/implementations/branding/styles/page.rb
|
260
260
|
- lib/cb/models/implementations/branding/widget.rb
|
261
261
|
- lib/cb/models/implementations/category.rb
|
262
|
-
- lib/cb/models/implementations/collapsed_job_results.rb
|
263
|
-
- lib/cb/models/implementations/collapsed_jobs.rb
|
264
262
|
- lib/cb/models/implementations/company.rb
|
265
263
|
- lib/cb/models/implementations/cover_letter.rb
|
266
264
|
- lib/cb/models/implementations/data_lists/resume_data_list.rb
|
@@ -271,7 +269,6 @@ files:
|
|
271
269
|
- lib/cb/models/implementations/job.rb
|
272
270
|
- lib/cb/models/implementations/job_branding.rb
|
273
271
|
- lib/cb/models/implementations/job_results.rb
|
274
|
-
- lib/cb/models/implementations/job_results_v3.rb
|
275
272
|
- lib/cb/models/implementations/recommended_job.rb
|
276
273
|
- lib/cb/models/implementations/report_job.rb
|
277
274
|
- lib/cb/models/implementations/resume.rb
|
@@ -352,7 +349,6 @@ files:
|
|
352
349
|
- lib/cb/responses/industry/search.rb
|
353
350
|
- lib/cb/responses/job/report.rb
|
354
351
|
- lib/cb/responses/job/search.rb
|
355
|
-
- lib/cb/responses/job/search_v3.rb
|
356
352
|
- lib/cb/responses/job/singular.rb
|
357
353
|
- lib/cb/responses/metadata.rb
|
358
354
|
- lib/cb/responses/nil_model.rb
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# Copyright 2015 CareerBuilder, LLC
|
2
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
3
|
-
# you may not use this file except in compliance with the License.
|
4
|
-
# You may obtain a copy of the License at
|
5
|
-
#
|
6
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
7
|
-
# Unless required by applicable law or agreed to in writing, software
|
8
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
9
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
-
# See the License for the specific language governing permissions and limitations under the License.
|
11
|
-
module Cb
|
12
|
-
module Models
|
13
|
-
class CollapsedJobResults
|
14
|
-
attr_reader :args_hash, :last_item_index, :search_location, :grouped_jobs, :grouping_parameter, :total_count, :total_pages, :first_item_index, :last_item_index
|
15
|
-
def initialize(args_hash)
|
16
|
-
@args_hash = args_hash
|
17
|
-
@last_item_index = args_hash['LastItemIndex']
|
18
|
-
@search_location = args_hash['SearchMetaData']['SearchLocations']['SearchLocation'] rescue nil
|
19
|
-
@grouping_parameter = args_hash['GroupedJobSearchResults']['GroupingParameter']
|
20
|
-
@grouped_jobs = extract_collapsed_jobs(Cb::Utils::ResponseArrayExtractor.extract(args_hash['GroupedJobSearchResults'],
|
21
|
-
'SearchResults', 'JobSearchResultsGroup'))
|
22
|
-
@total_pages = args_hash['TotalPages']
|
23
|
-
@total_count = args_hash['TotalCount']
|
24
|
-
@first_item_index = args_hash['FirstItemIndex']
|
25
|
-
@last_item_index = args_hash['LastItemIndex']
|
26
|
-
end
|
27
|
-
|
28
|
-
private
|
29
|
-
|
30
|
-
def extract_collapsed_jobs(collapsed_jobs)
|
31
|
-
collapsed_jobs.collect do |collapsed_job|
|
32
|
-
CollapsedJobs.new(collapsed_job)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
# Copyright 2015 CareerBuilder, LLC
|
2
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
3
|
-
# you may not use this file except in compliance with the License.
|
4
|
-
# You may obtain a copy of the License at
|
5
|
-
#
|
6
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
7
|
-
# Unless required by applicable law or agreed to in writing, software
|
8
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
9
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
-
# See the License for the specific language governing permissions and limitations under the License.
|
11
|
-
module Cb
|
12
|
-
module Models
|
13
|
-
class CollapsedJobs < ApiResponseModel
|
14
|
-
attr_accessor :jobs_in_group, :job_description, :grouping_value
|
15
|
-
|
16
|
-
def initialize(args = {})
|
17
|
-
super(args)
|
18
|
-
end
|
19
|
-
|
20
|
-
def job_count
|
21
|
-
@jobs_in_group
|
22
|
-
end
|
23
|
-
|
24
|
-
def job
|
25
|
-
@job_description
|
26
|
-
end
|
27
|
-
|
28
|
-
protected
|
29
|
-
|
30
|
-
def required_fields
|
31
|
-
[]
|
32
|
-
end
|
33
|
-
|
34
|
-
def set_model_properties
|
35
|
-
args = api_response
|
36
|
-
@jobs_in_group = args['NumberJobsInGroup']
|
37
|
-
@job_description = get_jobs(args['GroupedSearchResults']['JobSearchResult'])
|
38
|
-
@grouping_value = args['GroupingValue']
|
39
|
-
end
|
40
|
-
|
41
|
-
def get_jobs(jobs_hash)
|
42
|
-
Job.new(jobs_hash)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# Copyright 2015 CareerBuilder, LLC
|
2
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
3
|
-
# you may not use this file except in compliance with the License.
|
4
|
-
# You may obtain a copy of the License at
|
5
|
-
#
|
6
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
7
|
-
# Unless required by applicable law or agreed to in writing, software
|
8
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
9
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
-
# See the License for the specific language governing permissions and limitations under the License.
|
11
|
-
module Cb
|
12
|
-
module Models
|
13
|
-
class JobResultsV3
|
14
|
-
attr_reader :api_response
|
15
|
-
|
16
|
-
def initialize(response_hash = {})
|
17
|
-
@api_response = response_hash
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# Copyright 2015 CareerBuilder, LLC
|
2
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
3
|
-
# you may not use this file except in compliance with the License.
|
4
|
-
# You may obtain a copy of the License at
|
5
|
-
#
|
6
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
7
|
-
# Unless required by applicable law or agreed to in writing, software
|
8
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
9
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
-
# See the License for the specific language governing permissions and limitations under the License.
|
11
|
-
module Cb
|
12
|
-
module Responses
|
13
|
-
module Job
|
14
|
-
class SearchV3 < ApiResponse
|
15
|
-
protected
|
16
|
-
|
17
|
-
def validate_api_hash
|
18
|
-
required_response_field(root_node, response)
|
19
|
-
end
|
20
|
-
|
21
|
-
def hash_containing_metadata
|
22
|
-
'search_metadata'
|
23
|
-
end
|
24
|
-
|
25
|
-
def extract_models
|
26
|
-
Models::JobResultsV3.new(response)
|
27
|
-
end
|
28
|
-
|
29
|
-
private
|
30
|
-
|
31
|
-
def root_node
|
32
|
-
'data'
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|