cb-api 7.6.2 → 7.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/cb/config.rb CHANGED
@@ -11,8 +11,6 @@ module Cb
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,
14
- :uri_resume_own_all, :uri_resume_retrieve,
15
- :uri_resume_create, :uri_resume_update, :uri_resume_delete,
16
14
  :uri_saved_search_retrieve, :uri_saved_search_create, :uri_saved_search_update, :uri_saved_search_list, :uri_saved_search_delete,
17
15
  :uri_anon_saved_search_create, :uri_anon_saved_search_delete,
18
16
  :uri_saved_job_search_create,
@@ -91,11 +89,6 @@ module Cb
91
89
  :uri_user_retrieve => @uri_user_retrieve,
92
90
  :uri_user_check_existing => @uri_user_check_existing,
93
91
  :uri_job_branding => @uri_job_branding,
94
- :uri_resume_own_all => @uri_resume_own_all,
95
- :uri_resume_retrieve => @uri_resume_retrieve,
96
- :uri_resume_create => @uri_resume_create,
97
- :uri_resume_update => @uri_resume_update,
98
- :uri_resume_delete => @uri_resume_delete,
99
92
  :uri_saved_search_retrieve => @uri_saved_search_retrieve,
100
93
  :uri_saved_search_create => @uri_saved_search_create,
101
94
  :uri_saved_search_update => @uri_saved_search_update,
@@ -2,7 +2,7 @@ module Cb
2
2
  module Models
3
3
  class EmailSubscription
4
4
  attr_accessor :career_resources, :product_sponsor_info, :applicant_survey_invites,
5
- :job_recs, :unsubscribe_all
5
+ :job_recs, :unsubscribe_all, :djr
6
6
 
7
7
  def initialize(args = {})
8
8
  return if args.nil?
@@ -11,6 +11,7 @@ module Cb
11
11
  @product_sponsor_info = args['ProductSponsorInfo'].to_s || ''
12
12
  @applicant_survey_invites = args['ApplicantSurveyInvites'].to_s || ''
13
13
  @job_recs = args['JobRecs'].to_s || ''
14
+ @djr = args['DJR'].to_s || ''
14
15
  end
15
16
  end
16
17
  end
@@ -16,15 +16,15 @@ module Cb
16
16
  def body
17
17
  <<-eos
18
18
  <Request>
19
- <HostSite>#{@args[:host_site]}</HostSite>
20
- <Cobrand>#{@args[:cobrand]}</Cobrand>
21
- <BrowserID>#{@args[:browser_id]}</BrowserID>
22
- <SessionID>#{@args[:session_id]}</SessionID>
19
+ <HostSite>#{args[:host_site]}</HostSite>
20
+ <Cobrand>#{args[:cobrand]}</Cobrand>
21
+ <BrowserID>#{args[:browser_id]}</BrowserID>
22
+ <SessionID>#{args[:session_id]}</SessionID>
23
23
  <Test>#{test?}</Test>
24
- <EmailAddress>#{@args[:email_address]}</EmailAddress>
25
- <SearchName>#{@args[:search_name]}</SearchName>
26
- #{search_parameters(@args[:search_parameters]) unless @args[:search_parameters].nil?}
27
- <IsDailyEmail>#{@args[:is_daily_email]}</IsDailyEmail>
24
+ <EmailAddress>#{args[:email_address]}</EmailAddress>
25
+ <SearchName>#{args[:search_name]}</SearchName>
26
+ #{search_parameters(args[:search_parameters]) unless args[:search_parameters].nil?}
27
+ <IsDailyEmail>#{args[:is_daily_email]}</IsDailyEmail>
28
28
  <DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
29
29
  </Request>
30
30
  eos
@@ -16,7 +16,7 @@ module Cb
16
16
  def body
17
17
  <<-eos
18
18
  <Request>
19
- <ExternalID>#{@args[:external_id]}</ExternalID>
19
+ <ExternalID>#{args[:external_id]}</ExternalID>
20
20
  <DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
21
21
  <Test>#{test?}</Test>
22
22
  </Request>
@@ -25,18 +25,18 @@ module Cb
25
25
 
26
26
  def body
27
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]),
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
40
  Test: test?
41
41
  }.to_json
42
42
  end
@@ -8,7 +8,7 @@ module Cb
8
8
  include Cb::Requests::ApplicationUtils
9
9
 
10
10
  def endpoint_uri
11
- Cb.configuration.uri_application.sub ':did', @args[:application_did].to_s
11
+ Cb.configuration.uri_application.sub ':did', args[:application_did].to_s
12
12
  end
13
13
 
14
14
  def http_method
@@ -25,19 +25,19 @@ module Cb
25
25
 
26
26
  def body
27
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]),
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
41
  Test: test?
42
42
  }.to_json
43
43
  end
@@ -17,12 +17,12 @@ module Cb
17
17
  <<-eos
18
18
  <Request>
19
19
  <DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
20
- <EmailAddress>#{@args[:email_address]}</EmailAddress>
21
- <JobDID>#{@args[:job_did]}</JobDID>
22
- <SiteID>#{@args[:site_id]}</SiteID>
20
+ <EmailAddress>#{args[:email_address]}</EmailAddress>
21
+ <JobDID>#{args[:job_did]}</JobDID>
22
+ <SiteID>#{args[:site_id]}</SiteID>
23
23
  <IPath>#{ipath}</IPath>
24
- <IsExternalLinkApply>#{@args[:is_external_link_apply]}</IsExternalLinkApply>
25
- <HostSite>#{@args[:host_site] || Cb.configuration.host_site}</HostSite>
24
+ <IsExternalLinkApply>#{args[:is_external_link_apply]}</IsExternalLinkApply>
25
+ <HostSite>#{args[:host_site] || Cb.configuration.host_site}</HostSite>
26
26
  </Request>
27
27
  eos
28
28
  end
@@ -30,10 +30,10 @@ module Cb
30
30
  private
31
31
 
32
32
  def ipath
33
- return '' unless @args[:ipath].is_a?(String)
33
+ return '' unless args[:ipath].is_a?(String)
34
34
  ipath_length = 10
35
35
 
36
- @args[:ipath].slice(0, ipath_length)
36
+ args[:ipath].slice(0, ipath_length)
37
37
  end
38
38
 
39
39
  end
@@ -2,6 +2,8 @@ module Cb
2
2
  module Requests
3
3
  class Base
4
4
 
5
+ attr_reader :args
6
+
5
7
  def initialize(argument_hash)
6
8
  raise ArgumentError.new("#{argument_hash.class} is not a Hash") unless argument_hash.is_a?(Hash)
7
9
  @args = argument_hash
@@ -30,7 +32,7 @@ module Cb
30
32
  private
31
33
 
32
34
  def test?
33
- (@args[:test] || Cb.configuration.test_resources).to_s
35
+ (args[:test] || Cb.configuration.test_resources).to_s
34
36
  end
35
37
 
36
38
  end
@@ -15,7 +15,7 @@ module Cb
15
15
 
16
16
  def query
17
17
  {
18
- CountryCode: @args[:host_site]
18
+ CountryCode: args[:host_site]
19
19
  }
20
20
  end
21
21
 
@@ -15,7 +15,7 @@ module Cb
15
15
 
16
16
  def query
17
17
  {
18
- :CompanyDID => @args[:did],
18
+ :CompanyDID => args[:did],
19
19
  :HostSite=> Cb.configuration.host_site
20
20
  }
21
21
  end
@@ -0,0 +1,46 @@
1
+ require_relative '../base'
2
+
3
+ module Cb
4
+ module Requests
5
+ module EmailSubscription
6
+ class Modify < Base
7
+
8
+ def endpoint_uri
9
+ Cb.configuration.uri_subscription_modify
10
+ end
11
+
12
+ def http_method
13
+ :post
14
+ end
15
+
16
+ def body
17
+ <<eos
18
+ <Request>
19
+ <DeveloperKey>#{Cb.configuration.dev_key.to_s}</DeveloperKey>
20
+ <ExternalID>#{args[:external_id]}</ExternalID>
21
+ <Hostsite>#{args[:host_site]}</Hostsite>
22
+ <CareerResources>#{validate args[:career_resources]}</CareerResources>
23
+ <ProductSponsorInfo>#{validate args[:product_sponsor_info]}</ProductSponsorInfo>
24
+ <ApplicantSurveyInvites>#{validate args[:applicant_survey_invites]}</ApplicantSurveyInvites>
25
+ <JobRecs>#{validate args[:job_recs]}</JobRecs>
26
+ <DJR>#{validate args[:djr]}</DJR>
27
+ <UnsubscribeAll>#{args[:unsubscribe_all]}</UnsubscribeAll>
28
+ </Request>
29
+ eos
30
+ end
31
+
32
+ private
33
+
34
+ def validate value
35
+ return value unless unsubscribe_all?
36
+ false.to_s
37
+ end
38
+
39
+ def unsubscribe_all?
40
+ args[:unsubscribe_all] == "true" || args[:unsubscribe_all] == true
41
+ end
42
+
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,26 @@
1
+ require_relative '../base'
2
+
3
+ module Cb
4
+ module Requests
5
+ module EmailSubscription
6
+ class Retrieve < Base
7
+
8
+ def endpoint_uri
9
+ Cb.configuration.uri_subscription_retrieve
10
+ end
11
+
12
+ def http_method
13
+ :get
14
+ end
15
+
16
+ def query
17
+ {
18
+ ExternalID: args[:external_id],
19
+ HostSite: args[:host_site]
20
+ }
21
+ end
22
+
23
+ end
24
+ end
25
+ end
26
+ end
@@ -17,10 +17,10 @@ module Cb
17
17
  <<-eos
18
18
  <Request>
19
19
  <DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
20
- <ExternalID>#{@args[:external_id]}</ExternalID>
20
+ <ExternalID>#{args[:external_id]}</ExternalID>
21
21
  <Test>#{test?}</Test>
22
- <OldPassword>#{@args[:old_password]}</OldPassword>
23
- <NewPassword>#{@args[:new_password]}</NewPassword>
22
+ <OldPassword>#{args[:old_password]}</OldPassword>
23
+ <NewPassword>#{args[:new_password]}</NewPassword>
24
24
  </Request>
25
25
  eos
26
26
  end
@@ -17,8 +17,8 @@ module Cb
17
17
  <<-eos
18
18
  <Request>
19
19
  <DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
20
- <Email>#{@args[:email]}</Email>
21
- <Password>#{@args[:password]}</Password>
20
+ <Email>#{args[:email]}</Email>
21
+ <Password>#{args[:password]}</Password>
22
22
  <Test>#{test?}</Test>
23
23
  </Request>
24
24
  eos
@@ -17,9 +17,9 @@ module Cb
17
17
  <<-eos
18
18
  <Request>
19
19
  <DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
20
- <ExternalID>#{@args[:external_id]}</ExternalID>
20
+ <ExternalID>#{args[:external_id]}</ExternalID>
21
21
  <Test>#{test?}</Test>
22
- <Password>#{@args[:password]}</Password>
22
+ <Password>#{args[:password]}</Password>
23
23
  </Request>
24
24
  eos
25
25
  end
@@ -17,7 +17,7 @@ module Cb
17
17
  <<-eos
18
18
  <Request>
19
19
  <DeveloperKey>#{Cb.configuration.dev_key}</DeveloperKey>
20
- <ExternalID>#{@args[:external_id]}</ExternalID>
20
+ <ExternalID>#{args[:external_id]}</ExternalID>
21
21
  <Test>#{test?}</Test>
22
22
  </Request>
23
23
  eos
@@ -15,7 +15,7 @@ module Cb
15
15
 
16
16
  def query
17
17
  {
18
- 'ExternalID' => @args[:external_id]
18
+ 'ExternalID' => args[:external_id]
19
19
  }
20
20
  end
21
21
 
@@ -0,0 +1,34 @@
1
+ require 'cb/responses/api_response'
2
+
3
+ module Cb
4
+ module Responses
5
+ module EmailSubscription
6
+ class Response < ApiResponse
7
+
8
+ protected
9
+
10
+ def hash_containing_metadata
11
+ response
12
+ end
13
+
14
+ def validate_api_hash
15
+ required_response_field(response_node, response)
16
+ end
17
+
18
+ def extract_models
19
+ Cb::Models::EmailSubscription.new(model_hash)
20
+ end
21
+
22
+ private
23
+
24
+ def response_node
25
+ "SubscriptionValues"
26
+ end
27
+
28
+ def model_hash
29
+ response[response_node]
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -8,6 +8,14 @@ module Cb
8
8
  raise ResponseNotFoundError.new request_class
9
9
  end
10
10
 
11
+ protected
12
+
13
+ def response_hash_extension
14
+ {
15
+ response_hash_extension_not_implemented: true
16
+ }
17
+ end
18
+
11
19
  private
12
20
 
13
21
  def response_hash
@@ -24,16 +32,19 @@ module Cb
24
32
 
25
33
  Cb::Requests::Category::Search => Cb::Responses::Category::Search,
26
34
 
35
+ Cb::Requests::Company::Find => Cb::Responses::Company::Find,
36
+
27
37
  Cb::Requests::Education::Get => Cb::Responses::Education::Get,
28
38
 
29
- Cb::Requests::Company::Find => Cb::Responses::Company::Find,
39
+ Cb::Requests::EmailSubscription::Retrieve => Cb::Responses::EmailSubscription::Response,
40
+ Cb::Requests::EmailSubscription::Modify => Cb::Responses::EmailSubscription::Response,
30
41
 
31
42
  Cb::Requests::User::ChangePassword => Cb::Responses::User::ChangePassword,
32
43
  Cb::Requests::User::CheckExisting => Cb::Responses::User::CheckExisting,
33
44
  Cb::Requests::User::Delete => Cb::Responses::User::Delete,
34
45
  Cb::Requests::User::Retrieve => Cb::Responses::User::Retrieve,
35
46
  Cb::Requests::User::TemporaryPassword => Cb::Responses::User::TemporaryPassword
36
- }
47
+ }.merge response_hash_extension
37
48
  end
38
49
 
39
50
  end
data/lib/cb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cb
2
- VERSION = '7.6.2'
2
+ VERSION = '7.7.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.6.2
4
+ version: 7.7.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-06-04 00:00:00.000000000 Z
12
+ date: 2014-06-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -217,6 +217,7 @@ files:
217
217
  - lib/cb/responses/job/search.rb
218
218
  - lib/cb/responses/application/application_form.rb
219
219
  - lib/cb/responses/spot/retrieve_response.rb
220
+ - lib/cb/responses/email_subscription/response.rb
220
221
  - lib/cb/responses/industry/search.rb
221
222
  - lib/cb/responses/api_response.rb
222
223
  - lib/cb/responses/user/check_existing.rb
@@ -279,6 +280,8 @@ files:
279
280
  - lib/cb/requests/application/form.rb
280
281
  - lib/cb/requests/application/create.rb
281
282
  - lib/cb/requests/application/utils.rb
283
+ - lib/cb/requests/email_subscription/modify.rb
284
+ - lib/cb/requests/email_subscription/retrieve.rb
282
285
  - lib/cb/requests/user/check_existing.rb
283
286
  - lib/cb/requests/user/delete.rb
284
287
  - lib/cb/requests/user/change_password.rb