Module: WolfCore::Burnett::PositionsOperations

Includes:
HttpOperations
Defined in:
lib/wolf_core/application/burnett/positions_operations/positions_operations.rb

Instance Method Summary collapse

Methods included from HttpOperations

#async_http_get, #async_http_post, #async_http_put, #http_get, #http_post, #http_put, #parse_http_response, #parsed_http_get, #parsed_http_post, #parsed_http_put, #safe_http_get, #safe_http_post, #safe_http_put, #validate_http_response

Methods included from LoggingUtils

#log_object

Methods included from AsyncUtils

#run_async

Methods included from ExceptionOperations

#raise_service_error

Instance Method Details

#create_position(erecruit_token:, erecruit_platform_url:, position:) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/wolf_core/application/burnett/positions_operations/positions_operations.rb', line 17

def create_position(erecruit_token:, erecruit_platform_url:, position:)
  parsed_http_post(
    headers: { "Authorization" => "Bearer #{erecruit_token}" },
    url: "#{erecruit_platform_url}/Position",
    body: position
  )
end

#create_position!(erecruit_token:, erecruit_platform_url:, position:, error_message:, error_data: nil) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/wolf_core/application/burnett/positions_operations/positions_operations.rb', line 6

def create_position!(erecruit_token:, erecruit_platform_url:, position:, error_message:, error_data: nil)
  response = safe_http_post(
    headers: { "Authorization" => "Bearer #{erecruit_token}" },
    url: "#{erecruit_platform_url}/Position",
    body: position,
    error_message: error_message,
    error_data: error_data
  )
  response.body
end

#update_position(erecruit_token:, erecruit_platform_url:, position_id:, position:) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/wolf_core/application/burnett/positions_operations/positions_operations.rb', line 35

def update_position(erecruit_token:, erecruit_platform_url:, position_id:, position:)
  parsed_http_put(
    headers: { "Authorization" => "Bearer #{erecruit_token}" },
    url: "#{erecruit_platform_url}/Position/#{position_id}",
    body: position
  )
end

#update_position!(erecruit_token:, erecruit_platform_url:, position_id:, position:, error_message:) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/wolf_core/application/burnett/positions_operations/positions_operations.rb', line 25

def update_position!(erecruit_token:, erecruit_platform_url:, position_id:, position:, error_message:)
  response = safe_http_put(
    headers: { "Authorization" => "Bearer #{erecruit_token}" },
    url: "#{erecruit_platform_url}/Position/#{position_id}",
    body: position,
    error_message: error_message
  )
  response.body
end