Class: Gusto::PayrollEmployeeCompensationsTypeItem

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/types/payroll_employee_compensations_type_item.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(employee_uuid: OMIT, excluded: OMIT, version: OMIT, gross_pay: OMIT, net_pay: OMIT, check_amount: OMIT, payment_method: OMIT, memo: OMIT, fixed_compensations: OMIT, hourly_compensations: OMIT, paid_time_off: OMIT, benefits: OMIT, deductions: OMIT, taxes: OMIT, additional_properties: nil) ⇒ Gusto::PayrollEmployeeCompensationsTypeItem

Parameters:

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item.rb', line 110

def initialize(employee_uuid: OMIT, excluded: OMIT, version: OMIT, gross_pay: OMIT, net_pay: OMIT, check_amount: OMIT, payment_method: OMIT, memo: OMIT, fixed_compensations: OMIT, hourly_compensations: OMIT, paid_time_off: OMIT, benefits: OMIT, deductions: OMIT, taxes: OMIT, additional_properties: nil)
  @employee_uuid = employee_uuid if employee_uuid != OMIT
  @excluded = excluded if excluded != OMIT
  @version = version if version != OMIT
  @gross_pay = gross_pay if gross_pay != OMIT
  @net_pay = net_pay if net_pay != OMIT
  @check_amount = check_amount if check_amount != OMIT
  @payment_method = payment_method if payment_method != OMIT
  @memo = memo if memo != OMIT
  @fixed_compensations = fixed_compensations if fixed_compensations != OMIT
  @hourly_compensations = hourly_compensations if hourly_compensations != OMIT
  @paid_time_off = paid_time_off if paid_time_off != OMIT
  @benefits = benefits if benefits != OMIT
  @deductions = deductions if deductions != OMIT
  @taxes = taxes if taxes != OMIT
  @additional_properties = additional_properties
  @_field_set = { "employee_uuid": employee_uuid, "excluded": excluded, "version": version, "gross_pay": gross_pay, "net_pay": net_pay, "check_amount": check_amount, "payment_method": payment_method, "memo": memo, "fixed_compensations": fixed_compensations, "hourly_compensations": hourly_compensations, "paid_time_off": paid_time_off, "benefits": benefits, "deductions": deductions, "taxes": taxes }.reject do | _k, v |
  v == OMIT
end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



65
66
67
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item.rb', line 65

def additional_properties
  @additional_properties
end

#benefitsObject (readonly)

processed payroll when the include parameter is present.



56
57
58
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item.rb', line 56

def benefits
  @benefits
end

#check_amountObject (readonly)

only available for processed payrolls.



35
36
37
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item.rb', line 35

def check_amount
  @check_amount
end

#deductionsObject (readonly)

for processed payroll when the include parameter is present.



59
60
61
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item.rb', line 59

def deductions
  @deductions
end

#employee_uuidString (readonly)

Returns The UUID of the employee.

Returns:

  • (String)

    The UUID of the employee.



15
16
17
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item.rb', line 15

def employee_uuid
  @employee_uuid
end

#excludedObject (readonly)

false.



19
20
21
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item.rb', line 19

def excluded
  @excluded
end

#fixed_compensationsObject (readonly)

unprocessed payroll, all active fixed compensations are returned.



45
46
47
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item.rb', line 45

def fixed_compensations
  @fixed_compensations
end

#gross_payObject (readonly)

available for processed payrolls.



28
29
30
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item.rb', line 28

def gross_pay
  @gross_pay
end

#hourly_compensationsObject (readonly)

returned.



51
52
53
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item.rb', line 51

def hourly_compensations
  @hourly_compensations
end

#memoObject (readonly)

paystub.



40
41
42
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item.rb', line 40

def memo
  @memo
end

#net_payObject (readonly)

processed payrolls.



32
33
34
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item.rb', line 32

def net_pay
  @net_pay
end

Returns An array of all paid time off the employee is eligible for this pay period.

Returns:



53
54
55
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item.rb', line 53

def paid_time_off
  @paid_time_off
end

#payment_methodGusto::PayrollEmployeeCompensationsTypeItemPaymentMethod (readonly)

Returns The employee’s compensation payment method.

Returns:



37
38
39
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item.rb', line 37

def payment_method
  @payment_method
end

#taxesObject (readonly)

parameter.



63
64
65
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item.rb', line 63

def taxes
  @taxes
end

#versionObject (readonly)

on how to use this field.



24
25
26
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item.rb', line 24

def version
  @version
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::PayrollEmployeeCompensationsTypeItem

Parameters:

  • json_object (String)

Returns:



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
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item.rb', line 134

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  employee_uuid = parsed_json["employee_uuid"]
  excluded = parsed_json["excluded"]
  version = parsed_json["version"]
  gross_pay = parsed_json["gross_pay"]
  net_pay = parsed_json["net_pay"]
  check_amount = parsed_json["check_amount"]
  payment_method = parsed_json["payment_method"]
  memo = parsed_json["memo"]
  fixed_compensations = parsed_json["fixed_compensations"]&.map do | item |
  item = item.to_json
  Gusto::PayrollEmployeeCompensationsTypeItemFixedCompensationsItem.from_json(json_object: item)
end
  hourly_compensations = parsed_json["hourly_compensations"]&.map do | item |
  item = item.to_json
  Gusto::PayrollEmployeeCompensationsTypeItemHourlyCompensationsItem.from_json(json_object: item)
end
  paid_time_off = parsed_json["paid_time_off"]&.map do | item |
  item = item.to_json
  Gusto::PayrollEmployeeCompensationsTypeItemPaidTimeOffItem.from_json(json_object: item)
end
  benefits = parsed_json["benefits"]&.map do | item |
  item = item.to_json
  Gusto::PayrollEmployeeCompensationsTypeItemBenefitsItem.from_json(json_object: item)
end
  deductions = parsed_json["deductions"]&.map do | item |
  item = item.to_json
  Gusto::PayrollEmployeeCompensationsTypeItemDeductionsItem.from_json(json_object: item)
end
  taxes = parsed_json["taxes"]&.map do | item |
  item = item.to_json
  Gusto::PayrollEmployeeCompensationsTypeItemTaxesItem.from_json(json_object: item)
end
  new(
    employee_uuid: employee_uuid,
    excluded: excluded,
    version: version,
    gross_pay: gross_pay,
    net_pay: net_pay,
    check_amount: check_amount,
    payment_method: payment_method,
    memo: memo,
    fixed_compensations: fixed_compensations,
    hourly_compensations: hourly_compensations,
    paid_time_off: paid_time_off,
    benefits: benefits,
    deductions: deductions,
    taxes: taxes,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item.rb', line 199

def self.validate_raw(obj:)
  obj.employee_uuid&.is_a?(String) != false || raise("Passed value for field obj.employee_uuid is not the expected type, validation failed.")
  obj.excluded&.is_a?(Boolean) != false || raise("Passed value for field obj.excluded is not the expected type, validation failed.")
  obj.version&.is_a?(String) != false || raise("Passed value for field obj.version is not the expected type, validation failed.")
  obj.gross_pay&.is_a?(Float) != false || raise("Passed value for field obj.gross_pay is not the expected type, validation failed.")
  obj.net_pay&.is_a?(Float) != false || raise("Passed value for field obj.net_pay is not the expected type, validation failed.")
  obj.check_amount&.is_a?(Float) != false || raise("Passed value for field obj.check_amount is not the expected type, validation failed.")
  obj.payment_method&.is_a?(Gusto::PayrollEmployeeCompensationsTypeItemPaymentMethod) != false || raise("Passed value for field obj.payment_method is not the expected type, validation failed.")
  obj.memo&.is_a?(String) != false || raise("Passed value for field obj.memo is not the expected type, validation failed.")
  obj.fixed_compensations&.is_a?(Array) != false || raise("Passed value for field obj.fixed_compensations is not the expected type, validation failed.")
  obj.hourly_compensations&.is_a?(Array) != false || raise("Passed value for field obj.hourly_compensations is not the expected type, validation failed.")
  obj.paid_time_off&.is_a?(Array) != false || raise("Passed value for field obj.paid_time_off is not the expected type, validation failed.")
  obj.benefits&.is_a?(Array) != false || raise("Passed value for field obj.benefits is not the expected type, validation failed.")
  obj.deductions&.is_a?(Array) != false || raise("Passed value for field obj.deductions is not the expected type, validation failed.")
  obj.taxes&.is_a?(Array) != false || raise("Passed value for field obj.taxes is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


190
191
192
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item.rb', line 190

def to_json
  @_field_set&.to_json
end