cb-api 7.1.0 → 7.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -78,7 +78,8 @@ Pass it a request object, and you will receive the appropriate response object b
78
78
 
79
79
  Currently, this workflow only works on the following endpoints:
80
80
 
81
- * User
82
81
  * Anonymous Saved Search
82
+ * Application
83
+ * User
83
84
 
84
85
  Look here for future updates on this refactor!
@@ -7,7 +7,7 @@ module Cb
7
7
  :uri_recommendation_for_job, :uri_recommendation_for_user,
8
8
  :uri_recommendation_for_company,
9
9
  :uri_application, :uri_application_submit, :uri_application_form,
10
- :uri_application_external,
10
+ :uri_application_external, :uri_application_create,
11
11
  :uri_application_registered, :uri_user_change_password, :uri_user_temp_password,
12
12
  :uri_user_delete, :uri_user_retrieve, :uri_user_check_existing,
13
13
  :uri_job_branding,
@@ -38,6 +38,7 @@ module Cb
38
38
  @uri_recommendation_for_user ||= '/v1/Recommendations/ForUser'
39
39
  @uri_recommendation_for_company ||= '/Employer/JobRecommendation'
40
40
  @uri_application ||= '/cbapi/application/:did'
41
+ @uri_application_create ||= '/cbapi/application/'
41
42
  @uri_application_submit ||= '/v1/Application/submit'
42
43
  @uri_application_registered ||= '/v3/application/registered'
43
44
  @uri_application_external ||= '/v1/application/external'
@@ -20,7 +20,7 @@ module Cb
20
20
  <Cobrand>#{@args[:cobrand]}</Cobrand>
21
21
  <BrowserID>#{@args[:browser_id]}</BrowserID>
22
22
  <SessionID>#{@args[:session_id]}</SessionID>
23
- <Test>#{(@args[:test] || false).to_s}</Test>
23
+ <Test>#{test?}</Test>
24
24
  <EmailAddress>#{@args[:email_address]}</EmailAddress>
25
25
  <SearchName>#{@args[:search_name]}</SearchName>
26
26
  #{search_parameters(@args[:search_parameters]) unless @args[:search_parameters].nil?}
@@ -18,7 +18,7 @@ module Cb
18
18
  <Request>
19
19
  <ExternalID>#{@args[:external_id]}</ExternalID>
20
20
  <DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
21
- <Test>#{(@args[:test] || false).to_s}</Test>
21
+ <Test>#{test?}</Test>
22
22
  </Request>
23
23
  eos
24
24
  end
@@ -0,0 +1,47 @@
1
+ require_relative '../base'
2
+ require_relative 'utils'
3
+
4
+ module Cb
5
+ module Requests
6
+ module Application
7
+ class Create < Base
8
+ include Cb::Requests::ApplicationUtils
9
+
10
+ def endpoint_uri
11
+ Cb.configuration.uri_application_create
12
+ end
13
+
14
+ def http_method
15
+ :post
16
+ end
17
+
18
+ def headers
19
+ {
20
+ 'DeveloperKey' => Cb.configuration.dev_key,
21
+ 'HostSite' => Cb.configuration.host_site,
22
+ 'Content-Type' => 'application/json'
23
+ }
24
+ end
25
+
26
+ def body
27
+ {
28
+ JobDID: @args[:job_did],
29
+ IsSubmitted: @args[:is_submitted],
30
+ ExternalUserID: @args[:external_user_id],
31
+ VID: @args[:vid],
32
+ BID: @args[:bid],
33
+ SID: @args[:sid],
34
+ SiteID: @args[:site_id],
35
+ IPathID: @args[:ipath_id],
36
+ TNDID: @args[:tn_did],
37
+ Resume: resume_info(@args[:resume]),
38
+ CoverLetter: cover_letter_info(@args[:cover_letter]),
39
+ Responses: parsed_responses(@args[:responses]),
40
+ Test: test?
41
+ }.to_json
42
+ end
43
+
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,27 @@
1
+ require_relative '../base'
2
+
3
+ module Cb
4
+ module Requests
5
+ module Application
6
+ class Form < Base
7
+
8
+ def endpoint_uri
9
+ Cb.configuration.uri_application_form.sub ':did', @args[:application_did].to_s
10
+ end
11
+
12
+ def http_method
13
+ :get
14
+ end
15
+
16
+ def headers
17
+ {
18
+ 'DeveloperKey' => Cb.configuration.dev_key,
19
+ 'HostSite' => Cb.configuration.host_site,
20
+ 'Content-Type' => 'application/json'
21
+ }
22
+ end
23
+
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,26 @@
1
+ require_relative '../base'
2
+
3
+ module Cb
4
+ module Requests
5
+ module Application
6
+ class Get < Base
7
+
8
+ def endpoint_uri
9
+ Cb.configuration.uri_application.sub ':did', @args[:did].to_s
10
+ end
11
+
12
+ def http_method
13
+ :get
14
+ end
15
+
16
+ def headers
17
+ {
18
+ 'DeveloperKey' => Cb.configuration.dev_key,
19
+ 'HostSite' => Cb.configuration.host_site,
20
+ 'Content-Type' => 'application/json'
21
+ }
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,48 @@
1
+ require_relative '../base'
2
+ require_relative 'utils'
3
+
4
+ module Cb
5
+ module Requests
6
+ module Application
7
+ class Update < Base
8
+ include Cb::Requests::ApplicationUtils
9
+
10
+ def endpoint_uri
11
+ Cb.configuration.uri_application.sub ':did', @args[:application_did].to_s
12
+ end
13
+
14
+ def http_method
15
+ :put
16
+ end
17
+
18
+ def headers
19
+ {
20
+ 'DeveloperKey' => Cb.configuration.dev_key,
21
+ 'HostSite' => Cb.configuration.host_site,
22
+ 'Content-Type' => 'application/json'
23
+ }
24
+ end
25
+
26
+ def body
27
+ {
28
+ ApplicationDID: @args[:application_did],
29
+ JobDID: @args[:job_did],
30
+ IsSubmitted: @args[:is_submitted],
31
+ ExternalUserID: @args[:external_user_id],
32
+ VID: @args[:vid],
33
+ BID: @args[:bid],
34
+ SID: @args[:sid],
35
+ SiteID: @args[:site_id],
36
+ IPathID: @args[:ipath_id],
37
+ TNDID: @args[:tn_did],
38
+ Resume: resume_info(@args[:resume]),
39
+ CoverLetter: cover_letter_info(@args[:cover_letter]),
40
+ Responses: parsed_responses(@args[:responses]),
41
+ Test: test?
42
+ }.to_json
43
+ end
44
+
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,37 @@
1
+
2
+ module Cb
3
+ module Requests
4
+ module ApplicationUtils
5
+
6
+ def resume_info(resume)
7
+ return {} if resume.nil?
8
+ {
9
+ ExternalResumeID: resume[:external_resume_id],
10
+ ResumeFileName: resume[:resume_file_name],
11
+ ResumeData: resume[:resume_data],
12
+ ResumeExtension: resume[:resume_extension],
13
+ ResumeTitle: resume[:resume_title]
14
+ }
15
+ end
16
+
17
+ def cover_letter_info(cover_letter)
18
+ return {} if cover_letter.nil?
19
+ {
20
+ CoverLetterID: cover_letter[:cover_letter_id],
21
+ CoverLetterText: cover_letter[:cover_letter_text],
22
+ CoverLetterTitle: cover_letter[:cover_letter_title]
23
+ }
24
+ end
25
+
26
+ def parsed_responses(responses)
27
+ return [] if responses.nil?
28
+ responses.map do |response|
29
+ {
30
+ QuestionID: response[:question_id],
31
+ ResponseText: response[:response_text]
32
+ }
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -25,6 +25,13 @@ module Cb
25
25
  def body
26
26
  nil
27
27
  end
28
+
29
+ private
30
+
31
+ def test?
32
+ (@args[:test] || Cb.configuration.test_resources).to_s
33
+ end
34
+
28
35
  end
29
36
  end
30
37
  end
@@ -18,7 +18,7 @@ module Cb
18
18
  <Request>
19
19
  <DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
20
20
  <ExternalID>#{@args[:external_id]}</ExternalID>
21
- <Test>#{(@args[:test] || false).to_s}</Test>
21
+ <Test>#{test?}</Test>
22
22
  <OldPassword>#{@args[:old_password]}</OldPassword>
23
23
  <NewPassword>#{@args[:new_password]}</NewPassword>
24
24
  </Request>
@@ -19,7 +19,7 @@ module Cb
19
19
  <DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
20
20
  <Email>#{@args[:email]}</Email>
21
21
  <Password>#{@args[:password]}</Password>
22
- <Test>#{(@args[:test] || false).to_s}</Test>
22
+ <Test>#{test?}</Test>
23
23
  </Request>
24
24
  eos
25
25
  end
@@ -18,7 +18,7 @@ module Cb
18
18
  <Request>
19
19
  <DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
20
20
  <ExternalID>#{@args[:external_id]}</ExternalID>
21
- <Test>#{(@args[:test] || false).to_s}</Test>
21
+ <Test>#{test?}</Test>
22
22
  <Password>#{@args[:password]}</Password>
23
23
  </Request>
24
24
  eos
@@ -18,7 +18,7 @@ module Cb
18
18
  <Request>
19
19
  <DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
20
20
  <ExternalID>#{@args[:external_id]}</ExternalID>
21
- <Test>#{(@args[:test] || false).to_s}</Test>
21
+ <Test>#{test?}</Test>
22
22
  </Request>
23
23
  eos
24
24
  end
@@ -15,6 +15,11 @@ module Cb
15
15
  Cb::Requests::AnonymousSavedSearch::Create => Cb::Responses::AnonymousSavedSearch::Create,
16
16
  Cb::Requests::AnonymousSavedSearch::Delete => Cb::Responses::AnonymousSavedSearch::Delete,
17
17
 
18
+ Cb::Requests::Application::Create => Cb::Responses::Application,
19
+ Cb::Requests::Application::Form => Cb::Responses::ApplicationForm,
20
+ Cb::Requests::Application::Get => Cb::Responses::Application,
21
+ Cb::Requests::Application::Update => Cb::Responses::Application,
22
+
18
23
  Cb::Requests::User::ChangePassword => Cb::Responses::User::ChangePassword,
19
24
  Cb::Requests::User::CheckExisting => Cb::Responses::User::CheckExisting,
20
25
  Cb::Requests::User::Delete => Cb::Responses::User::Delete,
@@ -1,3 +1,3 @@
1
1
  module Cb
2
- VERSION = '7.1.0'
2
+ VERSION = '7.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cb-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.1.0
4
+ version: 7.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-23 00:00:00.000000000 Z
12
+ date: 2014-05-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -270,6 +270,11 @@ files:
270
270
  - lib/cb/models/api_call_model.rb
271
271
  - lib/cb/requests/anonymous_saved_search/delete.rb
272
272
  - lib/cb/requests/anonymous_saved_search/create.rb
273
+ - lib/cb/requests/application/update.rb
274
+ - lib/cb/requests/application/get.rb
275
+ - lib/cb/requests/application/form.rb
276
+ - lib/cb/requests/application/create.rb
277
+ - lib/cb/requests/application/utils.rb
273
278
  - lib/cb/requests/user/check_existing.rb
274
279
  - lib/cb/requests/user/delete.rb
275
280
  - lib/cb/requests/user/change_password.rb