cb-api 17.4.0 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
@@ -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 Responses
|
|
3
13
|
class Recommendations < ApiResponse
|
|
4
|
-
|
|
5
14
|
def validate_api_hash
|
|
6
15
|
check_nonstandard_error_node(response)
|
|
7
16
|
required_response_field(root_node, response)
|
|
@@ -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 Responses
|
|
3
13
|
module AnonymousSavedSearch
|
|
4
|
-
|
|
5
14
|
class Create < ApiResponse
|
|
6
15
|
protected
|
|
7
16
|
|
|
@@ -30,7 +39,6 @@ module Cb
|
|
|
30
39
|
'ExternalID'
|
|
31
40
|
end
|
|
32
41
|
end
|
|
33
|
-
|
|
34
42
|
end
|
|
35
43
|
end
|
|
36
44
|
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 Responses
|
|
3
13
|
module AnonymousSavedSearch
|
|
4
|
-
|
|
5
14
|
class Delete < ApiResponse
|
|
6
15
|
protected
|
|
7
16
|
|
|
@@ -17,7 +26,6 @@ module Cb
|
|
|
17
26
|
Models::SavedSearch::Delete.new(response)
|
|
18
27
|
end
|
|
19
28
|
end
|
|
20
|
-
|
|
21
29
|
end
|
|
22
30
|
end
|
|
23
31
|
end
|
|
@@ -1,8 +1,17 @@
|
|
|
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 'forwardable'
|
|
2
12
|
|
|
3
13
|
module Cb
|
|
4
14
|
module Responses
|
|
5
|
-
|
|
6
15
|
class ApiResponse
|
|
7
16
|
extend Forwardable
|
|
8
17
|
delegate [:timing, :errors] => :metadata
|
|
@@ -18,34 +27,36 @@ module Cb
|
|
|
18
27
|
end
|
|
19
28
|
|
|
20
29
|
protected
|
|
30
|
+
|
|
21
31
|
attr_reader :metadata
|
|
22
32
|
|
|
23
33
|
def extract_models
|
|
24
|
-
|
|
34
|
+
fail NotImplementedError.new(__method__)
|
|
25
35
|
end
|
|
26
36
|
|
|
27
37
|
def validate_api_hash
|
|
28
|
-
|
|
38
|
+
fail NotImplementedError.new(__method__)
|
|
29
39
|
end
|
|
30
40
|
|
|
31
41
|
def hash_containing_metadata
|
|
32
|
-
|
|
42
|
+
fail NotImplementedError.new(__method__)
|
|
33
43
|
end
|
|
34
44
|
|
|
35
45
|
def raise_on_timing_parse_error
|
|
36
46
|
true
|
|
37
47
|
end
|
|
48
|
+
|
|
38
49
|
def required_response_field(field_name, parent_hash)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
50
|
+
fail ArgumentError.new("field_name can't be nil!") if field_name.nil?
|
|
51
|
+
fail ArgumentError.new("parent_hash can't be nil!") if parent_hash.nil?
|
|
52
|
+
fail ExpectedResponseFieldMissing.new(field_name) unless parent_hash.key?(field_name)
|
|
42
53
|
end
|
|
43
54
|
|
|
44
55
|
private
|
|
45
56
|
|
|
46
57
|
def set_response_variable(response_hash)
|
|
47
58
|
should_raise = response_hash.nil? || response_hash.empty?
|
|
48
|
-
|
|
59
|
+
fail ApiResponseError.new('Response is empty!') if should_raise
|
|
49
60
|
@response = response_hash
|
|
50
61
|
end
|
|
51
62
|
|
|
@@ -58,6 +69,5 @@ module Cb
|
|
|
58
69
|
extract_models
|
|
59
70
|
end
|
|
60
71
|
end
|
|
61
|
-
|
|
62
72
|
end
|
|
63
73
|
end
|
|
@@ -1,9 +1,18 @@
|
|
|
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 'cb/responses/api_response'
|
|
2
12
|
|
|
3
13
|
module Cb
|
|
4
14
|
module Responses
|
|
5
15
|
class Application < ApiResponse
|
|
6
|
-
|
|
7
16
|
protected
|
|
8
17
|
|
|
9
18
|
def hash_containing_metadata
|
|
@@ -17,7 +26,6 @@ module Cb
|
|
|
17
26
|
def extract_models
|
|
18
27
|
response['Results'].map { |application_data| Cb::Models::Application.new(application_data) }
|
|
19
28
|
end
|
|
20
|
-
|
|
21
29
|
end
|
|
22
30
|
end
|
|
23
31
|
end
|
|
@@ -1,9 +1,18 @@
|
|
|
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 'cb/responses/api_response'
|
|
2
12
|
|
|
3
13
|
module Cb
|
|
4
14
|
module Responses
|
|
5
15
|
class ApplicationForm < ApiResponse
|
|
6
|
-
|
|
7
16
|
protected
|
|
8
17
|
|
|
9
18
|
def hash_containing_metadata
|
|
@@ -17,7 +26,6 @@ module Cb
|
|
|
17
26
|
def extract_models
|
|
18
27
|
response['Results'].map { |app_form_data| Cb::Models::Application::Form.new(app_form_data) }
|
|
19
28
|
end
|
|
20
|
-
|
|
21
29
|
end
|
|
22
30
|
end
|
|
23
31
|
end
|
|
@@ -1,11 +1,20 @@
|
|
|
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 'cb/responses/api_response'
|
|
2
12
|
|
|
3
13
|
module Cb
|
|
4
14
|
module Responses
|
|
5
15
|
module ApplicationExternal
|
|
6
16
|
class SubmitApplication < ApiResponse
|
|
7
|
-
|
|
8
|
-
class Model < Struct.new(:apply_url) ; end
|
|
17
|
+
class Model < Struct.new(:apply_url); end
|
|
9
18
|
|
|
10
19
|
protected
|
|
11
20
|
|
|
@@ -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 'cb/responses/api_response'
|
|
2
12
|
|
|
3
13
|
module Cb
|
|
4
14
|
module Responses
|
|
5
15
|
module Category
|
|
6
16
|
class Search < ApiResponse
|
|
7
|
-
|
|
8
17
|
protected
|
|
9
18
|
|
|
10
19
|
def hash_containing_metadata
|
|
@@ -24,15 +33,15 @@ module Cb
|
|
|
24
33
|
private
|
|
25
34
|
|
|
26
35
|
def response_node
|
|
27
|
-
|
|
36
|
+
'ResponseCategories'
|
|
28
37
|
end
|
|
29
38
|
|
|
30
39
|
def categories_node
|
|
31
|
-
|
|
40
|
+
'Categories'
|
|
32
41
|
end
|
|
33
42
|
|
|
34
43
|
def category_node
|
|
35
|
-
|
|
44
|
+
'Category'
|
|
36
45
|
end
|
|
37
46
|
|
|
38
47
|
def model_array
|
|
@@ -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 'cb/responses/api_response'
|
|
2
12
|
|
|
3
13
|
module Cb
|
|
4
14
|
module Responses
|
|
5
15
|
module Company
|
|
6
16
|
class Find < ApiResponse
|
|
7
|
-
|
|
8
17
|
protected
|
|
9
18
|
|
|
10
19
|
def hash_containing_metadata
|
|
@@ -23,11 +32,11 @@ module Cb
|
|
|
23
32
|
private
|
|
24
33
|
|
|
25
34
|
def results_node
|
|
26
|
-
|
|
35
|
+
'Results'
|
|
27
36
|
end
|
|
28
37
|
|
|
29
38
|
def company_profile_node
|
|
30
|
-
|
|
39
|
+
'CompanyProfileDetail'
|
|
31
40
|
end
|
|
32
41
|
|
|
33
42
|
def company
|
|
@@ -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
|
module Cb
|
|
2
12
|
module Responses
|
|
3
13
|
class State < ApiResponse
|
|
@@ -16,7 +26,6 @@ module Cb
|
|
|
16
26
|
def root_node
|
|
17
27
|
'Results'
|
|
18
28
|
end
|
|
19
|
-
|
|
20
29
|
end
|
|
21
30
|
end
|
|
22
31
|
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 Responses
|
|
3
13
|
class ResumeDataList < ApiResponse
|
|
4
|
-
|
|
5
14
|
protected
|
|
6
15
|
|
|
7
16
|
def validate_api_hash
|
|
@@ -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 'cb/responses/api_response'
|
|
2
12
|
|
|
3
13
|
module Cb
|
|
4
14
|
module Responses
|
|
5
15
|
module Education
|
|
6
16
|
class Get < ApiResponse
|
|
7
|
-
|
|
8
17
|
protected
|
|
9
18
|
|
|
10
19
|
def hash_containing_metadata
|
|
@@ -24,15 +33,15 @@ module Cb
|
|
|
24
33
|
private
|
|
25
34
|
|
|
26
35
|
def response_node
|
|
27
|
-
|
|
36
|
+
'ResponseEducationCodes'
|
|
28
37
|
end
|
|
29
38
|
|
|
30
39
|
def education_codes_node
|
|
31
|
-
|
|
40
|
+
'EducationCodes'
|
|
32
41
|
end
|
|
33
42
|
|
|
34
43
|
def education_array_node
|
|
35
|
-
|
|
44
|
+
'Education'
|
|
36
45
|
end
|
|
37
46
|
|
|
38
47
|
def model_array
|
|
@@ -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 'cb/responses/api_response'
|
|
2
12
|
|
|
3
13
|
module Cb
|
|
4
14
|
module Responses
|
|
5
15
|
module EmailSubscription
|
|
6
16
|
class Response < ApiResponse
|
|
7
|
-
|
|
8
17
|
protected
|
|
9
18
|
|
|
10
19
|
def hash_containing_metadata
|
|
@@ -22,7 +31,7 @@ module Cb
|
|
|
22
31
|
private
|
|
23
32
|
|
|
24
33
|
def response_node
|
|
25
|
-
|
|
34
|
+
'SubscriptionValues'
|
|
26
35
|
end
|
|
27
36
|
|
|
28
37
|
def model_hash
|
|
@@ -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 Responses
|
|
3
13
|
module EmployeeTypes
|
|
4
|
-
|
|
5
14
|
class Search < ApiResponse
|
|
6
15
|
protected
|
|
7
16
|
|
|
@@ -41,8 +50,6 @@ module Cb
|
|
|
41
50
|
Utils::ResponseArrayExtractor.extract(response[root_node], outer_collection_node)
|
|
42
51
|
end
|
|
43
52
|
end
|
|
44
|
-
|
|
45
53
|
end
|
|
46
54
|
end
|
|
47
55
|
end
|
|
48
|
-
|
data/lib/cb/responses/errors.rb
CHANGED
|
@@ -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 Responses
|
|
3
|
-
|
|
4
13
|
class Errors
|
|
5
14
|
attr_reader :parsed
|
|
6
15
|
|
|
@@ -11,12 +20,13 @@ module Cb
|
|
|
11
20
|
end
|
|
12
21
|
|
|
13
22
|
private
|
|
23
|
+
|
|
14
24
|
attr_reader :response, :should_raise
|
|
15
25
|
|
|
16
26
|
def parsed_errors
|
|
17
|
-
return
|
|
27
|
+
return [] unless response.respond_to?(:map)
|
|
18
28
|
errors = response.map { |key, value| parsed_error(key, value) }.flatten
|
|
19
|
-
|
|
29
|
+
fail ApiResponseError.new(errors.join(',')) if errors.any? && should_raise
|
|
20
30
|
errors
|
|
21
31
|
end
|
|
22
32
|
|
|
@@ -26,7 +36,7 @@ module Cb
|
|
|
26
36
|
elsif error_array?(key, value)
|
|
27
37
|
value
|
|
28
38
|
else
|
|
29
|
-
|
|
39
|
+
[]
|
|
30
40
|
end
|
|
31
41
|
end
|
|
32
42
|
|
|
@@ -42,6 +52,5 @@ module Cb
|
|
|
42
52
|
parsed.send(method, *args, &block)
|
|
43
53
|
end
|
|
44
54
|
end
|
|
45
|
-
|
|
46
55
|
end
|
|
47
56
|
end
|