cb-api 17.4.0 → 18.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/CONTRIBUTING.md +18 -0
- data/LICENSE +202 -0
- data/README.md +3 -1
- data/lib/cb.rb +12 -2
- data/lib/cb/client.rb +10 -0
- data/lib/cb/clients/anon_saved_search.rb +12 -4
- data/lib/cb/clients/application.rb +10 -2
- data/lib/cb/clients/application_external.rb +13 -5
- data/lib/cb/clients/category.rb +16 -8
- data/lib/cb/clients/company.rb +16 -8
- data/lib/cb/clients/education.rb +17 -9
- data/lib/cb/clients/employee_types.rb +11 -3
- data/lib/cb/clients/industry.rb +12 -3
- data/lib/cb/clients/job.rb +10 -2
- data/lib/cb/clients/job_branding.rb +13 -5
- data/lib/cb/clients/recommendation.rb +27 -18
- data/lib/cb/clients/saved_search.rb +21 -15
- data/lib/cb/clients/talent_network.rb +20 -12
- data/lib/cb/clients/user.rb +22 -14
- data/lib/cb/config.rb +64 -54
- data/lib/cb/convenience.rb +22 -13
- data/lib/cb/criteria/application/cover_letter.rb +10 -0
- data/lib/cb/criteria/application/create.rb +11 -1
- data/lib/cb/criteria/application/get.rb +10 -0
- data/lib/cb/criteria/application/response.rb +10 -0
- data/lib/cb/criteria/application/resume.rb +10 -0
- data/lib/cb/criteria/application/update.rb +10 -0
- data/lib/cb/criteria/job/details.rb +11 -1
- data/lib/cb/criteria/resumes/get_by_hash.rb +12 -2
- data/lib/cb/criteria/user/change_password.rb +21 -11
- data/lib/cb/criteria/user/delete.rb +18 -11
- data/lib/cb/exceptions.rb +14 -4
- data/lib/cb/models/api_call_model.rb +10 -1
- data/lib/cb/models/api_response_model.rb +15 -7
- data/lib/cb/models/implementations/application.rb +10 -1
- data/lib/cb/models/implementations/application/cover_letter.rb +10 -1
- data/lib/cb/models/implementations/application/form.rb +13 -5
- data/lib/cb/models/implementations/application/response.rb +10 -1
- data/lib/cb/models/implementations/application/resume.rb +10 -1
- data/lib/cb/models/implementations/application_external.rb +12 -3
- data/lib/cb/models/implementations/branding/media.rb +10 -2
- data/lib/cb/models/implementations/branding/section.rb +10 -2
- data/lib/cb/models/implementations/branding/style.rb +10 -2
- data/lib/cb/models/implementations/branding/styles/base.rb +12 -4
- data/lib/cb/models/implementations/branding/styles/buttons.rb +10 -2
- data/lib/cb/models/implementations/branding/styles/company_info.rb +11 -3
- data/lib/cb/models/implementations/branding/styles/container.rb +11 -3
- data/lib/cb/models/implementations/branding/styles/content.rb +10 -2
- data/lib/cb/models/implementations/branding/styles/css_adapter.rb +10 -2
- data/lib/cb/models/implementations/branding/styles/headings.rb +10 -2
- data/lib/cb/models/implementations/branding/styles/job_details.rb +10 -2
- data/lib/cb/models/implementations/branding/styles/page.rb +10 -2
- data/lib/cb/models/implementations/branding/widget.rb +10 -2
- data/lib/cb/models/implementations/category.rb +17 -7
- data/lib/cb/models/implementations/collapsed_job_results.rb +10 -1
- data/lib/cb/models/implementations/collapsed_jobs.rb +10 -0
- data/lib/cb/models/implementations/company.rb +17 -10
- data/lib/cb/models/implementations/data_lists/resume_data_list.rb +11 -1
- data/lib/cb/models/implementations/education.rb +10 -0
- data/lib/cb/models/implementations/email_subscription.rb +10 -0
- data/lib/cb/models/implementations/employee_type.rb +14 -4
- data/lib/cb/models/implementations/industry.rb +14 -6
- data/lib/cb/models/implementations/job.rb +24 -20
- data/lib/cb/models/implementations/job_branding.rb +13 -5
- data/lib/cb/models/implementations/job_results.rb +10 -2
- data/lib/cb/models/implementations/job_results_v3.rb +11 -1
- data/lib/cb/models/implementations/recommended_job.rb +10 -0
- data/lib/cb/models/implementations/resume.rb +11 -1
- data/lib/cb/models/implementations/resume_document.rb +10 -0
- data/lib/cb/models/implementations/resume_listing.rb +11 -1
- data/lib/cb/models/implementations/resumes/country_code.rb +10 -0
- data/lib/cb/models/implementations/resumes/education.rb +11 -1
- data/lib/cb/models/implementations/resumes/government_and_military.rb +11 -1
- data/lib/cb/models/implementations/resumes/language_code.rb +12 -2
- data/lib/cb/models/implementations/resumes/relocation.rb +11 -1
- data/lib/cb/models/implementations/resumes/salary_information.rb +11 -2
- data/lib/cb/models/implementations/resumes/skills_and_qualifications.rb +10 -0
- data/lib/cb/models/implementations/resumes/work_experience.rb +11 -1
- data/lib/cb/models/implementations/saved_search.rb +83 -73
- data/lib/cb/models/implementations/state.rb +11 -2
- data/lib/cb/models/implementations/talent_network.rb +44 -36
- data/lib/cb/models/implementations/user.rb +12 -2
- data/lib/cb/models/implementations/work_status.rb +12 -3
- data/lib/cb/requests/anonymous_saved_search/create.rb +10 -2
- data/lib/cb/requests/anonymous_saved_search/delete.rb +10 -2
- data/lib/cb/requests/application/create.rb +10 -1
- data/lib/cb/requests/application/form.rb +10 -2
- data/lib/cb/requests/application/get.rb +10 -1
- data/lib/cb/requests/application/update.rb +10 -1
- data/lib/cb/requests/application/utils.rb +10 -1
- data/lib/cb/requests/application_external/submit_application.rb +10 -2
- data/lib/cb/requests/base.rb +13 -5
- data/lib/cb/requests/category/search.rb +10 -2
- data/lib/cb/requests/company/find.rb +12 -4
- data/lib/cb/requests/data_lists/countries.rb +10 -0
- data/lib/cb/requests/data_lists/data_list_base.rb +11 -1
- data/lib/cb/requests/data_lists/desired_job_type.rb +10 -0
- data/lib/cb/requests/data_lists/education_codes.rb +10 -0
- data/lib/cb/requests/data_lists/languages.rb +10 -0
- data/lib/cb/requests/data_lists/state.rb +12 -2
- data/lib/cb/requests/education/get.rb +10 -2
- data/lib/cb/requests/email_subscription/modify.rb +13 -5
- data/lib/cb/requests/email_subscription/retrieve.rb +10 -2
- data/lib/cb/requests/job_search/get.rb +12 -3
- data/lib/cb/requests/recommendations/resume_recs.rb +12 -4
- data/lib/cb/requests/resumes/delete.rb +10 -0
- data/lib/cb/requests/resumes/get.rb +10 -0
- data/lib/cb/requests/resumes/language_codes.rb +12 -2
- data/lib/cb/requests/resumes/list.rb +12 -2
- data/lib/cb/requests/resumes/post.rb +11 -1
- data/lib/cb/requests/resumes/put.rb +11 -3
- data/lib/cb/requests/user/change_password.rb +10 -2
- data/lib/cb/requests/user/check_existing.rb +10 -2
- data/lib/cb/requests/user/delete.rb +10 -2
- data/lib/cb/requests/user/retrieve.rb +10 -2
- data/lib/cb/requests/user/temporary_password.rb +11 -3
- data/lib/cb/requests/work_status/list.rb +10 -2
- data/lib/cb/responses/Recommendation/recommendations.rb +10 -1
- data/lib/cb/responses/anonymous_saved_search/create.rb +10 -2
- data/lib/cb/responses/anonymous_saved_search/delete.rb +10 -2
- data/lib/cb/responses/api_response.rb +19 -9
- data/lib/cb/responses/application.rb +10 -2
- data/lib/cb/responses/application/application_form.rb +10 -2
- data/lib/cb/responses/application_external/submit_application.rb +11 -2
- data/lib/cb/responses/category/search.rb +13 -4
- data/lib/cb/responses/company/find.rb +12 -3
- data/lib/cb/responses/data_list/state.rb +10 -1
- data/lib/cb/responses/data_lists/resume_data_list.rb +10 -1
- data/lib/cb/responses/education/get.rb +13 -4
- data/lib/cb/responses/email_subscription/response.rb +11 -2
- data/lib/cb/responses/employee_types/search.rb +10 -3
- data/lib/cb/responses/errors.rb +14 -5
- data/lib/cb/responses/industry/search.rb +11 -4
- data/lib/cb/responses/job/search.rb +10 -1
- data/lib/cb/responses/job/search_v3.rb +10 -1
- data/lib/cb/responses/job/singular.rb +13 -4
- data/lib/cb/responses/metadata.rb +11 -2
- data/lib/cb/responses/resumes/language_codes.rb +11 -0
- data/lib/cb/responses/resumes/resume.rb +10 -1
- data/lib/cb/responses/resumes/resume_document.rb +10 -0
- data/lib/cb/responses/resumes/resume_list.rb +10 -0
- data/lib/cb/responses/saved_search/delete.rb +11 -3
- data/lib/cb/responses/saved_search/list.rb +10 -2
- data/lib/cb/responses/saved_search/retrieve.rb +10 -2
- data/lib/cb/responses/saved_search/singular.rb +10 -2
- data/lib/cb/responses/saved_search/update.rb +11 -3
- data/lib/cb/responses/timing.rb +15 -6
- data/lib/cb/responses/user/change_password.rb +12 -4
- data/lib/cb/responses/user/check_existing.rb +11 -3
- data/lib/cb/responses/user/delete.rb +11 -3
- data/lib/cb/responses/user/retrieve.rb +10 -3
- data/lib/cb/responses/user/temporary_password.rb +10 -3
- data/lib/cb/responses/work_status/list.rb +12 -4
- data/lib/cb/utils/api.rb +22 -12
- data/lib/cb/utils/console_observer.rb +11 -2
- data/lib/cb/utils/country.rb +14 -4
- data/lib/cb/utils/fluid_attributes.rb +11 -4
- data/lib/cb/utils/meta_values.rb +10 -0
- data/lib/cb/utils/response_array_extractor.rb +14 -6
- data/lib/cb/utils/response_map.rb +12 -3
- data/lib/cb/utils/validator.rb +21 -19
- data/lib/cb/version.rb +11 -1
- data/lib/tasks/cb.rake +11 -1
- data/lib/tasks/doc.rake +15 -5
- metadata +5 -3
data/lib/cb/clients/company.rb
CHANGED
@@ -1,18 +1,27 @@
|
|
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.
|
1
11
|
require 'json'
|
2
12
|
|
3
13
|
module Cb
|
4
14
|
module Clients
|
5
15
|
class Company
|
6
|
-
|
7
16
|
def self.find_by_did(did)
|
8
17
|
my_api = Cb::Utils::Api.instance
|
9
|
-
json_hash = my_api.cb_get(Cb.configuration.uri_company_find, :
|
18
|
+
json_hash = my_api.cb_get(Cb.configuration.uri_company_find, query: { CompanyDID: did, hostsite: Cb.configuration.host_site })
|
10
19
|
|
11
|
-
if json_hash.
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
20
|
+
if json_hash.key?('Results')
|
21
|
+
if json_hash['Results'].key?('CompanyProfileDetail')
|
22
|
+
company = Models::Company.new(json_hash['Results']['CompanyProfileDetail'])
|
23
|
+
end
|
24
|
+
my_api.append_api_responses(company, json_hash['Results'])
|
16
25
|
end
|
17
26
|
|
18
27
|
my_api.append_api_responses(company, json_hash)
|
@@ -28,7 +37,6 @@ module Cb
|
|
28
37
|
|
29
38
|
find_by_did did unless did.empty?
|
30
39
|
end
|
31
|
-
|
32
40
|
end
|
33
41
|
end
|
34
42
|
end
|
data/lib/cb/clients/education.rb
CHANGED
@@ -1,28 +1,36 @@
|
|
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.
|
1
11
|
require 'json'
|
2
12
|
|
3
13
|
module Cb
|
4
14
|
module Clients
|
5
15
|
class Education
|
6
|
-
|
7
16
|
def self.get_for(country)
|
8
17
|
Cb::Utils::Country.is_valid? country ? country : 'US'
|
9
18
|
my_api = Cb::Utils::Api.instance
|
10
|
-
json_hash = my_api.cb_get(Cb.configuration.uri_education_code, :
|
19
|
+
json_hash = my_api.cb_get(Cb.configuration.uri_education_code, query: { countrycode: country })
|
11
20
|
|
12
21
|
codes = []
|
13
|
-
if json_hash.
|
14
|
-
if json_hash['ResponseEducationCodes'].
|
15
|
-
json_hash['ResponseEducationCodes']['EducationCodes'].
|
16
|
-
|
17
|
-
|
18
|
-
|
22
|
+
if json_hash.key?('ResponseEducationCodes')
|
23
|
+
if json_hash['ResponseEducationCodes'].key?('EducationCodes') &&
|
24
|
+
json_hash['ResponseEducationCodes']['EducationCodes'].key?('Education')
|
25
|
+
json_hash['ResponseEducationCodes']['EducationCodes']['Education'].each do |education|
|
26
|
+
codes << Cb::Models::Education.new(education)
|
27
|
+
end
|
19
28
|
end
|
20
29
|
my_api.append_api_responses(codes, json_hash['ResponseEducationCodes'])
|
21
30
|
end
|
22
31
|
|
23
32
|
my_api.append_api_responses(codes, json_hash)
|
24
33
|
end
|
25
|
-
|
26
34
|
end
|
27
35
|
end
|
28
36
|
end
|
@@ -1,6 +1,15 @@
|
|
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.
|
1
11
|
module Cb
|
2
12
|
module Clients
|
3
|
-
|
4
13
|
class EmployeeTypes
|
5
14
|
def search
|
6
15
|
json = cb_client.cb_get(endpoint)
|
@@ -8,7 +17,7 @@ module Cb
|
|
8
17
|
end
|
9
18
|
|
10
19
|
def search_by_hostsite(host_site)
|
11
|
-
json = cb_client.cb_get(endpoint, :
|
20
|
+
json = cb_client.cb_get(endpoint, query: { CountryCode: host_site })
|
12
21
|
new_response_object(json)
|
13
22
|
end
|
14
23
|
|
@@ -26,6 +35,5 @@ module Cb
|
|
26
35
|
Responses::EmployeeTypes::Search.new(json_response)
|
27
36
|
end
|
28
37
|
end
|
29
|
-
|
30
38
|
end
|
31
39
|
end
|
data/lib/cb/clients/industry.rb
CHANGED
@@ -1,12 +1,21 @@
|
|
1
|
-
|
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
|
+
require 'json'
|
2
12
|
|
3
13
|
module Cb
|
4
14
|
module Clients
|
5
15
|
class Industry
|
6
16
|
class << self
|
7
|
-
|
8
17
|
def search
|
9
|
-
response = api_client.cb_get(Cb.configuration.uri_job_industry_search, :
|
18
|
+
response = api_client.cb_get(Cb.configuration.uri_job_industry_search, query: { CountryCode: Cb.configuration.host_site })
|
10
19
|
Cb::Responses::Industry::Search.new(response)
|
11
20
|
end
|
12
21
|
|
data/lib/cb/clients/job.rb
CHANGED
@@ -1,10 +1,19 @@
|
|
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.
|
1
11
|
require 'json'
|
2
12
|
|
3
13
|
module Cb
|
4
14
|
module Clients
|
5
15
|
class Job
|
6
16
|
class << self
|
7
|
-
|
8
17
|
def search(args)
|
9
18
|
response = api_client.cb_get(Cb.configuration.uri_job_search, query: args)
|
10
19
|
Cb::Responses::Job::Search.new(response)
|
@@ -28,7 +37,6 @@ module Cb
|
|
28
37
|
def api_client
|
29
38
|
@api ||= Cb::Utils::Api.instance
|
30
39
|
end
|
31
|
-
|
32
40
|
end
|
33
41
|
end
|
34
42
|
end
|
@@ -1,19 +1,27 @@
|
|
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.
|
1
11
|
module Cb
|
2
12
|
module Clients
|
3
13
|
class JobBranding
|
4
|
-
|
5
|
-
def self.find_by_id id
|
14
|
+
def self.find_by_id(id)
|
6
15
|
my_api = Cb::Utils::Api.instance
|
7
|
-
json_hash = my_api.cb_get Cb.configuration.uri_job_branding, :
|
16
|
+
json_hash = my_api.cb_get Cb.configuration.uri_job_branding, query: { id: id }
|
8
17
|
|
9
|
-
if json_hash.
|
18
|
+
if json_hash.key? 'Branding'
|
10
19
|
branding = Models::JobBranding.new json_hash['Branding']
|
11
20
|
my_api.append_api_responses(branding, json_hash['Branding'])
|
12
21
|
end
|
13
22
|
|
14
23
|
my_api.append_api_responses(branding, json_hash)
|
15
24
|
end
|
16
|
-
|
17
25
|
end
|
18
26
|
end
|
19
27
|
end
|
@@ -1,3 +1,13 @@
|
|
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.
|
1
11
|
require 'json'
|
2
12
|
|
3
13
|
module Cb
|
@@ -8,12 +18,12 @@ module Cb
|
|
8
18
|
hash = normalize_args(args)
|
9
19
|
hash = set_hash_defaults(hash)
|
10
20
|
json_hash = my_api.cb_get(Cb.configuration.uri_recommendation_for_job,
|
11
|
-
|
21
|
+
query: hash)
|
12
22
|
|
13
23
|
jobs = []
|
14
24
|
|
15
|
-
if json_hash.
|
16
|
-
if json_hash['ResponseRecommendJob'].
|
25
|
+
if json_hash.key?('ResponseRecommendJob')
|
26
|
+
if json_hash['ResponseRecommendJob'].key?('RecommendJobResults') &&
|
17
27
|
!json_hash['ResponseRecommendJob']['RecommendJobResults'].nil?
|
18
28
|
|
19
29
|
jobs = create_jobs json_hash, 'Job'
|
@@ -32,14 +42,14 @@ module Cb
|
|
32
42
|
hash = normalize_args(args)
|
33
43
|
hash = set_hash_defaults(hash)
|
34
44
|
json_hash = my_api.cb_get(Cb.configuration.uri_recommendation_for_user,
|
35
|
-
|
45
|
+
query: hash)
|
36
46
|
|
37
47
|
jobs = []
|
38
48
|
|
39
|
-
if json_hash.
|
49
|
+
if json_hash.key?('ResponseRecommendUser')
|
40
50
|
|
41
|
-
if json_hash['ResponseRecommendUser'].
|
42
|
-
|
51
|
+
if json_hash['ResponseRecommendUser'].key?('RecommendJobResults') &&
|
52
|
+
!json_hash['ResponseRecommendUser']['RecommendJobResults'].nil?
|
43
53
|
|
44
54
|
jobs = create_jobs json_hash, 'User'
|
45
55
|
|
@@ -54,11 +64,11 @@ module Cb
|
|
54
64
|
|
55
65
|
def self.for_company(company_did)
|
56
66
|
my_api = Cb::Utils::Api.instance
|
57
|
-
json_hash = my_api.cb_get(Cb.configuration.uri_recommendation_for_company, :
|
67
|
+
json_hash = my_api.cb_get(Cb.configuration.uri_recommendation_for_company, query: { CompanyDID: company_did })
|
58
68
|
|
59
69
|
jobs = []
|
60
|
-
if json_hash.
|
61
|
-
if json_hash['Results'].
|
70
|
+
if json_hash.key?('Results')
|
71
|
+
if json_hash['Results'].key?('JobRecommendation')
|
62
72
|
json_hash['Results']['JobRecommendation']['Jobs'].each do |cur_job|
|
63
73
|
jobs << Models::Job.new(cur_job)
|
64
74
|
end
|
@@ -76,21 +86,21 @@ module Cb
|
|
76
86
|
def self.normalize_args(args)
|
77
87
|
return args[0] if args[0].class == Hash
|
78
88
|
{
|
79
|
-
:
|
80
|
-
:
|
81
|
-
:
|
82
|
-
:
|
83
|
-
:
|
89
|
+
ExternalID: args[0],
|
90
|
+
JobDID: args[0],
|
91
|
+
CountLimit: args[1] || '25',
|
92
|
+
SiteID: args[2] || '',
|
93
|
+
CoBrand: args[3] || ''
|
84
94
|
}
|
85
95
|
end
|
86
96
|
|
87
97
|
def self.set_hash_defaults(hash)
|
88
98
|
hash[:CountLimit] ||= '25'
|
89
|
-
hash[:HostSite]
|
99
|
+
hash[:HostSite] ||= Cb.configuration.host_site
|
90
100
|
hash
|
91
101
|
end
|
92
102
|
|
93
|
-
def self.create_jobs
|
103
|
+
def self.create_jobs(json_hash, type)
|
94
104
|
jobs = []
|
95
105
|
|
96
106
|
[json_hash["ResponseRecommend#{type}"]['RecommendJobResults']['RecommendJobResult']].flatten.each do |api_job|
|
@@ -99,7 +109,6 @@ module Cb
|
|
99
109
|
|
100
110
|
jobs
|
101
111
|
end
|
102
|
-
|
103
112
|
end
|
104
113
|
end
|
105
114
|
end
|
@@ -1,6 +1,15 @@
|
|
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.
|
1
11
|
module Cb
|
2
12
|
module Clients
|
3
|
-
|
4
13
|
class SavedSearch
|
5
14
|
def create(saved_search)
|
6
15
|
body = saved_search.create_to_xml
|
@@ -18,10 +27,8 @@ module Cb
|
|
18
27
|
uri = replace_uri_field(Cb.configuration.uri_saved_search_delete, ':did', hash[:did])
|
19
28
|
json = cb_client.cb_delete(
|
20
29
|
uri,
|
21
|
-
{
|
22
|
-
|
23
|
-
query: { "UserOAuthToken" =>hash[:user_oauth_token] }
|
24
|
-
}
|
30
|
+
headers: { 'HostSite' => hash[:host_site] },
|
31
|
+
query: { 'UserOAuthToken' => hash[:user_oauth_token] }
|
25
32
|
)
|
26
33
|
Responses::SavedSearch::Delete.new(json)
|
27
34
|
end
|
@@ -41,11 +48,11 @@ module Cb
|
|
41
48
|
|
42
49
|
private
|
43
50
|
|
44
|
-
def update_headers
|
51
|
+
def update_headers(host_site)
|
45
52
|
{
|
46
|
-
|
47
|
-
|
48
|
-
|
53
|
+
'developerkey' => Cb.configuration.dev_key,
|
54
|
+
'Content-Type' => 'application/json',
|
55
|
+
'HostSite' => (host_site.blank? ? Cb.configuration.host_site : host_site)
|
49
56
|
}
|
50
57
|
end
|
51
58
|
|
@@ -55,16 +62,16 @@ module Cb
|
|
55
62
|
|
56
63
|
def retrieve_query(oauth_token)
|
57
64
|
{
|
58
|
-
|
59
|
-
|
65
|
+
developerkey: Cb.configuration.dev_key,
|
66
|
+
useroauthtoken: oauth_token
|
60
67
|
}
|
61
68
|
end
|
62
69
|
|
63
70
|
def list_query(oauth_token, hostsite)
|
64
71
|
{
|
65
|
-
|
66
|
-
|
67
|
-
|
72
|
+
developerkey: Cb.configuration.dev_key,
|
73
|
+
useroauthtoken: oauth_token,
|
74
|
+
hostsite: hostsite
|
68
75
|
}
|
69
76
|
end
|
70
77
|
|
@@ -78,6 +85,5 @@ module Cb
|
|
78
85
|
uri_string.gsub(field, replacement)
|
79
86
|
end
|
80
87
|
end
|
81
|
-
|
82
88
|
end
|
83
89
|
end
|
@@ -1,7 +1,16 @@
|
|
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.
|
1
11
|
module Cb
|
2
12
|
module Clients
|
3
13
|
class TalentNetwork
|
4
|
-
|
5
14
|
def self.join_form_questions(tndid)
|
6
15
|
my_api = Cb::Utils::Api.instance
|
7
16
|
json_hash = my_api.cb_get("#{Cb.configuration.uri_tn_join_questions}/#{tndid}/json")
|
@@ -13,39 +22,38 @@ module Cb
|
|
13
22
|
my_api = Cb::Utils::Api.instance
|
14
23
|
json_hash = my_api.cb_get("#{Cb.configuration.uri_tn_join_form_branding}/#{tndid}/json")
|
15
24
|
|
16
|
-
if json_hash.
|
25
|
+
if json_hash.key? 'Branding'
|
17
26
|
tn_join_form_branding = Models::TalentNetwork::JoinFormBranding.new(json_hash['Branding'])
|
18
27
|
end
|
19
28
|
|
20
29
|
my_api.append_api_responses(tn_join_form_branding, json_hash)
|
21
30
|
end
|
22
31
|
|
23
|
-
def self.join_form_geography(tnlanguage=
|
32
|
+
def self.join_form_geography(tnlanguage = 'USEnglish')
|
24
33
|
my_api = Cb::Utils::Api.instance
|
25
|
-
json_hash = my_api.cb_get("#{Cb.configuration.uri_tn_join_form_geo}", :
|
34
|
+
json_hash = my_api.cb_get("#{Cb.configuration.uri_tn_join_form_geo}", query: { TNLanguage: "#{tnlanguage}" })
|
26
35
|
geo_dropdown = Models::TalentNetwork::JoinFormGeo.new(json_hash)
|
27
36
|
my_api.append_api_responses(geo_dropdown, json_hash)
|
28
37
|
end
|
29
38
|
|
30
|
-
def self.member_create(args={})
|
39
|
+
def self.member_create(args = {})
|
31
40
|
my_api = Cb::Utils::Api.instance
|
32
41
|
tn_member = Models::TalentNetwork::Member.new(args)
|
33
|
-
json_hash = my_api.cb_post("#{Cb.configuration.uri_tn_member_create}/json", :
|
42
|
+
json_hash = my_api.cb_post("#{Cb.configuration.uri_tn_member_create}/json", body: tn_member.to_xml)
|
34
43
|
my_api.append_api_responses(json_hash, json_hash)
|
35
44
|
end
|
36
45
|
|
37
|
-
def self.tn_job_information(job_did, join_form_intercept=
|
46
|
+
def self.tn_job_information(job_did, join_form_intercept = 'true')
|
38
47
|
my_api = Cb::Utils::Api.instance
|
39
|
-
json_hash = my_api.cb_get("#{Cb.configuration.uri_tn_job_info}/#{job_did}/json",
|
40
|
-
|
48
|
+
json_hash = my_api.cb_get("#{Cb.configuration.uri_tn_job_info}/#{job_did}/json",
|
49
|
+
query: {RequestJoinFormIntercept: join_form_intercept } )
|
41
50
|
|
42
|
-
if json_hash.
|
51
|
+
if json_hash.key? 'Response'
|
43
52
|
tn_job_info = Models::TalentNetwork::JobInfo.new(json_hash['Response'])
|
44
53
|
end
|
45
54
|
|
46
55
|
my_api.append_api_responses(tn_job_info, json_hash)
|
47
56
|
end
|
48
|
-
|
49
57
|
end
|
50
58
|
end
|
51
|
-
end
|
59
|
+
end
|