Class: Gusto::CompanyBenefitWithEmployeeBenefitsEmployeeBenefitsItem
- Inherits:
-
Object
- Object
- Gusto::CompanyBenefitWithEmployeeBenefitsEmployeeBenefitsItem
- Defined in:
- lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#active ⇒ Boolean
readonly
Whether the employee benefit is active.
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#company_benefit_uuid ⇒ String
readonly
The UUID of the company benefit.
-
#company_contribution ⇒ String
readonly
The value of the company contribution.
-
#contribution ⇒ Gusto::CompanyBenefitWithEmployeeBenefitsEmployeeBenefitsItemContribution
readonly
An object representing the type and value of the company contribution.
-
#deduct_as_percentage ⇒ Object
readonly
deducted from each payroll.
-
#employee_deduction ⇒ String
readonly
The amount to be deducted, per pay period, from the employee’s pay.
-
#employee_uuid ⇒ String
readonly
The UUID of the employee to which the benefit belongs.
- #uuid ⇒ String readonly
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::CompanyBenefitWithEmployeeBenefitsEmployeeBenefitsItem
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(employee_uuid: OMIT, company_benefit_uuid: OMIT, active: OMIT, deduct_as_percentage: OMIT, employee_deduction: OMIT, company_contribution: OMIT, uuid: OMIT, contribution: OMIT, additional_properties: nil) ⇒ Gusto::CompanyBenefitWithEmployeeBenefitsEmployeeBenefitsItem constructor
- #to_json ⇒ String
Constructor Details
#initialize(employee_uuid: OMIT, company_benefit_uuid: OMIT, active: OMIT, deduct_as_percentage: OMIT, employee_deduction: OMIT, company_contribution: OMIT, uuid: OMIT, contribution: OMIT, additional_properties: nil) ⇒ Gusto::CompanyBenefitWithEmployeeBenefitsEmployeeBenefitsItem
44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item.rb', line 44 def initialize(employee_uuid: OMIT, company_benefit_uuid: OMIT, active: OMIT, deduct_as_percentage: OMIT, employee_deduction: OMIT, company_contribution: OMIT, uuid: OMIT, contribution: OMIT, additional_properties: nil) @employee_uuid = employee_uuid if employee_uuid != OMIT @company_benefit_uuid = company_benefit_uuid if company_benefit_uuid != OMIT @active = active if active != OMIT @deduct_as_percentage = deduct_as_percentage if deduct_as_percentage != OMIT @employee_deduction = employee_deduction if employee_deduction != OMIT @company_contribution = company_contribution if company_contribution != OMIT @uuid = uuid if uuid != OMIT @contribution = contribution if contribution != OMIT @additional_properties = additional_properties @_field_set = { "employee_uuid": employee_uuid, "company_benefit_uuid": company_benefit_uuid, "active": active, "deduct_as_percentage": deduct_as_percentage, "employee_deduction": employee_deduction, "company_contribution": company_contribution, "uuid": uuid, "contribution": contribution }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#active ⇒ Boolean (readonly)
Returns Whether the employee benefit is active.
13 14 15 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item.rb', line 13 def active @active end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
26 27 28 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item.rb', line 26 def additional_properties @additional_properties end |
#company_benefit_uuid ⇒ String (readonly)
Returns The UUID of the company benefit.
11 12 13 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item.rb', line 11 def company_benefit_uuid @company_benefit_uuid end |
#company_contribution ⇒ String (readonly)
Returns The value of the company contribution.
20 21 22 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item.rb', line 20 def company_contribution @company_contribution end |
#contribution ⇒ Gusto::CompanyBenefitWithEmployeeBenefitsEmployeeBenefitsItemContribution (readonly)
Returns An object representing the type and value of the company contribution.
24 25 26 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item.rb', line 24 def contribution @contribution end |
#deduct_as_percentage ⇒ Object (readonly)
deducted from each payroll.
16 17 18 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item.rb', line 16 def deduct_as_percentage @deduct_as_percentage end |
#employee_deduction ⇒ String (readonly)
Returns The amount to be deducted, per pay period, from the employee’s pay.
18 19 20 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item.rb', line 18 def employee_deduction @employee_deduction end |
#employee_uuid ⇒ String (readonly)
Returns The UUID of the employee to which the benefit belongs.
9 10 11 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item.rb', line 9 def employee_uuid @employee_uuid end |
#uuid ⇒ String (readonly)
22 23 24 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item.rb', line 22 def uuid @uuid end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::CompanyBenefitWithEmployeeBenefitsEmployeeBenefitsItem
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item.rb', line 63 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"] company_benefit_uuid = parsed_json["company_benefit_uuid"] active = parsed_json["active"] deduct_as_percentage = parsed_json["deduct_as_percentage"] employee_deduction = parsed_json["employee_deduction"] company_contribution = parsed_json["company_contribution"] uuid = parsed_json["uuid"] unless parsed_json["contribution"].nil? contribution = parsed_json["contribution"].to_json contribution = Gusto::CompanyBenefitWithEmployeeBenefitsEmployeeBenefitsItemContribution.from_json(json_object: contribution) else contribution = nil end new( employee_uuid: employee_uuid, company_benefit_uuid: company_benefit_uuid, active: active, deduct_as_percentage: deduct_as_percentage, employee_deduction: employee_deduction, company_contribution: company_contribution, uuid: uuid, contribution: contribution, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
104 105 106 107 108 109 110 111 112 113 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item.rb', line 104 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.company_benefit_uuid&.is_a?(String) != false || raise("Passed value for field obj.company_benefit_uuid is not the expected type, validation failed.") obj.active&.is_a?(Boolean) != false || raise("Passed value for field obj.active is not the expected type, validation failed.") obj.deduct_as_percentage&.is_a?(Boolean) != false || raise("Passed value for field obj.deduct_as_percentage is not the expected type, validation failed.") obj.employee_deduction&.is_a?(String) != false || raise("Passed value for field obj.employee_deduction is not the expected type, validation failed.") obj.company_contribution&.is_a?(String) != false || raise("Passed value for field obj.company_contribution is not the expected type, validation failed.") obj.uuid&.is_a?(String) != false || raise("Passed value for field obj.uuid is not the expected type, validation failed.") obj.contribution.nil? || Gusto::CompanyBenefitWithEmployeeBenefitsEmployeeBenefitsItemContribution.validate_raw(obj: obj.contribution) end |
Instance Method Details
#to_json ⇒ String
95 96 97 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits_employee_benefits_item.rb', line 95 def to_json @_field_set&.to_json end |