cb-api 7.2.0 → 7.3.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.
data/README.md CHANGED
@@ -80,6 +80,7 @@ Currently, this workflow only works on the following endpoints:
80
80
 
81
81
  * Anonymous Saved Search
82
82
  * Application
83
+ * Application External
83
84
  * User
84
85
 
85
86
  Look here for future updates on this refactor!
@@ -0,0 +1,42 @@
1
+ require_relative '../base'
2
+
3
+ module Cb
4
+ module Requests
5
+ module ApplicationExternal
6
+ class SubmitApplication < Base
7
+
8
+ def endpoint_uri
9
+ Cb.configuration.uri_application_external
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}</DeveloperKey>
20
+ <EmailAddress>#{@args[:email_address]}</EmailAddress>
21
+ <JobDID>#{@args[:job_did]}</JobDID>
22
+ <SiteID>#{@args[:site_id]}</SiteID>
23
+ <IPath>#{ipath}</IPath>
24
+ <IsExternalLinkApply>#{@args[:is_external_link_apply]}</IsExternalLinkApply>
25
+ <HostSite>#{@args[:host_site] || Cb.configuration.host_site}</HostSite>
26
+ </Request>
27
+ eos
28
+ end
29
+
30
+ private
31
+
32
+ def ipath
33
+ return '' unless @args[:ipath].is_a?(String)
34
+ ipath_length = 10
35
+
36
+ @args[:ipath].slice(0, ipath_length)
37
+ end
38
+
39
+ end
40
+ end
41
+ end
42
+ end
@@ -3,7 +3,8 @@ module Cb
3
3
  class Base
4
4
 
5
5
  def initialize(argument_hash)
6
- @args = argument_hash || {}
6
+ raise ArgumentError.new("#{argument_hash.class} is not a Hash") unless argument_hash.is_a?(Hash)
7
+ @args = argument_hash
7
8
  end
8
9
 
9
10
  def endpoint_uri
@@ -0,0 +1,34 @@
1
+ require 'cb/responses/api_response'
2
+
3
+ module Cb
4
+ module Responses
5
+ module ApplicationExternal
6
+ class SubmitApplication < ApiResponse
7
+
8
+ class Model < Struct.new(:apply_url) ; end
9
+
10
+ protected
11
+
12
+ def hash_containing_metadata
13
+ response
14
+ end
15
+
16
+ def validate_api_hash
17
+ required_response_field(apply_url, response)
18
+ end
19
+
20
+ def extract_models
21
+ model = Model.new
22
+ model.apply_url = response[apply_url]
23
+ model
24
+ end
25
+
26
+ private
27
+
28
+ def apply_url
29
+ 'ApplyUrl'
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -20,6 +20,8 @@ module Cb
20
20
  Cb::Requests::Application::Get => Cb::Responses::Application,
21
21
  Cb::Requests::Application::Update => Cb::Responses::Application,
22
22
 
23
+ Cb::Requests::ApplicationExternal::SubmitApplication => Cb::Responses::ApplicationExternal::SubmitApplication,
24
+
23
25
  Cb::Requests::User::ChangePassword => Cb::Responses::User::ChangePassword,
24
26
  Cb::Requests::User::CheckExisting => Cb::Responses::User::CheckExisting,
25
27
  Cb::Requests::User::Delete => Cb::Responses::User::Delete,
data/lib/cb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cb
2
- VERSION = '7.2.0'
2
+ VERSION = '7.3.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.2.0
4
+ version: 7.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -225,6 +225,7 @@ files:
225
225
  - lib/cb/responses/user/temporary_password.rb
226
226
  - lib/cb/responses/user/retrieve.rb
227
227
  - lib/cb/responses/timing.rb
228
+ - lib/cb/responses/application_external/submit_application.rb
228
229
  - lib/cb/responses/saved_search/list.rb
229
230
  - lib/cb/responses/saved_search/singular.rb
230
231
  - lib/cb/responses/saved_search/delete.rb
@@ -281,6 +282,7 @@ files:
281
282
  - lib/cb/requests/user/temporary_password.rb
282
283
  - lib/cb/requests/user/retrieve.rb
283
284
  - lib/cb/requests/base.rb
285
+ - lib/cb/requests/application_external/submit_application.rb
284
286
  - lib/cb/convenience.rb
285
287
  - lib/cb/clients/job_branding.rb
286
288
  - lib/cb/clients/recommendation.rb