Class: Gusto::CompanyBenefit
- Inherits:
-
Object
- Object
- Gusto::CompanyBenefit
- Defined in:
- lib/fern_gusto/types/company_benefit.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 ⇒ Float
readonly
The type of the benefit to which the company benefit belongs.
-
#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”.
-
#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, additional_properties: nil) ⇒ Gusto::CompanyBenefit 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, additional_properties: nil) ⇒ Gusto::CompanyBenefit
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/fern_gusto/types/company_benefit.rb', line 67 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, 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 @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 }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#active ⇒ Object (readonly)
only be deactivated if no employees are actively participating.
18 19 20 |
# File 'lib/fern_gusto/types/company_benefit.rb', line 18 def active @active end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
38 39 40 |
# File 'lib/fern_gusto/types/company_benefit.rb', line 38 def additional_properties @additional_properties end |
#benefit_type ⇒ Float (readonly)
Returns The type of the benefit to which the company benefit belongs.
15 16 17 |
# File 'lib/fern_gusto/types/company_benefit.rb', line 15 def benefit_type @benefit_type end |
#deletable ⇒ Object (readonly)
and the benefit is not owned by Gusto or a Partner
26 27 28 |
# File 'lib/fern_gusto/types/company_benefit.rb', line 26 def deletable @deletable end |
#description ⇒ Object (readonly)
something more specific like “Kaiser Permanente” or “Blue Cross/ Blue Shield”.
22 23 24 |
# File 'lib/fern_gusto/types/company_benefit.rb', line 22 def description @description end |
#responsible_for_employee_w2 ⇒ Object (readonly)
applicable to third party sick pay benefits.
36 37 38 |
# File 'lib/fern_gusto/types/company_benefit.rb', line 36 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.
33 34 35 |
# File 'lib/fern_gusto/types/company_benefit.rb', line 33 def responsible_for_employer_taxes @responsible_for_employer_taxes end |
#supports_percentage_amounts ⇒ Object (readonly)
and is not configurable by the company.
30 31 32 |
# File 'lib/fern_gusto/types/company_benefit.rb', line 30 def supports_percentage_amounts @supports_percentage_amounts end |
#uuid ⇒ String (readonly)
Returns The UUID of the company benefit.
13 14 15 |
# File 'lib/fern_gusto/types/company_benefit.rb', line 13 def uuid @uuid end |
#version ⇒ Object (readonly)
on how to use this field.
11 12 13 |
# File 'lib/fern_gusto/types/company_benefit.rb', line 11 def version @version end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::CompanyBenefit
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/fern_gusto/types/company_benefit.rb', line 86 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"] 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, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/fern_gusto/types/company_benefit.rb', line 123 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.") end |
Instance Method Details
#to_json ⇒ String
114 115 116 |
# File 'lib/fern_gusto/types/company_benefit.rb', line 114 def to_json @_field_set&.to_json end |