Class: Gusto::ExternalPayrolls::ExternalPayrollExternalPayrollItemsItemBenefitsItem
- Inherits:
-
Object
- Object
- Gusto::ExternalPayrolls::ExternalPayrollExternalPayrollItemsItemBenefitsItem
- Defined in:
- lib/fern_gusto/external_payrolls/types/external_payroll_external_payroll_items_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.
- #benefit_id ⇒ Integer readonly
- #company_contribution_amount ⇒ String readonly
- #employee_deduction_amount ⇒ String readonly
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::ExternalPayrolls::ExternalPayrollExternalPayrollItemsItemBenefitsItem
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(benefit_id: OMIT, company_contribution_amount: OMIT, employee_deduction_amount: OMIT, additional_properties: nil) ⇒ Gusto::ExternalPayrolls::ExternalPayrollExternalPayrollItemsItemBenefitsItem constructor
- #to_json ⇒ String
Constructor Details
#initialize(benefit_id: OMIT, company_contribution_amount: OMIT, employee_deduction_amount: OMIT, additional_properties: nil) ⇒ Gusto::ExternalPayrolls::ExternalPayrollExternalPayrollItemsItemBenefitsItem
27 28 29 30 31 32 33 34 35 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_external_payroll_items_item_benefits_item.rb', line 27 def initialize(benefit_id: OMIT, company_contribution_amount: OMIT, employee_deduction_amount: OMIT, additional_properties: nil) @benefit_id = benefit_id if benefit_id != OMIT @company_contribution_amount = company_contribution_amount if company_contribution_amount != OMIT @employee_deduction_amount = employee_deduction_amount if employee_deduction_amount != OMIT @additional_properties = additional_properties @_field_set = { "benefit_id": benefit_id, "company_contribution_amount": company_contribution_amount, "employee_deduction_amount": employee_deduction_amount }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
15 16 17 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_external_payroll_items_item_benefits_item.rb', line 15 def additional_properties @additional_properties end |
#benefit_id ⇒ Integer (readonly)
9 10 11 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_external_payroll_items_item_benefits_item.rb', line 9 def benefit_id @benefit_id end |
#company_contribution_amount ⇒ String (readonly)
11 12 13 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_external_payroll_items_item_benefits_item.rb', line 11 def company_contribution_amount @company_contribution_amount end |
#employee_deduction_amount ⇒ String (readonly)
13 14 15 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_external_payroll_items_item_benefits_item.rb', line 13 def employee_deduction_amount @employee_deduction_amount end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::ExternalPayrolls::ExternalPayrollExternalPayrollItemsItemBenefitsItem
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_external_payroll_items_item_benefits_item.rb', line 41 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) benefit_id = parsed_json["benefit_id"] company_contribution_amount = parsed_json["company_contribution_amount"] employee_deduction_amount = parsed_json["employee_deduction_amount"] new( benefit_id: benefit_id, company_contribution_amount: company_contribution_amount, employee_deduction_amount: employee_deduction_amount, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
67 68 69 70 71 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_external_payroll_items_item_benefits_item.rb', line 67 def self.validate_raw(obj:) obj.benefit_id&.is_a?(Integer) != false || raise("Passed value for field obj.benefit_id is not the expected type, validation failed.") obj.company_contribution_amount&.is_a?(String) != false || raise("Passed value for field obj.company_contribution_amount is not the expected type, validation failed.") obj.employee_deduction_amount&.is_a?(String) != false || raise("Passed value for field obj.employee_deduction_amount is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
58 59 60 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_external_payroll_items_item_benefits_item.rb', line 58 def to_json @_field_set&.to_json end |