merge_hris_client 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +179 -0
- data/Rakefile +10 -0
- data/config.json +1 -0
- data/docs/AccountIntegration.md +28 -0
- data/docs/AccountToken.md +18 -0
- data/docs/AccountTokenApi.md +79 -0
- data/docs/AvailableActions.md +22 -0
- data/docs/AvailableActionsApi.md +79 -0
- data/docs/Benefit.md +32 -0
- data/docs/BenefitPlanTypeEnum.md +15 -0
- data/docs/BenefitsApi.md +181 -0
- data/docs/CompaniesApi.md +175 -0
- data/docs/Company.md +28 -0
- data/docs/CountryEnum.md +15 -0
- data/docs/DataPassthrough.md +24 -0
- data/docs/DataPassthroughRequest.md +26 -0
- data/docs/Deduction.md +28 -0
- data/docs/Earning.md +26 -0
- data/docs/Employee.md +66 -0
- data/docs/EmployeePayrollRun.md +42 -0
- data/docs/EmployeePayrollRunsApi.md +183 -0
- data/docs/EmployeesApi.md +187 -0
- data/docs/Employment.md +38 -0
- data/docs/EmploymentStatusEnum.md +15 -0
- data/docs/EmploymentTypeEnum.md +15 -0
- data/docs/EmploymentsApi.md +177 -0
- data/docs/EndUserDetails.md +24 -0
- data/docs/EndUserDetailsRequest.md +26 -0
- data/docs/EthnicityEnum.md +15 -0
- data/docs/FlsaStatusEnum.md +15 -0
- data/docs/GenderEnum.md +15 -0
- data/docs/GenerateKeyApi.md +79 -0
- data/docs/GenerateRemoteKeyRequest.md +18 -0
- data/docs/LinkToken.md +20 -0
- data/docs/LinkTokenApi.md +79 -0
- data/docs/Location.md +36 -0
- data/docs/LocationsApi.md +175 -0
- data/docs/MaritalStatusEnum.md +15 -0
- data/docs/MethodEnum.md +15 -0
- data/docs/ModelOperation.md +22 -0
- data/docs/NullEnum.md +15 -0
- data/docs/PaginatedBenefitList.md +22 -0
- data/docs/PaginatedCompanyList.md +22 -0
- data/docs/PaginatedEmployeeList.md +22 -0
- data/docs/PaginatedEmployeePayrollRunList.md +22 -0
- data/docs/PaginatedEmploymentList.md +22 -0
- data/docs/PaginatedLocationList.md +22 -0
- data/docs/PaginatedPayrollRunList.md +22 -0
- data/docs/PaginatedTeamList.md +22 -0
- data/docs/PaginatedTimeOffList.md +22 -0
- data/docs/PassthroughApi.md +81 -0
- data/docs/PayCurrencyEnum.md +15 -0
- data/docs/PayFrequencyEnum.md +15 -0
- data/docs/PayPeriodEnum.md +15 -0
- data/docs/PayrollRun.md +32 -0
- data/docs/PayrollRunsApi.md +175 -0
- data/docs/RegenerateKeyApi.md +79 -0
- data/docs/RemoteData.md +20 -0
- data/docs/RemoteKey.md +20 -0
- data/docs/RemoteKeyForRegeneration.md +18 -0
- data/docs/RemoteKeyForRegenerationRequest.md +18 -0
- data/docs/RemoteResponse.md +26 -0
- data/docs/RequestTypeEnum.md +15 -0
- data/docs/RunStateEnum.md +15 -0
- data/docs/RunTypeEnum.md +15 -0
- data/docs/StateEnum.md +15 -0
- data/docs/SyncStatus.md +28 -0
- data/docs/SyncStatusApi.md +79 -0
- data/docs/Tax.md +28 -0
- data/docs/Team.md +24 -0
- data/docs/TeamsApi.md +175 -0
- data/docs/TimeOff.md +36 -0
- data/docs/TimeOffApi.md +183 -0
- data/docs/TimeOffStatusEnum.md +15 -0
- data/docs/TypeEnum.md +15 -0
- data/docs/UnitsEnum.md +15 -0
- data/git_push.sh +58 -0
- data/lib/merge_hris_client.rb +110 -0
- data/lib/merge_hris_client/api/account_token_api.rb +83 -0
- data/lib/merge_hris_client/api/available_actions_api.rb +84 -0
- data/lib/merge_hris_client/api/benefits_api.rb +196 -0
- data/lib/merge_hris_client/api/companies_api.rb +179 -0
- data/lib/merge_hris_client/api/employee_payroll_runs_api.rb +199 -0
- data/lib/merge_hris_client/api/employees_api.rb +205 -0
- data/lib/merge_hris_client/api/employments_api.rb +182 -0
- data/lib/merge_hris_client/api/generate_key_api.rb +85 -0
- data/lib/merge_hris_client/api/link_token_api.rb +85 -0
- data/lib/merge_hris_client/api/locations_api.rb +179 -0
- data/lib/merge_hris_client/api/passthrough_api.rb +92 -0
- data/lib/merge_hris_client/api/payroll_runs_api.rb +179 -0
- data/lib/merge_hris_client/api/regenerate_key_api.rb +85 -0
- data/lib/merge_hris_client/api/sync_status_api.rb +84 -0
- data/lib/merge_hris_client/api/teams_api.rb +179 -0
- data/lib/merge_hris_client/api/time_off_api.rb +199 -0
- data/lib/merge_hris_client/api_client.rb +390 -0
- data/lib/merge_hris_client/api_error.rb +57 -0
- data/lib/merge_hris_client/configuration.rb +279 -0
- data/lib/merge_hris_client/models/account_integration.rb +325 -0
- data/lib/merge_hris_client/models/account_token.rb +223 -0
- data/lib/merge_hris_client/models/available_actions.rb +249 -0
- data/lib/merge_hris_client/models/benefit.rb +297 -0
- data/lib/merge_hris_client/models/benefit_plan_type_enum.rb +56 -0
- data/lib/merge_hris_client/models/company.rb +277 -0
- data/lib/merge_hris_client/models/country_enum.rb +282 -0
- data/lib/merge_hris_client/models/data_passthrough.rb +262 -0
- data/lib/merge_hris_client/models/data_passthrough_request.rb +271 -0
- data/lib/merge_hris_client/models/deduction.rb +275 -0
- data/lib/merge_hris_client/models/earning.rb +264 -0
- data/lib/merge_hris_client/models/employee.rb +544 -0
- data/lib/merge_hris_client/models/employee_payroll_run.rb +352 -0
- data/lib/merge_hris_client/models/employment.rb +330 -0
- data/lib/merge_hris_client/models/employment_status_enum.rb +37 -0
- data/lib/merge_hris_client/models/employment_type_enum.rb +39 -0
- data/lib/merge_hris_client/models/end_user_details.rb +289 -0
- data/lib/merge_hris_client/models/end_user_details_request.rb +298 -0
- data/lib/merge_hris_client/models/ethnicity_enum.rb +42 -0
- data/lib/merge_hris_client/models/flsa_status_enum.rb +38 -0
- data/lib/merge_hris_client/models/gender_enum.rb +39 -0
- data/lib/merge_hris_client/models/generate_remote_key_request.rb +224 -0
- data/lib/merge_hris_client/models/link_token.rb +237 -0
- data/lib/merge_hris_client/models/location.rb +319 -0
- data/lib/merge_hris_client/models/marital_status_enum.rb +39 -0
- data/lib/merge_hris_client/models/method_enum.rb +41 -0
- data/lib/merge_hris_client/models/model_operation.rb +256 -0
- data/lib/merge_hris_client/models/paginated_benefit_list.rb +240 -0
- data/lib/merge_hris_client/models/paginated_company_list.rb +240 -0
- data/lib/merge_hris_client/models/paginated_employee_list.rb +240 -0
- data/lib/merge_hris_client/models/paginated_employee_payroll_run_list.rb +240 -0
- data/lib/merge_hris_client/models/paginated_employment_list.rb +240 -0
- data/lib/merge_hris_client/models/paginated_location_list.rb +240 -0
- data/lib/merge_hris_client/models/paginated_payroll_run_list.rb +240 -0
- data/lib/merge_hris_client/models/paginated_team_list.rb +240 -0
- data/lib/merge_hris_client/models/paginated_time_off_list.rb +240 -0
- data/lib/merge_hris_client/models/pay_currency_enum.rb +340 -0
- data/lib/merge_hris_client/models/pay_frequency_enum.rb +43 -0
- data/lib/merge_hris_client/models/pay_period_enum.rb +42 -0
- data/lib/merge_hris_client/models/payroll_run.rb +297 -0
- data/lib/merge_hris_client/models/remote_data.rb +234 -0
- data/lib/merge_hris_client/models/remote_key.rb +238 -0
- data/lib/merge_hris_client/models/remote_key_for_regeneration.rb +224 -0
- data/lib/merge_hris_client/models/remote_key_for_regeneration_request.rb +224 -0
- data/lib/merge_hris_client/models/remote_response.rb +279 -0
- data/lib/merge_hris_client/models/request_type_enum.rb +38 -0
- data/lib/merge_hris_client/models/run_state_enum.rb +39 -0
- data/lib/merge_hris_client/models/run_type_enum.rb +49 -0
- data/lib/merge_hris_client/models/state_enum.rb +93 -0
- data/lib/merge_hris_client/models/sync_status.rb +294 -0
- data/lib/merge_hris_client/models/tax.rb +275 -0
- data/lib/merge_hris_client/models/team.rb +253 -0
- data/lib/merge_hris_client/models/time_off.rb +319 -0
- data/lib/merge_hris_client/models/time_off_status_enum.rb +39 -0
- data/lib/merge_hris_client/models/type_enum.rb +38 -0
- data/lib/merge_hris_client/models/units_enum.rb +36 -0
- data/lib/merge_hris_client/version.rb +15 -0
- data/merge_hris_client-1.0.0.gem +0 -0
- data/merge_hris_client.gemspec +38 -0
- data/pull_request_template.md +20 -0
- data/spec/api/account_token_api_spec.rb +46 -0
- data/spec/api/available_actions_api_spec.rb +46 -0
- data/spec/api/benefits_api_spec.rb +68 -0
- data/spec/api/companies_api_spec.rb +65 -0
- data/spec/api/employee_payroll_runs_api_spec.rb +69 -0
- data/spec/api/employees_api_spec.rb +71 -0
- data/spec/api/employments_api_spec.rb +66 -0
- data/spec/api/link_token_api_spec.rb +46 -0
- data/spec/api/locations_api_spec.rb +65 -0
- data/spec/api/passthrough_api_spec.rb +48 -0
- data/spec/api/payroll_runs_api_spec.rb +65 -0
- data/spec/api/regenerate_key_api_spec.rb +46 -0
- data/spec/api/teams_api_spec.rb +65 -0
- data/spec/api/time_off_api_spec.rb +69 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/account_integration_spec.rb +58 -0
- data/spec/models/account_token_spec.rb +34 -0
- data/spec/models/available_actions_spec.rb +34 -0
- data/spec/models/benefit_plan_type_enum_spec.rb +28 -0
- data/spec/models/benefit_spec.rb +70 -0
- data/spec/models/company_spec.rb +58 -0
- data/spec/models/country_enum_spec.rb +28 -0
- data/spec/models/data_passthrough_request_spec.rb +58 -0
- data/spec/models/data_passthrough_spec.rb +52 -0
- data/spec/models/deduction_spec.rb +58 -0
- data/spec/models/earning_spec.rb +52 -0
- data/spec/models/employee_payroll_run_spec.rb +100 -0
- data/spec/models/employee_spec.rb +166 -0
- data/spec/models/employment_spec.rb +88 -0
- data/spec/models/employment_status_enum_spec.rb +28 -0
- data/spec/models/employment_type_enum_spec.rb +28 -0
- data/spec/models/end_user_details_request_spec.rb +56 -0
- data/spec/models/end_user_details_spec.rb +56 -0
- data/spec/models/ethnicity_enum_spec.rb +28 -0
- data/spec/models/flsa_status_enum_spec.rb +28 -0
- data/spec/models/gender_enum_spec.rb +28 -0
- data/spec/models/link_token_spec.rb +40 -0
- data/spec/models/location_spec.rb +82 -0
- data/spec/models/marital_status_enum_spec.rb +28 -0
- data/spec/models/method_enum_spec.rb +28 -0
- data/spec/models/model_operation_spec.rb +40 -0
- data/spec/models/paginated_benefit_list_spec.rb +46 -0
- data/spec/models/paginated_company_list_spec.rb +46 -0
- data/spec/models/paginated_employee_list_spec.rb +46 -0
- data/spec/models/paginated_employee_payroll_run_list_spec.rb +46 -0
- data/spec/models/paginated_employment_list_spec.rb +46 -0
- data/spec/models/paginated_location_list_spec.rb +46 -0
- data/spec/models/paginated_payroll_run_list_spec.rb +46 -0
- data/spec/models/paginated_team_list_spec.rb +46 -0
- data/spec/models/paginated_time_off_list_spec.rb +46 -0
- data/spec/models/pay_currency_enum_spec.rb +28 -0
- data/spec/models/pay_frequency_enum_spec.rb +28 -0
- data/spec/models/pay_period_enum_spec.rb +28 -0
- data/spec/models/payroll_run_spec.rb +70 -0
- data/spec/models/remote_data_spec.rb +40 -0
- data/spec/models/remote_key_for_regeneration_request_spec.rb +34 -0
- data/spec/models/remote_key_for_regeneration_spec.rb +34 -0
- data/spec/models/remote_key_spec.rb +40 -0
- data/spec/models/remote_response_spec.rb +58 -0
- data/spec/models/request_type_enum_spec.rb +28 -0
- data/spec/models/run_state_enum_spec.rb +28 -0
- data/spec/models/run_type_enum_spec.rb +28 -0
- data/spec/models/state_enum_spec.rb +28 -0
- data/spec/models/tax_spec.rb +58 -0
- data/spec/models/team_spec.rb +46 -0
- data/spec/models/time_off_spec.rb +82 -0
- data/spec/models/time_off_status_enum_spec.rb +28 -0
- data/spec/models/type_enum_spec.rb +28 -0
- data/spec/models/units_enum_spec.rb +28 -0
- data/spec/spec_helper.rb +111 -0
- data/test_ruby.rb +30 -0
- metadata +385 -0
@@ -0,0 +1,352 @@
|
|
1
|
+
=begin
|
2
|
+
#Merge HRIS API
|
3
|
+
|
4
|
+
#The unified API for building rich integrations with multiple HR Information System platforms.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: hello@merge.dev
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module MergeHRISClient
|
17
|
+
# # The EmployeePayrollRun Object ### Description The `EmployeePayrollRun` object is used to represent a payroll run for a specific employee. ### Usage Example Fetch from the `LIST EmployeePayrollRun` endpoint and filter by `ID` to show all employee payroll runs.
|
18
|
+
class EmployeePayrollRun
|
19
|
+
attr_accessor :id
|
20
|
+
|
21
|
+
# The third-party API ID of the matching object.
|
22
|
+
attr_accessor :remote_id
|
23
|
+
|
24
|
+
# The employee whose payroll is being run.
|
25
|
+
attr_accessor :employee
|
26
|
+
|
27
|
+
# The payroll being run.
|
28
|
+
attr_accessor :payroll_run
|
29
|
+
|
30
|
+
# The gross pay from the run.
|
31
|
+
attr_accessor :gross_pay
|
32
|
+
|
33
|
+
# The net pay from the run.
|
34
|
+
attr_accessor :net_pay
|
35
|
+
|
36
|
+
# The day and time the payroll run started.
|
37
|
+
attr_accessor :start_date
|
38
|
+
|
39
|
+
# The day and time the payroll run ended.
|
40
|
+
attr_accessor :end_date
|
41
|
+
|
42
|
+
# The day and time the payroll run was checked.
|
43
|
+
attr_accessor :check_date
|
44
|
+
|
45
|
+
attr_accessor :earnings
|
46
|
+
|
47
|
+
attr_accessor :deductions
|
48
|
+
|
49
|
+
attr_accessor :taxes
|
50
|
+
|
51
|
+
attr_accessor :remote_data
|
52
|
+
|
53
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
54
|
+
def self.attribute_map
|
55
|
+
{
|
56
|
+
:'id' => :'id',
|
57
|
+
:'remote_id' => :'remote_id',
|
58
|
+
:'employee' => :'employee',
|
59
|
+
:'payroll_run' => :'payroll_run',
|
60
|
+
:'gross_pay' => :'gross_pay',
|
61
|
+
:'net_pay' => :'net_pay',
|
62
|
+
:'start_date' => :'start_date',
|
63
|
+
:'end_date' => :'end_date',
|
64
|
+
:'check_date' => :'check_date',
|
65
|
+
:'earnings' => :'earnings',
|
66
|
+
:'deductions' => :'deductions',
|
67
|
+
:'taxes' => :'taxes',
|
68
|
+
:'remote_data' => :'remote_data'
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
# Returns all the JSON keys this model knows about
|
73
|
+
def self.acceptable_attributes
|
74
|
+
attribute_map.values
|
75
|
+
end
|
76
|
+
|
77
|
+
# Attribute type mapping.
|
78
|
+
def self.openapi_types
|
79
|
+
{
|
80
|
+
:'id' => :'String',
|
81
|
+
:'remote_id' => :'String',
|
82
|
+
:'employee' => :'String',
|
83
|
+
:'payroll_run' => :'String',
|
84
|
+
:'gross_pay' => :'Float',
|
85
|
+
:'net_pay' => :'Float',
|
86
|
+
:'start_date' => :'Time',
|
87
|
+
:'end_date' => :'Time',
|
88
|
+
:'check_date' => :'Time',
|
89
|
+
:'earnings' => :'Array<Earning>',
|
90
|
+
:'deductions' => :'Array<Deduction>',
|
91
|
+
:'taxes' => :'Array<Tax>',
|
92
|
+
:'remote_data' => :'Array<RemoteData>'
|
93
|
+
}
|
94
|
+
end
|
95
|
+
|
96
|
+
# List of attributes with nullable: true
|
97
|
+
def self.openapi_nullable
|
98
|
+
Set.new([
|
99
|
+
:'remote_id',
|
100
|
+
:'employee',
|
101
|
+
:'payroll_run',
|
102
|
+
:'gross_pay',
|
103
|
+
:'net_pay',
|
104
|
+
:'start_date',
|
105
|
+
:'end_date',
|
106
|
+
:'check_date',
|
107
|
+
:'remote_data'
|
108
|
+
])
|
109
|
+
end
|
110
|
+
|
111
|
+
# Initializes the object
|
112
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
113
|
+
def initialize(attributes = {})
|
114
|
+
if (!attributes.is_a?(Hash))
|
115
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::EmployeePayrollRun` initialize method"
|
116
|
+
end
|
117
|
+
|
118
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
119
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
120
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
121
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::EmployeePayrollRun`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
122
|
+
end
|
123
|
+
h[k.to_sym] = v
|
124
|
+
}
|
125
|
+
|
126
|
+
if attributes.key?(:'id')
|
127
|
+
self.id = attributes[:'id']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.key?(:'remote_id')
|
131
|
+
self.remote_id = attributes[:'remote_id']
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes.key?(:'employee')
|
135
|
+
self.employee = attributes[:'employee']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.key?(:'payroll_run')
|
139
|
+
self.payroll_run = attributes[:'payroll_run']
|
140
|
+
end
|
141
|
+
|
142
|
+
if attributes.key?(:'gross_pay')
|
143
|
+
self.gross_pay = attributes[:'gross_pay']
|
144
|
+
end
|
145
|
+
|
146
|
+
if attributes.key?(:'net_pay')
|
147
|
+
self.net_pay = attributes[:'net_pay']
|
148
|
+
end
|
149
|
+
|
150
|
+
if attributes.key?(:'start_date')
|
151
|
+
self.start_date = attributes[:'start_date']
|
152
|
+
end
|
153
|
+
|
154
|
+
if attributes.key?(:'end_date')
|
155
|
+
self.end_date = attributes[:'end_date']
|
156
|
+
end
|
157
|
+
|
158
|
+
if attributes.key?(:'check_date')
|
159
|
+
self.check_date = attributes[:'check_date']
|
160
|
+
end
|
161
|
+
|
162
|
+
if attributes.key?(:'earnings')
|
163
|
+
if (value = attributes[:'earnings']).is_a?(Array)
|
164
|
+
self.earnings = value
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
if attributes.key?(:'deductions')
|
169
|
+
if (value = attributes[:'deductions']).is_a?(Array)
|
170
|
+
self.deductions = value
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
if attributes.key?(:'taxes')
|
175
|
+
if (value = attributes[:'taxes']).is_a?(Array)
|
176
|
+
self.taxes = value
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
if attributes.key?(:'remote_data')
|
181
|
+
if (value = attributes[:'remote_data']).is_a?(Array)
|
182
|
+
self.remote_data = value
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
188
|
+
# @return Array for valid properties with the reasons
|
189
|
+
def list_invalid_properties
|
190
|
+
invalid_properties = Array.new
|
191
|
+
invalid_properties
|
192
|
+
end
|
193
|
+
|
194
|
+
# Check to see if the all the properties in the model are valid
|
195
|
+
# @return true if the model is valid
|
196
|
+
def valid?
|
197
|
+
true
|
198
|
+
end
|
199
|
+
|
200
|
+
# Checks equality by comparing each attribute.
|
201
|
+
# @param [Object] Object to be compared
|
202
|
+
def ==(o)
|
203
|
+
return true if self.equal?(o)
|
204
|
+
self.class == o.class &&
|
205
|
+
id == o.id &&
|
206
|
+
remote_id == o.remote_id &&
|
207
|
+
employee == o.employee &&
|
208
|
+
payroll_run == o.payroll_run &&
|
209
|
+
gross_pay == o.gross_pay &&
|
210
|
+
net_pay == o.net_pay &&
|
211
|
+
start_date == o.start_date &&
|
212
|
+
end_date == o.end_date &&
|
213
|
+
check_date == o.check_date &&
|
214
|
+
earnings == o.earnings &&
|
215
|
+
deductions == o.deductions &&
|
216
|
+
taxes == o.taxes &&
|
217
|
+
remote_data == o.remote_data
|
218
|
+
end
|
219
|
+
|
220
|
+
# @see the `==` method
|
221
|
+
# @param [Object] Object to be compared
|
222
|
+
def eql?(o)
|
223
|
+
self == o
|
224
|
+
end
|
225
|
+
|
226
|
+
# Calculates hash code according to all attributes.
|
227
|
+
# @return [Integer] Hash code
|
228
|
+
def hash
|
229
|
+
[id, remote_id, employee, payroll_run, gross_pay, net_pay, start_date, end_date, check_date, earnings, deductions, taxes, remote_data].hash
|
230
|
+
end
|
231
|
+
|
232
|
+
# Builds the object from hash
|
233
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
234
|
+
# @return [Object] Returns the model itself
|
235
|
+
def self.build_from_hash(attributes)
|
236
|
+
new.build_from_hash(attributes)
|
237
|
+
end
|
238
|
+
|
239
|
+
# Builds the object from hash
|
240
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
241
|
+
# @return [Object] Returns the model itself
|
242
|
+
def build_from_hash(attributes)
|
243
|
+
return nil unless attributes.is_a?(Hash)
|
244
|
+
self.class.openapi_types.each_pair do |key, type|
|
245
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
246
|
+
self.send("#{key}=", nil)
|
247
|
+
elsif type =~ /\AArray<(.*)>/i
|
248
|
+
# check to ensure the input is an array given that the attribute
|
249
|
+
# is documented as an array but the input is not
|
250
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
251
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
252
|
+
end
|
253
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
254
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
self
|
259
|
+
end
|
260
|
+
|
261
|
+
# Deserializes the data based on type
|
262
|
+
# @param string type Data type
|
263
|
+
# @param string value Value to be deserialized
|
264
|
+
# @return [Object] Deserialized data
|
265
|
+
def _deserialize(type, value)
|
266
|
+
case type.to_sym
|
267
|
+
when :Time
|
268
|
+
Time.parse(value)
|
269
|
+
when :Date
|
270
|
+
Date.parse(value)
|
271
|
+
when :String
|
272
|
+
value.to_s
|
273
|
+
when :Integer
|
274
|
+
value.to_i
|
275
|
+
when :Float
|
276
|
+
value.to_f
|
277
|
+
when :Boolean
|
278
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
279
|
+
true
|
280
|
+
else
|
281
|
+
false
|
282
|
+
end
|
283
|
+
when :Object
|
284
|
+
# generic object (usually a Hash), return directly
|
285
|
+
value
|
286
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
287
|
+
inner_type = Regexp.last_match[:inner_type]
|
288
|
+
value.map { |v| _deserialize(inner_type, v) }
|
289
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
290
|
+
k_type = Regexp.last_match[:k_type]
|
291
|
+
v_type = Regexp.last_match[:v_type]
|
292
|
+
{}.tap do |hash|
|
293
|
+
value.each do |k, v|
|
294
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
295
|
+
end
|
296
|
+
end
|
297
|
+
else # model
|
298
|
+
# models (e.g. Pet) or oneOf
|
299
|
+
klass = MergeHRISClient.const_get(type)
|
300
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
301
|
+
end
|
302
|
+
end
|
303
|
+
|
304
|
+
# Returns the string representation of the object
|
305
|
+
# @return [String] String presentation of the object
|
306
|
+
def to_s
|
307
|
+
to_hash.to_s
|
308
|
+
end
|
309
|
+
|
310
|
+
# to_body is an alias to to_hash (backward compatibility)
|
311
|
+
# @return [Hash] Returns the object in the form of hash
|
312
|
+
def to_body
|
313
|
+
to_hash
|
314
|
+
end
|
315
|
+
|
316
|
+
# Returns the object in the form of hash
|
317
|
+
# @return [Hash] Returns the object in the form of hash
|
318
|
+
def to_hash
|
319
|
+
hash = {}
|
320
|
+
self.class.attribute_map.each_pair do |attr, param|
|
321
|
+
value = self.send(attr)
|
322
|
+
if value.nil?
|
323
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
324
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
325
|
+
end
|
326
|
+
|
327
|
+
hash[param] = _to_hash(value)
|
328
|
+
end
|
329
|
+
hash
|
330
|
+
end
|
331
|
+
|
332
|
+
# Outputs non-array value in the form of hash
|
333
|
+
# For object, use to_hash. Otherwise, just return the value
|
334
|
+
# @param [Object] value Any valid value
|
335
|
+
# @return [Hash] Returns the value in the form of hash
|
336
|
+
def _to_hash(value)
|
337
|
+
if value.is_a?(Array)
|
338
|
+
value.compact.map { |v| _to_hash(v) }
|
339
|
+
elsif value.is_a?(Hash)
|
340
|
+
{}.tap do |hash|
|
341
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
342
|
+
end
|
343
|
+
elsif value.respond_to? :to_hash
|
344
|
+
value.to_hash
|
345
|
+
else
|
346
|
+
value
|
347
|
+
end
|
348
|
+
end
|
349
|
+
|
350
|
+
end
|
351
|
+
|
352
|
+
end
|
@@ -0,0 +1,330 @@
|
|
1
|
+
=begin
|
2
|
+
#Merge HRIS API
|
3
|
+
|
4
|
+
#The unified API for building rich integrations with multiple HR Information System platforms.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: hello@merge.dev
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module MergeHRISClient
|
17
|
+
# # The Employment Object ### Description The `Employment` object is used to represent an employment position at a company. These are associated with the employee filling the role. ### Usage Example Fetch from the `LIST Employments` endpoint and filter by `ID` to show all employees.
|
18
|
+
class Employment
|
19
|
+
attr_accessor :id
|
20
|
+
|
21
|
+
# The third-party API ID of the matching object.
|
22
|
+
attr_accessor :remote_id
|
23
|
+
|
24
|
+
# The position's title.
|
25
|
+
attr_accessor :job_title
|
26
|
+
|
27
|
+
# The position's pay rate in dollars.
|
28
|
+
attr_accessor :pay_rate
|
29
|
+
|
30
|
+
# The time period this pay rate encompasses.
|
31
|
+
attr_accessor :pay_period
|
32
|
+
|
33
|
+
# The position's pay frequency.
|
34
|
+
attr_accessor :pay_frequency
|
35
|
+
|
36
|
+
# The position's currency code.
|
37
|
+
attr_accessor :pay_currency
|
38
|
+
|
39
|
+
# The position's FLSA status.
|
40
|
+
attr_accessor :flsa_status
|
41
|
+
|
42
|
+
# The position's effective date.
|
43
|
+
attr_accessor :effective_date
|
44
|
+
|
45
|
+
# The position's type of employment.
|
46
|
+
attr_accessor :employment_type
|
47
|
+
|
48
|
+
attr_accessor :remote_data
|
49
|
+
|
50
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
51
|
+
def self.attribute_map
|
52
|
+
{
|
53
|
+
:'id' => :'id',
|
54
|
+
:'remote_id' => :'remote_id',
|
55
|
+
:'job_title' => :'job_title',
|
56
|
+
:'pay_rate' => :'pay_rate',
|
57
|
+
:'pay_period' => :'pay_period',
|
58
|
+
:'pay_frequency' => :'pay_frequency',
|
59
|
+
:'pay_currency' => :'pay_currency',
|
60
|
+
:'flsa_status' => :'flsa_status',
|
61
|
+
:'effective_date' => :'effective_date',
|
62
|
+
:'employment_type' => :'employment_type',
|
63
|
+
:'remote_data' => :'remote_data'
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
# Returns all the JSON keys this model knows about
|
68
|
+
def self.acceptable_attributes
|
69
|
+
attribute_map.values
|
70
|
+
end
|
71
|
+
|
72
|
+
# Attribute type mapping.
|
73
|
+
def self.openapi_types
|
74
|
+
{
|
75
|
+
:'id' => :'String',
|
76
|
+
:'remote_id' => :'String',
|
77
|
+
:'job_title' => :'String',
|
78
|
+
:'pay_rate' => :'Float',
|
79
|
+
:'pay_period' => :'PayPeriodEnum',
|
80
|
+
:'pay_frequency' => :'PayFrequencyEnum',
|
81
|
+
:'pay_currency' => :'PayCurrencyEnum',
|
82
|
+
:'flsa_status' => :'FlsaStatusEnum',
|
83
|
+
:'effective_date' => :'Time',
|
84
|
+
:'employment_type' => :'EmploymentTypeEnum',
|
85
|
+
:'remote_data' => :'Array<RemoteData>'
|
86
|
+
}
|
87
|
+
end
|
88
|
+
|
89
|
+
# List of attributes with nullable: true
|
90
|
+
def self.openapi_nullable
|
91
|
+
Set.new([
|
92
|
+
:'remote_id',
|
93
|
+
:'job_title',
|
94
|
+
:'pay_rate',
|
95
|
+
:'pay_period',
|
96
|
+
:'pay_frequency',
|
97
|
+
:'pay_currency',
|
98
|
+
:'flsa_status',
|
99
|
+
:'effective_date',
|
100
|
+
:'employment_type',
|
101
|
+
:'remote_data'
|
102
|
+
])
|
103
|
+
end
|
104
|
+
|
105
|
+
# Initializes the object
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
+
def initialize(attributes = {})
|
108
|
+
if (!attributes.is_a?(Hash))
|
109
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::Employment` initialize method"
|
110
|
+
end
|
111
|
+
|
112
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
113
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
114
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
115
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::Employment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
116
|
+
end
|
117
|
+
h[k.to_sym] = v
|
118
|
+
}
|
119
|
+
|
120
|
+
if attributes.key?(:'id')
|
121
|
+
self.id = attributes[:'id']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'remote_id')
|
125
|
+
self.remote_id = attributes[:'remote_id']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'job_title')
|
129
|
+
self.job_title = attributes[:'job_title']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.key?(:'pay_rate')
|
133
|
+
self.pay_rate = attributes[:'pay_rate']
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.key?(:'pay_period')
|
137
|
+
self.pay_period = attributes[:'pay_period']
|
138
|
+
end
|
139
|
+
|
140
|
+
if attributes.key?(:'pay_frequency')
|
141
|
+
self.pay_frequency = attributes[:'pay_frequency']
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.key?(:'pay_currency')
|
145
|
+
self.pay_currency = attributes[:'pay_currency']
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.key?(:'flsa_status')
|
149
|
+
self.flsa_status = attributes[:'flsa_status']
|
150
|
+
end
|
151
|
+
|
152
|
+
if attributes.key?(:'effective_date')
|
153
|
+
self.effective_date = attributes[:'effective_date']
|
154
|
+
end
|
155
|
+
|
156
|
+
if attributes.key?(:'employment_type')
|
157
|
+
self.employment_type = attributes[:'employment_type']
|
158
|
+
end
|
159
|
+
|
160
|
+
if attributes.key?(:'remote_data')
|
161
|
+
if (value = attributes[:'remote_data']).is_a?(Array)
|
162
|
+
self.remote_data = value
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
168
|
+
# @return Array for valid properties with the reasons
|
169
|
+
def list_invalid_properties
|
170
|
+
invalid_properties = Array.new
|
171
|
+
invalid_properties
|
172
|
+
end
|
173
|
+
|
174
|
+
# Check to see if the all the properties in the model are valid
|
175
|
+
# @return true if the model is valid
|
176
|
+
def valid?
|
177
|
+
true
|
178
|
+
end
|
179
|
+
|
180
|
+
# Checks equality by comparing each attribute.
|
181
|
+
# @param [Object] Object to be compared
|
182
|
+
def ==(o)
|
183
|
+
return true if self.equal?(o)
|
184
|
+
self.class == o.class &&
|
185
|
+
id == o.id &&
|
186
|
+
remote_id == o.remote_id &&
|
187
|
+
job_title == o.job_title &&
|
188
|
+
pay_rate == o.pay_rate &&
|
189
|
+
pay_period == o.pay_period &&
|
190
|
+
pay_frequency == o.pay_frequency &&
|
191
|
+
pay_currency == o.pay_currency &&
|
192
|
+
flsa_status == o.flsa_status &&
|
193
|
+
effective_date == o.effective_date &&
|
194
|
+
employment_type == o.employment_type &&
|
195
|
+
remote_data == o.remote_data
|
196
|
+
end
|
197
|
+
|
198
|
+
# @see the `==` method
|
199
|
+
# @param [Object] Object to be compared
|
200
|
+
def eql?(o)
|
201
|
+
self == o
|
202
|
+
end
|
203
|
+
|
204
|
+
# Calculates hash code according to all attributes.
|
205
|
+
# @return [Integer] Hash code
|
206
|
+
def hash
|
207
|
+
[id, remote_id, job_title, pay_rate, pay_period, pay_frequency, pay_currency, flsa_status, effective_date, employment_type, remote_data].hash
|
208
|
+
end
|
209
|
+
|
210
|
+
# Builds the object from hash
|
211
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
212
|
+
# @return [Object] Returns the model itself
|
213
|
+
def self.build_from_hash(attributes)
|
214
|
+
new.build_from_hash(attributes)
|
215
|
+
end
|
216
|
+
|
217
|
+
# Builds the object from hash
|
218
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
219
|
+
# @return [Object] Returns the model itself
|
220
|
+
def build_from_hash(attributes)
|
221
|
+
return nil unless attributes.is_a?(Hash)
|
222
|
+
self.class.openapi_types.each_pair do |key, type|
|
223
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
224
|
+
self.send("#{key}=", nil)
|
225
|
+
elsif type =~ /\AArray<(.*)>/i
|
226
|
+
# check to ensure the input is an array given that the attribute
|
227
|
+
# is documented as an array but the input is not
|
228
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
229
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
230
|
+
end
|
231
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
232
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
self
|
237
|
+
end
|
238
|
+
|
239
|
+
# Deserializes the data based on type
|
240
|
+
# @param string type Data type
|
241
|
+
# @param string value Value to be deserialized
|
242
|
+
# @return [Object] Deserialized data
|
243
|
+
def _deserialize(type, value)
|
244
|
+
case type.to_sym
|
245
|
+
when :Time
|
246
|
+
Time.parse(value)
|
247
|
+
when :Date
|
248
|
+
Date.parse(value)
|
249
|
+
when :String
|
250
|
+
value.to_s
|
251
|
+
when :Integer
|
252
|
+
value.to_i
|
253
|
+
when :Float
|
254
|
+
value.to_f
|
255
|
+
when :Boolean
|
256
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
257
|
+
true
|
258
|
+
else
|
259
|
+
false
|
260
|
+
end
|
261
|
+
when :Object
|
262
|
+
# generic object (usually a Hash), return directly
|
263
|
+
value
|
264
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
265
|
+
inner_type = Regexp.last_match[:inner_type]
|
266
|
+
value.map { |v| _deserialize(inner_type, v) }
|
267
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
268
|
+
k_type = Regexp.last_match[:k_type]
|
269
|
+
v_type = Regexp.last_match[:v_type]
|
270
|
+
{}.tap do |hash|
|
271
|
+
value.each do |k, v|
|
272
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
273
|
+
end
|
274
|
+
end
|
275
|
+
else # model
|
276
|
+
# models (e.g. Pet) or oneOf
|
277
|
+
klass = MergeHRISClient.const_get(type)
|
278
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
282
|
+
# Returns the string representation of the object
|
283
|
+
# @return [String] String presentation of the object
|
284
|
+
def to_s
|
285
|
+
to_hash.to_s
|
286
|
+
end
|
287
|
+
|
288
|
+
# to_body is an alias to to_hash (backward compatibility)
|
289
|
+
# @return [Hash] Returns the object in the form of hash
|
290
|
+
def to_body
|
291
|
+
to_hash
|
292
|
+
end
|
293
|
+
|
294
|
+
# Returns the object in the form of hash
|
295
|
+
# @return [Hash] Returns the object in the form of hash
|
296
|
+
def to_hash
|
297
|
+
hash = {}
|
298
|
+
self.class.attribute_map.each_pair do |attr, param|
|
299
|
+
value = self.send(attr)
|
300
|
+
if value.nil?
|
301
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
302
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
303
|
+
end
|
304
|
+
|
305
|
+
hash[param] = _to_hash(value)
|
306
|
+
end
|
307
|
+
hash
|
308
|
+
end
|
309
|
+
|
310
|
+
# Outputs non-array value in the form of hash
|
311
|
+
# For object, use to_hash. Otherwise, just return the value
|
312
|
+
# @param [Object] value Any valid value
|
313
|
+
# @return [Hash] Returns the value in the form of hash
|
314
|
+
def _to_hash(value)
|
315
|
+
if value.is_a?(Array)
|
316
|
+
value.compact.map { |v| _to_hash(v) }
|
317
|
+
elsif value.is_a?(Hash)
|
318
|
+
{}.tap do |hash|
|
319
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
320
|
+
end
|
321
|
+
elsif value.respond_to? :to_hash
|
322
|
+
value.to_hash
|
323
|
+
else
|
324
|
+
value
|
325
|
+
end
|
326
|
+
end
|
327
|
+
|
328
|
+
end
|
329
|
+
|
330
|
+
end
|