Class: Gusto::PayrollEmployeeCompensationsTypeItemBenefitsItem
- Inherits:
-
Object
- Object
- Gusto::PayrollEmployeeCompensationsTypeItemBenefitsItem
- Defined in:
- lib/fern_gusto/types/payroll_employee_compensations_type_item_benefits_item.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #company_contribution ⇒ Float readonly
- #employee_deduction ⇒ Float readonly
- #imputed ⇒ Boolean readonly
- #name ⇒ String readonly
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::PayrollEmployeeCompensationsTypeItemBenefitsItem
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(name: OMIT, employee_deduction: OMIT, company_contribution: OMIT, imputed: OMIT, additional_properties: nil) ⇒ Gusto::PayrollEmployeeCompensationsTypeItemBenefitsItem constructor
- #to_json ⇒ String
Constructor Details
#initialize(name: OMIT, employee_deduction: OMIT, company_contribution: OMIT, imputed: OMIT, additional_properties: nil) ⇒ Gusto::PayrollEmployeeCompensationsTypeItemBenefitsItem
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_benefits_item.rb', line 29 def initialize(name: OMIT, employee_deduction: OMIT, company_contribution: OMIT, imputed: OMIT, additional_properties: nil) @name = name if name != OMIT @employee_deduction = employee_deduction if employee_deduction != OMIT @company_contribution = company_contribution if company_contribution != OMIT @imputed = imputed if imputed != OMIT @additional_properties = additional_properties @_field_set = { "name": name, "employee_deduction": employee_deduction, "company_contribution": company_contribution, "imputed": imputed }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
16 17 18 |
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_benefits_item.rb', line 16 def additional_properties @additional_properties end |
#company_contribution ⇒ Float (readonly)
12 13 14 |
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_benefits_item.rb', line 12 def company_contribution @company_contribution end |
#employee_deduction ⇒ Float (readonly)
10 11 12 |
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_benefits_item.rb', line 10 def employee_deduction @employee_deduction end |
#imputed ⇒ Boolean (readonly)
14 15 16 |
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_benefits_item.rb', line 14 def imputed @imputed end |
#name ⇒ String (readonly)
8 9 10 |
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_benefits_item.rb', line 8 def name @name end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::PayrollEmployeeCompensationsTypeItemBenefitsItem
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_benefits_item.rb', line 44 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) name = parsed_json["name"] employee_deduction = parsed_json["employee_deduction"] company_contribution = parsed_json["company_contribution"] imputed = parsed_json["imputed"] new( name: name, employee_deduction: employee_deduction, company_contribution: company_contribution, imputed: imputed, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
72 73 74 75 76 77 |
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_benefits_item.rb', line 72 def self.validate_raw(obj:) obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.employee_deduction&.is_a?(Float) != false || raise("Passed value for field obj.employee_deduction is not the expected type, validation failed.") obj.company_contribution&.is_a?(Float) != false || raise("Passed value for field obj.company_contribution is not the expected type, validation failed.") obj.imputed&.is_a?(Boolean) != false || raise("Passed value for field obj.imputed is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
63 64 65 |
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_benefits_item.rb', line 63 def to_json @_field_set&.to_json end |