Class: Merge::Hris::ExternalTargetFieldApiResponse
- Inherits:
-
Object
- Object
- Merge::Hris::ExternalTargetFieldApiResponse
- Defined in:
- lib/merge_ruby_client/hris/types/external_target_field_api_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #bank_info ⇒ Array<Merge::Hris::ExternalTargetFieldApi> readonly
- #benefit ⇒ Array<Merge::Hris::ExternalTargetFieldApi> readonly
- #company ⇒ Array<Merge::Hris::ExternalTargetFieldApi> readonly
- #dependent ⇒ Array<Merge::Hris::ExternalTargetFieldApi> readonly
- #employee ⇒ Array<Merge::Hris::ExternalTargetFieldApi> readonly
- #employee_payroll_run ⇒ Array<Merge::Hris::ExternalTargetFieldApi> readonly
- #employer_benefit ⇒ Array<Merge::Hris::ExternalTargetFieldApi> readonly
- #employment ⇒ Array<Merge::Hris::ExternalTargetFieldApi> readonly
- #group ⇒ Array<Merge::Hris::ExternalTargetFieldApi> readonly
- #location ⇒ Array<Merge::Hris::ExternalTargetFieldApi> readonly
- #pay_group ⇒ Array<Merge::Hris::ExternalTargetFieldApi> readonly
- #payroll_run ⇒ Array<Merge::Hris::ExternalTargetFieldApi> readonly
- #team ⇒ Array<Merge::Hris::ExternalTargetFieldApi> readonly
- #time_off ⇒ Array<Merge::Hris::ExternalTargetFieldApi> readonly
- #time_off_balance ⇒ Array<Merge::Hris::ExternalTargetFieldApi> readonly
- #timesheet_entry ⇒ Array<Merge::Hris::ExternalTargetFieldApi> readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Merge::Hris::ExternalTargetFieldApiResponse
Deserialize a JSON object to an instance of ExternalTargetFieldApiResponse.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(benefit: OMIT, employer_benefit: OMIT, company: OMIT, employee_payroll_run: OMIT, employee: OMIT, employment: OMIT, location: OMIT, payroll_run: OMIT, team: OMIT, time_off: OMIT, time_off_balance: OMIT, bank_info: OMIT, pay_group: OMIT, group: OMIT, dependent: OMIT, timesheet_entry: OMIT, additional_properties: nil) ⇒ Merge::Hris::ExternalTargetFieldApiResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ExternalTargetFieldApiResponse to a JSON object.
Constructor Details
#initialize(benefit: OMIT, employer_benefit: OMIT, company: OMIT, employee_payroll_run: OMIT, employee: OMIT, employment: OMIT, location: OMIT, payroll_run: OMIT, team: OMIT, time_off: OMIT, time_off_balance: OMIT, bank_info: OMIT, pay_group: OMIT, group: OMIT, dependent: OMIT, timesheet_entry: OMIT, additional_properties: nil) ⇒ Merge::Hris::ExternalTargetFieldApiResponse
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 68 def initialize(benefit: OMIT, employer_benefit: OMIT, company: OMIT, employee_payroll_run: OMIT, employee: OMIT, employment: OMIT, location: OMIT, payroll_run: OMIT, team: OMIT, time_off: OMIT, time_off_balance: OMIT, bank_info: OMIT, pay_group: OMIT, group: OMIT, dependent: OMIT, timesheet_entry: OMIT, additional_properties: nil) @benefit = benefit if benefit != OMIT @employer_benefit = employer_benefit if employer_benefit != OMIT @company = company if company != OMIT @employee_payroll_run = employee_payroll_run if employee_payroll_run != OMIT @employee = employee if employee != OMIT @employment = employment if employment != OMIT @location = location if location != OMIT @payroll_run = payroll_run if payroll_run != OMIT @team = team if team != OMIT @time_off = time_off if time_off != OMIT @time_off_balance = time_off_balance if time_off_balance != OMIT @bank_info = bank_info if bank_info != OMIT @pay_group = pay_group if pay_group != OMIT @group = group if group != OMIT @dependent = dependent if dependent != OMIT @timesheet_entry = timesheet_entry if timesheet_entry != OMIT @additional_properties = additional_properties @_field_set = { "Benefit": benefit, "EmployerBenefit": employer_benefit, "Company": company, "EmployeePayrollRun": employee_payroll_run, "Employee": employee, "Employment": employment, "Location": location, "PayrollRun": payroll_run, "Team": team, "TimeOff": time_off, "TimeOffBalance": time_off_balance, "BankInfo": bank_info, "PayGroup": pay_group, "Group": group, "Dependent": dependent, "TimesheetEntry": timesheet_entry }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
43 44 45 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 43 def additional_properties @additional_properties end |
#bank_info ⇒ Array<Merge::Hris::ExternalTargetFieldApi> (readonly)
33 34 35 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 33 def bank_info @bank_info end |
#benefit ⇒ Array<Merge::Hris::ExternalTargetFieldApi> (readonly)
11 12 13 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 11 def benefit @benefit end |
#company ⇒ Array<Merge::Hris::ExternalTargetFieldApi> (readonly)
15 16 17 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 15 def company @company end |
#dependent ⇒ Array<Merge::Hris::ExternalTargetFieldApi> (readonly)
39 40 41 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 39 def dependent @dependent end |
#employee ⇒ Array<Merge::Hris::ExternalTargetFieldApi> (readonly)
19 20 21 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 19 def employee @employee end |
#employee_payroll_run ⇒ Array<Merge::Hris::ExternalTargetFieldApi> (readonly)
17 18 19 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 17 def employee_payroll_run @employee_payroll_run end |
#employer_benefit ⇒ Array<Merge::Hris::ExternalTargetFieldApi> (readonly)
13 14 15 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 13 def employer_benefit @employer_benefit end |
#employment ⇒ Array<Merge::Hris::ExternalTargetFieldApi> (readonly)
21 22 23 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 21 def employment @employment end |
#group ⇒ Array<Merge::Hris::ExternalTargetFieldApi> (readonly)
37 38 39 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 37 def group @group end |
#location ⇒ Array<Merge::Hris::ExternalTargetFieldApi> (readonly)
23 24 25 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 23 def location @location end |
#pay_group ⇒ Array<Merge::Hris::ExternalTargetFieldApi> (readonly)
35 36 37 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 35 def pay_group @pay_group end |
#payroll_run ⇒ Array<Merge::Hris::ExternalTargetFieldApi> (readonly)
25 26 27 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 25 def payroll_run @payroll_run end |
#team ⇒ Array<Merge::Hris::ExternalTargetFieldApi> (readonly)
27 28 29 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 27 def team @team end |
#time_off ⇒ Array<Merge::Hris::ExternalTargetFieldApi> (readonly)
29 30 31 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 29 def time_off @time_off end |
#time_off_balance ⇒ Array<Merge::Hris::ExternalTargetFieldApi> (readonly)
31 32 33 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 31 def time_off_balance @time_off_balance end |
#timesheet_entry ⇒ Array<Merge::Hris::ExternalTargetFieldApi> (readonly)
41 42 43 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 41 def timesheet_entry @timesheet_entry end |
Class Method Details
.from_json(json_object:) ⇒ Merge::Hris::ExternalTargetFieldApiResponse
Deserialize a JSON object to an instance of ExternalTargetFieldApiResponse
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 113 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) benefit = parsed_json["Benefit"]&.map do |item| item = item.to_json Merge::Hris::ExternalTargetFieldApi.from_json(json_object: item) end employer_benefit = parsed_json["EmployerBenefit"]&.map do |item| item = item.to_json Merge::Hris::ExternalTargetFieldApi.from_json(json_object: item) end company = parsed_json["Company"]&.map do |item| item = item.to_json Merge::Hris::ExternalTargetFieldApi.from_json(json_object: item) end employee_payroll_run = parsed_json["EmployeePayrollRun"]&.map do |item| item = item.to_json Merge::Hris::ExternalTargetFieldApi.from_json(json_object: item) end employee = parsed_json["Employee"]&.map do |item| item = item.to_json Merge::Hris::ExternalTargetFieldApi.from_json(json_object: item) end employment = parsed_json["Employment"]&.map do |item| item = item.to_json Merge::Hris::ExternalTargetFieldApi.from_json(json_object: item) end location = parsed_json["Location"]&.map do |item| item = item.to_json Merge::Hris::ExternalTargetFieldApi.from_json(json_object: item) end payroll_run = parsed_json["PayrollRun"]&.map do |item| item = item.to_json Merge::Hris::ExternalTargetFieldApi.from_json(json_object: item) end team = parsed_json["Team"]&.map do |item| item = item.to_json Merge::Hris::ExternalTargetFieldApi.from_json(json_object: item) end time_off = parsed_json["TimeOff"]&.map do |item| item = item.to_json Merge::Hris::ExternalTargetFieldApi.from_json(json_object: item) end time_off_balance = parsed_json["TimeOffBalance"]&.map do |item| item = item.to_json Merge::Hris::ExternalTargetFieldApi.from_json(json_object: item) end bank_info = parsed_json["BankInfo"]&.map do |item| item = item.to_json Merge::Hris::ExternalTargetFieldApi.from_json(json_object: item) end pay_group = parsed_json["PayGroup"]&.map do |item| item = item.to_json Merge::Hris::ExternalTargetFieldApi.from_json(json_object: item) end group = parsed_json["Group"]&.map do |item| item = item.to_json Merge::Hris::ExternalTargetFieldApi.from_json(json_object: item) end dependent = parsed_json["Dependent"]&.map do |item| item = item.to_json Merge::Hris::ExternalTargetFieldApi.from_json(json_object: item) end timesheet_entry = parsed_json["TimesheetEntry"]&.map do |item| item = item.to_json Merge::Hris::ExternalTargetFieldApi.from_json(json_object: item) end new( benefit: benefit, employer_benefit: employer_benefit, company: company, employee_payroll_run: employee_payroll_run, employee: employee, employment: employment, location: location, payroll_run: payroll_run, team: team, time_off: time_off, time_off_balance: time_off_balance, bank_info: bank_info, pay_group: pay_group, group: group, dependent: dependent, timesheet_entry: timesheet_entry, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 214 def self.validate_raw(obj:) obj.benefit&.is_a?(Array) != false || raise("Passed value for field obj.benefit is not the expected type, validation failed.") obj.employer_benefit&.is_a?(Array) != false || raise("Passed value for field obj.employer_benefit is not the expected type, validation failed.") obj.company&.is_a?(Array) != false || raise("Passed value for field obj.company is not the expected type, validation failed.") obj.employee_payroll_run&.is_a?(Array) != false || raise("Passed value for field obj.employee_payroll_run is not the expected type, validation failed.") obj.employee&.is_a?(Array) != false || raise("Passed value for field obj.employee is not the expected type, validation failed.") obj.employment&.is_a?(Array) != false || raise("Passed value for field obj.employment is not the expected type, validation failed.") obj.location&.is_a?(Array) != false || raise("Passed value for field obj.location is not the expected type, validation failed.") obj.payroll_run&.is_a?(Array) != false || raise("Passed value for field obj.payroll_run is not the expected type, validation failed.") obj.team&.is_a?(Array) != false || raise("Passed value for field obj.team is not the expected type, validation failed.") obj.time_off&.is_a?(Array) != false || raise("Passed value for field obj.time_off is not the expected type, validation failed.") obj.time_off_balance&.is_a?(Array) != false || raise("Passed value for field obj.time_off_balance is not the expected type, validation failed.") obj.bank_info&.is_a?(Array) != false || raise("Passed value for field obj.bank_info is not the expected type, validation failed.") obj.pay_group&.is_a?(Array) != false || raise("Passed value for field obj.pay_group is not the expected type, validation failed.") obj.group&.is_a?(Array) != false || raise("Passed value for field obj.group is not the expected type, validation failed.") obj.dependent&.is_a?(Array) != false || raise("Passed value for field obj.dependent is not the expected type, validation failed.") obj.timesheet_entry&.is_a?(Array) != false || raise("Passed value for field obj.timesheet_entry is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of ExternalTargetFieldApiResponse to a JSON object
204 205 206 |
# File 'lib/merge_ruby_client/hris/types/external_target_field_api_response.rb', line 204 def to_json(*_args) @_field_set&.to_json end |