stackone_client 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/stackone/accounts.rb +224 -0
- data/lib/stackone/ats.rb +1289 -0
- data/lib/stackone/connect_sessions.rb +100 -0
- data/lib/stackone/connectors.rb +98 -0
- data/lib/stackone/crm.rb +323 -0
- data/lib/stackone/hris.rb +682 -0
- data/lib/stackone/marketing.rb +584 -0
- data/lib/stackone/models/operations/ats_create_application.rb +53 -0
- data/lib/stackone/models/operations/ats_create_candidate.rb +53 -0
- data/lib/stackone/models/operations/ats_create_candidate_note.rb +56 -0
- data/lib/stackone/models/operations/ats_create_offer.rb +53 -0
- data/lib/stackone/models/operations/ats_get_application.rb +88 -0
- data/lib/stackone/models/operations/ats_get_application_offer.rb +91 -0
- data/lib/stackone/models/operations/ats_get_application_scorecard.rb +91 -0
- data/lib/stackone/models/operations/ats_get_candidate.rb +88 -0
- data/lib/stackone/models/operations/ats_get_candidate_note.rb +91 -0
- data/lib/stackone/models/operations/ats_get_department.rb +88 -0
- data/lib/stackone/models/operations/ats_get_interview.rb +88 -0
- data/lib/stackone/models/operations/ats_get_interview_stage.rb +88 -0
- data/lib/stackone/models/operations/ats_get_job.rb +88 -0
- data/lib/stackone/models/operations/ats_get_job_posting.rb +91 -0
- data/lib/stackone/models/operations/ats_get_location.rb +88 -0
- data/lib/stackone/models/operations/ats_get_offer.rb +88 -0
- data/lib/stackone/models/operations/ats_get_rejected_reason.rb +88 -0
- data/lib/stackone/models/operations/ats_get_user.rb +88 -0
- data/lib/stackone/models/operations/ats_list_application_scorecards.rb +88 -0
- data/lib/stackone/models/operations/ats_list_applications.rb +85 -0
- data/lib/stackone/models/operations/ats_list_applications_offers.rb +88 -0
- data/lib/stackone/models/operations/ats_list_candidate_notes.rb +88 -0
- data/lib/stackone/models/operations/ats_list_candidates.rb +85 -0
- data/lib/stackone/models/operations/ats_list_departments.rb +85 -0
- data/lib/stackone/models/operations/ats_list_interview_stages.rb +85 -0
- data/lib/stackone/models/operations/ats_list_interviews.rb +85 -0
- data/lib/stackone/models/operations/ats_list_job_postings.rb +88 -0
- data/lib/stackone/models/operations/ats_list_jobs.rb +85 -0
- data/lib/stackone/models/operations/ats_list_locations.rb +85 -0
- data/lib/stackone/models/operations/ats_list_offers.rb +85 -0
- data/lib/stackone/models/operations/ats_list_rejected_reasons.rb +85 -0
- data/lib/stackone/models/operations/ats_list_users.rb +85 -0
- data/lib/stackone/models/operations/ats_update_application.rb +56 -0
- data/lib/stackone/models/operations/ats_update_candidate.rb +56 -0
- data/lib/stackone/models/operations/crm_create_contact.rb +53 -0
- data/lib/stackone/models/operations/crm_get_account.rb +88 -0
- data/lib/stackone/models/operations/crm_get_contact.rb +88 -0
- data/lib/stackone/models/operations/crm_get_list.rb +88 -0
- data/lib/stackone/models/operations/crm_list_accounts.rb +85 -0
- data/lib/stackone/models/operations/crm_list_contacts.rb +85 -0
- data/lib/stackone/models/operations/crm_list_lists.rb +85 -0
- data/lib/stackone/models/operations/crm_update_contact.rb +56 -0
- data/lib/stackone/models/operations/hris_create_employee.rb +53 -0
- data/lib/stackone/models/operations/hris_create_employee_time_off_request.rb +56 -0
- data/lib/stackone/models/operations/hris_create_time_off_request.rb +53 -0
- data/lib/stackone/models/operations/hris_get_company.rb +88 -0
- data/lib/stackone/models/operations/hris_get_employee.rb +94 -0
- data/lib/stackone/models/operations/hris_get_employees_time_off_request.rb +91 -0
- data/lib/stackone/models/operations/hris_get_employment.rb +88 -0
- data/lib/stackone/models/operations/hris_get_location.rb +88 -0
- data/lib/stackone/models/operations/hris_get_time_off_request.rb +88 -0
- data/lib/stackone/models/operations/hris_list_companies.rb +85 -0
- data/lib/stackone/models/operations/hris_list_employee_time_off_requests.rb +88 -0
- data/lib/stackone/models/operations/hris_list_employees.rb +91 -0
- data/lib/stackone/models/operations/hris_list_employments.rb +85 -0
- data/lib/stackone/models/operations/hris_list_locations.rb +85 -0
- data/lib/stackone/models/operations/hris_list_time_off_requests.rb +85 -0
- data/lib/stackone/models/operations/hris_update_employee.rb +56 -0
- data/lib/stackone/models/operations/hris_update_time_off_request.rb +56 -0
- data/lib/stackone/models/operations/marketing_create_email_template.rb +53 -0
- data/lib/stackone/models/operations/marketing_create_omni_channel_template.rb +53 -0
- data/lib/stackone/models/operations/marketing_create_push_template.rb +53 -0
- data/lib/stackone/models/operations/marketing_get_campaign.rb +88 -0
- data/lib/stackone/models/operations/marketing_get_email_template.rb +88 -0
- data/lib/stackone/models/operations/marketing_get_omni_channel_template.rb +88 -0
- data/lib/stackone/models/operations/marketing_get_push_template.rb +88 -0
- data/lib/stackone/models/operations/marketing_list_campaigns.rb +85 -0
- data/lib/stackone/models/operations/marketing_list_email_templates.rb +85 -0
- data/lib/stackone/models/operations/marketing_list_omni_channel_templates.rb +85 -0
- data/lib/stackone/models/operations/marketing_list_push_templates.rb +85 -0
- data/lib/stackone/models/operations/marketing_update_email_template.rb +56 -0
- data/lib/stackone/models/operations/marketing_update_omni_channel_template.rb +56 -0
- data/lib/stackone/models/operations/marketing_update_push_template.rb +56 -0
- data/lib/stackone/models/operations/stackone_authenticate_connect_session.rb +35 -0
- data/lib/stackone/models/operations/stackone_create_connect_session.rb +35 -0
- data/lib/stackone/models/operations/stackone_delete_account.rb +49 -0
- data/lib/stackone/models/operations/stackone_get_account.rb +49 -0
- data/lib/stackone/models/operations/stackone_get_account_meta_info.rb +49 -0
- data/lib/stackone/models/operations/stackone_get_connector_meta.rb +52 -0
- data/lib/stackone/models/operations/stackone_list_connectors_meta.rb +48 -0
- data/lib/stackone/models/operations/stackone_list_linked_accounts.rb +51 -0
- data/lib/stackone/models/operations/stackone_proxy_request.rb +49 -0
- data/lib/stackone/models/operations/stackone_update_account.rb +53 -0
- data/lib/stackone/models/shared/account.rb +55 -0
- data/lib/stackone/models/shared/accountaddress.rb +342 -0
- data/lib/stackone/models/shared/accountresult.rb +29 -0
- data/lib/stackone/models/shared/accountspaginated.rb +34 -0
- data/lib/stackone/models/shared/answer.rb +64 -0
- data/lib/stackone/models/shared/application.rb +75 -0
- data/lib/stackone/models/shared/applicationattachment.rb +63 -0
- data/lib/stackone/models/shared/applicationcandidate.rb +31 -0
- data/lib/stackone/models/shared/applicationresult.rb +29 -0
- data/lib/stackone/models/shared/applicationspaginated.rb +34 -0
- data/lib/stackone/models/shared/applicationstatusenumapimodel.rb +50 -0
- data/lib/stackone/models/shared/atscreateapplicationrequestdto.rb +45 -0
- data/lib/stackone/models/shared/atscreatecandidaterequestdto.rb +46 -0
- data/lib/stackone/models/shared/atscreatenotesrequestdto.rb +57 -0
- data/lib/stackone/models/shared/atscreateofferrequestdto.rb +41 -0
- data/lib/stackone/models/shared/atslocation.rb +28 -0
- data/lib/stackone/models/shared/atslocationresult.rb +29 -0
- data/lib/stackone/models/shared/atslocationspaginated.rb +34 -0
- data/lib/stackone/models/shared/atsupdateapplicationrequestdto.rb +48 -0
- data/lib/stackone/models/shared/atsupdatecandidatesrequestdto.rb +49 -0
- data/lib/stackone/models/shared/attachmenttype.rb +40 -0
- data/lib/stackone/models/shared/campaign.rb +120 -0
- data/lib/stackone/models/shared/campaignresult.rb +29 -0
- data/lib/stackone/models/shared/campaignspaginated.rb +34 -0
- data/lib/stackone/models/shared/candidate.rb +64 -0
- data/lib/stackone/models/shared/candidateemail.rb +28 -0
- data/lib/stackone/models/shared/candidateresult.rb +29 -0
- data/lib/stackone/models/shared/candidatespaginated.rb +34 -0
- data/lib/stackone/models/shared/channelsenum.rb +42 -0
- data/lib/stackone/models/shared/companiespaginated.rb +34 -0
- data/lib/stackone/models/shared/company.rb +37 -0
- data/lib/stackone/models/shared/companyresult.rb +29 -0
- data/lib/stackone/models/shared/compensation.rb +149 -0
- data/lib/stackone/models/shared/connectorsmeta.rb +73 -0
- data/lib/stackone/models/shared/connectsession.rb +68 -0
- data/lib/stackone/models/shared/connectsessionauthenticate.rb +25 -0
- data/lib/stackone/models/shared/connectsessioncreate.rb +72 -0
- data/lib/stackone/models/shared/connectsessiontoken.rb +71 -0
- data/lib/stackone/models/shared/contact.rb +52 -0
- data/lib/stackone/models/shared/contactresult.rb +29 -0
- data/lib/stackone/models/shared/contactspaginated.rb +34 -0
- data/lib/stackone/models/shared/countrycodeenum.rb +284 -0
- data/lib/stackone/models/shared/createcandidatenoteresult.rb +31 -0
- data/lib/stackone/models/shared/createemployeeresult.rb +31 -0
- data/lib/stackone/models/shared/createofferresult.rb +31 -0
- data/lib/stackone/models/shared/createresult.rb +31 -0
- data/lib/stackone/models/shared/createtemplateresult.rb +31 -0
- data/lib/stackone/models/shared/createtimeoffresult.rb +31 -0
- data/lib/stackone/models/shared/crmcreatecontactrequestdto.rb +43 -0
- data/lib/stackone/models/shared/department.rb +28 -0
- data/lib/stackone/models/shared/departmentresult.rb +29 -0
- data/lib/stackone/models/shared/departmentspaginated.rb +34 -0
- data/lib/stackone/models/shared/emailmessages.rb +93 -0
- data/lib/stackone/models/shared/employee.rb +1035 -0
- data/lib/stackone/models/shared/employeecustomfields.rb +83 -0
- data/lib/stackone/models/shared/employeeresult.rb +29 -0
- data/lib/stackone/models/shared/employeespaginated.rb +34 -0
- data/lib/stackone/models/shared/employment.rb +191 -0
- data/lib/stackone/models/shared/employmentresult.rb +29 -0
- data/lib/stackone/models/shared/employmentspaginated.rb +34 -0
- data/lib/stackone/models/shared/field.rb +56 -0
- data/lib/stackone/models/shared/hiringteam.rb +37 -0
- data/lib/stackone/models/shared/hriscreateemployeerequestdto.rb +8638 -0
- data/lib/stackone/models/shared/hriscreatetimeoffrequestdto.rb +93 -0
- data/lib/stackone/models/shared/hrislocation.rb +361 -0
- data/lib/stackone/models/shared/hrislocationresult.rb +29 -0
- data/lib/stackone/models/shared/hrislocationspaginated.rb +34 -0
- data/lib/stackone/models/shared/interview.rb +91 -0
- data/lib/stackone/models/shared/interviewer.rb +37 -0
- data/lib/stackone/models/shared/interviewpart.rb +40 -0
- data/lib/stackone/models/shared/interviewspaginated.rb +34 -0
- data/lib/stackone/models/shared/interviewsresult.rb +29 -0
- data/lib/stackone/models/shared/interviewstage.rb +37 -0
- data/lib/stackone/models/shared/interviewstageresult.rb +29 -0
- data/lib/stackone/models/shared/interviewstagespaginated.rb +34 -0
- data/lib/stackone/models/shared/job.rb +65 -0
- data/lib/stackone/models/shared/jobposting.rb +182 -0
- data/lib/stackone/models/shared/jobpostingresult.rb +29 -0
- data/lib/stackone/models/shared/jobpostingspaginated.rb +34 -0
- data/lib/stackone/models/shared/jobresult.rb +29 -0
- data/lib/stackone/models/shared/jobspaginated.rb +34 -0
- data/lib/stackone/models/shared/jobstatusenum.rb +43 -0
- data/lib/stackone/models/shared/linkedaccount.rb +75 -0
- data/lib/stackone/models/shared/linkedaccountmeta.rb +54 -0
- data/lib/stackone/models/shared/list.rb +67 -0
- data/lib/stackone/models/shared/listresult.rb +29 -0
- data/lib/stackone/models/shared/listspaginated.rb +34 -0
- data/lib/stackone/models/shared/location.rb +28 -0
- data/lib/stackone/models/shared/marketingcreateemailtemplaterequestdto.rb +34 -0
- data/lib/stackone/models/shared/marketingcreatepushtemplaterequestdto.rb +34 -0
- data/lib/stackone/models/shared/marketingcreatetemplaterequestdto.rb +34 -0
- data/lib/stackone/models/shared/message.rb +50 -0
- data/lib/stackone/models/shared/note.rb +69 -0
- data/lib/stackone/models/shared/notecontentapimodel.rb +25 -0
- data/lib/stackone/models/shared/noteresult.rb +29 -0
- data/lib/stackone/models/shared/notespaginated.rb +34 -0
- data/lib/stackone/models/shared/offer.rb +50 -0
- data/lib/stackone/models/shared/offerhistory.rb +37 -0
- data/lib/stackone/models/shared/offerspaginated.rb +34 -0
- data/lib/stackone/models/shared/offersresult.rb +29 -0
- data/lib/stackone/models/shared/offerstatusenum.rb +43 -0
- data/lib/stackone/models/shared/patchaccountdto.rb +21 -0
- data/lib/stackone/models/shared/proxyrequestbody.rb +69 -0
- data/lib/stackone/models/shared/pushmessages.rb +81 -0
- data/lib/stackone/models/shared/questionnaire.rb +28 -0
- data/lib/stackone/models/shared/rawresponse.rb +44 -0
- data/lib/stackone/models/shared/rejectedreason.rb +32 -0
- data/lib/stackone/models/shared/rejectedreasonresult.rb +29 -0
- data/lib/stackone/models/shared/rejectedreasonspaginated.rb +34 -0
- data/lib/stackone/models/shared/rejectedreasontypeenum.rb +40 -0
- data/lib/stackone/models/shared/resultlink.rb +28 -0
- data/lib/stackone/models/shared/scorecard.rb +65 -0
- data/lib/stackone/models/shared/scorecardsection.rb +31 -0
- data/lib/stackone/models/shared/scorecardspaginated.rb +34 -0
- data/lib/stackone/models/shared/security.rb +28 -0
- data/lib/stackone/models/shared/sociallink.rb +28 -0
- data/lib/stackone/models/shared/template.rb +37 -0
- data/lib/stackone/models/shared/templateresult.rb +29 -0
- data/lib/stackone/models/shared/templatespaginated.rb +34 -0
- data/lib/stackone/models/shared/timeoff.rb +102 -0
- data/lib/stackone/models/shared/timeoffpaginated.rb +34 -0
- data/lib/stackone/models/shared/timeoffresult.rb +29 -0
- data/lib/stackone/models/shared/updateresult.rb +31 -0
- data/lib/stackone/models/shared/user.rb +40 -0
- data/lib/stackone/models/shared/userresult.rb +29 -0
- data/lib/stackone/models/shared/userspaginated.rb +34 -0
- data/lib/stackone/proxy.rb +59 -0
- data/lib/stackone/sdk.rb +87 -0
- data/lib/stackone/sdkconfiguration.rb +53 -0
- data/lib/stackone/utils/metadata_fields.rb +154 -0
- data/lib/stackone/utils/utils.rb +774 -0
- data/lib/stackone_client.rb +229 -0
- metadata +393 -0
@@ -0,0 +1,682 @@
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
2
|
+
|
3
|
+
# typed: true
|
4
|
+
# frozen_string_literal: true
|
5
|
+
|
6
|
+
require 'faraday'
|
7
|
+
require 'faraday/multipart'
|
8
|
+
require 'sorbet-runtime'
|
9
|
+
|
10
|
+
module StackOne
|
11
|
+
extend T::Sig
|
12
|
+
class Hris
|
13
|
+
|
14
|
+
extend T::Sig
|
15
|
+
sig { params(sdk_config: SDKConfiguration).void }
|
16
|
+
def initialize(sdk_config)
|
17
|
+
@sdk_configuration = sdk_config
|
18
|
+
end
|
19
|
+
|
20
|
+
sig { params(hris_create_employee_request_dto: Shared::HrisCreateEmployeeRequestDto, x_account_id: String).returns(Utils::FieldAugmented) }
|
21
|
+
def create_employee(hris_create_employee_request_dto, x_account_id)
|
22
|
+
# create_employee - Creates an employee
|
23
|
+
request = Operations::HrisCreateEmployeeRequest.new(
|
24
|
+
|
25
|
+
hris_create_employee_request_dto: hris_create_employee_request_dto,
|
26
|
+
x_account_id: x_account_id
|
27
|
+
)
|
28
|
+
url, params = @sdk_configuration.get_server_details
|
29
|
+
base_url = Utils.template_url(url, params)
|
30
|
+
url = "#{base_url}/unified/hris/employees"
|
31
|
+
headers = Utils.get_headers(request)
|
32
|
+
req_content_type, data, form = Utils.serialize_request_body(request, :hris_create_employee_request_dto, :json)
|
33
|
+
headers['content-type'] = req_content_type
|
34
|
+
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
35
|
+
headers['Accept'] = 'application/json'
|
36
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
37
|
+
|
38
|
+
r = @sdk_configuration.client.post(url) do |req|
|
39
|
+
req.headers = headers
|
40
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
41
|
+
if form
|
42
|
+
req.body = Utils.encode_form(form)
|
43
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
44
|
+
req.body = URI.encode_www_form(data)
|
45
|
+
else
|
46
|
+
req.body = data
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
51
|
+
|
52
|
+
res = Operations::HrisCreateEmployeeResponse.new(
|
53
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
54
|
+
)
|
55
|
+
if r.status == 201
|
56
|
+
if Utils.match_content_type(content_type, 'application/json')
|
57
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::CreateEmployeeResult)
|
58
|
+
res.create_employee_result = out
|
59
|
+
end
|
60
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
61
|
+
end
|
62
|
+
res
|
63
|
+
end
|
64
|
+
|
65
|
+
sig { params(hris_create_time_off_request_dto: Shared::HrisCreateTimeOffRequestDto, id: String, x_account_id: String).returns(Utils::FieldAugmented) }
|
66
|
+
def create_employee_time_off_request(hris_create_time_off_request_dto, id, x_account_id)
|
67
|
+
# create_employee_time_off_request - Create Employee Time Off Request
|
68
|
+
request = Operations::HrisCreateEmployeeTimeOffRequestRequest.new(
|
69
|
+
|
70
|
+
hris_create_time_off_request_dto: hris_create_time_off_request_dto,
|
71
|
+
id: id,
|
72
|
+
x_account_id: x_account_id
|
73
|
+
)
|
74
|
+
url, params = @sdk_configuration.get_server_details
|
75
|
+
base_url = Utils.template_url(url, params)
|
76
|
+
url = Utils.generate_url(
|
77
|
+
Operations::HrisCreateEmployeeTimeOffRequestRequest,
|
78
|
+
base_url,
|
79
|
+
'/unified/hris/employees/{id}/time_off',
|
80
|
+
request
|
81
|
+
)
|
82
|
+
headers = Utils.get_headers(request)
|
83
|
+
req_content_type, data, form = Utils.serialize_request_body(request, :hris_create_time_off_request_dto, :json)
|
84
|
+
headers['content-type'] = req_content_type
|
85
|
+
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
86
|
+
headers['Accept'] = 'application/json'
|
87
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
88
|
+
|
89
|
+
r = @sdk_configuration.client.post(url) do |req|
|
90
|
+
req.headers = headers
|
91
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
92
|
+
if form
|
93
|
+
req.body = Utils.encode_form(form)
|
94
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
95
|
+
req.body = URI.encode_www_form(data)
|
96
|
+
else
|
97
|
+
req.body = data
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
102
|
+
|
103
|
+
res = Operations::HrisCreateEmployeeTimeOffRequestResponse.new(
|
104
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
105
|
+
)
|
106
|
+
if r.status == 201
|
107
|
+
if Utils.match_content_type(content_type, 'application/json')
|
108
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::CreateTimeOffResult)
|
109
|
+
res.create_time_off_result = out
|
110
|
+
end
|
111
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
112
|
+
end
|
113
|
+
res
|
114
|
+
end
|
115
|
+
|
116
|
+
sig { params(hris_create_time_off_request_dto: Shared::HrisCreateTimeOffRequestDto, x_account_id: String).returns(Utils::FieldAugmented) }
|
117
|
+
def create_time_off_request(hris_create_time_off_request_dto, x_account_id)
|
118
|
+
# create_time_off_request - Creates a time off request
|
119
|
+
request = Operations::HrisCreateTimeOffRequestRequest.new(
|
120
|
+
|
121
|
+
hris_create_time_off_request_dto: hris_create_time_off_request_dto,
|
122
|
+
x_account_id: x_account_id
|
123
|
+
)
|
124
|
+
url, params = @sdk_configuration.get_server_details
|
125
|
+
base_url = Utils.template_url(url, params)
|
126
|
+
url = "#{base_url}/unified/hris/time_off"
|
127
|
+
headers = Utils.get_headers(request)
|
128
|
+
req_content_type, data, form = Utils.serialize_request_body(request, :hris_create_time_off_request_dto, :json)
|
129
|
+
headers['content-type'] = req_content_type
|
130
|
+
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
131
|
+
headers['Accept'] = 'application/json'
|
132
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
133
|
+
|
134
|
+
r = @sdk_configuration.client.post(url) do |req|
|
135
|
+
req.headers = headers
|
136
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
137
|
+
if form
|
138
|
+
req.body = Utils.encode_form(form)
|
139
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
140
|
+
req.body = URI.encode_www_form(data)
|
141
|
+
else
|
142
|
+
req.body = data
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
147
|
+
|
148
|
+
res = Operations::HrisCreateTimeOffRequestResponse.new(
|
149
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
150
|
+
)
|
151
|
+
if r.status == 201
|
152
|
+
if Utils.match_content_type(content_type, 'application/json')
|
153
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::CreateTimeOffResult)
|
154
|
+
res.create_time_off_result = out
|
155
|
+
end
|
156
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
157
|
+
end
|
158
|
+
res
|
159
|
+
end
|
160
|
+
|
161
|
+
sig { params(request: T.nilable(Operations::HrisGetCompanyRequest)).returns(Utils::FieldAugmented) }
|
162
|
+
def get_company(request)
|
163
|
+
# get_company - Get Company
|
164
|
+
url, params = @sdk_configuration.get_server_details
|
165
|
+
base_url = Utils.template_url(url, params)
|
166
|
+
url = Utils.generate_url(
|
167
|
+
Operations::HrisGetCompanyRequest,
|
168
|
+
base_url,
|
169
|
+
'/unified/hris/companies/{id}',
|
170
|
+
request
|
171
|
+
)
|
172
|
+
headers = Utils.get_headers(request)
|
173
|
+
query_params = Utils.get_query_params(Operations::HrisGetCompanyRequest, request)
|
174
|
+
headers['Accept'] = 'application/json'
|
175
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
176
|
+
|
177
|
+
r = @sdk_configuration.client.get(url) do |req|
|
178
|
+
req.headers = headers
|
179
|
+
req.params = query_params
|
180
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
181
|
+
end
|
182
|
+
|
183
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
184
|
+
|
185
|
+
res = Operations::HrisGetCompanyResponse.new(
|
186
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
187
|
+
)
|
188
|
+
if r.status == 200
|
189
|
+
if Utils.match_content_type(content_type, 'application/json')
|
190
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::CompanyResult)
|
191
|
+
res.company_result = out
|
192
|
+
end
|
193
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
194
|
+
end
|
195
|
+
res
|
196
|
+
end
|
197
|
+
|
198
|
+
sig { params(request: T.nilable(Operations::HrisGetEmployeeRequest)).returns(Utils::FieldAugmented) }
|
199
|
+
def get_employee(request)
|
200
|
+
# get_employee - Get Employee
|
201
|
+
url, params = @sdk_configuration.get_server_details
|
202
|
+
base_url = Utils.template_url(url, params)
|
203
|
+
url = Utils.generate_url(
|
204
|
+
Operations::HrisGetEmployeeRequest,
|
205
|
+
base_url,
|
206
|
+
'/unified/hris/employees/{id}',
|
207
|
+
request
|
208
|
+
)
|
209
|
+
headers = Utils.get_headers(request)
|
210
|
+
query_params = Utils.get_query_params(Operations::HrisGetEmployeeRequest, request)
|
211
|
+
headers['Accept'] = 'application/json'
|
212
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
213
|
+
|
214
|
+
r = @sdk_configuration.client.get(url) do |req|
|
215
|
+
req.headers = headers
|
216
|
+
req.params = query_params
|
217
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
218
|
+
end
|
219
|
+
|
220
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
221
|
+
|
222
|
+
res = Operations::HrisGetEmployeeResponse.new(
|
223
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
224
|
+
)
|
225
|
+
if r.status == 200
|
226
|
+
if Utils.match_content_type(content_type, 'application/json')
|
227
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::EmployeeResult)
|
228
|
+
res.employee_result = out
|
229
|
+
end
|
230
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
231
|
+
end
|
232
|
+
res
|
233
|
+
end
|
234
|
+
|
235
|
+
sig { params(request: T.nilable(Operations::HrisGetEmployeesTimeOffRequestRequest)).returns(Utils::FieldAugmented) }
|
236
|
+
def get_employees_time_off_request(request)
|
237
|
+
# get_employees_time_off_request - Get Employees Time Off Request
|
238
|
+
url, params = @sdk_configuration.get_server_details
|
239
|
+
base_url = Utils.template_url(url, params)
|
240
|
+
url = Utils.generate_url(
|
241
|
+
Operations::HrisGetEmployeesTimeOffRequestRequest,
|
242
|
+
base_url,
|
243
|
+
'/unified/hris/employees/{id}/time_off/{subResourceId}',
|
244
|
+
request
|
245
|
+
)
|
246
|
+
headers = Utils.get_headers(request)
|
247
|
+
query_params = Utils.get_query_params(Operations::HrisGetEmployeesTimeOffRequestRequest, request)
|
248
|
+
headers['Accept'] = 'application/json'
|
249
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
250
|
+
|
251
|
+
r = @sdk_configuration.client.get(url) do |req|
|
252
|
+
req.headers = headers
|
253
|
+
req.params = query_params
|
254
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
255
|
+
end
|
256
|
+
|
257
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
258
|
+
|
259
|
+
res = Operations::HrisGetEmployeesTimeOffRequestResponse.new(
|
260
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
261
|
+
)
|
262
|
+
if r.status == 200
|
263
|
+
if Utils.match_content_type(content_type, 'application/json')
|
264
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::TimeOffResult)
|
265
|
+
res.time_off_result = out
|
266
|
+
end
|
267
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
268
|
+
end
|
269
|
+
res
|
270
|
+
end
|
271
|
+
|
272
|
+
sig { params(request: T.nilable(Operations::HrisGetEmploymentRequest)).returns(Utils::FieldAugmented) }
|
273
|
+
def get_employment(request)
|
274
|
+
# get_employment - Get Employment
|
275
|
+
url, params = @sdk_configuration.get_server_details
|
276
|
+
base_url = Utils.template_url(url, params)
|
277
|
+
url = Utils.generate_url(
|
278
|
+
Operations::HrisGetEmploymentRequest,
|
279
|
+
base_url,
|
280
|
+
'/unified/hris/employments/{id}',
|
281
|
+
request
|
282
|
+
)
|
283
|
+
headers = Utils.get_headers(request)
|
284
|
+
query_params = Utils.get_query_params(Operations::HrisGetEmploymentRequest, request)
|
285
|
+
headers['Accept'] = 'application/json'
|
286
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
287
|
+
|
288
|
+
r = @sdk_configuration.client.get(url) do |req|
|
289
|
+
req.headers = headers
|
290
|
+
req.params = query_params
|
291
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
292
|
+
end
|
293
|
+
|
294
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
295
|
+
|
296
|
+
res = Operations::HrisGetEmploymentResponse.new(
|
297
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
298
|
+
)
|
299
|
+
if r.status == 200
|
300
|
+
if Utils.match_content_type(content_type, 'application/json')
|
301
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::EmploymentResult)
|
302
|
+
res.employment_result = out
|
303
|
+
end
|
304
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
305
|
+
end
|
306
|
+
res
|
307
|
+
end
|
308
|
+
|
309
|
+
sig { params(request: T.nilable(Operations::HrisGetLocationRequest)).returns(Utils::FieldAugmented) }
|
310
|
+
def get_location(request)
|
311
|
+
# get_location - Get Location
|
312
|
+
url, params = @sdk_configuration.get_server_details
|
313
|
+
base_url = Utils.template_url(url, params)
|
314
|
+
url = Utils.generate_url(
|
315
|
+
Operations::HrisGetLocationRequest,
|
316
|
+
base_url,
|
317
|
+
'/unified/hris/locations/{id}',
|
318
|
+
request
|
319
|
+
)
|
320
|
+
headers = Utils.get_headers(request)
|
321
|
+
query_params = Utils.get_query_params(Operations::HrisGetLocationRequest, request)
|
322
|
+
headers['Accept'] = 'application/json'
|
323
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
324
|
+
|
325
|
+
r = @sdk_configuration.client.get(url) do |req|
|
326
|
+
req.headers = headers
|
327
|
+
req.params = query_params
|
328
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
329
|
+
end
|
330
|
+
|
331
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
332
|
+
|
333
|
+
res = Operations::HrisGetLocationResponse.new(
|
334
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
335
|
+
)
|
336
|
+
if r.status == 200
|
337
|
+
if Utils.match_content_type(content_type, 'application/json')
|
338
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::HRISLocationResult)
|
339
|
+
res.hris_location_result = out
|
340
|
+
end
|
341
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
342
|
+
end
|
343
|
+
res
|
344
|
+
end
|
345
|
+
|
346
|
+
sig { params(request: T.nilable(Operations::HrisGetTimeOffRequestRequest)).returns(Utils::FieldAugmented) }
|
347
|
+
def get_time_off_request(request)
|
348
|
+
# get_time_off_request - Get time off request
|
349
|
+
url, params = @sdk_configuration.get_server_details
|
350
|
+
base_url = Utils.template_url(url, params)
|
351
|
+
url = Utils.generate_url(
|
352
|
+
Operations::HrisGetTimeOffRequestRequest,
|
353
|
+
base_url,
|
354
|
+
'/unified/hris/time_off/{id}',
|
355
|
+
request
|
356
|
+
)
|
357
|
+
headers = Utils.get_headers(request)
|
358
|
+
query_params = Utils.get_query_params(Operations::HrisGetTimeOffRequestRequest, request)
|
359
|
+
headers['Accept'] = 'application/json'
|
360
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
361
|
+
|
362
|
+
r = @sdk_configuration.client.get(url) do |req|
|
363
|
+
req.headers = headers
|
364
|
+
req.params = query_params
|
365
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
366
|
+
end
|
367
|
+
|
368
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
369
|
+
|
370
|
+
res = Operations::HrisGetTimeOffRequestResponse.new(
|
371
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
372
|
+
)
|
373
|
+
if r.status == 200
|
374
|
+
if Utils.match_content_type(content_type, 'application/json')
|
375
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::TimeOffResult)
|
376
|
+
res.time_off_result = out
|
377
|
+
end
|
378
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
379
|
+
end
|
380
|
+
res
|
381
|
+
end
|
382
|
+
|
383
|
+
sig { params(request: T.nilable(Operations::HrisListCompaniesRequest)).returns(Utils::FieldAugmented) }
|
384
|
+
def list_companies(request)
|
385
|
+
# list_companies - List Companies
|
386
|
+
url, params = @sdk_configuration.get_server_details
|
387
|
+
base_url = Utils.template_url(url, params)
|
388
|
+
url = "#{base_url}/unified/hris/companies"
|
389
|
+
headers = Utils.get_headers(request)
|
390
|
+
query_params = Utils.get_query_params(Operations::HrisListCompaniesRequest, request)
|
391
|
+
headers['Accept'] = 'application/json'
|
392
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
393
|
+
|
394
|
+
r = @sdk_configuration.client.get(url) do |req|
|
395
|
+
req.headers = headers
|
396
|
+
req.params = query_params
|
397
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
398
|
+
end
|
399
|
+
|
400
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
401
|
+
|
402
|
+
res = Operations::HrisListCompaniesResponse.new(
|
403
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
404
|
+
)
|
405
|
+
if r.status == 200
|
406
|
+
if Utils.match_content_type(content_type, 'application/json')
|
407
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::CompaniesPaginated)
|
408
|
+
res.companies_paginated = out
|
409
|
+
end
|
410
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
411
|
+
end
|
412
|
+
res
|
413
|
+
end
|
414
|
+
|
415
|
+
sig { params(request: T.nilable(Operations::HrisListEmployeeTimeOffRequestsRequest)).returns(Utils::FieldAugmented) }
|
416
|
+
def list_employee_time_off_requests(request)
|
417
|
+
# list_employee_time_off_requests - List Employee Time Off Requests
|
418
|
+
url, params = @sdk_configuration.get_server_details
|
419
|
+
base_url = Utils.template_url(url, params)
|
420
|
+
url = Utils.generate_url(
|
421
|
+
Operations::HrisListEmployeeTimeOffRequestsRequest,
|
422
|
+
base_url,
|
423
|
+
'/unified/hris/employees/{id}/time_off',
|
424
|
+
request
|
425
|
+
)
|
426
|
+
headers = Utils.get_headers(request)
|
427
|
+
query_params = Utils.get_query_params(Operations::HrisListEmployeeTimeOffRequestsRequest, request)
|
428
|
+
headers['Accept'] = 'application/json'
|
429
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
430
|
+
|
431
|
+
r = @sdk_configuration.client.get(url) do |req|
|
432
|
+
req.headers = headers
|
433
|
+
req.params = query_params
|
434
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
435
|
+
end
|
436
|
+
|
437
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
438
|
+
|
439
|
+
res = Operations::HrisListEmployeeTimeOffRequestsResponse.new(
|
440
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
441
|
+
)
|
442
|
+
if r.status == 200
|
443
|
+
if Utils.match_content_type(content_type, 'application/json')
|
444
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::TimeOffPaginated)
|
445
|
+
res.time_off_paginated = out
|
446
|
+
end
|
447
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
448
|
+
end
|
449
|
+
res
|
450
|
+
end
|
451
|
+
|
452
|
+
sig { params(request: T.nilable(Operations::HrisListEmployeesRequest)).returns(Utils::FieldAugmented) }
|
453
|
+
def list_employees(request)
|
454
|
+
# list_employees - List Employees
|
455
|
+
url, params = @sdk_configuration.get_server_details
|
456
|
+
base_url = Utils.template_url(url, params)
|
457
|
+
url = "#{base_url}/unified/hris/employees"
|
458
|
+
headers = Utils.get_headers(request)
|
459
|
+
query_params = Utils.get_query_params(Operations::HrisListEmployeesRequest, request)
|
460
|
+
headers['Accept'] = 'application/json'
|
461
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
462
|
+
|
463
|
+
r = @sdk_configuration.client.get(url) do |req|
|
464
|
+
req.headers = headers
|
465
|
+
req.params = query_params
|
466
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
467
|
+
end
|
468
|
+
|
469
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
470
|
+
|
471
|
+
res = Operations::HrisListEmployeesResponse.new(
|
472
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
473
|
+
)
|
474
|
+
if r.status == 200
|
475
|
+
if Utils.match_content_type(content_type, 'application/json')
|
476
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::EmployeesPaginated)
|
477
|
+
res.employees_paginated = out
|
478
|
+
end
|
479
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
480
|
+
end
|
481
|
+
res
|
482
|
+
end
|
483
|
+
|
484
|
+
sig { params(request: T.nilable(Operations::HrisListEmploymentsRequest)).returns(Utils::FieldAugmented) }
|
485
|
+
def list_employments(request)
|
486
|
+
# list_employments - List Employments
|
487
|
+
url, params = @sdk_configuration.get_server_details
|
488
|
+
base_url = Utils.template_url(url, params)
|
489
|
+
url = "#{base_url}/unified/hris/employments"
|
490
|
+
headers = Utils.get_headers(request)
|
491
|
+
query_params = Utils.get_query_params(Operations::HrisListEmploymentsRequest, request)
|
492
|
+
headers['Accept'] = 'application/json'
|
493
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
494
|
+
|
495
|
+
r = @sdk_configuration.client.get(url) do |req|
|
496
|
+
req.headers = headers
|
497
|
+
req.params = query_params
|
498
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
499
|
+
end
|
500
|
+
|
501
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
502
|
+
|
503
|
+
res = Operations::HrisListEmploymentsResponse.new(
|
504
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
505
|
+
)
|
506
|
+
if r.status == 200
|
507
|
+
if Utils.match_content_type(content_type, 'application/json')
|
508
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::EmploymentsPaginated)
|
509
|
+
res.employments_paginated = out
|
510
|
+
end
|
511
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
512
|
+
end
|
513
|
+
res
|
514
|
+
end
|
515
|
+
|
516
|
+
sig { params(request: T.nilable(Operations::HrisListLocationsRequest)).returns(Utils::FieldAugmented) }
|
517
|
+
def list_locations(request)
|
518
|
+
# list_locations - List locations
|
519
|
+
url, params = @sdk_configuration.get_server_details
|
520
|
+
base_url = Utils.template_url(url, params)
|
521
|
+
url = "#{base_url}/unified/hris/locations"
|
522
|
+
headers = Utils.get_headers(request)
|
523
|
+
query_params = Utils.get_query_params(Operations::HrisListLocationsRequest, request)
|
524
|
+
headers['Accept'] = 'application/json'
|
525
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
526
|
+
|
527
|
+
r = @sdk_configuration.client.get(url) do |req|
|
528
|
+
req.headers = headers
|
529
|
+
req.params = query_params
|
530
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
531
|
+
end
|
532
|
+
|
533
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
534
|
+
|
535
|
+
res = Operations::HrisListLocationsResponse.new(
|
536
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
537
|
+
)
|
538
|
+
if r.status == 200
|
539
|
+
if Utils.match_content_type(content_type, 'application/json')
|
540
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::HRISLocationsPaginated)
|
541
|
+
res.hris_locations_paginated = out
|
542
|
+
end
|
543
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
544
|
+
end
|
545
|
+
res
|
546
|
+
end
|
547
|
+
|
548
|
+
sig { params(request: T.nilable(Operations::HrisListTimeOffRequestsRequest)).returns(Utils::FieldAugmented) }
|
549
|
+
def list_time_off_requests(request)
|
550
|
+
# list_time_off_requests - List time off requests
|
551
|
+
url, params = @sdk_configuration.get_server_details
|
552
|
+
base_url = Utils.template_url(url, params)
|
553
|
+
url = "#{base_url}/unified/hris/time_off"
|
554
|
+
headers = Utils.get_headers(request)
|
555
|
+
query_params = Utils.get_query_params(Operations::HrisListTimeOffRequestsRequest, request)
|
556
|
+
headers['Accept'] = 'application/json'
|
557
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
558
|
+
|
559
|
+
r = @sdk_configuration.client.get(url) do |req|
|
560
|
+
req.headers = headers
|
561
|
+
req.params = query_params
|
562
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
563
|
+
end
|
564
|
+
|
565
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
566
|
+
|
567
|
+
res = Operations::HrisListTimeOffRequestsResponse.new(
|
568
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
569
|
+
)
|
570
|
+
if r.status == 200
|
571
|
+
if Utils.match_content_type(content_type, 'application/json')
|
572
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::TimeOffPaginated)
|
573
|
+
res.time_off_paginated = out
|
574
|
+
end
|
575
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
576
|
+
end
|
577
|
+
res
|
578
|
+
end
|
579
|
+
|
580
|
+
sig { params(hris_create_employee_request_dto: Shared::HrisCreateEmployeeRequestDto, id: String, x_account_id: String).returns(Utils::FieldAugmented) }
|
581
|
+
def update_employee(hris_create_employee_request_dto, id, x_account_id)
|
582
|
+
# update_employee - Updates an employee
|
583
|
+
request = Operations::HrisUpdateEmployeeRequest.new(
|
584
|
+
|
585
|
+
hris_create_employee_request_dto: hris_create_employee_request_dto,
|
586
|
+
id: id,
|
587
|
+
x_account_id: x_account_id
|
588
|
+
)
|
589
|
+
url, params = @sdk_configuration.get_server_details
|
590
|
+
base_url = Utils.template_url(url, params)
|
591
|
+
url = Utils.generate_url(
|
592
|
+
Operations::HrisUpdateEmployeeRequest,
|
593
|
+
base_url,
|
594
|
+
'/unified/hris/employees/{id}',
|
595
|
+
request
|
596
|
+
)
|
597
|
+
headers = Utils.get_headers(request)
|
598
|
+
req_content_type, data, form = Utils.serialize_request_body(request, :hris_create_employee_request_dto, :json)
|
599
|
+
headers['content-type'] = req_content_type
|
600
|
+
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
601
|
+
headers['Accept'] = 'application/json'
|
602
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
603
|
+
|
604
|
+
r = @sdk_configuration.client.patch(url) do |req|
|
605
|
+
req.headers = headers
|
606
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
607
|
+
if form
|
608
|
+
req.body = Utils.encode_form(form)
|
609
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
610
|
+
req.body = URI.encode_www_form(data)
|
611
|
+
else
|
612
|
+
req.body = data
|
613
|
+
end
|
614
|
+
end
|
615
|
+
|
616
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
617
|
+
|
618
|
+
res = Operations::HrisUpdateEmployeeResponse.new(
|
619
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
620
|
+
)
|
621
|
+
if r.status == 200
|
622
|
+
if Utils.match_content_type(content_type, 'application/json')
|
623
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::CreateEmployeeResult)
|
624
|
+
res.create_employee_result = out
|
625
|
+
end
|
626
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
627
|
+
end
|
628
|
+
res
|
629
|
+
end
|
630
|
+
|
631
|
+
sig { params(hris_create_time_off_request_dto: Shared::HrisCreateTimeOffRequestDto, id: String, x_account_id: String).returns(Utils::FieldAugmented) }
|
632
|
+
def update_time_off_request(hris_create_time_off_request_dto, id, x_account_id)
|
633
|
+
# update_time_off_request - Update time off request
|
634
|
+
request = Operations::HrisUpdateTimeOffRequestRequest.new(
|
635
|
+
|
636
|
+
hris_create_time_off_request_dto: hris_create_time_off_request_dto,
|
637
|
+
id: id,
|
638
|
+
x_account_id: x_account_id
|
639
|
+
)
|
640
|
+
url, params = @sdk_configuration.get_server_details
|
641
|
+
base_url = Utils.template_url(url, params)
|
642
|
+
url = Utils.generate_url(
|
643
|
+
Operations::HrisUpdateTimeOffRequestRequest,
|
644
|
+
base_url,
|
645
|
+
'/unified/hris/time_off/{id}',
|
646
|
+
request
|
647
|
+
)
|
648
|
+
headers = Utils.get_headers(request)
|
649
|
+
req_content_type, data, form = Utils.serialize_request_body(request, :hris_create_time_off_request_dto, :json)
|
650
|
+
headers['content-type'] = req_content_type
|
651
|
+
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
652
|
+
headers['Accept'] = 'application/json'
|
653
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
654
|
+
|
655
|
+
r = @sdk_configuration.client.patch(url) do |req|
|
656
|
+
req.headers = headers
|
657
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
658
|
+
if form
|
659
|
+
req.body = Utils.encode_form(form)
|
660
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
661
|
+
req.body = URI.encode_www_form(data)
|
662
|
+
else
|
663
|
+
req.body = data
|
664
|
+
end
|
665
|
+
end
|
666
|
+
|
667
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
668
|
+
|
669
|
+
res = Operations::HrisUpdateTimeOffRequestResponse.new(
|
670
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
671
|
+
)
|
672
|
+
if r.status == 200
|
673
|
+
if Utils.match_content_type(content_type, 'application/json')
|
674
|
+
out = Utils.unmarshal_complex(r.env.response_body, Shared::CreateTimeOffResult)
|
675
|
+
res.create_time_off_result = out
|
676
|
+
end
|
677
|
+
elsif [400, 403, 412, 429, 500, 501].include?(r.status)
|
678
|
+
end
|
679
|
+
res
|
680
|
+
end
|
681
|
+
end
|
682
|
+
end
|