cb-api 18.3.0 → 18.4.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/lib/cb/config.rb +3 -0
- data/lib/cb/models/implementations/cover_letter.rb +25 -0
- data/lib/cb/requests/cover_letter/delete.rb +38 -0
- data/lib/cb/requests/cover_letter/list.rb +31 -0
- data/lib/cb/requests/cover_letter/retrieve.rb +34 -0
- data/lib/cb/responses/cover_letter/delete.rb +39 -0
- data/lib/cb/responses/cover_letter/list.rb +39 -0
- data/lib/cb/responses/cover_letter/retrieve.rb +39 -0
- data/lib/cb/utils/response_map.rb +4 -0
- data/lib/cb/version.rb +1 -1
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92b64824e96c472291ad8e31393461dfd84e3d3d
|
4
|
+
data.tar.gz: fd70916fec02c781ea0e753d89250e24bdd3c65b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dceeb0718cdc7037c7f07cdff7cac2f163d453544a3c8bb0fdb784f430fb55dd8e3e0b2b3e4250ffaf0f71445638b0038f9a1b5f239efff66e104e9d6ff80ac3
|
7
|
+
data.tar.gz: a8e73cba18fd993a25b2e4c61c4d4663bf007adad635397dae338e7e26938bbf181f0d31e8fd96393e04812190bda8a29eec3f1c39cf8b1b3e7523347e2d81bb
|
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
|
+
* 18.4.0 Adding support for Cover Letter APIs - Retrieve, List, and Delete.
|
6
7
|
* 18.3.0 Correcting report a job to use xml request and correctly map model from response.
|
7
8
|
* 18.2.2 Filter out release directory related information when getting the API caller.
|
8
9
|
* 18.2.1 No functional changes, just renamed `execute_http_request` to `timed_http_request`.
|
data/lib/cb/config.rb
CHANGED
@@ -105,6 +105,9 @@ module Cb
|
|
105
105
|
@uri_desired_job_type ||= '/consumer/datalist/desiredjobtype'
|
106
106
|
@uri_state_list ||= '/ajax/citysuggest.aspx'
|
107
107
|
@uri_report_job ||= '/v1/job/report'
|
108
|
+
@uri_cover_letter_list ||= '/v1/coverletter/list'
|
109
|
+
@uri_cover_letter_retrieve ||= '/coverletter/retrieve'
|
110
|
+
@uri_cover_letter_delete ||= '/coverletter/delete'
|
108
111
|
end
|
109
112
|
|
110
113
|
def set_attr_accessors
|
@@ -0,0 +1,25 @@
|
|
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 CoverLetter
|
14
|
+
attr_reader :id, :name, :text, :created, :modified
|
15
|
+
|
16
|
+
def initialize(api_cover_letter)
|
17
|
+
@id = api_cover_letter['CoverLetterDID'] || api_cover_letter['ExternalId']
|
18
|
+
@name = api_cover_letter['CoverLetterName'] || api_cover_letter['Name']
|
19
|
+
@text = api_cover_letter['CoverLetterText'] || api_cover_letter['Text']
|
20
|
+
@created = api_cover_letter['CreatedDate'] || api_cover_letter['CreatedDT']
|
21
|
+
@modified = api_cover_letter['ModifiedDate'] || api_cover_letter['ModifiedDT']
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,38 @@
|
|
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 'cb/requests/base'
|
12
|
+
|
13
|
+
module Cb
|
14
|
+
module Requests
|
15
|
+
module CoverLetter
|
16
|
+
class Delete < Base
|
17
|
+
def endpoint_uri
|
18
|
+
Cb.configuration.uri_cover_letter_delete
|
19
|
+
end
|
20
|
+
|
21
|
+
def http_method
|
22
|
+
:post
|
23
|
+
end
|
24
|
+
|
25
|
+
def body
|
26
|
+
<<-eos
|
27
|
+
<Request>
|
28
|
+
<DeveloperKey>#{ Cb.configuration.dev_key }</DeveloperKey>
|
29
|
+
<ExternalID>#{ args[:external_id] }</ExternalID>
|
30
|
+
<ExternalUserID>#{ args[:external_user_id] }</ExternalUserID>
|
31
|
+
<Test>#{ args[:test] || false }</Test>
|
32
|
+
</Request>
|
33
|
+
eos
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,31 @@
|
|
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 'cb/requests/base'
|
12
|
+
|
13
|
+
module Cb
|
14
|
+
module Requests
|
15
|
+
module CoverLetter
|
16
|
+
class List < Base
|
17
|
+
def endpoint_uri
|
18
|
+
Cb.configuration.uri_cover_letter_list
|
19
|
+
end
|
20
|
+
|
21
|
+
def http_method
|
22
|
+
:get
|
23
|
+
end
|
24
|
+
|
25
|
+
def query
|
26
|
+
{ ExternalUserId: args[:external_user_id] }
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,34 @@
|
|
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 'cb/requests/base'
|
12
|
+
|
13
|
+
module Cb
|
14
|
+
module Requests
|
15
|
+
module CoverLetter
|
16
|
+
class Retrieve < Base
|
17
|
+
def endpoint_uri
|
18
|
+
Cb.configuration.uri_cover_letter_retrieve
|
19
|
+
end
|
20
|
+
|
21
|
+
def http_method
|
22
|
+
:get
|
23
|
+
end
|
24
|
+
|
25
|
+
def query
|
26
|
+
{
|
27
|
+
ExternalId: args[:external_id],
|
28
|
+
ExternalUserId: args[:external_user_id]
|
29
|
+
}
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,39 @@
|
|
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 CoverLetter
|
14
|
+
class Delete < ApiResponse
|
15
|
+
def status
|
16
|
+
response[root_node]['Status']
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def extract_models
|
22
|
+
nil
|
23
|
+
end
|
24
|
+
|
25
|
+
def validate_api_hash
|
26
|
+
required_response_field(root_node, response)
|
27
|
+
end
|
28
|
+
|
29
|
+
def hash_containing_metadata
|
30
|
+
response
|
31
|
+
end
|
32
|
+
|
33
|
+
def root_node
|
34
|
+
'ResponseUserDelete'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,39 @@
|
|
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 CoverLetter
|
14
|
+
class List < ApiResponse
|
15
|
+
private
|
16
|
+
|
17
|
+
def extract_models
|
18
|
+
[ cover_letters_node ].flatten.map { |api_cover_letter| Models::CoverLetter.new api_cover_letter }
|
19
|
+
end
|
20
|
+
|
21
|
+
def validate_api_hash
|
22
|
+
required_response_field(root_node, response)
|
23
|
+
end
|
24
|
+
|
25
|
+
def hash_containing_metadata
|
26
|
+
response
|
27
|
+
end
|
28
|
+
|
29
|
+
def cover_letters_node
|
30
|
+
response[root_node]['CoverLetters'].nil? ? [] : response[root_node]['CoverLetters']['CoverLetter']
|
31
|
+
end
|
32
|
+
|
33
|
+
def root_node
|
34
|
+
'ResponseListCoverLetters'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,39 @@
|
|
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 CoverLetter
|
14
|
+
class Retrieve < ApiResponse
|
15
|
+
private
|
16
|
+
|
17
|
+
def extract_models
|
18
|
+
Models::CoverLetter.new api_cover_letter
|
19
|
+
end
|
20
|
+
|
21
|
+
def validate_api_hash
|
22
|
+
required_response_field(root_node, response)
|
23
|
+
end
|
24
|
+
|
25
|
+
def hash_containing_metadata
|
26
|
+
response
|
27
|
+
end
|
28
|
+
|
29
|
+
def api_cover_letter
|
30
|
+
response[root_node]['CoverLetter']
|
31
|
+
end
|
32
|
+
|
33
|
+
def root_node
|
34
|
+
'ResponseRetrieve'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -44,6 +44,10 @@ module Cb
|
|
44
44
|
|
45
45
|
Cb::Requests::Company::Find => Cb::Responses::Company::Find,
|
46
46
|
|
47
|
+
Cb::Requests::CoverLetter::List => Cb::Responses::CoverLetter::List,
|
48
|
+
Cb::Requests::CoverLetter::Retrieve => Cb::Responses::CoverLetter::Retrieve,
|
49
|
+
Cb::Requests::CoverLetter::Delete => Cb::Responses::CoverLetter::Delete,
|
50
|
+
|
47
51
|
Cb::Requests::Education::Get => Cb::Responses::Education::Get,
|
48
52
|
|
49
53
|
Cb::Requests::EmailSubscription::Retrieve => Cb::Responses::EmailSubscription::Response,
|
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: 18.
|
4
|
+
version: 18.4.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-09
|
11
|
+
date: 2015-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -262,6 +262,7 @@ files:
|
|
262
262
|
- lib/cb/models/implementations/collapsed_job_results.rb
|
263
263
|
- lib/cb/models/implementations/collapsed_jobs.rb
|
264
264
|
- lib/cb/models/implementations/company.rb
|
265
|
+
- lib/cb/models/implementations/cover_letter.rb
|
265
266
|
- lib/cb/models/implementations/data_lists/resume_data_list.rb
|
266
267
|
- lib/cb/models/implementations/education.rb
|
267
268
|
- lib/cb/models/implementations/email_subscription.rb
|
@@ -300,6 +301,9 @@ files:
|
|
300
301
|
- lib/cb/requests/base.rb
|
301
302
|
- lib/cb/requests/category/search.rb
|
302
303
|
- lib/cb/requests/company/find.rb
|
304
|
+
- lib/cb/requests/cover_letter/delete.rb
|
305
|
+
- lib/cb/requests/cover_letter/list.rb
|
306
|
+
- lib/cb/requests/cover_letter/retrieve.rb
|
303
307
|
- lib/cb/requests/data_lists/countries.rb
|
304
308
|
- lib/cb/requests/data_lists/data_list_base.rb
|
305
309
|
- lib/cb/requests/data_lists/desired_job_type.rb
|
@@ -333,6 +337,9 @@ files:
|
|
333
337
|
- lib/cb/responses/application_external/submit_application.rb
|
334
338
|
- lib/cb/responses/category/search.rb
|
335
339
|
- lib/cb/responses/company/find.rb
|
340
|
+
- lib/cb/responses/cover_letter/delete.rb
|
341
|
+
- lib/cb/responses/cover_letter/list.rb
|
342
|
+
- lib/cb/responses/cover_letter/retrieve.rb
|
336
343
|
- lib/cb/responses/data_list/state.rb
|
337
344
|
- lib/cb/responses/data_lists/resume_data_list.rb
|
338
345
|
- lib/cb/responses/education/get.rb
|