# Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. # typed: true # frozen_string_literal: true require 'faraday' require 'faraday/multipart' require 'sorbet-runtime' module StackOne extend T::Sig class Ats extend T::Sig sig { params(sdk_config: SDKConfiguration).void } def initialize(sdk_config) @sdk_configuration = sdk_config end sig { params(ats_create_application_request_dto: ::StackOne::Shared::AtsCreateApplicationRequestDto, x_account_id: ::String).returns(::StackOne::Operations::AtsCreateApplicationResponse) } def create_application(ats_create_application_request_dto, x_account_id) # create_application - Create Application request = ::StackOne::Operations::AtsCreateApplicationRequest.new( ats_create_application_request_dto: ats_create_application_request_dto, x_account_id: x_account_id ) url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/applications" headers = Utils.get_headers(request) req_content_type, data, form = Utils.serialize_request_body(request, :ats_create_application_request_dto, :json) headers['content-type'] = req_content_type raise StandardError, 'request body is required' if data.nil? && form.nil? headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.post(url) do |req| req.headers = headers 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.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsCreateApplicationResponse.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, ::StackOne::Shared::CreateResult) res.create_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(ats_create_candidate_request_dto: ::StackOne::Shared::AtsCreateCandidateRequestDto, x_account_id: ::String).returns(::StackOne::Operations::AtsCreateCandidateResponse) } def create_candidate(ats_create_candidate_request_dto, x_account_id) # create_candidate - Create Candidate request = ::StackOne::Operations::AtsCreateCandidateRequest.new( ats_create_candidate_request_dto: ats_create_candidate_request_dto, x_account_id: x_account_id ) url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/candidates" headers = Utils.get_headers(request) req_content_type, data, form = Utils.serialize_request_body(request, :ats_create_candidate_request_dto, :json) headers['content-type'] = req_content_type raise StandardError, 'request body is required' if data.nil? && form.nil? headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.post(url) do |req| req.headers = headers 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.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsCreateCandidateResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::CreateResult) res.create_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(ats_create_notes_request_dto: ::StackOne::Shared::AtsCreateNotesRequestDto, id: ::String, x_account_id: ::String).returns(::StackOne::Operations::AtsCreateCandidateNoteResponse) } def create_candidate_note(ats_create_notes_request_dto, id, x_account_id) # create_candidate_note - Create Candidate Note request = ::StackOne::Operations::AtsCreateCandidateNoteRequest.new( ats_create_notes_request_dto: ats_create_notes_request_dto, id: id, x_account_id: x_account_id ) url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsCreateCandidateNoteRequest, base_url, '/unified/ats/candidates/{id}/notes', request ) headers = Utils.get_headers(request) req_content_type, data, form = Utils.serialize_request_body(request, :ats_create_notes_request_dto, :json) headers['content-type'] = req_content_type raise StandardError, 'request body is required' if data.nil? && form.nil? headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.post(url) do |req| req.headers = headers 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.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsCreateCandidateNoteResponse.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, ::StackOne::Shared::CreateResult) res.create_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(ats_create_offer_request_dto: ::StackOne::Shared::AtsCreateOfferRequestDto, x_account_id: ::String).returns(::StackOne::Operations::AtsCreateOfferResponse) } def create_offer(ats_create_offer_request_dto, x_account_id) # create_offer - Creates an offer request = ::StackOne::Operations::AtsCreateOfferRequest.new( ats_create_offer_request_dto: ats_create_offer_request_dto, x_account_id: x_account_id ) url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/offers" headers = Utils.get_headers(request) req_content_type, data, form = Utils.serialize_request_body(request, :ats_create_offer_request_dto, :json) headers['content-type'] = req_content_type raise StandardError, 'request body is required' if data.nil? && form.nil? headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.post(url) do |req| req.headers = headers 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.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsCreateOfferResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::CreateResult) res.create_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(id: ::String, sub_resource_id: ::String, x_account_id: ::String, format: T.nilable(::String)).returns(::StackOne::Operations::AtsDownloadApplicationDocumentResponse) } def download_application_document(id, sub_resource_id, x_account_id, format = nil) # download_application_document - Download Application Document request = ::StackOne::Operations::AtsDownloadApplicationDocumentRequest.new( id: id, sub_resource_id: sub_resource_id, x_account_id: x_account_id, format: format ) url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsDownloadApplicationDocumentRequest, base_url, '/unified/ats/applications/{id}/documents/{subResourceId}/download', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsDownloadApplicationDocumentRequest, request) headers['Accept'] = 'application/octet-stream' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsDownloadApplicationDocumentResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 res.bytes = r.env.response_body if Utils.match_content_type(content_type, 'application/octet-stream') elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetApplicationRequest)).returns(::StackOne::Operations::AtsGetApplicationResponse) } def get_application(request) # get_application - Get Application url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetApplicationRequest, base_url, '/unified/ats/applications/{id}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetApplicationRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsGetApplicationResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::ApplicationResult) res.application_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetApplicationDocumentRequest)).returns(::StackOne::Operations::AtsGetApplicationDocumentResponse) } def get_application_document(request) # get_application_document - Get Application Document url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetApplicationDocumentRequest, base_url, '/unified/ats/applications/{id}/documents/{subResourceId}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetApplicationDocumentRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsGetApplicationDocumentResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::AtsDocumentResult) res.ats_document_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetApplicationOfferRequest)).returns(::StackOne::Operations::AtsGetApplicationOfferResponse) } def get_application_offer(request) # get_application_offer - Get Application Offer url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetApplicationOfferRequest, base_url, '/unified/ats/applications/{id}/offers/{subResourceId}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetApplicationOfferRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsGetApplicationOfferResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::OffersResult) res.offers_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetApplicationScorecardRequest)).returns(::StackOne::Operations::AtsGetApplicationScorecardResponse) } def get_application_scorecard(request) # get_application_scorecard - Get Application Scorecard url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetApplicationScorecardRequest, base_url, '/unified/ats/applications/{id}/scorecards/{subResourceId}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetApplicationScorecardRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsGetApplicationScorecardResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::ScorecardsResult) res.scorecards_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetCandidateRequest)).returns(::StackOne::Operations::AtsGetCandidateResponse) } def get_candidate(request) # get_candidate - Get Candidate url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetCandidateRequest, base_url, '/unified/ats/candidates/{id}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetCandidateRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsGetCandidateResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::CandidateResult) res.candidate_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetCandidateNoteRequest)).returns(::StackOne::Operations::AtsGetCandidateNoteResponse) } def get_candidate_note(request) # get_candidate_note - Get Candidate Note url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetCandidateNoteRequest, base_url, '/unified/ats/candidates/{id}/notes/{subResourceId}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetCandidateNoteRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsGetCandidateNoteResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::NoteResult) res.note_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetDepartmentRequest)).returns(::StackOne::Operations::AtsGetDepartmentResponse) } def get_department(request) # get_department - Get Department url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetDepartmentRequest, base_url, '/unified/ats/departments/{id}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetDepartmentRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsGetDepartmentResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::DepartmentResult) res.department_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetInterviewRequest)).returns(::StackOne::Operations::AtsGetInterviewResponse) } def get_interview(request) # get_interview - Get Interview url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetInterviewRequest, base_url, '/unified/ats/interviews/{id}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetInterviewRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsGetInterviewResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::InterviewsResult) res.interviews_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetInterviewStageRequest)).returns(::StackOne::Operations::AtsGetInterviewStageResponse) } def get_interview_stage(request) # get_interview_stage - Get Interview Stage url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetInterviewStageRequest, base_url, '/unified/ats/interview_stages/{id}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetInterviewStageRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsGetInterviewStageResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::InterviewStageResult) res.interview_stage_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetJobRequest)).returns(::StackOne::Operations::AtsGetJobResponse) } def get_job(request) # get_job - Get Job url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetJobRequest, base_url, '/unified/ats/jobs/{id}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetJobRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsGetJobResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::JobResult) res.job_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetJobPostingRequest)).returns(::StackOne::Operations::AtsGetJobPostingResponse) } def get_job_posting(request) # get_job_posting - Get Job Posting url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetJobPostingRequest, base_url, '/unified/ats/job_postings/{id}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetJobPostingRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsGetJobPostingResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::JobPostingResult) res.job_posting_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetLocationRequest)).returns(::StackOne::Operations::AtsGetLocationResponse) } def get_location(request) # get_location - Get Location url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetLocationRequest, base_url, '/unified/ats/locations/{id}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetLocationRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsGetLocationResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::ATSLocationResult) res.ats_location_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetOfferRequest)).returns(::StackOne::Operations::AtsGetOfferResponse) } def get_offer(request) # get_offer - Get Offer url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetOfferRequest, base_url, '/unified/ats/offers/{id}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetOfferRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsGetOfferResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::OffersResult) res.offers_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetRejectedReasonRequest)).returns(::StackOne::Operations::AtsGetRejectedReasonResponse) } def get_rejected_reason(request) # get_rejected_reason - Get Rejected Reason url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetRejectedReasonRequest, base_url, '/unified/ats/rejected_reasons/{id}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetRejectedReasonRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsGetRejectedReasonResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::RejectedReasonResult) res.rejected_reason_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetUserRequest)).returns(::StackOne::Operations::AtsGetUserResponse) } def get_user(request) # get_user - Get User url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetUserRequest, base_url, '/unified/ats/users/{id}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetUserRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsGetUserResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::UserResult) res.user_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsListApplicationDocumentsRequest)).returns(::StackOne::Operations::AtsListApplicationDocumentsResponse) } def list_application_documents(request) # list_application_documents - List Application Documents url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsListApplicationDocumentsRequest, base_url, '/unified/ats/applications/{id}/documents', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListApplicationDocumentsRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsListApplicationDocumentsResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::AtsDocumentsPaginated) res.ats_documents_paginated = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsListApplicationScorecardsRequest)).returns(::StackOne::Operations::AtsListApplicationScorecardsResponse) } def list_application_scorecards(request) # list_application_scorecards - List Application Scorecards url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsListApplicationScorecardsRequest, base_url, '/unified/ats/applications/{id}/scorecards', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListApplicationScorecardsRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsListApplicationScorecardsResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::ScorecardsPaginated) res.scorecards_paginated = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsListApplicationsRequest)).returns(::StackOne::Operations::AtsListApplicationsResponse) } def list_applications(request) # list_applications - List Applications url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/applications" headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListApplicationsRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsListApplicationsResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::ApplicationsPaginated) res.applications_paginated = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsListApplicationsOffersRequest)).returns(::StackOne::Operations::AtsListApplicationsOffersResponse) } def list_applications_offers(request) # list_applications_offers - List Application Offers url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsListApplicationsOffersRequest, base_url, '/unified/ats/applications/{id}/offers', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListApplicationsOffersRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsListApplicationsOffersResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::OffersPaginated) res.offers_paginated = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsListCandidateNotesRequest)).returns(::StackOne::Operations::AtsListCandidateNotesResponse) } def list_candidate_notes(request) # list_candidate_notes - List Candidate Notes url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsListCandidateNotesRequest, base_url, '/unified/ats/candidates/{id}/notes', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListCandidateNotesRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsListCandidateNotesResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::NotesPaginated) res.notes_paginated = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsListCandidatesRequest)).returns(::StackOne::Operations::AtsListCandidatesResponse) } def list_candidates(request) # list_candidates - List Candidates url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/candidates" headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListCandidatesRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsListCandidatesResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::CandidatesPaginated) res.candidates_paginated = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsListDepartmentsRequest)).returns(::StackOne::Operations::AtsListDepartmentsResponse) } def list_departments(request) # list_departments - List Departments url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/departments" headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListDepartmentsRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsListDepartmentsResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::DepartmentsPaginated) res.departments_paginated = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsListInterviewStagesRequest)).returns(::StackOne::Operations::AtsListInterviewStagesResponse) } def list_interview_stages(request) # list_interview_stages - List Interview Stages url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/interview_stages" headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListInterviewStagesRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsListInterviewStagesResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::InterviewStagesPaginated) res.interview_stages_paginated = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsListInterviewsRequest)).returns(::StackOne::Operations::AtsListInterviewsResponse) } def list_interviews(request) # list_interviews - List Interviews url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/interviews" headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListInterviewsRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsListInterviewsResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::InterviewsPaginated) res.interviews_paginated = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsListJobPostingsRequest)).returns(::StackOne::Operations::AtsListJobPostingsResponse) } def list_job_postings(request) # list_job_postings - List Job Postings url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/job_postings" headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListJobPostingsRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsListJobPostingsResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::JobPostingsPaginated) res.job_postings_paginated = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsListJobsRequest)).returns(::StackOne::Operations::AtsListJobsResponse) } def list_jobs(request) # list_jobs - List Jobs url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/jobs" headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListJobsRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsListJobsResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::JobsPaginated) res.jobs_paginated = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsListLocationsRequest)).returns(::StackOne::Operations::AtsListLocationsResponse) } def list_locations(request) # list_locations - List locations url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/locations" headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListLocationsRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsListLocationsResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::ATSLocationsPaginated) res.ats_locations_paginated = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsListOffersRequest)).returns(::StackOne::Operations::AtsListOffersResponse) } def list_offers(request) # list_offers - List Offers url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/offers" headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListOffersRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsListOffersResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::OffersPaginated) res.offers_paginated = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsListRejectedReasonsRequest)).returns(::StackOne::Operations::AtsListRejectedReasonsResponse) } def list_rejected_reasons(request) # list_rejected_reasons - List Rejected Reasons url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/rejected_reasons" headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListRejectedReasonsRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsListRejectedReasonsResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::RejectedReasonsPaginated) res.rejected_reasons_paginated = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsListUsersRequest)).returns(::StackOne::Operations::AtsListUsersResponse) } def list_users(request) # list_users - List Users url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/users" headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListUsersRequest, request) headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers req.params = query_params Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsListUsersResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::UsersPaginated) res.users_paginated = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(ats_update_application_request_dto: ::StackOne::Shared::AtsUpdateApplicationRequestDto, id: ::String, x_account_id: ::String).returns(::StackOne::Operations::AtsUpdateApplicationResponse) } def update_application(ats_update_application_request_dto, id, x_account_id) # update_application - Update an Application request = ::StackOne::Operations::AtsUpdateApplicationRequest.new( ats_update_application_request_dto: ats_update_application_request_dto, id: id, x_account_id: x_account_id ) url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsUpdateApplicationRequest, base_url, '/unified/ats/applications/{id}', request ) headers = Utils.get_headers(request) req_content_type, data, form = Utils.serialize_request_body(request, :ats_update_application_request_dto, :json) headers['content-type'] = req_content_type raise StandardError, 'request body is required' if data.nil? && form.nil? headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.patch(url) do |req| req.headers = headers 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.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsUpdateApplicationResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::UpdateResult) res.update_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(ats_update_candidate_request_dto: ::StackOne::Shared::AtsUpdateCandidateRequestDto, id: ::String, x_account_id: ::String).returns(::StackOne::Operations::AtsUpdateCandidateResponse) } def update_candidate(ats_update_candidate_request_dto, id, x_account_id) # update_candidate - Update Candidate request = ::StackOne::Operations::AtsUpdateCandidateRequest.new( ats_update_candidate_request_dto: ats_update_candidate_request_dto, id: id, x_account_id: x_account_id ) url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsUpdateCandidateRequest, base_url, '/unified/ats/candidates/{id}', request ) headers = Utils.get_headers(request) req_content_type, data, form = Utils.serialize_request_body(request, :ats_update_candidate_request_dto, :json) headers['content-type'] = req_content_type raise StandardError, 'request body is required' if data.nil? && form.nil? headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.patch(url) do |req| req.headers = headers 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.headers.fetch('Content-Type', 'application/octet-stream') res = ::StackOne::Operations::AtsUpdateCandidateResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::StackOne::Shared::CreateResult) res.create_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end end end