62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
# File 'lib/open_api_sdk/ats_candidates.rb', line 62
def create(x_connection_token, unified_ats_candidate_input, remote_data = nil)
request = ::OpenApiSDK::Operations::CreateAtsCandidateRequest.new(
x_connection_token: x_connection_token,
unified_ats_candidate_input: unified_ats_candidate_input,
remote_data: remote_data
)
url, params = @sdk_configuration.get_server_details
base_url = Utils.template_url(url, params)
url = "#{base_url}/ats/candidates"
= Utils.(request)
req_content_type, data, form = Utils.serialize_request_body(request, :unified_ats_candidate_input, :json)
['content-type'] = req_content_type
raise StandardError, 'request body is required' if data.nil? && form.nil?
query_params = Utils.get_query_params(::OpenApiSDK::Operations::CreateAtsCandidateRequest, request)
['Accept'] = 'application/json'
['user-agent'] = @sdk_configuration.user_agent
r = @sdk_configuration.client.post(url) do |req|
req. =
req.params = query_params
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
if form
req.body = Utils.encode_form(form)
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
req.body = URI.encode_www_form(data)
else
req.body = data
end
end
content_type = r..fetch('Content-Type', 'application/octet-stream')
res = ::OpenApiSDK::Operations::CreateAtsCandidateResponse.new(
status_code: r.status, content_type: content_type, raw_response: r
)
if r.status == 201
if Utils.match_content_type(content_type, 'application/json')
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::UnifiedAtsCandidateOutput)
res.unified_ats_candidate_output = out
end
end
res
end
|