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