Class: Gusto::ExternalPayrolls::ExternalPayrollApplicableTaxesItem
- Inherits:
-
Object
- Object
- Gusto::ExternalPayrolls::ExternalPayrollApplicableTaxesItem
- Defined in:
- lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#employer_tax ⇒ Object
readonly
employer’s amount.
- #id ⇒ Integer readonly
- #name ⇒ String readonly
-
#resident_tax ⇒ Object
readonly
the employee is a resident or non-resident of the tax jurisdiction.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::ExternalPayrolls::ExternalPayrollApplicableTaxesItem
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(id: OMIT, name: OMIT, employer_tax: OMIT, resident_tax: OMIT, additional_properties: nil) ⇒ Gusto::ExternalPayrolls::ExternalPayrollApplicableTaxesItem constructor
- #to_json ⇒ String
Constructor Details
#initialize(id: OMIT, name: OMIT, employer_tax: OMIT, resident_tax: OMIT, additional_properties: nil) ⇒ Gusto::ExternalPayrolls::ExternalPayrollApplicableTaxesItem
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb', line 36 def initialize(id: OMIT, name: OMIT, employer_tax: OMIT, resident_tax: OMIT, additional_properties: nil) @id = id if id != OMIT @name = name if name != OMIT @employer_tax = employer_tax if employer_tax != OMIT @resident_tax = resident_tax if resident_tax != OMIT @additional_properties = additional_properties @_field_set = { "id": id, "name": name, "employer_tax": employer_tax, "resident_tax": resident_tax }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
20 21 22 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb', line 20 def additional_properties @additional_properties end |
#employer_tax ⇒ Object (readonly)
employer’s amount.
15 16 17 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb', line 15 def employer_tax @employer_tax end |
#id ⇒ Integer (readonly)
9 10 11 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb', line 9 def id @id end |
#name ⇒ String (readonly)
11 12 13 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb', line 11 def name @name end |
#resident_tax ⇒ Object (readonly)
the employee is a resident or non-resident of the tax jurisdiction.
18 19 20 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb', line 18 def resident_tax @resident_tax end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::ExternalPayrolls::ExternalPayrollApplicableTaxesItem
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb', line 50 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] name = parsed_json["name"] employer_tax = parsed_json["employer_tax"] resident_tax = parsed_json["resident_tax"] new( id: id, name: name, employer_tax: employer_tax, resident_tax: resident_tax, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
77 78 79 80 81 82 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb', line 77 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.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.employer_tax&.is_a?(Boolean) != false || raise("Passed value for field obj.employer_tax is not the expected type, validation failed.") obj.resident_tax&.is_a?(Boolean) != false || raise("Passed value for field obj.resident_tax is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
68 69 70 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb', line 68 def to_json @_field_set&.to_json end |