Class: Gusto::CompanyBenefitWithEmployeeBenefits
- Inherits:
-
Object
- Object
- Gusto::CompanyBenefitWithEmployeeBenefits
- Defined in:
- lib/fern_gusto/types/company_benefit_with_employee_benefits.rb
Overview
The representation of a company benefit.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#active ⇒ Object
readonly
only be deactivated if no employees are actively participating.
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#benefit_type ⇒ Object
readonly
benefit_id).
-
#deletable ⇒ Object
readonly
and the benefit is not owned by Gusto or a Partner.
-
#description ⇒ Object
readonly
something more specific like “Kaiser Permanente” or “Blue Cross/ Blue Shield”.
- #employee_benefits ⇒ Array<Gusto::CompanyBenefitWithEmployeeBenefitsEmployeeBenefitsItem> readonly
-
#responsible_for_employee_w2 ⇒ Object
readonly
applicable to third party sick pay benefits.
-
#responsible_for_employer_taxes ⇒ Object
readonly
leave.
-
#supports_percentage_amounts ⇒ Object
readonly
and is not configurable by the company.
-
#uuid ⇒ String
readonly
The UUID of the company benefit.
-
#version ⇒ Object
readonly
on how to use this field.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(version: OMIT, uuid:, benefit_type: OMIT, active: OMIT, description: OMIT, deletable: OMIT, supports_percentage_amounts: OMIT, responsible_for_employer_taxes: OMIT, responsible_for_employee_w2: OMIT, employee_benefits: OMIT, additional_properties: nil) ⇒ Gusto::CompanyBenefitWithEmployeeBenefits constructor
- #to_json ⇒ String
Constructor Details
#initialize(version: OMIT, uuid:, benefit_type: OMIT, active: OMIT, description: OMIT, deletable: OMIT, supports_percentage_amounts: OMIT, responsible_for_employer_taxes: OMIT, responsible_for_employee_w2: OMIT, employee_benefits: OMIT, additional_properties: nil) ⇒ Gusto::CompanyBenefitWithEmployeeBenefits
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits.rb', line 73 def initialize(version: OMIT, uuid:, benefit_type: OMIT, active: OMIT, description: OMIT, deletable: OMIT, supports_percentage_amounts: OMIT, responsible_for_employer_taxes: OMIT, responsible_for_employee_w2: OMIT, employee_benefits: OMIT, additional_properties: nil) @version = version if version != OMIT @uuid = uuid @benefit_type = benefit_type if benefit_type != OMIT @active = active if active != OMIT @description = description if description != OMIT @deletable = deletable if deletable != OMIT @supports_percentage_amounts = supports_percentage_amounts if supports_percentage_amounts != OMIT @responsible_for_employer_taxes = responsible_for_employer_taxes if responsible_for_employer_taxes != OMIT @responsible_for_employee_w2 = responsible_for_employee_w2 if responsible_for_employee_w2 != OMIT @employee_benefits = employee_benefits if employee_benefits != OMIT @additional_properties = additional_properties @_field_set = { "version": version, "uuid": uuid, "benefit_type": benefit_type, "active": active, "description": description, "deletable": deletable, "supports_percentage_amounts": supports_percentage_amounts, "responsible_for_employer_taxes": responsible_for_employer_taxes, "responsible_for_employee_w2": responsible_for_employee_w2, "employee_benefits": employee_benefits }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#active ⇒ Object (readonly)
only be deactivated if no employees are actively participating.
20 21 22 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits.rb', line 20 def active @active end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
42 43 44 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits.rb', line 42 def additional_properties @additional_properties end |
#benefit_type ⇒ Object (readonly)
benefit_id).
17 18 19 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits.rb', line 17 def benefit_type @benefit_type end |
#deletable ⇒ Object (readonly)
and the benefit is not owned by Gusto or a Partner
28 29 30 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits.rb', line 28 def deletable @deletable end |
#description ⇒ Object (readonly)
something more specific like “Kaiser Permanente” or “Blue Cross/ Blue Shield”.
24 25 26 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits.rb', line 24 def description @description end |
#employee_benefits ⇒ Array<Gusto::CompanyBenefitWithEmployeeBenefitsEmployeeBenefitsItem> (readonly)
40 41 42 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits.rb', line 40 def employee_benefits @employee_benefits end |
#responsible_for_employee_w2 ⇒ Object (readonly)
applicable to third party sick pay benefits.
38 39 40 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits.rb', line 38 def responsible_for_employee_w2 @responsible_for_employee_w2 end |
#responsible_for_employer_taxes ⇒ Object (readonly)
leave. Only applicable to third party sick pay benefits.
35 36 37 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits.rb', line 35 def responsible_for_employer_taxes @responsible_for_employer_taxes end |
#supports_percentage_amounts ⇒ Object (readonly)
and is not configurable by the company.
32 33 34 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits.rb', line 32 def supports_percentage_amounts @supports_percentage_amounts end |
#uuid ⇒ String (readonly)
Returns The UUID of the company benefit.
14 15 16 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits.rb', line 14 def uuid @uuid end |
#version ⇒ Object (readonly)
on how to use this field.
12 13 14 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits.rb', line 12 def version @version end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::CompanyBenefitWithEmployeeBenefits
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits.rb', line 93 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) version = parsed_json["version"] uuid = parsed_json["uuid"] benefit_type = parsed_json["benefit_type"] active = parsed_json["active"] description = parsed_json["description"] deletable = parsed_json["deletable"] supports_percentage_amounts = parsed_json["supports_percentage_amounts"] responsible_for_employer_taxes = parsed_json["responsible_for_employer_taxes"] responsible_for_employee_w2 = parsed_json["responsible_for_employee_w2"] employee_benefits = parsed_json["employee_benefits"]&.map do | item | item = item.to_json Gusto::CompanyBenefitWithEmployeeBenefitsEmployeeBenefitsItem.from_json(json_object: item) end new( version: version, uuid: uuid, benefit_type: benefit_type, active: active, description: description, deletable: deletable, supports_percentage_amounts: supports_percentage_amounts, responsible_for_employer_taxes: responsible_for_employer_taxes, responsible_for_employee_w2: responsible_for_employee_w2, employee_benefits: employee_benefits, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits.rb', line 135 def self.validate_raw(obj:) obj.version&.is_a?(String) != false || raise("Passed value for field obj.version 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.benefit_type&.is_a?(Float) != false || raise("Passed value for field obj.benefit_type 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.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.") obj.deletable&.is_a?(Boolean) != false || raise("Passed value for field obj.deletable is not the expected type, validation failed.") obj.supports_percentage_amounts&.is_a?(Boolean) != false || raise("Passed value for field obj.supports_percentage_amounts is not the expected type, validation failed.") obj.responsible_for_employer_taxes&.is_a?(Boolean) != false || raise("Passed value for field obj.responsible_for_employer_taxes is not the expected type, validation failed.") obj.responsible_for_employee_w2&.is_a?(Boolean) != false || raise("Passed value for field obj.responsible_for_employee_w2 is not the expected type, validation failed.") obj.employee_benefits&.is_a?(Array) != false || raise("Passed value for field obj.employee_benefits is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
126 127 128 |
# File 'lib/fern_gusto/types/company_benefit_with_employee_benefits.rb', line 126 def to_json @_field_set&.to_json end |