# Code generated by Speakeasy (https://speakeasy.com). 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_background_check_packages_request_dto: ::StackOne::Shared::AtsCreateBackgroundCheckPackagesRequestDto, x_account_id: ::String).returns(::StackOne::Operations::AtsCreateBackgroundCheckPackageResponse) } def create_background_check_package(ats_create_background_check_packages_request_dto, x_account_id) # create_background_check_package - Create Background Check Package request = ::StackOne::Operations::AtsCreateBackgroundCheckPackageRequest.new( ats_create_background_check_packages_request_dto: ats_create_background_check_packages_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/background_checks/packages" headers = Utils.get_headers(request) req_content_type, data, form = Utils.serialize_request_body(request, :ats_create_background_check_packages_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::AtsCreateBackgroundCheckPackageResponse.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_job_request_dto: ::StackOne::Shared::AtsCreateJobRequestDto, x_account_id: ::String).returns(::StackOne::Operations::AtsCreateJobResponse) } def create_job(ats_create_job_request_dto, x_account_id) # create_job - Create Job request = ::StackOne::Operations::AtsCreateJobRequest.new( ats_create_job_request_dto: ats_create_job_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/jobs" headers = Utils.get_headers(request) req_content_type, data, form = Utils.serialize_request_body(request, :ats_create_job_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::AtsCreateJobResponse.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_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::AtsGetApplicationCustomFieldDefinitionRequest)).returns(::StackOne::Operations::AtsGetApplicationCustomFieldDefinitionResponse) } def get_application_custom_field_definition(request) # get_application_custom_field_definition - Get Application Custom Field Definition url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetApplicationCustomFieldDefinitionRequest, base_url, '/unified/ats/custom_field_definitions/applications/{id}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetApplicationCustomFieldDefinitionRequest, 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::AtsGetApplicationCustomFieldDefinitionResponse.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::CustomFieldDefinitionResultApiModel) res.custom_field_definition_result_api_model = 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::AtsGetApplicationScheduledInterviewRequest)).returns(::StackOne::Operations::AtsGetApplicationScheduledInterviewResponse) } def get_application_scheduled_interview(request) # get_application_scheduled_interview - Get Applications scheduled interview url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetApplicationScheduledInterviewRequest, base_url, '/unified/ats/applications/{id}/scheduled_interviews/{subResourceId}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetApplicationScheduledInterviewRequest, 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::AtsGetApplicationScheduledInterviewResponse.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::ScheduledInterviewsResult) res.scheduled_interviews_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::AtsGetAssessmentsPackageRequest)).returns(::StackOne::Operations::AtsGetAssessmentsPackageResponse) } def get_assessments_package(request) # get_assessments_package - Get Assessments Package url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetAssessmentsPackageRequest, base_url, '/unified/ats/assessments/packages/{id}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetAssessmentsPackageRequest, 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::AtsGetAssessmentsPackageResponse.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::AssessmentsPackagesResult) res.assessments_packages_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetAssessmentsRequestRequest)).returns(::StackOne::Operations::AtsGetAssessmentsRequestResponse) } def get_assessments_request(request) # get_assessments_request - Get Assessments Requests url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetAssessmentsRequestRequest, base_url, '/unified/ats/assessments/orders/{id}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetAssessmentsRequestRequest, 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::AtsGetAssessmentsRequestResponse.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::AssessmentsOrderResult) res.assessments_order_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetAssessmentsResultRequest)).returns(::StackOne::Operations::AtsGetAssessmentsResultResponse) } def get_assessments_result(request) # get_assessments_result - Get Assessments Results url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetAssessmentsResultRequest, base_url, '/unified/ats/assessments/orders/{id}/results', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetAssessmentsResultRequest, 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::AtsGetAssessmentsResultResponse.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::AssessmentsResultsResult) res.assessments_results_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetBackgroundCheckPackageRequest)).returns(::StackOne::Operations::AtsGetBackgroundCheckPackageResponse) } def get_background_check_package(request) # get_background_check_package - Get Background Check Package url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetBackgroundCheckPackageRequest, base_url, '/unified/ats/background_checks/packages/{id}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetBackgroundCheckPackageRequest, 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::AtsGetBackgroundCheckPackageResponse.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::BackgroundCheckPackageResult) res.background_check_package_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetBackgroundCheckRequestRequest)).returns(::StackOne::Operations::AtsGetBackgroundCheckRequestResponse) } def get_background_check_request(request) # get_background_check_request - Get Background Check Request url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetBackgroundCheckRequestRequest, base_url, '/unified/ats/background_checks/orders/{id}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetBackgroundCheckRequestRequest, 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::AtsGetBackgroundCheckRequestResponse.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::BackgroundCheckOrderResult) res.background_check_order_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsGetBackgroundCheckResultRequest)).returns(::StackOne::Operations::AtsGetBackgroundCheckResultResponse) } def get_background_check_result(request) # get_background_check_result - Get Background Check Results url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetBackgroundCheckResultRequest, base_url, '/unified/ats/background_checks/orders/{id}/results', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetBackgroundCheckResultRequest, 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::AtsGetBackgroundCheckResultResponse.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::BackgroundCheckResultsResult) res.background_check_results_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::AtsGetCandidateCustomFieldDefinitionRequest)).returns(::StackOne::Operations::AtsGetCandidateCustomFieldDefinitionResponse) } def get_candidate_custom_field_definition(request) # get_candidate_custom_field_definition - Get Candidate Custom Field Definition url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetCandidateCustomFieldDefinitionRequest, base_url, '/unified/ats/custom_field_definitions/candidates/{id}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetCandidateCustomFieldDefinitionRequest, 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::AtsGetCandidateCustomFieldDefinitionResponse.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::CustomFieldDefinitionResultApiModel) res.custom_field_definition_result_api_model = 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::AtsGetJobCustomFieldDefinitionRequest)).returns(::StackOne::Operations::AtsGetJobCustomFieldDefinitionResponse) } def get_job_custom_field_definition(request) # get_job_custom_field_definition - Get Job Custom Field Definition url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetJobCustomFieldDefinitionRequest, base_url, '/unified/ats/custom_field_definitions/jobs/{id}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetJobCustomFieldDefinitionRequest, 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::AtsGetJobCustomFieldDefinitionResponse.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::CustomFieldDefinitionResultApiModel) res.custom_field_definition_result_api_model = 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::AtsGetListRequest)).returns(::StackOne::Operations::AtsGetListResponse) } def get_list(request) # get_list - Get List url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsGetListRequest, base_url, '/unified/ats/lists/{id}', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsGetListRequest, 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::AtsGetListResponse.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::ListResult) res.list_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::AtsListApplicationCustomFieldDefinitionsRequest)).returns(::StackOne::Operations::AtsListApplicationCustomFieldDefinitionsResponse) } def list_application_custom_field_definitions(request) # list_application_custom_field_definitions - List Application Custom Field Definitions url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/custom_field_definitions/applications" headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListApplicationCustomFieldDefinitionsRequest, 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::AtsListApplicationCustomFieldDefinitionsResponse.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::CustomFieldDefinitionsPaginated) res.custom_field_definitions_paginated = 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::AtsListApplicationsScheduledInterviewsRequest)).returns(::StackOne::Operations::AtsListApplicationsScheduledInterviewsResponse) } def list_applications_scheduled_interviews(request) # list_applications_scheduled_interviews - List Applications scheduled interviews url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::StackOne::Operations::AtsListApplicationsScheduledInterviewsRequest, base_url, '/unified/ats/applications/{id}/scheduled_interviews', request ) headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListApplicationsScheduledInterviewsRequest, 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::AtsListApplicationsScheduledInterviewsResponse.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::ScheduledInterviewsPaginated) res.scheduled_interviews_paginated = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsListAssessmentsPackagesRequest)).returns(::StackOne::Operations::AtsListAssessmentsPackagesResponse) } def list_assessments_packages(request) # list_assessments_packages - List Assessments Packages url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/assessments/packages" headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListAssessmentsPackagesRequest, 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::AtsListAssessmentsPackagesResponse.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::AssessmentsPackagesPaginated) res.assessments_packages_paginated = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsListBackgroundCheckPackagesRequest)).returns(::StackOne::Operations::AtsListBackgroundCheckPackagesResponse) } def list_background_check_packages(request) # list_background_check_packages - List Background Check Packages url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/background_checks/packages" headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListBackgroundCheckPackagesRequest, 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::AtsListBackgroundCheckPackagesResponse.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::BackgroundCheckPackagePaginated) res.background_check_package_paginated = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsListBackgroundCheckRequestRequest)).returns(::StackOne::Operations::AtsListBackgroundCheckRequestResponse) } def list_background_check_request(request) # list_background_check_request - List Background Check Request url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/background_checks/orders" headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListBackgroundCheckRequestRequest, 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::AtsListBackgroundCheckRequestResponse.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::BackgroundCheckOrderPaginated) res.background_check_order_paginated = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(request: T.nilable(::StackOne::Operations::AtsListCandidateCustomFieldDefinitionsRequest)).returns(::StackOne::Operations::AtsListCandidateCustomFieldDefinitionsResponse) } def list_candidate_custom_field_definitions(request) # list_candidate_custom_field_definitions - List Candidate Custom Field Definitions url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/custom_field_definitions/candidates" headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListCandidateCustomFieldDefinitionsRequest, 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::AtsListCandidateCustomFieldDefinitionsResponse.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::CustomFieldDefinitionsPaginated) res.custom_field_definitions_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::AtsListJobCustomFieldDefinitionsRequest)).returns(::StackOne::Operations::AtsListJobCustomFieldDefinitionsResponse) } def list_job_custom_field_definitions(request) # list_job_custom_field_definitions - List Job Custom Field Definitions url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/custom_field_definitions/jobs" headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListJobCustomFieldDefinitionsRequest, 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::AtsListJobCustomFieldDefinitionsResponse.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::CustomFieldDefinitionsPaginated) res.custom_field_definitions_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::AtsListListsRequest)).returns(::StackOne::Operations::AtsListListsResponse) } def list_lists(request) # list_lists - Get all Lists url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = "#{base_url}/unified/ats/lists" headers = Utils.get_headers(request) query_params = Utils.get_query_params(::StackOne::Operations::AtsListListsRequest, 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::AtsListListsResponse.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::ListsPaginated) res.lists_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_move_application_request_dto: ::StackOne::Shared::AtsMoveApplicationRequestDto, id: ::String, x_account_id: ::String).returns(::StackOne::Operations::AtsMoveApplicationResponse) } def move_application(ats_move_application_request_dto, id, x_account_id) # move_application - Move Application request = ::StackOne::Operations::AtsMoveApplicationRequest.new( ats_move_application_request_dto: ats_move_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::AtsMoveApplicationRequest, base_url, '/unified/ats/applications/{id}/move', request ) headers = Utils.get_headers(request) req_content_type, data, form = Utils.serialize_request_body(request, :ats_move_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::AtsMoveApplicationResponse.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::MoveApplicationResult) res.move_application_result = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end sig { params(ats_reject_application_request_dto: ::StackOne::Shared::AtsRejectApplicationRequestDto, id: ::String, x_account_id: ::String).returns(::StackOne::Operations::AtsRejectApplicationResponse) } def reject_application(ats_reject_application_request_dto, id, x_account_id) # reject_application - Reject Application request = ::StackOne::Operations::AtsRejectApplicationRequest.new( ats_reject_application_request_dto: ats_reject_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::AtsRejectApplicationRequest, base_url, '/unified/ats/applications/{id}/reject', request ) headers = Utils.get_headers(request) req_content_type, data, form = Utils.serialize_request_body(request, :ats_reject_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::AtsRejectApplicationResponse.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::RejectApplicationResult) res.reject_application_result = 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 sig { params(ats_update_job_request_dto: ::StackOne::Shared::AtsUpdateJobRequestDto, id: ::String, x_account_id: ::String).returns(::StackOne::Operations::AtsUpdateJobResponse) } def update_job(ats_update_job_request_dto, id, x_account_id) # update_job - Update Job request = ::StackOne::Operations::AtsUpdateJobRequest.new( ats_update_job_request_dto: ats_update_job_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::AtsUpdateJobRequest, base_url, '/unified/ats/jobs/{id}', request ) headers = Utils.get_headers(request) req_content_type, data, form = Utils.serialize_request_body(request, :ats_update_job_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::AtsUpdateJobResponse.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(unified_upload_request_dto: ::StackOne::Shared::UnifiedUploadRequestDto, id: ::String, x_account_id: ::String).returns(::StackOne::Operations::AtsUploadApplicationDocumentResponse) } def upload_application_document(unified_upload_request_dto, id, x_account_id) # upload_application_document - Upload Application Document request = ::StackOne::Operations::AtsUploadApplicationDocumentRequest.new( unified_upload_request_dto: unified_upload_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::AtsUploadApplicationDocumentRequest, base_url, '/unified/ats/applications/{id}/documents/upload', request ) headers = Utils.get_headers(request) req_content_type, data, form = Utils.serialize_request_body(request, :unified_upload_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::AtsUploadApplicationDocumentResponse.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::WriteResultApiModel) res.write_result_api_model = out end elsif [400, 403, 412, 429, 500, 501].include?(r.status) end res end end end